Hi,
had to write subcommand handler for a Perl script for the second time now,
so decided to add command_runsub to Perl API.

fuchs
Index: docs/perl.txt
===================================================================
RCS file: /home/cvs/irssi/docs/perl.txt,v
retrieving revision 1.10
diff -u -r1.10 perl.txt
--- docs/perl.txt       2001/05/11 12:37:40     1.10
+++ docs/perl.txt       2001/05/24 23:52:03
@@ -307,6 +307,14 @@
   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.
 
Index: src/perl/perl-signals.c
===================================================================
RCS file: /home/cvs/irssi/src/perl/perl-signals.c,v
retrieving revision 1.6
diff -u -r1.6 perl-signals.c
--- src/perl/perl-signals.c     2001/03/07 12:09:38     1.6
+++ src/perl/perl-signals.c     2001/05/24 23:52:06
@@ -273,6 +273,12 @@
        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;
Index: src/perl/common/Core.xs
===================================================================
RCS file: /home/cvs/irssi/src/perl/common/Core.xs,v
retrieving revision 1.13
diff -u -r1.13 Core.xs
--- src/perl/common/Core.xs     2001/01/13 02:23:24     1.13
+++ src/perl/common/Core.xs     2001/05/24 23:52:06
@@ -326,6 +326,15 @@
        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

Reply via email to