diff options
author | Timo Sirainen <cras@irssi.org> | 2001-01-06 21:59:28 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2001-01-06 21:59:28 +0000 |
commit | 341cd555872d49a805e8271e5c4b4bdee03bb866 (patch) | |
tree | dfee61d174e6cda35aded9fd0f5547beb052ee13 /src | |
parent | d108026a377aae45a9294b495b81b951b5d84e85 (diff) | |
download | irssi-341cd555872d49a805e8271e5c4b4bdee03bb866.zip |
Perl updates. Lots of updates to perl documentation :)
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1081 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src')
-rw-r--r-- | src/perl/common/Channel.xs | 23 | ||||
-rw-r--r-- | src/perl/common/Core.xs | 3 | ||||
-rw-r--r-- | src/perl/common/Irssi.pm | 10 | ||||
-rw-r--r-- | src/perl/common/Log.xs | 4 | ||||
-rw-r--r-- | src/perl/common/Query.xs | 22 | ||||
-rw-r--r-- | src/perl/common/Rawlog.xs | 20 | ||||
-rw-r--r-- | src/perl/common/Server.xs | 8 | ||||
-rw-r--r-- | src/perl/common/Themes.xs | 28 | ||||
-rw-r--r-- | src/perl/common/Window.xs | 107 | ||||
-rw-r--r-- | src/perl/common/module.h | 2 | ||||
-rw-r--r-- | src/perl/common/typemap | 2 | ||||
-rw-r--r-- | src/perl/perl-common.c | 15 |
12 files changed, 123 insertions, 121 deletions
diff --git a/src/perl/common/Channel.xs b/src/perl/common/Channel.xs index 47e0a37a..b8fdecd0 100644 --- a/src/perl/common/Channel.xs +++ b/src/perl/common/Channel.xs @@ -17,6 +17,14 @@ CODE: OUTPUT: RETVAL +Irssi::Channel +channel_create(chat_type, name, automatic) + int chat_type + char *name + int automatic +CODE: + channel_create(chat_type, NULL, name, automatic); + #******************************* MODULE = Irssi PACKAGE = Irssi::Server #******************************* @@ -31,12 +39,21 @@ PPCODE: XPUSHs(sv_2mortal(irssi_bless((CHANNEL_REC *) tmp->data))); } +void +channels_join(server, channels, automatic) + Irssi::Server server + char *channels + int automatic +CODE: + server->channels_join(server, channels, automatic); + Irssi::Channel -channel_create(chat_type, server, name, automatic) - int chat_type +channel_create(server, name, automatic) Irssi::Server server char *name int automatic +CODE: + channel_create(server->chat_type, server, name, automatic); Irssi::Channel channel_find(server, name) @@ -44,7 +61,7 @@ channel_find(server, name) char *name void -nicklist_get_same(server, nick) +nicks_get_same(server, nick) Irssi::Server server char *nick PREINIT: diff --git a/src/perl/common/Core.xs b/src/perl/common/Core.xs index 52b3a0b7..dab69e94 100644 --- a/src/perl/common/Core.xs +++ b/src/perl/common/Core.xs @@ -318,12 +318,11 @@ PPCODE: } void -command_bind(cmd, category, func) +command_bind(cmd, func, category = "Perl scripts' commands") char *cmd char *category char *func CODE: - if (*category == '\0') category = "Perl scripts' commands"; perl_command_bind(cmd, category, func); void diff --git a/src/perl/common/Irssi.pm b/src/perl/common/Irssi.pm index b141821e..edb6aaff 100644 --- a/src/perl/common/Irssi.pm +++ b/src/perl/common/Irssi.pm @@ -13,7 +13,15 @@ require Exporter; require DynaLoader; @ISA = qw(Exporter DynaLoader); -@EXPORT = qw(INPUT_READ INPUT_WRITE); +@EXPORT = qw(INPUT_READ INPUT_WRITE + MSGLEVEL_CRAP MSGLEVEL_MSGS MSGLEVEL_PUBLIC MSGLEVEL_NOTICES + MSGLEVEL_SNOTES MSGLEVEL_CTCPS MSGLEVEL_ACTIONS MSGLEVEL_JOINS + MSGLEVEL_PARTS MSGLEVEL_QUITS MSGLEVEL_KICKS MSGLEVEL_MODES + MSGLEVEL_TOPICS MSGLEVEL_WALLOPS MSGLEVEL_INVITES MSGLEVEL_NICKS + MSGLEVEL_DCC MSGLEVEL_DCCMSGS MSGLEVEL_CLIENTNOTICE MSGLEVEL_CLIENTCRAP + MSGLEVEL_CLIENTERROR MSGLEVEL_HILIGHT MSGLEVEL_ALL MSGLEVEL_NOHILIGHT + MSGLEVEL_NO_ACT MSGLEVEL_NEVER MSGLEVEL_LASTLOG +); @EXPORT_OK = qw(); bootstrap Irssi $VERSION; diff --git a/src/perl/common/Log.xs b/src/perl/common/Log.xs index 5821ebaa..5a693c49 100644 --- a/src/perl/common/Log.xs +++ b/src/perl/common/Log.xs @@ -34,9 +34,9 @@ log_item_add(log, type, name, server) void log_item_destroy(log, item) Irssi::Log log - Irssi::LogItem item + Irssi::Logitem item -Irssi::LogItem +Irssi::Logitem log_item_find(log, type, item, server) Irssi::Log log int type diff --git a/src/perl/common/Query.xs b/src/perl/common/Query.xs index 3af0b8d0..139bd88b 100644 --- a/src/perl/common/Query.xs +++ b/src/perl/common/Query.xs @@ -11,6 +11,21 @@ PPCODE: XPUSHs(sv_2mortal(irssi_bless(rec))); } +Irssi::Query +query_create(chat_type, server_tag, nick, automatic) + int chat_type + char *server_tag + char *nick + int automatic + +Irssi::Query +query_find(nick) + char *nick +CODE: + RETVAL = query_find(NULL, nick); +OUTPUT: + RETVAL + #******************************* MODULE = Irssi PACKAGE = Irssi::Server #******************************* @@ -28,13 +43,6 @@ PPCODE: } Irssi::Query -query_create(chat_type, server_tag, nick, automatic) - int chat_type - char *server_tag - char *nick - int automatic - -Irssi::Query query_find(server, nick) Irssi::Server server char *nick diff --git a/src/perl/common/Rawlog.xs b/src/perl/common/Rawlog.xs index 34ace267..08827f62 100644 --- a/src/perl/common/Rawlog.xs +++ b/src/perl/common/Rawlog.xs @@ -8,26 +8,6 @@ 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_ #******************************* diff --git a/src/perl/common/Server.xs b/src/perl/common/Server.xs index 6bbd7752..7454aa8f 100644 --- a/src/perl/common/Server.xs +++ b/src/perl/common/Server.xs @@ -88,14 +88,6 @@ CODE: (char *) SvPV(ST(n), n_a), (char *) SvPV(ST(n+1), n_a), (int) SvIV(ST(n+2))); } -void -channels_join(server, data, automatic) - Irssi::Server server - char *data - int automatic -CODE: - server->channels_join(server, data, automatic); - int isnickflag(server, flag) Irssi::Server server diff --git a/src/perl/common/Themes.xs b/src/perl/common/Themes.xs index 46958b63..47654fce 100644 --- a/src/perl/common/Themes.xs +++ b/src/perl/common/Themes.xs @@ -50,9 +50,14 @@ CODE: printformat_perl(&dest, format, arglist); +#******************************* +MODULE = Irssi PACKAGE = Irssi::Server +#******************************* + void -printformat_window(window, level, format, ...) - Irssi::Window window +printformat(server, target, level, format, ...) + Irssi::Server server + char *target int level char *format PREINIT: @@ -60,22 +65,21 @@ PREINIT: char *arglist[MAX_FORMAT_PARAMS]; int n; CODE: - format_create_dest(&dest, NULL, NULL, level, window); + format_create_dest(&dest, server, target, level, NULL); memset(arglist, 0, sizeof(arglist)); - for (n = 3; n < 3+MAX_FORMAT_PARAMS; n++) { - arglist[n-3] = n < items ? SvPV(ST(n), PL_na) : ""; + for (n = 4; n < 4+MAX_FORMAT_PARAMS; n++) { + arglist[n-4] = n < items ? SvPV(ST(n), PL_na) : ""; } printformat_perl(&dest, format, arglist); #******************************* -MODULE = Irssi PACKAGE = Irssi::Server +MODULE = Irssi PACKAGE = Irssi::Window #******************************* void -printformat(server, target, level, format, ...) - Irssi::Server server - char *target +printformat(window, level, format, ...) + Irssi::Window window int level char *format PREINIT: @@ -83,10 +87,10 @@ PREINIT: char *arglist[MAX_FORMAT_PARAMS]; int n; CODE: - format_create_dest(&dest, server, target, level, NULL); + format_create_dest(&dest, NULL, NULL, level, window); memset(arglist, 0, sizeof(arglist)); - for (n = 4; n < 4+MAX_FORMAT_PARAMS; n++) { - arglist[n-4] = n < items ? SvPV(ST(n), PL_na) : ""; + for (n = 3; n < 3+MAX_FORMAT_PARAMS; n++) { + arglist[n-3] = n < items ? SvPV(ST(n), PL_na) : ""; } printformat_perl(&dest, format, arglist); diff --git a/src/perl/common/Window.xs b/src/perl/common/Window.xs index db4bc6db..5f082d74 100644 --- a/src/perl/common/Window.xs +++ b/src/perl/common/Window.xs @@ -34,19 +34,10 @@ CODE: printtext_string(NULL, NULL, level, str); void -print_window(str, level=MSGLEVEL_CLIENTNOTICE) - char *str - int level; -CODE: - printtext_window(active_win, level, str); - -void -command(cmd, server=active_win->active_server, item=active_win->active) +command(cmd) char *cmd - Irssi::Server server - Irssi::Windowitem item CODE: - perl_command(cmd, server, item); + perl_command(cmd, active_win->active_server, active_win->active); Irssi::Window window_find_name(name) @@ -78,6 +69,14 @@ OUTPUT: RETVAL Irssi::Window +window_find_item(name) + char *name +CODE: + RETVAL = window_find_item(NULL, name); +OUTPUT: + RETVAL + +Irssi::Window window_find_closest(name, level) char *name int level @@ -86,20 +85,25 @@ CODE: OUTPUT: RETVAL +Irssi::Windowitem +window_item_find(name) + char *name +CODE: + RETVAL = window_item_find(NULL, name); +OUTPUT: + RETVAL + #******************************* MODULE = Irssi PACKAGE = Irssi::Server #******************************* void -command(server, cmd, item=active_win->active) +command(server, cmd) Irssi::Server server char *cmd - Irssi::Windowitem item CODE: - if (item != NULL && item->server != SERVER(server)) - item = NULL; - perl_command(cmd, server, item); + perl_command(cmd, server, active_win->active); void print(server, channel, str, level) @@ -107,12 +111,8 @@ print(server, channel, str, level) char *channel char *str int level -PREINIT: - char *fixed; CODE: - fixed = perl_fix_formats(str); - printtext(server, channel, level, fixed); - g_free(fixed); + printtext_string(server, channel, level, str); Irssi::Windowitem window_item_find(server, name) @@ -120,6 +120,11 @@ window_item_find(server, name) char *name Irssi::Window +window_find_item(server, name) + Irssi::Server server + char *name + +Irssi::Window window_find_level(server, level) Irssi::Server server int level @@ -148,33 +153,32 @@ PPCODE: } void -command(window, cmd, server=window->active_server, item=window->active) +print(window, str, level=MSGLEVEL_CLIENTNOTICE) Irssi::Window window - char *cmd - Irssi::Server server - Irssi::Windowitem item + char *str + int level; CODE: - perl_command(cmd, server, item); + printtext_window(window, level, str); void -window_item_add(window, item, automatic) +command(window, cmd) Irssi::Window window - Irssi::Windowitem item - int automatic + char *cmd +CODE: + perl_command(cmd, window->active_server, window->active); void -window_item_remove(window, item) +window_item_add(window, item, automatic) Irssi::Window window Irssi::Windowitem item + int automatic void -window_item_destroy(window, item) - Irssi::Window window +window_item_remove(item) Irssi::Windowitem item void -window_item_set_active(window, item) - Irssi::Window window +window_item_destroy(item) Irssi::Windowitem item void @@ -217,11 +221,6 @@ char * window_get_active_name(window) Irssi::Window window -Irssi::Window -window_find_item(server, name) - Irssi::Server server - char *name - Irssi::Windowitem window_item_find(window, server, name) Irssi::Window window @@ -233,10 +232,18 @@ OUTPUT: RETVAL #******************************* -MODULE = Irssi PACKAGE = Irssi::Windowitem +MODULE = Irssi PACKAGE = Irssi::Windowitem PREFIX = window_item_ #******************************* void +print(item, str, level=MSGLEVEL_CLIENTNOTICE) + Irssi::Windowitem item + int level + char *str +CODE: + printtext_string(item->server, item->name, level, str); + +void command(item, cmd) Irssi::Windowitem item char *cmd @@ -248,11 +255,6 @@ window_create(item, automatic) Irssi::Windowitem item int automatic -void -window_item_create(item, automatic) - Irssi::Windowitem item - int automatic - Irssi::Window window(item) Irssi::Windowitem item @@ -270,19 +272,8 @@ int window_item_is_active(item) Irssi::Windowitem item - -#******************************* -MODULE = Irssi PACKAGE = Irssi::Windowitem -#******************************* - void -print(item, str, level=MSGLEVEL_CLIENTNOTICE) +window_item_set_active(item) Irssi::Windowitem item - int level - char *str -PREINIT: - char *fixed; CODE: - fixed = perl_fix_formats(str); - printtext(item->server, item->name, level, fixed); - g_free(fixed); + window_item_set_active(window_item_window(item), item); diff --git a/src/perl/common/module.h b/src/perl/common/module.h index 5942bc2c..e355ac8a 100644 --- a/src/perl/common/module.h +++ b/src/perl/common/module.h @@ -36,7 +36,7 @@ typedef COMMAND_REC *Irssi__Command; typedef LOG_REC *Irssi__Log; -typedef LOG_ITEM_REC *Irssi__LogItem; +typedef LOG_ITEM_REC *Irssi__Logitem; typedef RAWLOG_REC *Irssi__Rawlog; typedef IGNORE_REC *Irssi__Ignore; typedef MODULE_REC *Irssi__Module; diff --git a/src/perl/common/typemap b/src/perl/common/typemap index 76bcd17d..5be3bcd0 100644 --- a/src/perl/common/typemap +++ b/src/perl/common/typemap @@ -9,7 +9,7 @@ Irssi::Command T_PlainObj Irssi::Nick T_IrssiObj Irssi::Ignore T_PlainObj Irssi::Log T_PlainObj -Irssi::LogItem T_PlainObj +Irssi::Logitem T_PlainObj Irssi::Rawlog T_PlainObj Irssi::Module T_PlainObj Irssi::Theme T_PlainObj diff --git a/src/perl/perl-common.c b/src/perl/perl-common.c index 25444a02..500d6145 100644 --- a/src/perl/perl-common.c +++ b/src/perl/perl-common.c @@ -188,7 +188,7 @@ void perl_connect_fill_hash(HV *hv, SERVER_CONNECT_REC *conn) void perl_server_fill_hash(HV *hv, SERVER_REC *server) { - char *type, *chat_type; + char *type; HV *stash; g_return_if_fail(hv != NULL); @@ -197,10 +197,7 @@ void perl_server_fill_hash(HV *hv, SERVER_REC *server) perl_connect_fill_hash(hv, server->connrec); type = "SERVER"; - chat_type = (char *) chat_protocol_find_id(server->chat_type)->name; - hv_store(hv, "type", 4, new_pv(type), 0); - hv_store(hv, "chat_type", 9, new_pv(chat_type), 0); hv_store(hv, "connect_time", 12, newSViv(server->connect_time), 0); hv_store(hv, "real_connect_time", 17, newSViv(server->real_connect_time), 0); @@ -350,7 +347,7 @@ void perl_log_fill_hash(HV *hv, LOG_REC *log) hv_store(hv, "failed", 6, newSViv(log->failed), 0); hv_store(hv, "temp", 4, newSViv(log->temp), 0); - stash = gv_stashpv("Irssi::LogItem", 0); + stash = gv_stashpv("Irssi::Logitem", 0); av = newAV(); for (tmp = log->items; tmp != NULL; tmp = tmp->next) { av_push(av, sv_2mortal(new_bless(tmp->data, stash))); @@ -382,7 +379,13 @@ void perl_rawlog_fill_hash(HV *hv, RAWLOG_REC *rawlog) void perl_reconnect_fill_hash(HV *hv, RECONNECT_REC *reconnect) { + char *type; + perl_connect_fill_hash(hv, reconnect->conn); + + type = "RECONNECT"; + hv_store(hv, "type", 4, new_pv(type), 0); + hv_store(hv, "tag", 3, newSViv(reconnect->tag), 0); hv_store(hv, "next_connect", 12, newSViv(reconnect->next_connect), 0); } @@ -561,7 +564,7 @@ void perl_common_init(void) { "Irssi::Command", (PERL_OBJECT_FUNC) perl_command_fill_hash }, { "Irssi::Ignore", (PERL_OBJECT_FUNC) perl_ignore_fill_hash }, { "Irssi::Log", (PERL_OBJECT_FUNC) perl_log_fill_hash }, - { "Irssi::LogItem", (PERL_OBJECT_FUNC) perl_log_item_fill_hash }, + { "Irssi::Logitem", (PERL_OBJECT_FUNC) perl_log_item_fill_hash }, { "Irssi::Rawlog", (PERL_OBJECT_FUNC) perl_rawlog_fill_hash }, { "Irssi::Reconnect", (PERL_OBJECT_FUNC) perl_rawlog_fill_hash }, { "Irssi::Window", (PERL_OBJECT_FUNC) perl_window_fill_hash }, |