1
0
mirror of https://github.com/irssi/irssi.git synced 2024-10-27 05:20:20 -04:00

Moved the ISA defines from .pm to irssi code, so that non-irc protocols

would work also without a specific .pm file. Also you don't need to
use Irssi::Irc anymore if you don't need IRC specific functions.


git-svn-id: http://svn.irssi.org/repos/irssi/trunk@800 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2000-10-30 22:52:51 +00:00 committed by cras
parent ae06c90be1
commit 5da6c63cdd
3 changed files with 17 additions and 12 deletions

View File

@ -18,12 +18,5 @@ require DynaLoader;
bootstrap Irssi::Irc $VERSION;
@Irssi::Irc::Chatnet::ISA = qw(Irssi::Chatnet);
@Irssi::Irc::Server::ISA = qw(Irssi::Server);
@Irssi::Irc::ServerConnect::ISA = qw(Irssi::ServerConnect);
@Irssi::Irc::ServerSetup::ISA = qw(Irssi::ServerSetup);
@Irssi::Irc::Channel::ISA = qw(Irssi::Channel);
@Irssi::Irc::Query::ISA = qw(Irssi::Query);
1;

View File

@ -159,8 +159,13 @@ void perl_query_fill_hash(HV *hv, QUERY_REC *query)
static void perl_register_protocol(CHAT_PROTOCOL_REC *rec)
{
char *name, stash[100];
int type, chat_type;
static char *items[] = {
"Chatnet",
"Server", "ServerConnect", "ServerSetup",
"Channel", "Query"
};
char *name, stash[100], code[100];
int type, chat_type, n;
chat_type = chat_protocol_lookup(rec->name);
g_return_if_fail(chat_type >= 0);
@ -186,6 +191,13 @@ static void perl_register_protocol(CHAT_PROTOCOL_REC *rec)
g_snprintf(stash, sizeof(stash), "Irssi::%s::Connect", name);
irssi_add_stash(type, chat_type, stash);
/* register ISAs */
for (n = 0; n < sizeof(items)/sizeof(items[0]); n++) {
g_snprintf(code, sizeof(code),
"@Irssi::%s::%s::ISA = qw(Irssi::%s);",
name, items[n], items[n]);
perl_eval_pv(code, TRUE);
}
g_free(name);
}

View File

@ -154,7 +154,7 @@ static void irssi_perl_start(void)
"\n"
" eval {$package->handler;};\n"
" die $@ if $@;\n"
"}";
"}\n";
first_signals = g_hash_table_new((GHashFunc) g_direct_hash,
(GCompareFunc) g_direct_equal);
@ -663,8 +663,6 @@ static void irssi_perl_autorun(void)
void perl_init(void)
{
perl_common_init();
perl_scripts = NULL;
command_bind("run", NULL, (SIGNAL_FUNC) cmd_run);
command_bind_first("unload", NULL, (SIGNAL_FUNC) cmd_unload);
@ -673,6 +671,8 @@ void perl_init(void)
PL_perl_destruct_level = 1;
irssi_perl_start();
perl_common_init();
irssi_perl_autorun();
}