From 391a419a1fce87ea4fef199390e23cbf0dbee589 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Tue, 3 Oct 2000 19:10:24 +0000 Subject: 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 --- src/perl/common/.cvsignore | 7 ++ src/perl/common/Channel.xs | 156 +++++++++++++++++++++++++++++++++++++++++ src/perl/common/Core.xs | 125 +++++++++++++++++++++++++++++++++ src/perl/common/Irssi.pm | 32 +++++++++ src/perl/common/Irssi.xs | 16 +++++ src/perl/common/Log.xs | 76 ++++++++++++++++++++ src/perl/common/Makefile.PL.in | 6 ++ src/perl/common/Masks.xs | 58 +++++++++++++++ src/perl/common/Query.xs | 65 +++++++++++++++++ src/perl/common/Rawlog.xs | 84 ++++++++++++++++++++++ src/perl/common/Server.xs | 137 ++++++++++++++++++++++++++++++++++++ src/perl/common/Settings.xs | 39 +++++++++++ src/perl/common/Window.xs | 143 +++++++++++++++++++++++++++++++++++++ src/perl/common/module.h | 37 ++++++++++ src/perl/common/typemap | 12 ++++ src/perl/core/.cvsignore | 7 -- src/perl/core/Channel.xs | 156 ----------------------------------------- src/perl/core/Core.xs | 125 --------------------------------- src/perl/core/Irssi.pm | 32 --------- src/perl/core/Irssi.xs | 16 ----- src/perl/core/Log.xs | 76 -------------------- src/perl/core/Makefile.PL.in | 6 -- src/perl/core/Masks.xs | 58 --------------- src/perl/core/Query.xs | 65 ----------------- src/perl/core/Rawlog.xs | 84 ---------------------- src/perl/core/Server.xs | 137 ------------------------------------ src/perl/core/Settings.xs | 39 ----------- src/perl/core/Window.xs | 143 ------------------------------------- src/perl/core/module.h | 37 ---------- src/perl/core/typemap | 12 ---- 30 files changed, 993 insertions(+), 993 deletions(-) create mode 100644 src/perl/common/.cvsignore create mode 100644 src/perl/common/Channel.xs create mode 100644 src/perl/common/Core.xs create mode 100644 src/perl/common/Irssi.pm create mode 100644 src/perl/common/Irssi.xs create mode 100644 src/perl/common/Log.xs create mode 100644 src/perl/common/Makefile.PL.in create mode 100644 src/perl/common/Masks.xs create mode 100644 src/perl/common/Query.xs create mode 100644 src/perl/common/Rawlog.xs create mode 100644 src/perl/common/Server.xs create mode 100644 src/perl/common/Settings.xs create mode 100644 src/perl/common/Window.xs create mode 100644 src/perl/common/module.h create mode 100644 src/perl/common/typemap delete mode 100644 src/perl/core/.cvsignore delete mode 100644 src/perl/core/Channel.xs delete mode 100644 src/perl/core/Core.xs delete mode 100644 src/perl/core/Irssi.pm delete mode 100644 src/perl/core/Irssi.xs delete mode 100644 src/perl/core/Log.xs delete mode 100644 src/perl/core/Makefile.PL.in delete mode 100644 src/perl/core/Masks.xs delete mode 100644 src/perl/core/Query.xs delete mode 100644 src/perl/core/Rawlog.xs delete mode 100644 src/perl/core/Server.xs delete mode 100644 src/perl/core/Settings.xs delete mode 100644 src/perl/core/Window.xs delete mode 100644 src/perl/core/module.h delete mode 100644 src/perl/core/typemap (limited to 'src') diff --git a/src/perl/common/.cvsignore b/src/perl/common/.cvsignore new file mode 100644 index 00000000..d424b077 --- /dev/null +++ b/src/perl/common/.cvsignore @@ -0,0 +1,7 @@ +Makefile +Makefile.PL +Irssi.c +Irssi.bs +*.o +pm_to_blib +blib diff --git a/src/perl/common/Channel.xs b/src/perl/common/Channel.xs new file mode 100644 index 00000000..8a2cd824 --- /dev/null +++ b/src/perl/common/Channel.xs @@ -0,0 +1,156 @@ +MODULE = Irssi PACKAGE = Irssi + +void +channels() +PREINIT: + GSList *tmp; +PPCODE: + for (tmp = channels; tmp != NULL; tmp = tmp->next) { + CHANNEL_REC *rec = tmp->data; + + XPUSHs(sv_2mortal(sv_bless(newRV_noinc(newSViv(GPOINTER_TO_INT(rec))), + irssi_get_stash(rec)))); + } + +#******************************* +MODULE = Irssi PACKAGE = Irssi::Server +#******************************* + +void +channels(server) + Irssi::Server server +PREINIT: + GSList *tmp; +PPCODE: + for (tmp = server->channels; tmp != NULL; tmp = tmp->next) { + CHANNEL_REC *rec = tmp->data; + + XPUSHs(sv_2mortal(sv_bless(newRV_noinc(newSViv(GPOINTER_TO_INT(rec))), + irssi_get_stash(rec)))); + } + +Irssi::Channel +channel_create(chat_type, server, name, automatic) + int chat_type + Irssi::Server server + char *name + int automatic + +Irssi::Channel +channel_find(server, name) + Irssi::Server server + char *name + +#******************************* +MODULE = Irssi PACKAGE = Irssi::Channel PREFIX = channel_ +#******************************* + +void +values(channel) + Irssi::Channel channel +PREINIT: + HV *hv; +PPCODE: + hv = newHV(); + perl_channel_fill_hash(hv, channel); + XPUSHs(sv_2mortal(newRV_noinc((SV*)hv))); + +void +channel_destroy(channel) + Irssi::Channel channel + +Irssi::Channel +channel_find(channel) + char *channel +CODE: + RETVAL = channel_find(NULL, channel); +OUTPUT: + RETVAL + +void +command(channel, cmd) + Irssi::Channel channel + char *cmd +CODE: + signal_emit("send command", 3, cmd, channel->server, channel); + +Irssi::Nick +nicklist_insert(channel, nick, op, voice, send_massjoin) + Irssi::Channel channel + char *nick + int op + int voice + int send_massjoin + +void +nicklist_remove(channel, nick) + Irssi::Channel channel + Irssi::Nick nick + +Irssi::Nick +nicklist_find(channel, mask) + Irssi::Channel channel + char *mask + +void +nicklist_getnicks(channel) + Irssi::Channel channel +PREINIT: + GSList *list, *tmp; + HV *stash; +PPCODE: + list = nicklist_getnicks(channel); + + stash = gv_stashpv("Irssi::Nick", 0); + for (tmp = list; tmp != NULL; tmp = tmp->next) { + XPUSHs(sv_2mortal(sv_bless(newRV_noinc(newSViv(GPOINTER_TO_INT(tmp->data))), stash))); + } + g_slist_free(list); + +void +nicklist_get_same(server, nick) + Irssi::Server server + char *nick +PREINIT: + GSList *list, *tmp; + HV *nickstash; +PPCODE: + list = nicklist_get_same(server, nick); + + nickstash = gv_stashpv("Irssi::Nick", 0); + for (tmp = list; tmp != NULL; tmp = tmp->next->next) { + CHANNEL_REC *channel = tmp->data; + + XPUSHs(sv_2mortal(sv_bless(newRV_noinc(newSViv(GPOINTER_TO_INT(channel))), + irssi_get_stash(channel)))); + XPUSHs(sv_2mortal(sv_bless(newRV_noinc(newSViv(GPOINTER_TO_INT(tmp->next->data))), nickstash))); + } + g_slist_free(list); + +#******************************* +MODULE = Irssi PACKAGE = Irssi::Nick +#******************************* + +void +values(nick) + Irssi::Nick nick +PREINIT: + HV *hv; +PPCODE: + hv = newHV(); + hv_store(hv, "last_check", 10, newSViv(nick->last_check), 0); + + hv_store(hv, "nick", 4, new_pv(nick->nick), 0); + hv_store(hv, "host", 4, new_pv(nick->host), 0); + hv_store(hv, "realname", 8, new_pv(nick->realname), 0); + hv_store(hv, "hops", 4, newSViv(nick->hops), 0); + + hv_store(hv, "gone", 4, newSViv(nick->gone), 0); + hv_store(hv, "serverop", 8, newSViv(nick->serverop), 0); + + hv_store(hv, "send_massjoin", 13, newSViv(nick->send_massjoin), 0); + hv_store(hv, "op", 2, newSViv(nick->op), 0); + hv_store(hv, "halfop", 6, newSViv(nick->halfop), 0); + hv_store(hv, "voice", 5, newSViv(nick->voice), 0); + XPUSHs(sv_2mortal(newRV_noinc((SV*)hv))); + diff --git a/src/perl/common/Core.xs b/src/perl/common/Core.xs new file mode 100644 index 00000000..bac9e90b --- /dev/null +++ b/src/perl/common/Core.xs @@ -0,0 +1,125 @@ +MODULE = Irssi PACKAGE = Irssi + +void +signal_emit(signal, ...) + char *signal +PREINIT: + STRLEN n_a; +CODE: + void *p[6]; + int n; + + memset(p, 0, sizeof(p)); + for (n = 1; n < items && n < 6; n++) { + p[n-1] = SvPOKp(ST(n)) ? SvPV(ST(n), n_a) : (void *) SvIV((SV*)SvRV(ST(n))); + } + signal_emit(signal, items-1, p[0], p[1], p[2], p[3], p[4], p[5]); + +void +signal_add(signal, func) + char *signal + char *func +CODE: + perl_signal_add(signal, func); + +void +signal_add_last(signal, func) + char *signal + char *func +CODE: + perl_signal_add_last(signal, func); + +void +signal_remove(signal, func) + char *signal + char *func +CODE: + perl_signal_remove(signal, func); + +void +signal_stop() + +void +signal_stop_by_name(signal) + char *signal + +int +timeout_add(msecs, func, data) + int msecs + char *func + char *data +CODE: + RETVAL = perl_timeout_add(msecs, func, data); +OUTPUT: + RETVAL + +void +timeout_remove(tag) + int tag +CODE: + perl_timeout_remove(tag); + +int +level2bits(str) + char *str + +char * +bits2level(bits) + int bits + +int +combine_level(level, str) + int level + char *str + +void +commands() +PREINIT: + GSList *tmp; + HV *stash; +PPCODE: + stash = gv_stashpv("Irssi::Command", 0); + for (tmp = commands; tmp != NULL; tmp = tmp->next) { + XPUSHs(sv_2mortal(sv_bless(newRV_noinc(newSViv(GPOINTER_TO_INT(tmp->data))), stash))); + } + +void +command_bind(cmd, category, func) + char *cmd + char *category + char *func +CODE: + char *signal; + GSList *tmp; + + if (*category == '\0') category = "Perl scripts' commands"; + command_bind(cmd, category, NULL); + signal = g_strconcat("command ", cmd, NULL); + perl_signal_add(signal, func); + g_free(signal); + +void +command_unbind(cmd, func) + char *cmd + char *func +CODE: + char *signal; + + signal = g_strconcat("command ", cmd, NULL); + perl_signal_remove(signal, func); + g_free(signal); + +#******************************* +MODULE = Irssi PACKAGE = Irssi::Command PREFIX = command_ +#******************************* + +void +values(cmd) + Irssi::Command cmd +PREINIT: + HV *hv; +PPCODE: + hv = newHV(); + hv_store(hv, "category", 8, new_pv(cmd->category), 0); + hv_store(hv, "cmd", 3, new_pv(cmd->cmd), 0); + XPUSHs(sv_2mortal(newRV_noinc((SV*)hv))); diff --git a/src/perl/common/Irssi.pm b/src/perl/common/Irssi.pm new file mode 100644 index 00000000..62d5e442 --- /dev/null +++ b/src/perl/common/Irssi.pm @@ -0,0 +1,32 @@ +# +# Perl interface to irssi functions. +# + +package Irssi; + +use strict; +use vars qw($VERSION @ISA @EXPORT @EXPORT_OK); + +$VERSION = "0.20"; + +require Exporter; +require DynaLoader; + +@ISA = qw(Exporter DynaLoader); +@EXPORT = qw(); +@EXPORT_OK = qw(); + +bootstrap Irssi $VERSION; + +@Irssi::Ircnet::ISA = qw(Irssi::Chatnet); +@Irssi::IrcServer::ISA = qw(Irssi::Server); +@Irssi::IrcServerConnect::ISA = qw(Irssi::ServerConnect); +@Irssi::IrcServerSetup::ISA = qw(Irssi::ServerSetup); + +@Irssi::Channel::ISA = qw(Irssi::WindowItem); +@Irssi::Query::ISA = qw(Irssi::WindowItem); +@Irssi::IrcChannel::ISA = qw(Irssi::Channel); +@Irssi::IrcQuery::ISA = qw(Irssi::Query); + +1; + diff --git a/src/perl/common/Irssi.xs b/src/perl/common/Irssi.xs new file mode 100644 index 00000000..c996b6e2 --- /dev/null +++ b/src/perl/common/Irssi.xs @@ -0,0 +1,16 @@ +#include "module.h" +#include "levels.h" + +MODULE = Irssi PACKAGE = Irssi + +PROTOTYPES: ENABLE + +INCLUDE: Channel.xs +INCLUDE: Core.xs +INCLUDE: Log.xs +INCLUDE: Masks.xs +INCLUDE: Query.xs +INCLUDE: Rawlog.xs +INCLUDE: Server.xs +INCLUDE: Settings.xs +INCLUDE: Window.xs diff --git a/src/perl/common/Log.xs b/src/perl/common/Log.xs new file mode 100644 index 00000000..06b72d0b --- /dev/null +++ b/src/perl/common/Log.xs @@ -0,0 +1,76 @@ +MODULE = Irssi PACKAGE = Irssi + +void +logs() +PREINIT: + GSList *tmp; + HV *stash; +PPCODE: + stash = gv_stashpv("Irssi::Log", 0); + for (tmp = logs; tmp != NULL; tmp = tmp->next) { + XPUSHs(sv_2mortal(sv_bless(newRV_noinc(newSViv(GPOINTER_TO_INT(tmp->data))), stash))); + } + +Irssi::Log +log_create_rec(fname, level, items) + char *fname + int level + char *items + +Irssi::Log +log_find(fname) + char *fname + +void +log_write(item, level, str) + char *item + int level + char *str + +#******************************* +MODULE = Irssi PACKAGE = Irssi::Log PREFIX = log_ +#******************************* + +void +values(log) + Irssi::Log log +PREINIT: + HV *hv; + AV *av; + char **tmp; +PPCODE: + hv = newHV(); + hv_store(hv, "fname", 5, new_pv(log->fname), 0); + hv_store(hv, "opened", 6, newSViv(log->opened), 0); + hv_store(hv, "level", 5, newSViv(log->level), 0); + hv_store(hv, "last", 4, newSViv(log->last), 0); + hv_store(hv, "autoopen", 8, newSViv(log->autoopen), 0); + hv_store(hv, "temp", 4, newSViv(log->temp), 0); + + av = newAV(); + for (tmp = log->items; *tmp != NULL; tmp++) { + av_push(av, new_pv(*tmp)); + } + hv_store(hv, "items", 4, newRV_noinc((SV*)av), 0); + XPUSHs(sv_2mortal(newRV_noinc((SV*)hv))); + +void +log_update(log) + Irssi::Log log + +void +log_close(log) + Irssi::Log log + +void +log_write_rec(log, str) + Irssi::Log log + char *str + +void +log_start_logging(log) + Irssi::Log log + +void +log_stop_logging(log) + Irssi::Log log diff --git a/src/perl/common/Makefile.PL.in b/src/perl/common/Makefile.PL.in new file mode 100644 index 00000000..df6f8c2c --- /dev/null +++ b/src/perl/common/Makefile.PL.in @@ -0,0 +1,6 @@ +use ExtUtils::MakeMaker; + +WriteMakefile('NAME' => 'Irssi', + 'LIBS' => '', + 'INC' => '-I@top_srcdir@/src -I@top_srcdir@/src/core @GLIB_CFLAGS@', + 'VERSION_FROM' => '@srcdir@/Irssi.pm'); diff --git a/src/perl/common/Masks.xs b/src/perl/common/Masks.xs new file mode 100644 index 00000000..d27e32f3 --- /dev/null +++ b/src/perl/common/Masks.xs @@ -0,0 +1,58 @@ +MODULE = Irssi PACKAGE = Irssi + +int +mask_match(mask, nick, user, host) + char *mask + char *nick + char *user + char *host +CODE: + RETVAL = mask_match(NULL, mask, nick, user, host); +OUTPUT: + RETVAL + +int +mask_match_address(mask, nick, address) + char *mask + char *nick + char *address +CODE: + RETVAL = mask_match_address(NULL, mask, nick, address); +OUTPUT: + RETVAL + +int +masks_match(masks, nick, address) + char *masks + char *nick + char *address +CODE: + RETVAL = masks_match(NULL, masks, nick, address); +OUTPUT: + RETVAL + +#******************************* +MODULE = Irssi PACKAGE = Irssi::Server +#******************************* + +int +mask_match(server, mask, nick, user, host) + Irssi::Server server + char *mask + char *nick + char *user + char *host + +int +mask_match_address(server, mask, nick, address) + Irssi::Server server + char *mask + char *nick + char *address + +int +masks_match(server, masks, nick, address) + Irssi::Server server + char *masks + char *nick + char *address diff --git a/src/perl/common/Query.xs b/src/perl/common/Query.xs new file mode 100644 index 00000000..78004e06 --- /dev/null +++ b/src/perl/common/Query.xs @@ -0,0 +1,65 @@ +MODULE = Irssi PACKAGE = Irssi + +void +queries() +PREINIT: + GSList *tmp; +PPCODE: + for (tmp = queries; tmp != NULL; tmp = tmp->next) { + QUERY_REC *rec = tmp->data; + + XPUSHs(sv_2mortal(sv_bless(newRV_noinc(newSViv(GPOINTER_TO_INT(rec))), + irssi_get_stash(rec)))); + } + +#******************************* +MODULE = Irssi PACKAGE = Irssi::Server +#******************************* + +void +queries(server) + Irssi::Server server +PREINIT: + GSList *tmp; +PPCODE: + for (tmp = server->queries; tmp != NULL; tmp = tmp->next) { + QUERY_REC *rec = tmp->data; + + XPUSHs(sv_2mortal(sv_bless(newRV_noinc(newSViv(GPOINTER_TO_INT(rec))), + irssi_get_stash(rec)))); + } + +Irssi::Query +query_create(chat_type, server, nick, automatic) + int chat_type + Irssi::Server server + char *nick + int automatic + +Irssi::Query +query_find(server, nick) + Irssi::Server server + char *nick + +#******************************* +MODULE = Irssi PACKAGE = Irssi::Query PREFIX = query_ +#******************************* + +void +values(query) + Irssi::Query query +PREINIT: + HV *hv; +PPCODE: + hv = newHV(); + perl_query_fill_hash(hv, query); + XPUSHs(sv_2mortal(newRV_noinc((SV*)hv))); + +void +query_destroy(query) + Irssi::Query query + +void +query_change_server(query, server) + Irssi::Query query + Irssi::Server server diff --git a/src/perl/common/Rawlog.xs b/src/perl/common/Rawlog.xs new file mode 100644 index 00000000..c7422bac --- /dev/null +++ b/src/perl/common/Rawlog.xs @@ -0,0 +1,84 @@ +MODULE = Irssi PACKAGE = Irssi + +void +rawlog_set_size(lines) + int lines + +Irssi::Rawlog +rawlog_create() + +#******************************* +MODULE = Irssi PACKAGE = Irssi::Server +#******************************* + +void +rawlog_input(rawlog, str) + Irssi::Rawlog rawlog + char *str + +void +rawlog_output(rawlog, str) + Irssi::Rawlog rawlog + char *str + +void +rawlog_redirect(rawlog, str) + Irssi::Rawlog rawlog + char *str + + +#******************************* +MODULE = Irssi PACKAGE = Irssi::Rawlog PREFIX = rawlog_ +#******************************* + +void +values(rawlog) + Irssi::Rawlog rawlog +PREINIT: + HV *hv; + AV *av; + GSList *tmp; +PPCODE: + hv = newHV(); + hv_store(hv, "logging", 7, newSViv(rawlog->logging), 0); + hv_store(hv, "nlines", 6, newSViv(rawlog->nlines), 0); + + av = newAV(); + for (tmp = rawlog->lines; tmp != NULL; tmp = tmp->next) { + av_push(av, new_pv(tmp->data)); + } + hv_store(hv, "lines", 5, newRV_noinc((SV*)av), 0); + XPUSHs(sv_2mortal(newRV_noinc((SV*)hv))); + +void +rawlog_destroy(rawlog) + Irssi::Rawlog rawlog + +void +rawlog_input(rawlog, str) + Irssi::Rawlog rawlog + char *str + +void +rawlog_output(rawlog, str) + Irssi::Rawlog rawlog + char *str + +void +rawlog_redirect(rawlog, str) + Irssi::Rawlog rawlog + char *str + +void +rawlog_open(rawlog, fname) + Irssi::Rawlog rawlog + char *fname + +void +rawlog_close(rawlog) + Irssi::Rawlog rawlog + +void +rawlog_save(rawlog, fname) + Irssi::Rawlog rawlog + char *fname 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))); + diff --git a/src/perl/common/Settings.xs b/src/perl/common/Settings.xs new file mode 100644 index 00000000..6f5c0915 --- /dev/null +++ b/src/perl/common/Settings.xs @@ -0,0 +1,39 @@ +MODULE = Irssi PACKAGE = Irssi + +char * +settings_get_str(key) + char *key +CODE: + RETVAL = (char *) settings_get_str(key); +OUTPUT: + RETVAL + +int +settings_get_int(key) + char *key + +int +settings_get_bool(key) + char *key + +void +settings_add_str(section, key, def) + char *section + char *key + char *def + +void +settings_add_int(section, key, def) + char *section + char *key + int def + +void +settings_add_bool(section, key, def) + char *section + char *key + int def + +void +settings_remove(key) + char *key diff --git a/src/perl/common/Window.xs b/src/perl/common/Window.xs new file mode 100644 index 00000000..7a516020 --- /dev/null +++ b/src/perl/common/Window.xs @@ -0,0 +1,143 @@ +MODULE = Irssi PACKAGE = Irssi + +void +command(cmd, server=active_win->active_server, item=active_win->active) + char *cmd + Irssi::Server server + Irssi::Windowitem item +CODE: + signal_emit("send command", 3, cmd, server, item); + +Irssi::Window +active_win() +CODE: + RETVAL = active_win; +OUTPUT: + RETVAL + +Irssi::Server +active_server() +CODE: + RETVAL = active_win->active_server; +OUTPUT: + RETVAL + +void +print(str, level=MSGLEVEL_CLIENTNOTICE) + char *str + int level; +CODE: + printtext(NULL, NULL, level, str); + +void +print_window(str, level=MSGLEVEL_CLIENTNOTICE) + char *str + int level; +CODE: + printtext_window(active_win, level, str); + + +#******************************* +MODULE = Irssi PACKAGE = Irssi::Server +#******************************* + +void +command(server, cmd, item=active_win->active) + char *cmd + Irssi::Server server + Irssi::Windowitem item +CODE: + if (item != NULL && item->server != SERVER(server)) + item = NULL; + signal_emit("send command", 3, cmd, server, item); + +void +printtext(server, channel, level, str) + Irssi::Server server + char *channel + int level + char *str +CODE: + printtext(server, channel, level, str); + +#******************************* +MODULE = Irssi PACKAGE = Irssi::Window +#******************************* + +void +values(window) + Irssi::Window window +PREINIT: + HV *hv; + GSList *tmp; +PPCODE: + hv = newHV(); + hv_store(hv, "refnum", 6, newSViv(window->refnum), 0); + hv_store(hv, "name", 4, new_pv(window->name), 0); + + if (window->active) { + hv_store(hv, "active", 6, sv_bless(newRV_noinc(newSViv(GPOINTER_TO_INT(window->active))), + irssi_get_stash(window->active)), 0); + } + if (window->active_server) { + hv_store(hv, "active_server", 13, sv_bless(newRV_noinc(newSViv(GPOINTER_TO_INT(window->active_server))), + irssi_get_stash(window->active_server)), 0); + } + + hv_store(hv, "lines", 5, newSViv(window->lines), 0); + + hv_store(hv, "level", 5, newSViv(window->level), 0); + hv_store(hv, "new_data", 8, newSViv(window->new_data), 0); + hv_store(hv, "last_color", 10, newSViv(window->last_color), 0); + hv_store(hv, "last_timestamp", 14, newSViv(window->last_timestamp), 0); + hv_store(hv, "last_line", 9, newSViv(window->last_line), 0); + XPUSHs(sv_2mortal(newRV_noinc((SV*)hv))); + +void +items(window) + Irssi::Window window +PREINIT: + GSList *tmp; + HV *stash; +PPCODE: + for (tmp = window->items; tmp != NULL; tmp = tmp->next) { + CHANNEL_REC *rec = tmp->data; + + XPUSHs(sv_2mortal(sv_bless(newRV_noinc(newSViv(GPOINTER_TO_INT(rec))), + irssi_get_stash(rec)))); + } + +void +command(window, cmd, server=window->active_server, item=window->active) + Irssi::Window window + char *cmd + Irssi::Server server + Irssi::Windowitem item +CODE: + signal_emit("send command", 3, cmd, server, item); + +#******************************* +MODULE = Irssi PACKAGE = Irssi::Windowitem +#******************************* + +void +values(item) + Irssi::Windowitem item +PREINIT: + HV *hv; + AV *av; + GSList *tmp; +PPCODE: + hv = newHV(); + hv_store(hv, "server", 6, sv_bless(newRV_noinc(newSViv(GPOINTER_TO_INT(item->server))), + irssi_get_stash(item->server)), 0); + hv_store(hv, "name", 4, new_pv(item->name), 0); + hv_store(hv, "new_data", 8, newSViv(item->new_data), 0); + XPUSHs(sv_2mortal(newRV_noinc((SV*)hv))); + +void +command(item, cmd) + Irssi::Windowitem item + char *cmd +CODE: + signal_emit("send command", 3, cmd, item->server, item); diff --git a/src/perl/common/module.h b/src/perl/common/module.h new file mode 100644 index 00000000..4d33a474 --- /dev/null +++ b/src/perl/common/module.h @@ -0,0 +1,37 @@ +#include +#include +#include + +#undef _ +#include "common.h" +#include "network.h" +#include "commands.h" +#include "log.h" +#include "rawlog.h" +#include "settings.h" +#include "masks.h" + +#include "servers.h" +#include "servers-reconnect.h" +#include "servers-setup.h" +#include "channels.h" +#include "queries.h" +#include "nicklist.h" + +#include "perl/perl-common.h" + +#include "fe-common/core/windows.h" + +typedef COMMAND_REC *Irssi__Command; +typedef LOG_REC *Irssi__Log; +typedef RAWLOG_REC *Irssi__Rawlog; + +typedef SERVER_REC *Irssi__Server; +typedef SERVER_CONNECT_REC *Irssi__Connect; +typedef RECONNECT_REC *Irssi__Reconnect; +typedef CHANNEL_REC *Irssi__Channel; +typedef QUERY_REC *Irssi__Query; +typedef NICK_REC *Irssi__Nick; + +typedef WINDOW_REC *Irssi__Window; +typedef WI_ITEM_REC *Irssi__Windowitem; diff --git a/src/perl/common/typemap b/src/perl/common/typemap new file mode 100644 index 00000000..5490ce42 --- /dev/null +++ b/src/perl/common/typemap @@ -0,0 +1,12 @@ +TYPEMAP +Irssi::Server T_PTROBJ +Irssi::Connect T_PTROBJ +Irssi::Reconnect T_PTROBJ +Irssi::Channel T_PTROBJ +Irssi::Query T_PTROBJ +Irssi::Command T_PTROBJ +Irssi::Nick T_PTROBJ +Irssi::Log T_PTROBJ +Irssi::Rawlog T_PTROBJ +Irssi::Window T_PTROBJ +Irssi::Windowitem T_PTROBJ diff --git a/src/perl/core/.cvsignore b/src/perl/core/.cvsignore deleted file mode 100644 index d424b077..00000000 --- a/src/perl/core/.cvsignore +++ /dev/null @@ -1,7 +0,0 @@ -Makefile -Makefile.PL -Irssi.c -Irssi.bs -*.o -pm_to_blib -blib diff --git a/src/perl/core/Channel.xs b/src/perl/core/Channel.xs deleted file mode 100644 index 8a2cd824..00000000 --- a/src/perl/core/Channel.xs +++ /dev/null @@ -1,156 +0,0 @@ -MODULE = Irssi PACKAGE = Irssi - -void -channels() -PREINIT: - GSList *tmp; -PPCODE: - for (tmp = channels; tmp != NULL; tmp = tmp->next) { - CHANNEL_REC *rec = tmp->data; - - XPUSHs(sv_2mortal(sv_bless(newRV_noinc(newSViv(GPOINTER_TO_INT(rec))), - irssi_get_stash(rec)))); - } - -#******************************* -MODULE = Irssi PACKAGE = Irssi::Server -#******************************* - -void -channels(server) - Irssi::Server server -PREINIT: - GSList *tmp; -PPCODE: - for (tmp = server->channels; tmp != NULL; tmp = tmp->next) { - CHANNEL_REC *rec = tmp->data; - - XPUSHs(sv_2mortal(sv_bless(newRV_noinc(newSViv(GPOINTER_TO_INT(rec))), - irssi_get_stash(rec)))); - } - -Irssi::Channel -channel_create(chat_type, server, name, automatic) - int chat_type - Irssi::Server server - char *name - int automatic - -Irssi::Channel -channel_find(server, name) - Irssi::Server server - char *name - -#******************************* -MODULE = Irssi PACKAGE = Irssi::Channel PREFIX = channel_ -#******************************* - -void -values(channel) - Irssi::Channel channel -PREINIT: - HV *hv; -PPCODE: - hv = newHV(); - perl_channel_fill_hash(hv, channel); - XPUSHs(sv_2mortal(newRV_noinc((SV*)hv))); - -void -channel_destroy(channel) - Irssi::Channel channel - -Irssi::Channel -channel_find(channel) - char *channel -CODE: - RETVAL = channel_find(NULL, channel); -OUTPUT: - RETVAL - -void -command(channel, cmd) - Irssi::Channel channel - char *cmd -CODE: - signal_emit("send command", 3, cmd, channel->server, channel); - -Irssi::Nick -nicklist_insert(channel, nick, op, voice, send_massjoin) - Irssi::Channel channel - char *nick - int op - int voice - int send_massjoin - -void -nicklist_remove(channel, nick) - Irssi::Channel channel - Irssi::Nick nick - -Irssi::Nick -nicklist_find(channel, mask) - Irssi::Channel channel - char *mask - -void -nicklist_getnicks(channel) - Irssi::Channel channel -PREINIT: - GSList *list, *tmp; - HV *stash; -PPCODE: - list = nicklist_getnicks(channel); - - stash = gv_stashpv("Irssi::Nick", 0); - for (tmp = list; tmp != NULL; tmp = tmp->next) { - XPUSHs(sv_2mortal(sv_bless(newRV_noinc(newSViv(GPOINTER_TO_INT(tmp->data))), stash))); - } - g_slist_free(list); - -void -nicklist_get_same(server, nick) - Irssi::Server server - char *nick -PREINIT: - GSList *list, *tmp; - HV *nickstash; -PPCODE: - list = nicklist_get_same(server, nick); - - nickstash = gv_stashpv("Irssi::Nick", 0); - for (tmp = list; tmp != NULL; tmp = tmp->next->next) { - CHANNEL_REC *channel = tmp->data; - - XPUSHs(sv_2mortal(sv_bless(newRV_noinc(newSViv(GPOINTER_TO_INT(channel))), - irssi_get_stash(channel)))); - XPUSHs(sv_2mortal(sv_bless(newRV_noinc(newSViv(GPOINTER_TO_INT(tmp->next->data))), nickstash))); - } - g_slist_free(list); - -#******************************* -MODULE = Irssi PACKAGE = Irssi::Nick -#******************************* - -void -values(nick) - Irssi::Nick nick -PREINIT: - HV *hv; -PPCODE: - hv = newHV(); - hv_store(hv, "last_check", 10, newSViv(nick->last_check), 0); - - hv_store(hv, "nick", 4, new_pv(nick->nick), 0); - hv_store(hv, "host", 4, new_pv(nick->host), 0); - hv_store(hv, "realname", 8, new_pv(nick->realname), 0); - hv_store(hv, "hops", 4, newSViv(nick->hops), 0); - - hv_store(hv, "gone", 4, newSViv(nick->gone), 0); - hv_store(hv, "serverop", 8, newSViv(nick->serverop), 0); - - hv_store(hv, "send_massjoin", 13, newSViv(nick->send_massjoin), 0); - hv_store(hv, "op", 2, newSViv(nick->op), 0); - hv_store(hv, "halfop", 6, newSViv(nick->halfop), 0); - hv_store(hv, "voice", 5, newSViv(nick->voice), 0); - XPUSHs(sv_2mortal(newRV_noinc((SV*)hv))); - diff --git a/src/perl/core/Core.xs b/src/perl/core/Core.xs deleted file mode 100644 index bac9e90b..00000000 --- a/src/perl/core/Core.xs +++ /dev/null @@ -1,125 +0,0 @@ -MODULE = Irssi PACKAGE = Irssi - -void -signal_emit(signal, ...) - char *signal -PREINIT: - STRLEN n_a; -CODE: - void *p[6]; - int n; - - memset(p, 0, sizeof(p)); - for (n = 1; n < items && n < 6; n++) { - p[n-1] = SvPOKp(ST(n)) ? SvPV(ST(n), n_a) : (void *) SvIV((SV*)SvRV(ST(n))); - } - signal_emit(signal, items-1, p[0], p[1], p[2], p[3], p[4], p[5]); - -void -signal_add(signal, func) - char *signal - char *func -CODE: - perl_signal_add(signal, func); - -void -signal_add_last(signal, func) - char *signal - char *func -CODE: - perl_signal_add_last(signal, func); - -void -signal_remove(signal, func) - char *signal - char *func -CODE: - perl_signal_remove(signal, func); - -void -signal_stop() - -void -signal_stop_by_name(signal) - char *signal - -int -timeout_add(msecs, func, data) - int msecs - char *func - char *data -CODE: - RETVAL = perl_timeout_add(msecs, func, data); -OUTPUT: - RETVAL - -void -timeout_remove(tag) - int tag -CODE: - perl_timeout_remove(tag); - -int -level2bits(str) - char *str - -char * -bits2level(bits) - int bits - -int -combine_level(level, str) - int level - char *str - -void -commands() -PREINIT: - GSList *tmp; - HV *stash; -PPCODE: - stash = gv_stashpv("Irssi::Command", 0); - for (tmp = commands; tmp != NULL; tmp = tmp->next) { - XPUSHs(sv_2mortal(sv_bless(newRV_noinc(newSViv(GPOINTER_TO_INT(tmp->data))), stash))); - } - -void -command_bind(cmd, category, func) - char *cmd - char *category - char *func -CODE: - char *signal; - GSList *tmp; - - if (*category == '\0') category = "Perl scripts' commands"; - command_bind(cmd, category, NULL); - signal = g_strconcat("command ", cmd, NULL); - perl_signal_add(signal, func); - g_free(signal); - -void -command_unbind(cmd, func) - char *cmd - char *func -CODE: - char *signal; - - signal = g_strconcat("command ", cmd, NULL); - perl_signal_remove(signal, func); - g_free(signal); - -#******************************* -MODULE = Irssi PACKAGE = Irssi::Command PREFIX = command_ -#******************************* - -void -values(cmd) - Irssi::Command cmd -PREINIT: - HV *hv; -PPCODE: - hv = newHV(); - hv_store(hv, "category", 8, new_pv(cmd->category), 0); - hv_store(hv, "cmd", 3, new_pv(cmd->cmd), 0); - XPUSHs(sv_2mortal(newRV_noinc((SV*)hv))); diff --git a/src/perl/core/Irssi.pm b/src/perl/core/Irssi.pm deleted file mode 100644 index 62d5e442..00000000 --- a/src/perl/core/Irssi.pm +++ /dev/null @@ -1,32 +0,0 @@ -# -# Perl interface to irssi functions. -# - -package Irssi; - -use strict; -use vars qw($VERSION @ISA @EXPORT @EXPORT_OK); - -$VERSION = "0.20"; - -require Exporter; -require DynaLoader; - -@ISA = qw(Exporter DynaLoader); -@EXPORT = qw(); -@EXPORT_OK = qw(); - -bootstrap Irssi $VERSION; - -@Irssi::Ircnet::ISA = qw(Irssi::Chatnet); -@Irssi::IrcServer::ISA = qw(Irssi::Server); -@Irssi::IrcServerConnect::ISA = qw(Irssi::ServerConnect); -@Irssi::IrcServerSetup::ISA = qw(Irssi::ServerSetup); - -@Irssi::Channel::ISA = qw(Irssi::WindowItem); -@Irssi::Query::ISA = qw(Irssi::WindowItem); -@Irssi::IrcChannel::ISA = qw(Irssi::Channel); -@Irssi::IrcQuery::ISA = qw(Irssi::Query); - -1; - diff --git a/src/perl/core/Irssi.xs b/src/perl/core/Irssi.xs deleted file mode 100644 index c996b6e2..00000000 --- a/src/perl/core/Irssi.xs +++ /dev/null @@ -1,16 +0,0 @@ -#include "module.h" -#include "levels.h" - -MODULE = Irssi PACKAGE = Irssi - -PROTOTYPES: ENABLE - -INCLUDE: Channel.xs -INCLUDE: Core.xs -INCLUDE: Log.xs -INCLUDE: Masks.xs -INCLUDE: Query.xs -INCLUDE: Rawlog.xs -INCLUDE: Server.xs -INCLUDE: Settings.xs -INCLUDE: Window.xs diff --git a/src/perl/core/Log.xs b/src/perl/core/Log.xs deleted file mode 100644 index 06b72d0b..00000000 --- a/src/perl/core/Log.xs +++ /dev/null @@ -1,76 +0,0 @@ -MODULE = Irssi PACKAGE = Irssi - -void -logs() -PREINIT: - GSList *tmp; - HV *stash; -PPCODE: - stash = gv_stashpv("Irssi::Log", 0); - for (tmp = logs; tmp != NULL; tmp = tmp->next) { - XPUSHs(sv_2mortal(sv_bless(newRV_noinc(newSViv(GPOINTER_TO_INT(tmp->data))), stash))); - } - -Irssi::Log -log_create_rec(fname, level, items) - char *fname - int level - char *items - -Irssi::Log -log_find(fname) - char *fname - -void -log_write(item, level, str) - char *item - int level - char *str - -#******************************* -MODULE = Irssi PACKAGE = Irssi::Log PREFIX = log_ -#******************************* - -void -values(log) - Irssi::Log log -PREINIT: - HV *hv; - AV *av; - char **tmp; -PPCODE: - hv = newHV(); - hv_store(hv, "fname", 5, new_pv(log->fname), 0); - hv_store(hv, "opened", 6, newSViv(log->opened), 0); - hv_store(hv, "level", 5, newSViv(log->level), 0); - hv_store(hv, "last", 4, newSViv(log->last), 0); - hv_store(hv, "autoopen", 8, newSViv(log->autoopen), 0); - hv_store(hv, "temp", 4, newSViv(log->temp), 0); - - av = newAV(); - for (tmp = log->items; *tmp != NULL; tmp++) { - av_push(av, new_pv(*tmp)); - } - hv_store(hv, "items", 4, newRV_noinc((SV*)av), 0); - XPUSHs(sv_2mortal(newRV_noinc((SV*)hv))); - -void -log_update(log) - Irssi::Log log - -void -log_close(log) - Irssi::Log log - -void -log_write_rec(log, str) - Irssi::Log log - char *str - -void -log_start_logging(log) - Irssi::Log log - -void -log_stop_logging(log) - Irssi::Log log diff --git a/src/perl/core/Makefile.PL.in b/src/perl/core/Makefile.PL.in deleted file mode 100644 index df6f8c2c..00000000 --- a/src/perl/core/Makefile.PL.in +++ /dev/null @@ -1,6 +0,0 @@ -use ExtUtils::MakeMaker; - -WriteMakefile('NAME' => 'Irssi', - 'LIBS' => '', - 'INC' => '-I@top_srcdir@/src -I@top_srcdir@/src/core @GLIB_CFLAGS@', - 'VERSION_FROM' => '@srcdir@/Irssi.pm'); diff --git a/src/perl/core/Masks.xs b/src/perl/core/Masks.xs deleted file mode 100644 index d27e32f3..00000000 --- a/src/perl/core/Masks.xs +++ /dev/null @@ -1,58 +0,0 @@ -MODULE = Irssi PACKAGE = Irssi - -int -mask_match(mask, nick, user, host) - char *mask - char *nick - char *user - char *host -CODE: - RETVAL = mask_match(NULL, mask, nick, user, host); -OUTPUT: - RETVAL - -int -mask_match_address(mask, nick, address) - char *mask - char *nick - char *address -CODE: - RETVAL = mask_match_address(NULL, mask, nick, address); -OUTPUT: - RETVAL - -int -masks_match(masks, nick, address) - char *masks - char *nick - char *address -CODE: - RETVAL = masks_match(NULL, masks, nick, address); -OUTPUT: - RETVAL - -#******************************* -MODULE = Irssi PACKAGE = Irssi::Server -#******************************* - -int -mask_match(server, mask, nick, user, host) - Irssi::Server server - char *mask - char *nick - char *user - char *host - -int -mask_match_address(server, mask, nick, address) - Irssi::Server server - char *mask - char *nick - char *address - -int -masks_match(server, masks, nick, address) - Irssi::Server server - char *masks - char *nick - char *address diff --git a/src/perl/core/Query.xs b/src/perl/core/Query.xs deleted file mode 100644 index 78004e06..00000000 --- a/src/perl/core/Query.xs +++ /dev/null @@ -1,65 +0,0 @@ -MODULE = Irssi PACKAGE = Irssi - -void -queries() -PREINIT: - GSList *tmp; -PPCODE: - for (tmp = queries; tmp != NULL; tmp = tmp->next) { - QUERY_REC *rec = tmp->data; - - XPUSHs(sv_2mortal(sv_bless(newRV_noinc(newSViv(GPOINTER_TO_INT(rec))), - irssi_get_stash(rec)))); - } - -#******************************* -MODULE = Irssi PACKAGE = Irssi::Server -#******************************* - -void -queries(server) - Irssi::Server server -PREINIT: - GSList *tmp; -PPCODE: - for (tmp = server->queries; tmp != NULL; tmp = tmp->next) { - QUERY_REC *rec = tmp->data; - - XPUSHs(sv_2mortal(sv_bless(newRV_noinc(newSViv(GPOINTER_TO_INT(rec))), - irssi_get_stash(rec)))); - } - -Irssi::Query -query_create(chat_type, server, nick, automatic) - int chat_type - Irssi::Server server - char *nick - int automatic - -Irssi::Query -query_find(server, nick) - Irssi::Server server - char *nick - -#******************************* -MODULE = Irssi PACKAGE = Irssi::Query PREFIX = query_ -#******************************* - -void -values(query) - Irssi::Query query -PREINIT: - HV *hv; -PPCODE: - hv = newHV(); - perl_query_fill_hash(hv, query); - XPUSHs(sv_2mortal(newRV_noinc((SV*)hv))); - -void -query_destroy(query) - Irssi::Query query - -void -query_change_server(query, server) - Irssi::Query query - Irssi::Server server diff --git a/src/perl/core/Rawlog.xs b/src/perl/core/Rawlog.xs deleted file mode 100644 index c7422bac..00000000 --- a/src/perl/core/Rawlog.xs +++ /dev/null @@ -1,84 +0,0 @@ -MODULE = Irssi PACKAGE = Irssi - -void -rawlog_set_size(lines) - int lines - -Irssi::Rawlog -rawlog_create() - -#******************************* -MODULE = Irssi PACKAGE = Irssi::Server -#******************************* - -void -rawlog_input(rawlog, str) - Irssi::Rawlog rawlog - char *str - -void -rawlog_output(rawlog, str) - Irssi::Rawlog rawlog - char *str - -void -rawlog_redirect(rawlog, str) - Irssi::Rawlog rawlog - char *str - - -#******************************* -MODULE = Irssi PACKAGE = Irssi::Rawlog PREFIX = rawlog_ -#******************************* - -void -values(rawlog) - Irssi::Rawlog rawlog -PREINIT: - HV *hv; - AV *av; - GSList *tmp; -PPCODE: - hv = newHV(); - hv_store(hv, "logging", 7, newSViv(rawlog->logging), 0); - hv_store(hv, "nlines", 6, newSViv(rawlog->nlines), 0); - - av = newAV(); - for (tmp = rawlog->lines; tmp != NULL; tmp = tmp->next) { - av_push(av, new_pv(tmp->data)); - } - hv_store(hv, "lines", 5, newRV_noinc((SV*)av), 0); - XPUSHs(sv_2mortal(newRV_noinc((SV*)hv))); - -void -rawlog_destroy(rawlog) - Irssi::Rawlog rawlog - -void -rawlog_input(rawlog, str) - Irssi::Rawlog rawlog - char *str - -void -rawlog_output(rawlog, str) - Irssi::Rawlog rawlog - char *str - -void -rawlog_redirect(rawlog, str) - Irssi::Rawlog rawlog - char *str - -void -rawlog_open(rawlog, fname) - Irssi::Rawlog rawlog - char *fname - -void -rawlog_close(rawlog) - Irssi::Rawlog rawlog - -void -rawlog_save(rawlog, fname) - Irssi::Rawlog rawlog - char *fname diff --git a/src/perl/core/Server.xs b/src/perl/core/Server.xs deleted file mode 100644 index c3078485..00000000 --- a/src/perl/core/Server.xs +++ /dev/null @@ -1,137 +0,0 @@ -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))); - diff --git a/src/perl/core/Settings.xs b/src/perl/core/Settings.xs deleted file mode 100644 index 6f5c0915..00000000 --- a/src/perl/core/Settings.xs +++ /dev/null @@ -1,39 +0,0 @@ -MODULE = Irssi PACKAGE = Irssi - -char * -settings_get_str(key) - char *key -CODE: - RETVAL = (char *) settings_get_str(key); -OUTPUT: - RETVAL - -int -settings_get_int(key) - char *key - -int -settings_get_bool(key) - char *key - -void -settings_add_str(section, key, def) - char *section - char *key - char *def - -void -settings_add_int(section, key, def) - char *section - char *key - int def - -void -settings_add_bool(section, key, def) - char *section - char *key - int def - -void -settings_remove(key) - char *key diff --git a/src/perl/core/Window.xs b/src/perl/core/Window.xs deleted file mode 100644 index 7a516020..00000000 --- a/src/perl/core/Window.xs +++ /dev/null @@ -1,143 +0,0 @@ -MODULE = Irssi PACKAGE = Irssi - -void -command(cmd, server=active_win->active_server, item=active_win->active) - char *cmd - Irssi::Server server - Irssi::Windowitem item -CODE: - signal_emit("send command", 3, cmd, server, item); - -Irssi::Window -active_win() -CODE: - RETVAL = active_win; -OUTPUT: - RETVAL - -Irssi::Server -active_server() -CODE: - RETVAL = active_win->active_server; -OUTPUT: - RETVAL - -void -print(str, level=MSGLEVEL_CLIENTNOTICE) - char *str - int level; -CODE: - printtext(NULL, NULL, level, str); - -void -print_window(str, level=MSGLEVEL_CLIENTNOTICE) - char *str - int level; -CODE: - printtext_window(active_win, level, str); - - -#******************************* -MODULE = Irssi PACKAGE = Irssi::Server -#******************************* - -void -command(server, cmd, item=active_win->active) - char *cmd - Irssi::Server server - Irssi::Windowitem item -CODE: - if (item != NULL && item->server != SERVER(server)) - item = NULL; - signal_emit("send command", 3, cmd, server, item); - -void -printtext(server, channel, level, str) - Irssi::Server server - char *channel - int level - char *str -CODE: - printtext(server, channel, level, str); - -#******************************* -MODULE = Irssi PACKAGE = Irssi::Window -#******************************* - -void -values(window) - Irssi::Window window -PREINIT: - HV *hv; - GSList *tmp; -PPCODE: - hv = newHV(); - hv_store(hv, "refnum", 6, newSViv(window->refnum), 0); - hv_store(hv, "name", 4, new_pv(window->name), 0); - - if (window->active) { - hv_store(hv, "active", 6, sv_bless(newRV_noinc(newSViv(GPOINTER_TO_INT(window->active))), - irssi_get_stash(window->active)), 0); - } - if (window->active_server) { - hv_store(hv, "active_server", 13, sv_bless(newRV_noinc(newSViv(GPOINTER_TO_INT(window->active_server))), - irssi_get_stash(window->active_server)), 0); - } - - hv_store(hv, "lines", 5, newSViv(window->lines), 0); - - hv_store(hv, "level", 5, newSViv(window->level), 0); - hv_store(hv, "new_data", 8, newSViv(window->new_data), 0); - hv_store(hv, "last_color", 10, newSViv(window->last_color), 0); - hv_store(hv, "last_timestamp", 14, newSViv(window->last_timestamp), 0); - hv_store(hv, "last_line", 9, newSViv(window->last_line), 0); - XPUSHs(sv_2mortal(newRV_noinc((SV*)hv))); - -void -items(window) - Irssi::Window window -PREINIT: - GSList *tmp; - HV *stash; -PPCODE: - for (tmp = window->items; tmp != NULL; tmp = tmp->next) { - CHANNEL_REC *rec = tmp->data; - - XPUSHs(sv_2mortal(sv_bless(newRV_noinc(newSViv(GPOINTER_TO_INT(rec))), - irssi_get_stash(rec)))); - } - -void -command(window, cmd, server=window->active_server, item=window->active) - Irssi::Window window - char *cmd - Irssi::Server server - Irssi::Windowitem item -CODE: - signal_emit("send command", 3, cmd, server, item); - -#******************************* -MODULE = Irssi PACKAGE = Irssi::Windowitem -#******************************* - -void -values(item) - Irssi::Windowitem item -PREINIT: - HV *hv; - AV *av; - GSList *tmp; -PPCODE: - hv = newHV(); - hv_store(hv, "server", 6, sv_bless(newRV_noinc(newSViv(GPOINTER_TO_INT(item->server))), - irssi_get_stash(item->server)), 0); - hv_store(hv, "name", 4, new_pv(item->name), 0); - hv_store(hv, "new_data", 8, newSViv(item->new_data), 0); - XPUSHs(sv_2mortal(newRV_noinc((SV*)hv))); - -void -command(item, cmd) - Irssi::Windowitem item - char *cmd -CODE: - signal_emit("send command", 3, cmd, item->server, item); diff --git a/src/perl/core/module.h b/src/perl/core/module.h deleted file mode 100644 index 4d33a474..00000000 --- a/src/perl/core/module.h +++ /dev/null @@ -1,37 +0,0 @@ -#include -#include -#include - -#undef _ -#include "common.h" -#include "network.h" -#include "commands.h" -#include "log.h" -#include "rawlog.h" -#include "settings.h" -#include "masks.h" - -#include "servers.h" -#include "servers-reconnect.h" -#include "servers-setup.h" -#include "channels.h" -#include "queries.h" -#include "nicklist.h" - -#include "perl/perl-common.h" - -#include "fe-common/core/windows.h" - -typedef COMMAND_REC *Irssi__Command; -typedef LOG_REC *Irssi__Log; -typedef RAWLOG_REC *Irssi__Rawlog; - -typedef SERVER_REC *Irssi__Server; -typedef SERVER_CONNECT_REC *Irssi__Connect; -typedef RECONNECT_REC *Irssi__Reconnect; -typedef CHANNEL_REC *Irssi__Channel; -typedef QUERY_REC *Irssi__Query; -typedef NICK_REC *Irssi__Nick; - -typedef WINDOW_REC *Irssi__Window; -typedef WI_ITEM_REC *Irssi__Windowitem; diff --git a/src/perl/core/typemap b/src/perl/core/typemap deleted file mode 100644 index 5490ce42..00000000 --- a/src/perl/core/typemap +++ /dev/null @@ -1,12 +0,0 @@ -TYPEMAP -Irssi::Server T_PTROBJ -Irssi::Connect T_PTROBJ -Irssi::Reconnect T_PTROBJ -Irssi::Channel T_PTROBJ -Irssi::Query T_PTROBJ -Irssi::Command T_PTROBJ -Irssi::Nick T_PTROBJ -Irssi::Log T_PTROBJ -Irssi::Rawlog T_PTROBJ -Irssi::Window T_PTROBJ -Irssi::Windowitem T_PTROBJ -- cgit v1.2.3