diff options
author | Timo Sirainen <cras@irssi.org> | 2000-10-03 19:10:24 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2000-10-03 19:10:24 +0000 |
commit | 391a419a1fce87ea4fef199390e23cbf0dbee589 (patch) | |
tree | 4c5d7bfd3c10e3616bba6fba7b2d0d8e62bb8412 /src/perl/common/Server.xs | |
parent | 6fc2a3412178385f241efa4c16d7e8b10d392042 (diff) | |
download | irssi-391a419a1fce87ea4fef199390e23cbf0dbee589.zip |
s/core/common/ - because make clean tried to delete it :)
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@715 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/perl/common/Server.xs')
-rw-r--r-- | src/perl/common/Server.xs | 137 |
1 files changed, 137 insertions, 0 deletions
diff --git a/src/perl/common/Server.xs b/src/perl/common/Server.xs new file mode 100644 index 00000000..c3078485 --- /dev/null +++ b/src/perl/common/Server.xs @@ -0,0 +1,137 @@ +MODULE = Irssi PACKAGE = Irssi + +void +servers() +PREINIT: + GSList *tmp; +PPCODE: + for (tmp = servers; tmp != NULL; tmp = tmp->next) { + SERVER_REC *rec = tmp->data; + + XPUSHs(sv_2mortal(sv_bless(newRV_noinc(newSViv(GPOINTER_TO_INT(rec))), + irssi_get_stash(rec)))); + } + +void +reconnects() +PREINIT: + GSList *tmp; + HV *stash; +PPCODE: + stash = gv_stashpv("Irssi::Reconnect", 0); + for (tmp = reconnects; tmp != NULL; tmp = tmp->next) { + XPUSHs(sv_2mortal(sv_bless(newRV_noinc(newSViv(GPOINTER_TO_INT(tmp->data))), stash))); + } + +Irssi::Connect +server_create_conn(dest, port=6667, password=NULL, nick=NULL) + char *dest + int port + char *password + char *nick + +Irssi::Server +server_find_tag(tag) + char *tag + +Irssi::Server +server_find_chatnet(chatnet) + char *chatnet + +#******************************* +MODULE = Irssi PACKAGE = Irssi::Server PREFIX = server_ +#******************************* + +void +values(server) + Irssi::Server server +PREINIT: + HV *hv; +PPCODE: + hv = newHV(); + perl_server_fill_hash(hv, server); + XPUSHs(sv_2mortal(newRV_noinc((SV*)hv))); + +Irssi::Server +server_connect(conn) + Irssi::Connect conn + +void +server_disconnect(server) + Irssi::Server server + +void +server_redirect_init(server, command, last, ...) + Irssi::Server server + char *command + int last +PREINIT: + STRLEN n_a; + GSList *list; + int n; +CODE: + list = NULL; + for (n = 3; n < items; n++) { + list = g_slist_append(list, SvPV(ST(n), n_a)); + } + server_redirect_initv(server, command, last, list); + +int +server_redirect_single_event(server, arg, last, group, event, signal, argpos) + Irssi::Server server + char *arg + int last + int group + char *event + char *signal + int argpos + +void +server_redirect_event(server, arg, last, ...) + Irssi::Server server + char *arg + int last +PREINIT: + STRLEN n_a; + int n, group; +CODE: + group = 0; + for (n = 3; n+3 <= items; n += 3, last--) { + group = server_redirect_single_event(server, arg, last > 0, group, + (char *) SvPV(ST(n), n_a), (char *) SvPV(ST(n+1), n_a), (int) SvIV(ST(n+2))); + } + +#******************************* +MODULE = Irssi PACKAGE = Irssi::Connect PREFIX = server_ +#******************************* + +void +values(conn) + Irssi::Connect conn +PREINIT: + HV *hv; +PPCODE: + hv = newHV(); + perl_connect_fill_hash(hv, conn); + XPUSHs(sv_2mortal(newRV_noinc((SV*)hv))); + +Irssi::Server +server_connect(conn) + Irssi::Connect conn + +#******************************* +MODULE = Irssi PACKAGE = Irssi::Reconnect +#******************************* + +void +values(reconnect) + Irssi::Reconnect reconnect +PREINIT: + HV *hv; +PPCODE: + hv = newHV(); + perl_connect_fill_hash(hv, reconnect->conn); + hv_store(hv, "tag", 3, newSViv(reconnect->tag), 0); + hv_store(hv, "next_connect", 12, newSViv(reconnect->next_connect), 0); + XPUSHs(sv_2mortal(newRV_noinc((SV*)hv))); + |