diff --git a/docs/signals.txt b/docs/signals.txt index df582873..6a9d4e00 100644 --- a/docs/signals.txt +++ b/docs/signals.txt @@ -324,3 +324,8 @@ gui-readline.c: gui-printtext.c: "beep" + +Perl +---- + +"script error", PERL_SCRIPT_REC, char *errormsg diff --git a/src/perl/get-signals.pl b/src/perl/get-signals.pl index df4667ce..c61c81cc 100755 --- a/src/perl/get-signals.pl +++ b/src/perl/get-signals.pl @@ -51,6 +51,9 @@ while () { s/WINDOW_REC[^,]*/Irssi::UI::Window/g; s/WI_ITEM_REC[^,]*/iobject/g; + # perl + s/PERL_SCRIPT_REC[^,]*/Irssi::Script/g; + s/([\w\*:]+)(,|$)/"\1"\2/g; print " { \"$signal\", { $_, NULL } },\n"; } diff --git a/src/perl/perl-common.c b/src/perl/perl-common.c index fb6d3531..cd23afe5 100644 --- a/src/perl/perl-common.c +++ b/src/perl/perl-common.c @@ -40,6 +40,7 @@ #include "queries.h" #include "nicklist.h" +#include "perl-core.h" #include "perl-common.h" typedef struct { @@ -489,6 +490,14 @@ static void perl_reconnect_fill_hash(HV *hv, RECONNECT_REC *reconnect) hv_store(hv, "next_connect", 12, newSViv(reconnect->next_connect), 0); } +static void perl_script_fill_hash(HV *hv, PERL_SCRIPT_REC *script) +{ + hv_store(hv, "name", 4, new_pv(script->name), 0); + hv_store(hv, "package", 7, new_pv(script->package), 0); + hv_store(hv, "path", 4, new_pv(script->path), 0); + hv_store(hv, "data", 4, new_pv(script->data), 0); +} + void perl_command(const char *cmd, SERVER_REC *server, WI_ITEM_REC *item) { const char *cmdchars; @@ -626,6 +635,7 @@ void perl_common_start(void) { "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_reconnect_fill_hash }, + { "Irssi::Script", (PERL_OBJECT_FUNC) perl_script_fill_hash }, { NULL, NULL } };