diff --git a/src/perl/xs/.cvsignore b/src/perl/core/.cvsignore similarity index 100% rename from src/perl/xs/.cvsignore rename to src/perl/core/.cvsignore diff --git a/src/perl/xs/Irssi-channel.xs b/src/perl/core/Channel.xs similarity index 65% rename from src/perl/xs/Irssi-channel.xs rename to src/perl/core/Channel.xs index 8f14ebc9..8a2cd824 100644 --- a/src/perl/xs/Irssi-channel.xs +++ b/src/perl/core/Channel.xs @@ -4,20 +4,13 @@ void channels() PREINIT: GSList *tmp; - HV *stash; PPCODE: - stash = gv_stashpv("Irssi::Channel", 0); for (tmp = channels; tmp != NULL; tmp = tmp->next) { - XPUSHs(sv_2mortal(sv_bless(newRV_noinc(newSViv(GPOINTER_TO_INT(tmp->data))), stash))); - } + CHANNEL_REC *rec = tmp->data; -int -is_channel(text) - char *text -CODE: - RETVAL = ischannel(*text); -OUTPUT: - RETVAL + XPUSHs(sv_2mortal(sv_bless(newRV_noinc(newSViv(GPOINTER_TO_INT(rec))), + irssi_get_stash(rec)))); + } #******************************* MODULE = Irssi PACKAGE = Irssi::Server @@ -28,29 +21,25 @@ channels(server) Irssi::Server server PREINIT: GSList *tmp; - HV *stash; PPCODE: - stash = gv_stashpv("Irssi::Channel", 0); for (tmp = server->channels; tmp != NULL; tmp = tmp->next) { - XPUSHs(sv_2mortal(sv_bless(newRV_noinc(newSViv(GPOINTER_TO_INT(tmp->data))), stash))); + 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(server, channel, automatic) +channel_create(chat_type, server, name, automatic) + int chat_type Irssi::Server server - char *channel + char *name int automatic Irssi::Channel -channel_find(server, channel) +channel_find(server, name) Irssi::Server server - char *channel - -void -channels_join(server, data, automatic) - Irssi::Server server - char *data - int automatic + char *name #******************************* MODULE = Irssi PACKAGE = Irssi::Channel PREFIX = channel_ @@ -60,35 +49,10 @@ void values(channel) Irssi::Channel channel PREINIT: - HV *hv, *stash; - char *type; + HV *hv; PPCODE: - type = "channel"; - hv = newHV(); - hv_store(hv, "type", 4, new_pv(type), 0); - - stash = gv_stashpv("Irssi::Server", 0); - hv_store(hv, "server", 6, sv_bless(newRV_noinc(newSViv(GPOINTER_TO_INT(channel->server))), stash), 0); - hv_store(hv, "name", 4, new_pv(channel->name), 0); - - hv_store(hv, "new_data", 8, newSViv(channel->new_data), 0); - hv_store(hv, "createtime", 10, newSViv(channel->createtime), 0); - - hv_store(hv, "topic", 5, new_pv(channel->topic), 0); - hv_store(hv, "mode", 4, new_pv(channel->mode), 0); - hv_store(hv, "limit", 5, newSViv(channel->limit), 0); - hv_store(hv, "key", 3, new_pv(channel->key), 0); - - hv_store(hv, "chanop", 6, newSViv(channel->chanop), 0); - - hv_store(hv, "names_got", 9, newSViv(channel->names_got), 0); - hv_store(hv, "wholist", 7, newSViv(channel->wholist), 0); - hv_store(hv, "synced", 6, newSViv(channel->synced), 0); - - hv_store(hv, "left", 4, newSViv(channel->left), 0); - hv_store(hv, "kicked", 6, newSViv(channel->kicked), 0); - + perl_channel_fill_hash(hv, channel); XPUSHs(sv_2mortal(newRV_noinc((SV*)hv))); void @@ -149,15 +113,16 @@ nicklist_get_same(server, nick) char *nick PREINIT: GSList *list, *tmp; - HV *chanstash, *nickstash; + HV *nickstash; PPCODE: list = nicklist_get_same(server, nick); - chanstash = gv_stashpv("Irssi::Channel", 0); nickstash = gv_stashpv("Irssi::Nick", 0); - for (tmp = list; tmp != NULL; tmp = tmp->next->next) { - XPUSHs(sv_2mortal(sv_bless(newRV_noinc(newSViv(GPOINTER_TO_INT(tmp->data))), chanstash))); + 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); @@ -174,17 +139,18 @@ PREINIT: PPCODE: hv = newHV(); hv_store(hv, "last_check", 10, newSViv(nick->last_check), 0); - hv_store(hv, "send_massjoin", 13, newSViv(nick->send_massjoin), 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, "op", 2, newSViv(nick->op), 0); - hv_store(hv, "voice", 5, newSViv(nick->voice), 0); hv_store(hv, "gone", 4, newSViv(nick->gone), 0); - hv_store(hv, "ircop", 5, newSViv(nick->ircop), 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/xs/Irssi-core.xs b/src/perl/core/Core.xs similarity index 100% rename from src/perl/xs/Irssi-core.xs rename to src/perl/core/Core.xs diff --git a/src/perl/core/Irssi.pm b/src/perl/core/Irssi.pm new file mode 100644 index 00000000..62d5e442 --- /dev/null +++ b/src/perl/core/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/core/Irssi.xs b/src/perl/core/Irssi.xs new file mode 100644 index 00000000..c996b6e2 --- /dev/null +++ b/src/perl/core/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/xs/Irssi-log.xs b/src/perl/core/Log.xs similarity index 100% rename from src/perl/xs/Irssi-log.xs rename to src/perl/core/Log.xs diff --git a/src/perl/xs/Makefile.PL.in b/src/perl/core/Makefile.PL.in similarity index 100% rename from src/perl/xs/Makefile.PL.in rename to src/perl/core/Makefile.PL.in diff --git a/src/perl/core/Masks.xs b/src/perl/core/Masks.xs new file mode 100644 index 00000000..d27e32f3 --- /dev/null +++ b/src/perl/core/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/xs/Irssi-query.xs b/src/perl/core/Query.xs similarity index 60% rename from src/perl/xs/Irssi-query.xs rename to src/perl/core/Query.xs index 3f68a273..78004e06 100644 --- a/src/perl/xs/Irssi-query.xs +++ b/src/perl/core/Query.xs @@ -4,11 +4,12 @@ void queries() PREINIT: GSList *tmp; - HV *stash; PPCODE: - stash = gv_stashpv("Irssi::Query", 0); for (tmp = queries; tmp != NULL; tmp = tmp->next) { - XPUSHs(sv_2mortal(sv_bless(newRV_noinc(newSViv(GPOINTER_TO_INT(tmp->data))), stash))); + QUERY_REC *rec = tmp->data; + + XPUSHs(sv_2mortal(sv_bless(newRV_noinc(newSViv(GPOINTER_TO_INT(rec))), + irssi_get_stash(rec)))); } #******************************* @@ -20,15 +21,17 @@ queries(server) Irssi::Server server PREINIT: GSList *tmp; - HV *stash; PPCODE: - stash = gv_stashpv("Irssi::Query", 0); for (tmp = server->queries; tmp != NULL; tmp = tmp->next) { - XPUSHs(sv_2mortal(sv_bless(newRV_noinc(newSViv(GPOINTER_TO_INT(tmp->data))), stash))); + QUERY_REC *rec = tmp->data; + + XPUSHs(sv_2mortal(sv_bless(newRV_noinc(newSViv(GPOINTER_TO_INT(rec))), + irssi_get_stash(rec)))); } Irssi::Query -irc_query_create(server, nick, automatic) +query_create(chat_type, server, nick, automatic) + int chat_type Irssi::Server server char *nick int automatic @@ -46,22 +49,10 @@ void values(query) Irssi::Query query PREINIT: - HV *hv, *stash; - char *type; + HV *hv; PPCODE: - type = "query"; - hv = newHV(); - hv_store(hv, "type", 4, new_pv(type), 0); - - stash = gv_stashpv("Irssi::Server", 0); - hv_store(hv, "server", 6, sv_bless(newRV_noinc(newSViv(GPOINTER_TO_INT(query->server))), stash), 0); - hv_store(hv, "name", 4, new_pv(query->name), 0); - hv_store(hv, "new_data", 8, newSViv(query->new_data), 0); - - hv_store(hv, "address", 7, new_pv(query->address), 0); - hv_store(hv, "server_tag", 10, new_pv(query->server_tag), 0); - + perl_query_fill_hash(hv, query); XPUSHs(sv_2mortal(newRV_noinc((SV*)hv))); void diff --git a/src/perl/xs/Irssi-rawlog.xs b/src/perl/core/Rawlog.xs similarity index 100% rename from src/perl/xs/Irssi-rawlog.xs rename to src/perl/core/Rawlog.xs diff --git a/src/perl/xs/Irssi-server.xs b/src/perl/core/Server.xs similarity index 58% rename from src/perl/xs/Irssi-server.xs rename to src/perl/core/Server.xs index e88b8895..c3078485 100644 --- a/src/perl/xs/Irssi-server.xs +++ b/src/perl/core/Server.xs @@ -4,18 +4,19 @@ void servers() PREINIT: GSList *tmp; - HV *stash; PPCODE: - stash = gv_stashpv("Irssi::Server", 0); for (tmp = servers; tmp != NULL; tmp = tmp->next) { - XPUSHs(sv_2mortal(sv_bless(newRV_noinc(newSViv(GPOINTER_TO_INT(tmp->data))), stash))); + 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; + HV *stash; PPCODE: stash = gv_stashpv("Irssi::Reconnect", 0); for (tmp = reconnects; tmp != NULL; tmp = tmp->next) { @@ -23,7 +24,7 @@ PPCODE: } Irssi::Connect -irc_server_create_conn(dest, port=6667, password=NULL, nick=NULL) +server_create_conn(dest, port=6667, password=NULL, nick=NULL) char *dest int port char *password @@ -32,18 +33,10 @@ irc_server_create_conn(dest, port=6667, password=NULL, nick=NULL) Irssi::Server server_find_tag(tag) char *tag -CODE: - RETVAL = (IRC_SERVER_REC *) server_find_tag(tag); -OUTPUT: - RETVAL Irssi::Server -server_find_ircnet(ircnet) - char *ircnet -CODE: - RETVAL = (IRC_SERVER_REC *) server_find_ircnet(ircnet); -OUTPUT: - RETVAL +server_find_chatnet(chatnet) + char *chatnet #******************************* MODULE = Irssi PACKAGE = Irssi::Server PREFIX = server_ @@ -54,60 +47,18 @@ values(server) Irssi::Server server PREINIT: HV *hv; - char *type; PPCODE: - type = "IRC"; - hv = newHV(); - hv_store(hv, "type", 4, new_pv(type), 0); - server_fill_hash(hv, server); - - hv_store(hv, "real_address", 12, new_pv(server->real_address), 0); - hv_store(hv, "version", 7, new_pv(server->version), 0); - hv_store(hv, "usermode", 8, new_pv(server->usermode), 0); - hv_store(hv, "userhost", 8, new_pv(server->userhost), 0); - hv_store(hv, "last_invite", 11, new_pv(server->last_invite), 0); - hv_store(hv, "away_reason", 11, new_pv(server->away_reason), 0); - hv_store(hv, "usermode_away", 13, newSViv(server->usermode_away), 0); - hv_store(hv, "server_operator", 15, newSViv(server->server_operator), 0); + perl_server_fill_hash(hv, server); XPUSHs(sv_2mortal(newRV_noinc((SV*)hv))); -int -server_connect(server) - Irssi::Server server -CODE: - RETVAL = server_connect((SERVER_REC *) server); -OUTPUT: - RETVAL +Irssi::Server +server_connect(conn) + Irssi::Connect conn void server_disconnect(server) Irssi::Server server -CODE: - server_disconnect((SERVER_REC *) server); - -char * -irc_server_get_channels(server) - Irssi::Server server - -void -send_raw(server, cmd) - Irssi::Server server - char *cmd -CODE: - irc_send_cmd(server, cmd); - -void -irc_send_cmd_split(server, cmd, arg, max_nicks) - Irssi::Server server - char *cmd - int arg - int max_nicks - -void -ctcp_send_reply(server, data) - Irssi::Server server - char *data void server_redirect_init(server, command, last, ...) @@ -151,7 +102,7 @@ CODE: } #******************************* -MODULE = Irssi PACKAGE = Irssi::Connect PREFIX = irc_server_ +MODULE = Irssi PACKAGE = Irssi::Connect PREFIX = server_ #******************************* void @@ -161,11 +112,11 @@ PREINIT: HV *hv; PPCODE: hv = newHV(); - connect_fill_hash(hv, conn); + perl_connect_fill_hash(hv, conn); XPUSHs(sv_2mortal(newRV_noinc((SV*)hv))); Irssi::Server -irc_server_connect(conn) +server_connect(conn) Irssi::Connect conn #******************************* @@ -179,7 +130,7 @@ PREINIT: HV *hv; PPCODE: hv = newHV(); - add_connect_hash(hv, reconnect->conn); + 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/xs/Irssi-settings.xs b/src/perl/core/Settings.xs similarity index 100% rename from src/perl/xs/Irssi-settings.xs rename to src/perl/core/Settings.xs diff --git a/src/perl/xs/Irssi-window.xs b/src/perl/core/Window.xs similarity index 72% rename from src/perl/xs/Irssi-window.xs rename to src/perl/core/Window.xs index 65382bbb..7a516020 100644 --- a/src/perl/xs/Irssi-window.xs +++ b/src/perl/core/Window.xs @@ -1,7 +1,7 @@ MODULE = Irssi PACKAGE = Irssi void -command(cmd, server=IRC_SERVER(active_win->active_server), item=active_win->active) +command(cmd, server=active_win->active_server, item=active_win->active) char *cmd Irssi::Server server Irssi::Windowitem item @@ -18,7 +18,7 @@ OUTPUT: Irssi::Server active_server() CODE: - RETVAL = IRC_SERVER(active_win->active_server); + RETVAL = active_win->active_server; OUTPUT: RETVAL @@ -68,32 +68,45 @@ void values(window) Irssi::Window window PREINIT: - HV *hv, *stash; - AV *av; + 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); - av = newAV(); - for (tmp = window->items; tmp != NULL; tmp = tmp->next) { - av_push(av, new_pv(tmp->data)); + if (window->active) { + hv_store(hv, "active", 6, sv_bless(newRV_noinc(newSViv(GPOINTER_TO_INT(window->active))), + irssi_get_stash(window->active)), 0); } - hv_store(hv, "items", 8, newRV_noinc((SV*)av), 0); - - stash = gv_stashpv("Irssi::Windowitem", 0); - hv_store(hv, "active", 6, sv_bless(newRV_noinc(newSViv(GPOINTER_TO_INT(window->active))), stash), 0); - stash = gv_stashpv("Irssi::Server", 0); - hv_store(hv, "active_server", 13, sv_bless(newRV_noinc(newSViv(GPOINTER_TO_INT(window->active_server))), stash), 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 @@ -111,13 +124,13 @@ void values(item) Irssi::Windowitem item PREINIT: - HV *hv, *stash; + HV *hv; AV *av; GSList *tmp; PPCODE: hv = newHV(); - stash = gv_stashpv("Irssi::Server", 0); - hv_store(hv, "server", 6, sv_bless(newRV_noinc(newSViv(GPOINTER_TO_INT(item->server))), stash), 0); + 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))); diff --git a/src/perl/xs/typemap b/src/perl/core/typemap similarity index 60% rename from src/perl/xs/typemap rename to src/perl/core/typemap index 5173ebe4..5490ce42 100644 --- a/src/perl/xs/typemap +++ b/src/perl/core/typemap @@ -6,14 +6,7 @@ Irssi::Channel T_PTROBJ Irssi::Query T_PTROBJ Irssi::Command T_PTROBJ Irssi::Nick T_PTROBJ -Irssi::Ban T_PTROBJ -Irssi::Dcc T_PTROBJ -Irssi::Netsplit T_PTROBJ -Irssi::Netsplitserver T_PTROBJ -Irssi::Autoignore T_PTROBJ Irssi::Log T_PTROBJ Irssi::Rawlog T_PTROBJ -Irssi::Notifylist T_PTROBJ -Irssi::Ignore T_PTROBJ Irssi::Window T_PTROBJ Irssi::Windowitem T_PTROBJ diff --git a/src/perl/xs/Irssi-bans.xs b/src/perl/xs/Irssi-bans.xs deleted file mode 100644 index 6d76bb5d..00000000 --- a/src/perl/xs/Irssi-bans.xs +++ /dev/null @@ -1,40 +0,0 @@ -MODULE = Irssi PACKAGE = Irssi - -void -ban_set_type(type) - char *type - -#******************************* -MODULE = Irssi PACKAGE = Irssi::Channel -#******************************* - -char * -ban_get_mask(channel, nick) - Irssi::Channel channel - char *nick - -void -ban_set(channel, bans) - Irssi::Channel channel - char *bans - -void -ban_remove(channel, ban) - Irssi::Channel channel - char *ban - -#******************************* -MODULE = Irssi PACKAGE = Irssi::Ban -#******************************* - -void -values(ban) - Irssi::Ban ban -PREINIT: - HV *hv; -PPCODE: - hv = newHV(); - hv_store(hv, "ban", 3, new_pv(ban->ban), 0); - hv_store(hv, "setby", 5, new_pv(ban->setby), 0); - hv_store(hv, "time", 4, newSViv(ban->time), 0); - XPUSHs(sv_2mortal(newRV_noinc((SV*)hv))); diff --git a/src/perl/xs/Irssi-dcc.xs b/src/perl/xs/Irssi-dcc.xs deleted file mode 100644 index 971cc465..00000000 --- a/src/perl/xs/Irssi-dcc.xs +++ /dev/null @@ -1,81 +0,0 @@ -MODULE = Irssi PACKAGE = Irssi - -void -dccs() -PREINIT: - GSList *tmp; - HV *stash; -PPCODE: - stash = gv_stashpv("Irssi::Dcc", 0); - for (tmp = dcc_conns; tmp != NULL; tmp = tmp->next) { - XPUSHs(sv_2mortal(sv_bless(newRV_noinc(newSViv(GPOINTER_TO_INT(tmp->data))), stash))); - } - -Irssi::Dcc -dcc_find_item(type, nick, arg) - int type - char *nick - char *arg - -Irssi::Dcc -dcc_find_by_port(nick, port) - char *nick - int port - -void -dcc_ctcp_message(target, server, chat, notice, msg) - char *target - Irssi::Server server - Irssi::Dcc chat - int notice - char *msg - -Irssi::Dcc -item_get_dcc(item) - void *item - -#******************************* -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))); - diff --git a/src/perl/xs/Irssi-flood.xs b/src/perl/xs/Irssi-flood.xs deleted file mode 100644 index 3cb04226..00000000 --- a/src/perl/xs/Irssi-flood.xs +++ /dev/null @@ -1,29 +0,0 @@ -MODULE = Irssi PACKAGE = Irssi::Server - -void -autoignore_add(server, nick, level) - Irssi::Server server - char *nick - int level - -int -autoignore_remove(server, mask, level) - Irssi::Server server - char *mask - int level - -#******************************* -MODULE = Irssi PACKAGE = Irssi::Autoignore -#******************************* - -void -values(ai) - Irssi::Autoignore ai -PREINIT: - HV *hv; -PPCODE: - hv = newHV(); - hv_store(hv, "nick", 4, new_pv(ai->nick), 0); - hv_store(hv, "timeleft", 8, newSViv(ai->timeleft), 0); - hv_store(hv, "level", 5, newSViv(ai->level), 0); - XPUSHs(sv_2mortal(newRV_noinc((SV*)hv))); diff --git a/src/perl/xs/Irssi-ignore.xs b/src/perl/xs/Irssi-ignore.xs deleted file mode 100644 index 643198f3..00000000 --- a/src/perl/xs/Irssi-ignore.xs +++ /dev/null @@ -1,74 +0,0 @@ -MODULE = Irssi PACKAGE = Irssi - -void -ignores() -PREINIT: - GSList *tmp; - HV *stash; -PPCODE: - stash = gv_stashpv("Irssi::Ignore", 0); - for (tmp = servers; tmp != NULL; tmp = tmp->next) { - XPUSHs(sv_2mortal(sv_bless(newRV_noinc(newSViv(GPOINTER_TO_INT(tmp->data))), stash))); - } - -int -ignore_check(nick, host, channel, text, level) - char *nick - char *host - char *channel - char *text - int level -CODE: - RETVAL = ignore_check(NULL, nick, host, channel, text, level); -OUTPUT: - RETVAL - -#******************************* -MODULE = Irssi PACKAGE = Irssi::Server -#******************************* - -int -ignore_check(server, nick, host, channel, text, level) - Irssi::Server server - char *nick - char *host - char *channel - char *text - int level - -#******************************* -MODULE = Irssi PACKAGE = Irssi::Ignore PREFIX = ignore_ -#******************************* - -void -values(ignore) - Irssi::Ignore ignore -PREINIT: - HV *hv; - AV *av; - char **tmp; -PPCODE: - hv = newHV(); - hv_store(hv, "mask", 4, new_pv(ignore->mask), 0); - hv_store(hv, "servertag", 9, new_pv(ignore->servertag), 0); - av = newAV(); - for (tmp = ignore->channels; *tmp != NULL; tmp++) { - av_push(av, new_pv(*tmp)); - } - hv_store(hv, "channels", 8, newRV_noinc((SV*)av), 0); - hv_store(hv, "pattern", 7, new_pv(ignore->pattern), 0); - - hv_store(hv, "level", 5, newSViv(ignore->level), 0); - hv_store(hv, "except_level", 12, newSViv(ignore->except_level), 0); - - hv_store(hv, "regexp", 6, newSViv(ignore->regexp), 0); - hv_store(hv, "fullword", 8, newSViv(ignore->fullword), 0); - XPUSHs(sv_2mortal(newRV_noinc((SV*)hv))); - -void -ignore_add_rec(rec) - Irssi::Ignore rec - -void -ignore_update_rec(rec) - Irssi::Ignore rec diff --git a/src/perl/xs/Irssi-masks.xs b/src/perl/xs/Irssi-masks.xs deleted file mode 100644 index 1d8167ce..00000000 --- a/src/perl/xs/Irssi-masks.xs +++ /dev/null @@ -1,26 +0,0 @@ -MODULE = Irssi PACKAGE = Irssi - -int -irc_mask_match(mask, nick, user, host) - char *mask - char *nick - char *user - char *host - -int -irc_mask_match_address(mask, nick, address) - char *mask - char *nick - char *address - -int -irc_masks_match(masks, nick, address) - char *masks - char *nick - char *address - -char * -irc_get_mask(nick, host, flags) - char *nick - char *host - int flags diff --git a/src/perl/xs/Irssi-modes.xs b/src/perl/xs/Irssi-modes.xs deleted file mode 100644 index e1f08d10..00000000 --- a/src/perl/xs/Irssi-modes.xs +++ /dev/null @@ -1,67 +0,0 @@ -MODULE = Irssi PACKAGE = Irssi - -char * -modes_join(old, mode) - char *old - char *mode - -#******************************* -MODULE = Irssi PACKAGE = Irssi::Server -#******************************* - -void -channel_set_singlemode(server, channel, nicks, mode) - Irssi::Server server - char *channel - char *nicks - char *mode - -void -channel_set_mode(server, channel, mode) - Irssi::Server server - char *channel - char *mode - -#******************************* -MODULE = Irssi PACKAGE = Irssi::Channel PREFIX = channel_ -#******************************* - -void -parse_channel_modes(channel, setby, modestr) - Irssi::Channel channel - char *setby - char *modestr - -Irssi::Ban -banlist_add(channel, ban, nick, time) - Irssi::Channel channel - char *ban - char *nick - time_t time - -void -banlist_remove(channel, ban) - Irssi::Channel channel - char *ban - -Irssi::Ban -banlist_exception_add(channel, ban, nick, time) - Irssi::Channel channel - char *ban - char *nick - time_t time - -void -banlist_exception_remove(channel, ban) - Irssi::Channel channel - char *ban - -void -invitelist_add(channel, mask) - Irssi::Channel channel - char *mask - -void -invitelist_remove(channel, mask) - Irssi::Channel channel - char *mask diff --git a/src/perl/xs/Irssi-netsplit.xs b/src/perl/xs/Irssi-netsplit.xs deleted file mode 100644 index 428cb61a..00000000 --- a/src/perl/xs/Irssi-netsplit.xs +++ /dev/null @@ -1,51 +0,0 @@ -MODULE = Irssi PACKAGE = Irssi::Server - -Irssi::Netsplit -netsplit_find(server, nick, address) - Irssi::Server server - char *nick - char *address - -Irssi::Nick -netsplit_find_channel(server, nick, address, channel) - Irssi::Server server - char *nick - char *address - char *channel - - -#******************************* -MODULE = Irssi PACKAGE = Irssi::Netsplit -#******************************* - -void -values(netsplit) - Irssi::Netsplit netsplit -PREINIT: - HV *hv, *stash; -PPCODE: - hv = newHV(); - hv_store(hv, "nick", 4, new_pv(netsplit->nick), 0); - hv_store(hv, "address", 7, new_pv(netsplit->address), 0); - hv_store(hv, "destroy", 7, newSViv(netsplit->destroy), 0); - - stash = gv_stashpv("Irssi::Netsplitserver", 0); - hv_store(hv, "server", 6, sv_bless(newRV_noinc(newSViv(GPOINTER_TO_INT(netsplit->server))), stash), 0); - /*FIXME: add GSList *channels;*/ - XPUSHs(sv_2mortal(newRV_noinc((SV*)hv))); - -#******************************* -MODULE = Irssi PACKAGE = Irssi::Netsplitserver -#******************************* - -void -values(rec) - Irssi::Netsplitserver rec -PREINIT: - HV *hv; -PPCODE: - hv = newHV(); - hv_store(hv, "server", 6, new_pv(rec->server), 0); - hv_store(hv, "destserver", 10, new_pv(rec->destserver), 0); - hv_store(hv, "count", 5, newSViv(rec->count), 0); - XPUSHs(sv_2mortal(newRV_noinc((SV*)hv))); diff --git a/src/perl/xs/Irssi-notifylist.xs b/src/perl/xs/Irssi-notifylist.xs deleted file mode 100644 index 4b3d22c9..00000000 --- a/src/perl/xs/Irssi-notifylist.xs +++ /dev/null @@ -1,71 +0,0 @@ -MODULE = Irssi PACKAGE = Irssi - -void -notifies() -PREINIT: - GSList *tmp; - HV *stash; -PPCODE: - stash = gv_stashpv("Irssi::Notifylist", 0); - for (tmp = notifies; tmp != NULL; tmp = tmp->next) { - XPUSHs(sv_2mortal(sv_bless(newRV_noinc(newSViv(GPOINTER_TO_INT(tmp->data))), stash))); - } - -Irssi::Notifylist -notifylist_add(mask, ircnets, away_check, idle_check_time) - char *mask - char *ircnets - int away_check - int idle_check_time - -void -notifylist_remove(mask) - char *mask - -Irssi::Server -notifylist_ison(nick, serverlist) - char *nick - char *serverlist - -Irssi::Notifylist -notifylist_find(mask, ircnet) - char *mask - char *ircnet - -#******************************* -MODULE = Irssi PACKAGE = Irssi::Server -#******************************* - -int -notifylist_ison_server(server, nick) - Irssi::Server server - char *nick - -#******************************* -MODULE = Irssi PACKAGE = Irssi::Notifylist PREFIX = notifylist_ -#******************************* - -void -values(notify) - Irssi::Notifylist notify -PREINIT: - HV *hv; - AV *av; - char **tmp; -PPCODE: - hv = newHV(); - hv_store(hv, "mask", 4, new_pv(notify->mask), 0); - hv_store(hv, "away_check", 10, newSViv(notify->away_check), 0); - hv_store(hv, "idle_check_time", 15, newSViv(notify->idle_check_time), 0); - - av = newAV(); - for (tmp = notify->ircnets; *tmp != NULL; tmp++) { - av_push(av, new_pv(*tmp)); - } - hv_store(hv, "ircnets", 7, newRV_noinc((SV*)av), 0); - XPUSHs(sv_2mortal(newRV_noinc((SV*)hv))); - -int -notifylist_ircnets_match(rec, ircnet) - Irssi::Notifylist rec - char *ircnet diff --git a/src/perl/xs/Irssi.pm b/src/perl/xs/Irssi.pm deleted file mode 100644 index bd6af5fb..00000000 --- a/src/perl/xs/Irssi.pm +++ /dev/null @@ -1,21 +0,0 @@ -# -# Perl interface to irssi functions. -# - -package Irssi; - -use strict; -use vars qw($VERSION @ISA @EXPORT @EXPORT_OK); - -$VERSION = "0.10"; - -require Exporter; -require DynaLoader; - -@ISA = qw(Exporter DynaLoader); -@EXPORT = qw(channel_find_any); -@EXPORT_OK = qw(); -bootstrap Irssi $VERSION; - -1; - diff --git a/src/perl/xs/Irssi.xs b/src/perl/xs/Irssi.xs deleted file mode 100644 index a3c85c39..00000000 --- a/src/perl/xs/Irssi.xs +++ /dev/null @@ -1,53 +0,0 @@ -#include "module.h" -#include "levels.h" - -void connect_fill_hash(HV *hv, IRC_SERVER_CONNECT_REC *conn) -{ - hv_store(hv, "address", 7, new_pv(conn->address), 0); - hv_store(hv, "port", 4, newSViv(conn->port), 0); - hv_store(hv, "ircnet", 6, new_pv(conn->ircnet), 0); - - hv_store(hv, "password", 8, new_pv(conn->password), 0); - hv_store(hv, "wanted_nick", 11, new_pv(conn->nick), 0); - hv_store(hv, "alternate_nick", 14, new_pv(conn->alternate_nick), 0); - hv_store(hv, "username", 8, new_pv(conn->username), 0); - hv_store(hv, "realname", 8, new_pv(conn->realname), 0); -} - -void server_fill_hash(HV *hv, IRC_SERVER_REC *server) -{ - HV *stash; - - connect_fill_hash(hv, server->connrec); - hv_store(hv, "connect_time", 12, newSViv(server->connect_time), 0); - - hv_store(hv, "tag", 3, new_pv(server->tag), 0); - hv_store(hv, "nick", 4, new_pv(server->nick), 0); - - hv_store(hv, "connected", 9, newSViv(server->connected), 0); - hv_store(hv, "connection_lost", 15, newSViv(server->connection_lost), 0); - - stash = gv_stashpv("Irssi::Rawlog", 0); - hv_store(hv, "rawlog", 6, sv_bless(newRV_noinc(newSViv(GPOINTER_TO_INT(server->rawlog))), stash), 0); -} - -MODULE = Irssi PACKAGE = Irssi - -PROTOTYPES: ENABLE - -INCLUDE: Irssi-bans.xs -INCLUDE: Irssi-channel.xs -INCLUDE: Irssi-core.xs -INCLUDE: Irssi-dcc.xs -INCLUDE: Irssi-flood.xs -INCLUDE: Irssi-ignore.xs -INCLUDE: Irssi-log.xs -INCLUDE: Irssi-masks.xs -INCLUDE: Irssi-modes.xs -INCLUDE: Irssi-netsplit.xs -INCLUDE: Irssi-notifylist.xs -INCLUDE: Irssi-query.xs -INCLUDE: Irssi-rawlog.xs -INCLUDE: Irssi-server.xs -INCLUDE: Irssi-settings.xs -INCLUDE: Irssi-window.xs diff --git a/src/perl/xs/module.h b/src/perl/xs/module.h deleted file mode 100644 index 8f003fdc..00000000 --- a/src/perl/xs/module.h +++ /dev/null @@ -1,56 +0,0 @@ -#include -#include -#include - -#undef _ -#include "common.h" -#include "network.h" -#include "commands.h" -#include "servers.h" -#include "log.h" -#include "rawlog.h" -#include "settings.h" -#include "masks.h" - -#include "irc/core/bans.h" -#include "irc/core/irc.h" -#include "irc/core/irc-servers.h" -#include "irc/core/server-reconnect.h" -#include "irc/core/server-setup.h" -#include "irc/core/irc-channels.h" -#include "irc/core/irc-queries.h" -#include "irc/core/irc-nicklist.h" -#include "irc/core/modes.h" -#include "irc/core/mode-lists.h" -#include "irc/core/netsplit.h" -#include "irc/core/ignore.h" - -#include "irc/dcc/dcc.h" -#include "irc/flood/autoignore.h" -#include "irc/notifylist/notifylist.h" - -#include "fe-common/core/windows.h" - -#define new_pv(a) (newSVpv((a) == NULL ? "" : (a), (a) == NULL ? 0 : strlen(a))) - -typedef COMMAND_REC *Irssi__Command; -typedef LOG_REC *Irssi__Log; -typedef RAWLOG_REC *Irssi__Rawlog; - -typedef IRC_CHANNEL_REC *Irssi__Channel; -typedef QUERY_REC *Irssi__Query; -typedef IRC_SERVER_REC *Irssi__Server; -typedef IRC_SERVER_CONNECT_REC *Irssi__Connect; -typedef RECONNECT_REC *Irssi__Reconnect; -typedef NICK_REC *Irssi__Nick; -typedef BAN_REC *Irssi__Ban; -typedef NETSPLIT_REC *Irssi__Netsplit; -typedef NETSPLIT_SERVER_REC *Irssi__Netsplitserver; -typedef IGNORE_REC *Irssi__Ignore; - -typedef DCC_REC *Irssi__Dcc; -typedef AUTOIGNORE_REC *Irssi__Autoignore; -typedef NOTIFYLIST_REC *Irssi__Notifylist; - -typedef WINDOW_REC *Irssi__Window; -typedef WI_ITEM_REC *Irssi__Windowitem;