diff options
author | Timo Sirainen <cras@irssi.org> | 2001-02-20 02:37:01 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2001-02-20 02:37:01 +0000 |
commit | 2aeb9259e005635d0ee76e489d62d173623f6fb3 (patch) | |
tree | 9ba2fe9543c448d24fe308406ecda22766c6160d /src/perl/irc/Irc.xs | |
parent | 7a6c3f0b7c98c380e2225c358020704bdad73fa7 (diff) | |
download | irssi-2aeb9259e005635d0ee76e489d62d173623f6fb3.zip |
DCC updates
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1267 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/perl/irc/Irc.xs')
-rw-r--r-- | src/perl/irc/Irc.xs | 45 |
1 files changed, 44 insertions, 1 deletions
diff --git a/src/perl/irc/Irc.xs b/src/perl/irc/Irc.xs index ba9f9f20..37303ebb 100644 --- a/src/perl/irc/Irc.xs +++ b/src/perl/irc/Irc.xs @@ -26,6 +26,8 @@ static void perl_dcc_fill_hash(HV *hv, DCC_REC *dcc) { HV *stash; + hv_store(hv, "type", 4, new_pv(dcc_type2str(dcc->type)), 0); + hv_store(hv, "orig_type", 9, new_pv(dcc_type2str(dcc->orig_type)), 0); hv_store(hv, "created", 7, newSViv(dcc->created), 0); hv_store(hv, "server", 6, irssi_bless(dcc->server), 0); @@ -33,7 +35,7 @@ static void perl_dcc_fill_hash(HV *hv, DCC_REC *dcc) hv_store(hv, "mynick", 6, new_pv(dcc->mynick), 0); hv_store(hv, "nick", 4, new_pv(dcc->nick), 0); - stash = gv_stashpv("Irssi::Irc::Dcc", 0); + stash = gv_stashpv("Irssi::Irc::Dcc::Chat", 0); hv_store(hv, "chat", 4, new_bless(dcc->chat, stash), 0); hv_store(hv, "target", 6, new_pv(dcc->target), 0); hv_store(hv, "arg", 3, new_pv(dcc->arg), 0); @@ -45,6 +47,33 @@ static void perl_dcc_fill_hash(HV *hv, DCC_REC *dcc) hv_store(hv, "transfd", 7, newSViv(dcc->transfd), 0); } +static void perl_dcc_chat_fill_hash(HV *hv, CHAT_DCC_REC *dcc) +{ + perl_dcc_fill_hash(hv, (DCC_REC *) dcc); + + hv_store(hv, "id", 2, new_pv(dcc->id), 0); + hv_store(hv, "mirc_ctcp", 9, newSViv(dcc->mirc_ctcp), 0); + hv_store(hv, "connection_lost", 15, newSViv(dcc->connection_lost), 0); +} + +static void perl_dcc_get_fill_hash(HV *hv, GET_DCC_REC *dcc) +{ + perl_dcc_fill_hash(hv, (DCC_REC *) dcc); + + hv_store(hv, "get_type", 8, newSViv(dcc->get_type), 0); + hv_store(hv, "file", 4, new_pv(dcc->file), 0); + hv_store(hv, "file_quoted", 11, newSViv(dcc->file_quoted), 0); +} + +static void perl_dcc_send_fill_hash(HV *hv, SEND_DCC_REC *dcc) +{ + perl_dcc_fill_hash(hv, (DCC_REC *) dcc); + + hv_store(hv, "file_quoted", 11, newSViv(dcc->file_quoted), 0); + hv_store(hv, "waitforend", 10, newSViv(dcc->waitforend), 0); + hv_store(hv, "gotalldata", 10, newSViv(dcc->gotalldata), 0); +} + static void perl_netsplit_fill_hash(HV *hv, NETSPLIT_REC *netsplit) { AV *av; @@ -135,8 +164,22 @@ CODE: irssi_add_object(module_get_uniq_id("SERVER", 0), chat_type, "Irssi::Irc::Server", (PERL_OBJECT_FUNC) perl_irc_server_fill_hash); + irssi_add_object(module_get_uniq_id_str("DCC", "CHAT"), + 0, "Irssi::Irc::Dcc::Chat", + (PERL_OBJECT_FUNC) perl_dcc_chat_fill_hash); + irssi_add_object(module_get_uniq_id_str("DCC", "GET"), + 0, "Irssi::Irc::Dcc::Get", + (PERL_OBJECT_FUNC) perl_dcc_get_fill_hash); + irssi_add_object(module_get_uniq_id_str("DCC", "SEND"), + 0, "Irssi::Irc::Dcc::Send", + (PERL_OBJECT_FUNC) perl_dcc_send_fill_hash); irssi_add_plains(irc_plains); + perl_eval_pv("@Irssi::Irc::Dcc::Chat::ISA = qw(Irssi::Irc::Dcc);\n" + "@Irssi::Irc::Dcc::Get::ISA = qw(Irssi::Irc::Dcc);\n" + "@Irssi::Irc::Dcc::Send::ISA = qw(Irssi::Irc::Dcc);\n", + TRUE); + INCLUDE: IrcServer.xs INCLUDE: IrcChannel.xs INCLUDE: IrcQuery.xs |