From b2f1273c01f2f13f02683a7d31823540f251f951 Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Sat, 28 Mar 2009 20:58:00 +0100 Subject: Add infolists with list of scripts --- src/plugins/scripts/perl/weechat-perl.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'src/plugins/scripts/perl') diff --git a/src/plugins/scripts/perl/weechat-perl.c b/src/plugins/scripts/perl/weechat-perl.c index 04c0437ad..50fcc8a83 100644 --- a/src/plugins/scripts/perl/weechat-perl.c +++ b/src/plugins/scripts/perl/weechat-perl.c @@ -594,6 +594,30 @@ weechat_perl_completion_cb (void *data, const char *completion_item, return WEECHAT_RC_OK; } +/* + * weechat_perl_infolist_cb: callback for infolist + */ + +struct t_infolist * +weechat_perl_infolist_cb (void *data, const char *infolist_name, + void *pointer, const char *arguments) +{ + /* make C compiler happy */ + (void) data; + (void) arguments; + + if (!infolist_name || !infolist_name[0]) + return NULL; + + if (weechat_strcasecmp (infolist_name, "perl_script") == 0) + { + return script_infolist_list_scripts (weechat_perl_plugin, + perl_scripts, pointer); + } + + return NULL; +} + /* * weechat_perl_debug_dump_cb: dump Perl plugin data in WeeChat log file */ @@ -680,6 +704,7 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[]) script_init (weechat_perl_plugin, &weechat_perl_command_cb, &weechat_perl_completion_cb, + &weechat_perl_infolist_cb, &weechat_perl_debug_dump_cb, &weechat_perl_buffer_closed_cb, &weechat_perl_load_cb); -- cgit v1.2.3