1
0
mirror of https://github.com/irssi/irssi.git synced 2024-12-04 14:46:39 -05:00

Perl updates

git-svn-id: http://svn.irssi.org/repos/irssi/trunk@707 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2000-10-01 21:46:48 +00:00 committed by cras
parent 54ee1c6e8c
commit c48a05c3e8
25 changed files with 189 additions and 738 deletions

View File

@ -4,20 +4,13 @@ void
channels() channels()
PREINIT: PREINIT:
GSList *tmp; GSList *tmp;
HV *stash;
PPCODE: PPCODE:
stash = gv_stashpv("Irssi::Channel", 0);
for (tmp = channels; tmp != NULL; tmp = tmp->next) { 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 XPUSHs(sv_2mortal(sv_bless(newRV_noinc(newSViv(GPOINTER_TO_INT(rec))),
is_channel(text) irssi_get_stash(rec))));
char *text }
CODE:
RETVAL = ischannel(*text);
OUTPUT:
RETVAL
#******************************* #*******************************
MODULE = Irssi PACKAGE = Irssi::Server MODULE = Irssi PACKAGE = Irssi::Server
@ -28,29 +21,25 @@ channels(server)
Irssi::Server server Irssi::Server server
PREINIT: PREINIT:
GSList *tmp; GSList *tmp;
HV *stash;
PPCODE: PPCODE:
stash = gv_stashpv("Irssi::Channel", 0);
for (tmp = server->channels; tmp != NULL; tmp = tmp->next) { 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 Irssi::Channel
channel_create(server, channel, automatic) channel_create(chat_type, server, name, automatic)
int chat_type
Irssi::Server server Irssi::Server server
char *channel char *name
int automatic int automatic
Irssi::Channel Irssi::Channel
channel_find(server, channel) channel_find(server, name)
Irssi::Server server Irssi::Server server
char *channel char *name
void
channels_join(server, data, automatic)
Irssi::Server server
char *data
int automatic
#******************************* #*******************************
MODULE = Irssi PACKAGE = Irssi::Channel PREFIX = channel_ MODULE = Irssi PACKAGE = Irssi::Channel PREFIX = channel_
@ -60,35 +49,10 @@ void
values(channel) values(channel)
Irssi::Channel channel Irssi::Channel channel
PREINIT: PREINIT:
HV *hv, *stash; HV *hv;
char *type;
PPCODE: PPCODE:
type = "channel";
hv = newHV(); hv = newHV();
hv_store(hv, "type", 4, new_pv(type), 0); perl_channel_fill_hash(hv, channel);
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);
XPUSHs(sv_2mortal(newRV_noinc((SV*)hv))); XPUSHs(sv_2mortal(newRV_noinc((SV*)hv)));
void void
@ -149,15 +113,16 @@ nicklist_get_same(server, nick)
char *nick char *nick
PREINIT: PREINIT:
GSList *list, *tmp; GSList *list, *tmp;
HV *chanstash, *nickstash; HV *nickstash;
PPCODE: PPCODE:
list = nicklist_get_same(server, nick); list = nicklist_get_same(server, nick);
chanstash = gv_stashpv("Irssi::Channel", 0);
nickstash = gv_stashpv("Irssi::Nick", 0); nickstash = gv_stashpv("Irssi::Nick", 0);
for (tmp = list; tmp != NULL; tmp = tmp->next->next) { 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))); XPUSHs(sv_2mortal(sv_bless(newRV_noinc(newSViv(GPOINTER_TO_INT(tmp->next->data))), nickstash)));
} }
g_slist_free(list); g_slist_free(list);
@ -174,17 +139,18 @@ PREINIT:
PPCODE: PPCODE:
hv = newHV(); hv = newHV();
hv_store(hv, "last_check", 10, newSViv(nick->last_check), 0); 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, "nick", 4, new_pv(nick->nick), 0);
hv_store(hv, "host", 4, new_pv(nick->host), 0); hv_store(hv, "host", 4, new_pv(nick->host), 0);
hv_store(hv, "realname", 8, new_pv(nick->realname), 0); hv_store(hv, "realname", 8, new_pv(nick->realname), 0);
hv_store(hv, "hops", 4, newSViv(nick->hops), 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, "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))); XPUSHs(sv_2mortal(newRV_noinc((SV*)hv)));

32
src/perl/core/Irssi.pm Normal file
View File

@ -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;

16
src/perl/core/Irssi.xs Normal file
View File

@ -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

58
src/perl/core/Masks.xs Normal file
View File

@ -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

View File

@ -4,11 +4,12 @@ void
queries() queries()
PREINIT: PREINIT:
GSList *tmp; GSList *tmp;
HV *stash;
PPCODE: PPCODE:
stash = gv_stashpv("Irssi::Query", 0);
for (tmp = queries; tmp != NULL; tmp = tmp->next) { 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 Irssi::Server server
PREINIT: PREINIT:
GSList *tmp; GSList *tmp;
HV *stash;
PPCODE: PPCODE:
stash = gv_stashpv("Irssi::Query", 0);
for (tmp = server->queries; tmp != NULL; tmp = tmp->next) { 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 Irssi::Query
irc_query_create(server, nick, automatic) query_create(chat_type, server, nick, automatic)
int chat_type
Irssi::Server server Irssi::Server server
char *nick char *nick
int automatic int automatic
@ -46,22 +49,10 @@ void
values(query) values(query)
Irssi::Query query Irssi::Query query
PREINIT: PREINIT:
HV *hv, *stash; HV *hv;
char *type;
PPCODE: PPCODE:
type = "query";
hv = newHV(); hv = newHV();
hv_store(hv, "type", 4, new_pv(type), 0); perl_query_fill_hash(hv, query);
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);
XPUSHs(sv_2mortal(newRV_noinc((SV*)hv))); XPUSHs(sv_2mortal(newRV_noinc((SV*)hv)));
void void

View File

@ -4,11 +4,12 @@ void
servers() servers()
PREINIT: PREINIT:
GSList *tmp; GSList *tmp;
HV *stash;
PPCODE: PPCODE:
stash = gv_stashpv("Irssi::Server", 0);
for (tmp = servers; tmp != NULL; tmp = tmp->next) { 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 void
@ -23,7 +24,7 @@ PPCODE:
} }
Irssi::Connect 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 char *dest
int port int port
char *password char *password
@ -32,18 +33,10 @@ irc_server_create_conn(dest, port=6667, password=NULL, nick=NULL)
Irssi::Server Irssi::Server
server_find_tag(tag) server_find_tag(tag)
char *tag char *tag
CODE:
RETVAL = (IRC_SERVER_REC *) server_find_tag(tag);
OUTPUT:
RETVAL
Irssi::Server Irssi::Server
server_find_ircnet(ircnet) server_find_chatnet(chatnet)
char *ircnet char *chatnet
CODE:
RETVAL = (IRC_SERVER_REC *) server_find_ircnet(ircnet);
OUTPUT:
RETVAL
#******************************* #*******************************
MODULE = Irssi PACKAGE = Irssi::Server PREFIX = server_ MODULE = Irssi PACKAGE = Irssi::Server PREFIX = server_
@ -54,60 +47,18 @@ values(server)
Irssi::Server server Irssi::Server server
PREINIT: PREINIT:
HV *hv; HV *hv;
char *type;
PPCODE: PPCODE:
type = "IRC";
hv = newHV(); hv = newHV();
hv_store(hv, "type", 4, new_pv(type), 0); perl_server_fill_hash(hv, server);
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);
XPUSHs(sv_2mortal(newRV_noinc((SV*)hv))); XPUSHs(sv_2mortal(newRV_noinc((SV*)hv)));
int Irssi::Server
server_connect(server) server_connect(conn)
Irssi::Server server Irssi::Connect conn
CODE:
RETVAL = server_connect((SERVER_REC *) server);
OUTPUT:
RETVAL
void void
server_disconnect(server) server_disconnect(server)
Irssi::Server 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 void
server_redirect_init(server, command, last, ...) 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 void
@ -161,11 +112,11 @@ PREINIT:
HV *hv; HV *hv;
PPCODE: PPCODE:
hv = newHV(); hv = newHV();
connect_fill_hash(hv, conn); perl_connect_fill_hash(hv, conn);
XPUSHs(sv_2mortal(newRV_noinc((SV*)hv))); XPUSHs(sv_2mortal(newRV_noinc((SV*)hv)));
Irssi::Server Irssi::Server
irc_server_connect(conn) server_connect(conn)
Irssi::Connect conn Irssi::Connect conn
#******************************* #*******************************
@ -179,7 +130,7 @@ PREINIT:
HV *hv; HV *hv;
PPCODE: PPCODE:
hv = newHV(); 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, "tag", 3, newSViv(reconnect->tag), 0);
hv_store(hv, "next_connect", 12, newSViv(reconnect->next_connect), 0); hv_store(hv, "next_connect", 12, newSViv(reconnect->next_connect), 0);
XPUSHs(sv_2mortal(newRV_noinc((SV*)hv))); XPUSHs(sv_2mortal(newRV_noinc((SV*)hv)));

View File

@ -1,7 +1,7 @@
MODULE = Irssi PACKAGE = Irssi MODULE = Irssi PACKAGE = Irssi
void 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 char *cmd
Irssi::Server server Irssi::Server server
Irssi::Windowitem item Irssi::Windowitem item
@ -18,7 +18,7 @@ OUTPUT:
Irssi::Server Irssi::Server
active_server() active_server()
CODE: CODE:
RETVAL = IRC_SERVER(active_win->active_server); RETVAL = active_win->active_server;
OUTPUT: OUTPUT:
RETVAL RETVAL
@ -68,32 +68,45 @@ void
values(window) values(window)
Irssi::Window window Irssi::Window window
PREINIT: PREINIT:
HV *hv, *stash; HV *hv;
AV *av;
GSList *tmp; GSList *tmp;
PPCODE: PPCODE:
hv = newHV(); hv = newHV();
hv_store(hv, "refnum", 6, newSViv(window->refnum), 0); hv_store(hv, "refnum", 6, newSViv(window->refnum), 0);
hv_store(hv, "name", 4, new_pv(window->name), 0); hv_store(hv, "name", 4, new_pv(window->name), 0);
av = newAV(); if (window->active) {
for (tmp = window->items; tmp != NULL; tmp = tmp->next) { hv_store(hv, "active", 6, sv_bless(newRV_noinc(newSViv(GPOINTER_TO_INT(window->active))),
av_push(av, new_pv(tmp->data)); 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, "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);
hv_store(hv, "lines", 5, newSViv(window->lines), 0); hv_store(hv, "lines", 5, newSViv(window->lines), 0);
hv_store(hv, "level", 5, newSViv(window->level), 0); hv_store(hv, "level", 5, newSViv(window->level), 0);
hv_store(hv, "new_data", 8, newSViv(window->new_data), 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_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))); 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 void
command(window, cmd, server=window->active_server, item=window->active) command(window, cmd, server=window->active_server, item=window->active)
Irssi::Window window Irssi::Window window
@ -111,13 +124,13 @@ void
values(item) values(item)
Irssi::Windowitem item Irssi::Windowitem item
PREINIT: PREINIT:
HV *hv, *stash; HV *hv;
AV *av; AV *av;
GSList *tmp; GSList *tmp;
PPCODE: PPCODE:
hv = newHV(); hv = newHV();
stash = gv_stashpv("Irssi::Server", 0); hv_store(hv, "server", 6, sv_bless(newRV_noinc(newSViv(GPOINTER_TO_INT(item->server))),
hv_store(hv, "server", 6, sv_bless(newRV_noinc(newSViv(GPOINTER_TO_INT(item->server))), stash), 0); irssi_get_stash(item->server)), 0);
hv_store(hv, "name", 4, new_pv(item->name), 0); hv_store(hv, "name", 4, new_pv(item->name), 0);
hv_store(hv, "new_data", 8, newSViv(item->new_data), 0); hv_store(hv, "new_data", 8, newSViv(item->new_data), 0);
XPUSHs(sv_2mortal(newRV_noinc((SV*)hv))); XPUSHs(sv_2mortal(newRV_noinc((SV*)hv)));

View File

@ -6,14 +6,7 @@ Irssi::Channel T_PTROBJ
Irssi::Query T_PTROBJ Irssi::Query T_PTROBJ
Irssi::Command T_PTROBJ Irssi::Command T_PTROBJ
Irssi::Nick 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::Log T_PTROBJ
Irssi::Rawlog T_PTROBJ Irssi::Rawlog T_PTROBJ
Irssi::Notifylist T_PTROBJ
Irssi::Ignore T_PTROBJ
Irssi::Window T_PTROBJ Irssi::Window T_PTROBJ
Irssi::Windowitem T_PTROBJ Irssi::Windowitem T_PTROBJ

View File

@ -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)));

View File

@ -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)));

View File

@ -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)));

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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)));

View File

@ -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

View File

@ -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;

View File

@ -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

View File

@ -1,56 +0,0 @@
#include <EXTERN.h>
#include <perl.h>
#include <XSUB.h>
#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;