summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2001-05-30 08:58:48 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2001-05-30 08:58:48 +0000
commit5f6d953602fa8c01b76f3ba09470f05afc367658 (patch)
tree9923e0a19a38d5c142ab11de708ce4705dec6b63
parent5fe2ba9f6186b54271c6ef2f3cd870df7741a1ce (diff)
downloadirssi-5f6d953602fa8c01b76f3ba09470f05afc367658.zip
Irssi::command_runsub() - patch by fuchs
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1519 dbcabf3a-b0e7-0310-adc4-f8d773084564
-rw-r--r--docs/perl.txt8
-rw-r--r--src/perl/common/Core.xs9
-rw-r--r--src/perl/perl-signals.c6
3 files changed, 23 insertions, 0 deletions
diff --git a/docs/perl.txt b/docs/perl.txt
index e04330a0..a774ef52 100644
--- a/docs/perl.txt
+++ b/docs/perl.txt
@@ -307,6 +307,14 @@ command_bind(cmd, func[, category])
Bind command `cmd' to call function `func'. `category' is the
category where the command is displayed in /HELP.
+command_runsub(cms, data, server, item)
+ Run subcommands for `cmd'. First word in `data' is parsed as
+ subcommand. `server' is Irssi::Server rec for current
+ Irssi::Windowitem `item'.
+
+ Call command_runsub in handler function for `cmd' and bind
+ with command_bind("`cmd' `subcmd'", subcmdfunc[, category]);
+
command_unbind(cmd, func)
Unbind command `cmd' from function 'func.
diff --git a/src/perl/common/Core.xs b/src/perl/common/Core.xs
index c369b193..a225d09a 100644
--- a/src/perl/common/Core.xs
+++ b/src/perl/common/Core.xs
@@ -326,6 +326,15 @@ CODE:
perl_command_bind(cmd, category, func);
void
+command_runsub(cmd, data, server, item)
+ char *cmd
+ char *data
+ Irssi::Server server
+ Irssi::Windowitem item
+CODE:
+ perl_command_runsub(cmd, data, server, item);
+
+void
command_unbind(cmd, func)
char *cmd
char *func
diff --git a/src/perl/perl-signals.c b/src/perl/perl-signals.c
index 7f0db750..10f2534f 100644
--- a/src/perl/perl-signals.c
+++ b/src/perl/perl-signals.c
@@ -273,6 +273,12 @@ void perl_command_bind(const char *cmd, const char *category, const char *func)
g_free(signal);
}
+void perl_command_runsub(const char *cmd, const char *data,
+ SERVER_REC *server, WI_ITEM_REC *item)
+{
+ command_runsub(cmd, data, server, item);
+}
+
void perl_command_unbind(const char *cmd, const char *func)
{
char *signal;