summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2000-06-09 17:29:12 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2000-06-09 17:29:12 +0000
commit5a94ff859c1a3800a2c842ca9ec8a617823b8c23 (patch)
treebfedfe288c9d99aa8647a9ce3230fd37f5954acf /src
parent3fd3a03402c41f9e31bff05120e9c668cf3c2dc2 (diff)
downloadirssi-5a94ff859c1a3800a2c842ca9ec8a617823b8c23.zip
Added Irssi::Dcc::values(), updated a few other DCC things too.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@306 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src')
-rw-r--r--src/irc/dcc/dcc.h2
-rw-r--r--src/perl/xs/Irssi-dcc.xs56
2 files changed, 50 insertions, 8 deletions
diff --git a/src/irc/dcc/dcc.h b/src/irc/dcc/dcc.h
index 7fe5e9ee..eee5a069 100644
--- a/src/irc/dcc/dcc.h
+++ b/src/irc/dcc/dcc.h
@@ -81,6 +81,8 @@ void dcc_make_address(IPADDR *ip, char *host);
DCC_REC *dcc_create(int type, int handle, const char *nick, const char *arg, IRC_SERVER_REC *server, DCC_REC *chat);
void dcc_destroy(DCC_REC *dcc);
+/* Send a CTCP message/notify to target. Send the CTCP via DCC chat if
+ `chat' is specified. */
void dcc_ctcp_message(const char *target, IRC_SERVER_REC *server, DCC_REC *chat, int notice, const char *msg);
/* Send `data' to dcc chat. */
diff --git a/src/perl/xs/Irssi-dcc.xs b/src/perl/xs/Irssi-dcc.xs
index 900c475e..971cc465 100644
--- a/src/perl/xs/Irssi-dcc.xs
+++ b/src/perl/xs/Irssi-dcc.xs
@@ -22,15 +22,17 @@ dcc_find_by_port(nick, port)
char *nick
int port
-char *
-dcc_type2str(type)
- int type
-CODE:
- RETVAL = (char *) dcc_type2str(type);
+void
+dcc_ctcp_message(target, server, chat, notice, msg)
+ char *target
+ Irssi::Server server
+ Irssi::Dcc chat
+ int notice
+ char *msg
-int
-dcc_str2type(type)
- char *type
+Irssi::Dcc
+item_get_dcc(item)
+ void *item
#*******************************
MODULE = Irssi PACKAGE = Irssi::Dcc PREFIX = dcc_
@@ -39,3 +41,41 @@ MODULE = Irssi PACKAGE = Irssi::Dcc PREFIX = dcc_
void
dcc_destroy(dcc)
Irssi::Dcc dcc
+
+void
+dcc_chat_send(dcc, data)
+ Irssi::Dcc dcc
+ char *data
+
+void
+values(dcc)
+ Irssi::Dcc dcc
+PREINIT:
+ HV *hv, *stash;
+PPCODE:
+ hv = newHV();
+ hv_store(hv, "type", 4, new_pv((char *) dcc_type2str(dcc->type)), 0);
+ hv_store(hv, "created", 7, newSViv(dcc->created), 0);
+
+ stash = gv_stashpv("Irssi::Server", 0);
+ hv_store(hv, "server", 6, sv_bless(newRV_noinc(newSViv(GPOINTER_TO_INT(dcc->server))), stash), 0);
+ hv_store(hv, "nick", 4, new_pv(dcc->nick), 0);
+
+ stash = gv_stashpv("Irssi::Dcc", 0);
+ hv_store(hv, "chat", 4, sv_bless(newRV_noinc(newSViv(GPOINTER_TO_INT(dcc->chat))), stash), 0);
+
+ hv_store(hv, "ircnet", 6, new_pv(dcc->ircnet), 0);
+ hv_store(hv, "mynick", 6, new_pv(dcc->mynick), 0);
+
+ hv_store(hv, "arg", 3, new_pv(dcc->arg), 0);
+ hv_store(hv, "file", 4, new_pv(dcc->file), 0);
+
+ hv_store(hv, "addr", 4, new_pv(dcc->addrstr), 0);
+ hv_store(hv, "port", 4, newSViv(dcc->port), 0);
+
+ hv_store(hv, "size", 4, newSViv(dcc->size), 0);
+ hv_store(hv, "transfd", 7, newSViv(dcc->transfd), 0);
+ hv_store(hv, "skipped", 7, newSViv(dcc->skipped), 0);
+ hv_store(hv, "starttime", 9, newSViv(dcc->starttime), 0);
+ XPUSHs(sv_2mortal(newRV_noinc((SV*)hv)));
+