1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-09 22:05:42 +02:00

Add infolists with list of scripts

This commit is contained in:
Sebastien Helleu
2009-03-28 20:58:00 +01:00
parent 30a50c6999
commit b2f1273c01
14 changed files with 315 additions and 15 deletions
+25
View File
@@ -449,6 +449,30 @@ weechat_lua_completion_cb (void *data, const char *completion_item,
return WEECHAT_RC_OK;
}
/*
* weechat_lua_infolist_cb: callback for infolist
*/
struct t_infolist *
weechat_lua_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, "lua_script") == 0)
{
return script_infolist_list_scripts (weechat_lua_plugin,
lua_scripts, pointer);
}
return NULL;
}
/*
* weechat_lua_debug_dump_cb: dump Lua plugin data in WeeChat log file
*/
@@ -504,6 +528,7 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
script_init (weechat_lua_plugin,
&weechat_lua_command_cb,
&weechat_lua_completion_cb,
&weechat_lua_infolist_cb,
&weechat_lua_debug_dump_cb,
&weechat_lua_buffer_closed_cb,
&weechat_lua_load_cb);
+25
View File
@@ -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);
@@ -662,6 +662,30 @@ weechat_python_completion_cb (void *data, const char *completion_item,
return WEECHAT_RC_OK;
}
/*
* weechat_python_infolist_cb: callback for infolist
*/
struct t_infolist *
weechat_python_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, "python_script") == 0)
{
return script_infolist_list_scripts (weechat_python_plugin,
python_scripts, pointer);
}
return NULL;
}
/*
* weechat_python_debug_dump_cb: dump Python plugin data in WeeChat log file
*/
@@ -744,6 +768,7 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
script_init (weechat_python_plugin,
&weechat_python_command_cb,
&weechat_python_completion_cb,
&weechat_python_infolist_cb,
&weechat_python_debug_dump_cb,
&weechat_python_buffer_closed_cb,
&weechat_python_load_cb);
+25
View File
@@ -648,6 +648,30 @@ weechat_ruby_completion_cb (void *data, const char *completion_item,
return WEECHAT_RC_OK;
}
/*
* weechat_ruby_infolist_cb: callback for infolist
*/
struct t_infolist *
weechat_ruby_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, "ruby_script") == 0)
{
return script_infolist_list_scripts (weechat_ruby_plugin,
ruby_scripts, pointer);
}
return NULL;
}
/*
* weechat_ruby_debug_dump_cb: dump Ruby plugin data in WeeChat log file
*/
@@ -785,6 +809,7 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
script_init (weechat_ruby_plugin,
&weechat_ruby_command_cb,
&weechat_ruby_completion_cb,
&weechat_ruby_infolist_cb,
&weechat_ruby_debug_dump_cb,
&weechat_ruby_buffer_closed_cb,
&weechat_ruby_load_cb);
File diff suppressed because it is too large Load Diff
+12
View File
@@ -65,6 +65,10 @@ extern void script_init (struct t_weechat_plugin *weechat_plugin,
const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion),
struct t_infolist *(*callback_infolist)(void *data,
const char *infolist_name,
void *pointer,
const char *arguments),
int (*callback_signal_debug_dump)(void *data,
const char *signal,
const char *type_data,
@@ -74,6 +78,8 @@ extern void script_init (struct t_weechat_plugin *weechat_plugin,
const char *type_data,
void *signal_data),
void (*callback_load_file)(void *data, const char *filename));
extern int script_valid (struct t_plugin_script *scripts,
struct t_plugin_script *script);
extern char *script_ptr2str (void *pointer);
extern void *script_str2ptr (const char *pointer_str);
extern void script_auto_load (struct t_weechat_plugin *weechat_plugin,
@@ -104,6 +110,12 @@ extern void script_display_list (struct t_weechat_plugin *weechat_plugin,
const char *name, int full);
extern void script_display_short_list (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *scripts);
extern int script_add_to_infolist (struct t_weechat_plugin *weechat_plugin,
struct t_infolist *infolist,
struct t_plugin_script *script);
extern struct t_infolist *script_infolist_list_scripts (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *scripts,
void *pointer);
extern void script_print_log (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *scripts);
+30 -5
View File
@@ -389,6 +389,30 @@ weechat_tcl_completion_cb (void *data, const char *completion_item,
return WEECHAT_RC_OK;
}
/*
* weechat_tcl_infolist_cb: callback for infolist
*/
struct t_infolist *
weechat_tcl_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, "tcl_script") == 0)
{
return script_infolist_list_scripts (weechat_tcl_plugin,
tcl_scripts, pointer);
}
return NULL;
}
/*
* weechat_tcl_debug_dump_cb: dump Tcl plugin data in WeeChat log file
*/
@@ -442,11 +466,12 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
tcl_quiet = 1;
script_init (weechat_tcl_plugin,
weechat_tcl_command_cb,
weechat_tcl_completion_cb,
weechat_tcl_debug_dump_cb,
weechat_tcl_buffer_closed_cb,
weechat_tcl_load_cb);
&weechat_tcl_command_cb,
&weechat_tcl_completion_cb,
&weechat_tcl_infolist_cb,
&weechat_tcl_debug_dump_cb,
&weechat_tcl_buffer_closed_cb,
&weechat_tcl_load_cb);
tcl_quiet = 0;
script_display_short_list (weechat_tcl_plugin,