2001-10-20 15:52:07 -04:00
|
|
|
#include "module.h"
|
|
|
|
|
2001-11-12 04:13:12 -05:00
|
|
|
static GSList *register_hash2list(HV *hv)
|
|
|
|
{
|
|
|
|
HE *he;
|
|
|
|
GSList *list;
|
|
|
|
|
|
|
|
if (hv == NULL)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
list = NULL;
|
|
|
|
hv_iterinit(hv);
|
|
|
|
while ((he = hv_iternext(hv)) != NULL) {
|
|
|
|
I32 len;
|
|
|
|
char *key = hv_iterkey(he, &len);
|
|
|
|
int value = (int)SvIV(HeVAL(he));
|
|
|
|
|
|
|
|
list = g_slist_append(list, g_strdup(key));
|
|
|
|
list = g_slist_append(list, GINT_TO_POINTER(value));
|
|
|
|
}
|
|
|
|
return list;
|
|
|
|
}
|
|
|
|
|
|
|
|
static GSList *event_hash2list(HV *hv)
|
|
|
|
{
|
|
|
|
HE *he;
|
|
|
|
GSList *list;
|
|
|
|
|
|
|
|
if (hv == NULL)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
list = NULL;
|
|
|
|
hv_iterinit(hv);
|
|
|
|
while ((he = hv_iternext(hv)) != NULL) {
|
|
|
|
I32 len;
|
|
|
|
char *key = hv_iterkey(he, &len);
|
2001-12-11 11:44:53 -05:00
|
|
|
char *value = SvPV(HeVAL(he), PL_na);
|
2001-11-12 04:13:12 -05:00
|
|
|
|
|
|
|
list = g_slist_append(list, g_strdup(key));
|
|
|
|
list = g_slist_append(list, g_strdup(value));
|
|
|
|
}
|
|
|
|
return list;
|
|
|
|
}
|
|
|
|
|
2001-10-20 15:52:07 -04:00
|
|
|
MODULE = Irssi::Irc::Server PACKAGE = Irssi::Irc::Server PREFIX = irc_server_
|
|
|
|
PROTOTYPES: ENABLE
|
2000-10-01 16:48:48 -04:00
|
|
|
|
2002-05-13 13:57:19 -04:00
|
|
|
void
|
2000-10-01 16:48:48 -04:00
|
|
|
irc_server_get_channels(server)
|
|
|
|
Irssi::Irc::Server server
|
2002-05-13 13:57:19 -04:00
|
|
|
PREINIT:
|
|
|
|
char *ret;
|
|
|
|
PPCODE:
|
|
|
|
ret = irc_server_get_channels(server);
|
2002-05-13 14:25:21 -04:00
|
|
|
XPUSHs(sv_2mortal(new_pv(ret)));
|
2002-05-13 13:57:19 -04:00
|
|
|
g_free(ret);
|
2000-10-01 16:48:48 -04:00
|
|
|
|
2000-10-18 16:50:12 -04:00
|
|
|
void
|
|
|
|
send_raw(server, cmd)
|
|
|
|
Irssi::Irc::Server server
|
|
|
|
char *cmd
|
|
|
|
CODE:
|
|
|
|
irc_send_cmd(server, cmd);
|
|
|
|
|
|
|
|
void
|
|
|
|
send_raw_now(server, cmd)
|
|
|
|
Irssi::Irc::Server server
|
|
|
|
char *cmd
|
|
|
|
CODE:
|
|
|
|
irc_send_cmd_now(server, cmd);
|
|
|
|
|
|
|
|
void
|
|
|
|
send_raw_split(server, cmd, nickarg, max_nicks)
|
|
|
|
Irssi::Irc::Server server
|
|
|
|
char *cmd
|
|
|
|
int nickarg
|
|
|
|
int max_nicks
|
|
|
|
CODE:
|
|
|
|
irc_send_cmd_split(server, cmd, nickarg, max_nicks);
|
|
|
|
|
2001-11-11 13:59:19 -05:00
|
|
|
MODULE = Irssi::Irc::Server PACKAGE = Irssi::Irc::Server PREFIX = server_
|
|
|
|
|
|
|
|
void
|
2001-11-16 19:07:24 -05:00
|
|
|
server_redirect_register(command, remote, timeout, start, stop, opt)
|
2001-11-11 13:59:19 -05:00
|
|
|
char *command
|
|
|
|
int remote
|
|
|
|
int timeout
|
2001-11-14 19:04:16 -05:00
|
|
|
SV *start
|
|
|
|
SV *stop
|
2001-11-16 19:07:24 -05:00
|
|
|
SV *opt
|
2001-11-11 13:59:19 -05:00
|
|
|
CODE:
|
2001-11-12 04:13:12 -05:00
|
|
|
server_redirect_register_list(command, remote, timeout,
|
2001-11-14 19:04:16 -05:00
|
|
|
register_hash2list(hvref(start)),
|
2001-11-16 19:07:24 -05:00
|
|
|
register_hash2list(hvref(stop)),
|
|
|
|
register_hash2list(hvref(opt)));
|
2001-11-11 13:59:19 -05:00
|
|
|
|
|
|
|
void
|
2001-11-12 17:15:04 -05:00
|
|
|
server_redirect_event(server, command, count, arg, remote, failure_signal, signals)
|
2001-11-11 13:59:19 -05:00
|
|
|
Irssi::Irc::Server server
|
|
|
|
char *command
|
2001-11-12 17:15:04 -05:00
|
|
|
int count
|
2001-11-11 13:59:19 -05:00
|
|
|
char *arg
|
|
|
|
int remote
|
|
|
|
char *failure_signal
|
2001-11-14 19:04:16 -05:00
|
|
|
SV *signals
|
2001-11-11 13:59:19 -05:00
|
|
|
CODE:
|
2001-11-12 17:15:04 -05:00
|
|
|
server_redirect_event_list(server, command, count, *arg == '\0' ? NULL : arg, remote,
|
2001-11-12 09:49:21 -05:00
|
|
|
*failure_signal == '\0' ? NULL : failure_signal,
|
2001-11-14 19:04:16 -05:00
|
|
|
event_hash2list(hvref(signals)));
|
2001-11-12 04:13:12 -05:00
|
|
|
|
|
|
|
char *
|
|
|
|
server_redirect_get_signal(server, event, args)
|
|
|
|
Irssi::Irc::Server server
|
|
|
|
char *event
|
|
|
|
char *args
|
|
|
|
CODE:
|
|
|
|
RETVAL = (char *) server_redirect_get_signal(server, event, args);
|
|
|
|
OUTPUT:
|
|
|
|
RETVAL
|
|
|
|
|
|
|
|
char *
|
|
|
|
server_redirect_peek_signal(server, event, args)
|
|
|
|
Irssi::Irc::Server server
|
|
|
|
char *event
|
|
|
|
char *args
|
2001-12-07 21:03:25 -05:00
|
|
|
PREINIT:
|
|
|
|
int redirection;
|
2001-11-12 04:13:12 -05:00
|
|
|
CODE:
|
2001-12-07 21:03:25 -05:00
|
|
|
RETVAL = (char *) server_redirect_peek_signal(server, event, args, &redirection);
|
2001-11-12 04:13:12 -05:00
|
|
|
OUTPUT:
|
|
|
|
RETVAL
|
2001-11-11 13:59:19 -05:00
|
|
|
|
2001-10-20 15:52:07 -04:00
|
|
|
MODULE = Irssi::Irc::Server PACKAGE = Irssi::Irc::Connect PREFIX = irc_server_
|
2000-10-01 16:48:48 -04:00
|
|
|
|
|
|
|
Irssi::Irc::Server
|
|
|
|
irc_server_connect(conn)
|
|
|
|
Irssi::Irc::Connect conn
|