diff options
author | Timo Sirainen <cras@irssi.org> | 2001-01-07 09:54:21 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2001-01-07 09:54:21 +0000 |
commit | abcb44f835c5c5523709cc1ee76809bb6c749ffc (patch) | |
tree | f17944033351213d1fbff702607e02e761dde7c2 /src/perl/irc/Irc.xs | |
parent | 3f1b28ead9a703d09d651e776fdb13e9c5d1ae57 (diff) | |
download | irssi-abcb44f835c5c5523709cc1ee76809bb6c749ffc.zip |
perl updates
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1089 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/perl/irc/Irc.xs')
-rw-r--r-- | src/perl/irc/Irc.xs | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/perl/irc/Irc.xs b/src/perl/irc/Irc.xs index 58c417aa..d8122a90 100644 --- a/src/perl/irc/Irc.xs +++ b/src/perl/irc/Irc.xs @@ -52,7 +52,9 @@ static void perl_dcc_fill_hash(HV *hv, DCC_REC *dcc) static void perl_netsplit_fill_hash(HV *hv, NETSPLIT_REC *netsplit) { + AV *av; HV *stash; + GSList *tmp; hv_store(hv, "nick", 4, new_pv(netsplit->nick), 0); hv_store(hv, "address", 7, new_pv(netsplit->address), 0); @@ -60,7 +62,13 @@ static void perl_netsplit_fill_hash(HV *hv, NETSPLIT_REC *netsplit) stash = gv_stashpv("Irssi::Irc::Netsplitserver", 0); hv_store(hv, "server", 6, new_bless(netsplit->server, stash), 0); - /*FIXME: add GSList *channels;*/ + + stash = gv_stashpv("Irssi::Irc::Netsplitchannel", 0); + av = newAV(); + for (tmp = netsplit->channels; tmp != NULL; tmp = tmp->next) { + av_push(av, sv_2mortal(new_bless(tmp->data, stash))); + } + hv_store(hv, "channels", 7, newRV_noinc((SV*)av), 0); } static void perl_netsplit_server_fill_hash(HV *hv, NETSPLIT_SERVER_REC *rec) @@ -70,6 +78,12 @@ static void perl_netsplit_server_fill_hash(HV *hv, NETSPLIT_SERVER_REC *rec) hv_store(hv, "count", 5, newSViv(rec->count), 0); } +static void perl_netsplit_channel_fill_hash(HV *hv, NETSPLIT_CHANNEL_REC *rec) +{ + hv_store(hv, "name", 4, new_pv(rec->name), 0); + hv_store(hv, "nick", 4, irssi_bless(rec->nick), 0); +} + static void perl_autoignore_fill_hash(HV *hv, AUTOIGNORE_REC *ai) { hv_store(hv, "nick", 4, new_pv(ai->nick), 0); @@ -98,6 +112,7 @@ static PLAIN_OBJECT_INIT_REC irc_plains[] = { { "Irssi::Irc::Dcc", (PERL_OBJECT_FUNC) perl_dcc_fill_hash }, { "Irssi::Irc::Netsplit", (PERL_OBJECT_FUNC) perl_netsplit_fill_hash }, { "Irssi::Irc::Netsplitserver", (PERL_OBJECT_FUNC) perl_netsplit_server_fill_hash }, + { "Irssi::Irc::Netsplitchannel", (PERL_OBJECT_FUNC) perl_netsplit_channel_fill_hash }, { "Irssi::Irc::Autoignore", (PERL_OBJECT_FUNC) perl_autoignore_fill_hash }, { "Irssi::Irc::Notifylist", (PERL_OBJECT_FUNC) perl_notifylist_fill_hash }, @@ -127,7 +142,6 @@ CODE: (PERL_OBJECT_FUNC) perl_irc_server_fill_hash); irssi_add_plains(irc_plains); -INCLUDE: Bans.xs INCLUDE: IrcServer.xs INCLUDE: IrcChannel.xs INCLUDE: IrcQuery.xs |