diff --git a/ChangeLog b/ChangeLog index 581cc00ae..a025dadc2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,7 @@ WeeChat ChangeLog ================= Sébastien Helleu -v0.3.9-dev, 2012-08-02 +v0.3.9-dev, 2012-08-03 Version 0.3.9 (under dev!) @@ -69,6 +69,7 @@ Version 0.3.9 (under dev!) * relay: fix freeze when writing on relay socket (use non-blocking sockets in relay for irc and weechat protocols) (bug #36655) * ruby: detect ruby version 1.9.3 in cmake and autotools +* scripts: add hdata with list of scripts for each language * scripts: fix deletion of configuration files when script is unloaded (bug #36977) * scripts: fix function unhook_all: delete only callbacks of hooks and add diff --git a/doc/de/autogen/plugin_api/hdata.txt b/doc/de/autogen/plugin_api/hdata.txt index f069f0880..59f43e277 100644 --- a/doc/de/autogen/plugin_api/hdata.txt +++ b/doc/de/autogen/plugin_api/hdata.txt @@ -2,6 +2,23 @@ |======================================== | Erweiterung | Name | Beschreibung | Variablen | Listen +| guile | guile_script | Liste der Skripten | + 'filename' (string) + + 'interpreter' (pointer) + + 'name' (string) + + 'author' (string) + + 'version' (string) + + 'license' (string) + + 'description' (string) + + 'shutdown_func' (string) + + 'charset' (string) + + 'callbacks' (pointer) + + 'unloading' (integer) + + 'prev_script' (pointer, hdata: 'guile_script') + + 'next_script' (pointer, hdata: 'guile_script') | + '*last_script' + + '*scripts' + | irc | irc_channel | IRC-Channel | 'type' (integer) + 'name' (string) + @@ -172,6 +189,91 @@ 'irc_servers' + 'last_irc_server' +| lua | lua_script | Liste der Skripten | + 'filename' (string) + + 'interpreter' (pointer) + + 'name' (string) + + 'author' (string) + + 'version' (string) + + 'license' (string) + + 'description' (string) + + 'shutdown_func' (string) + + 'charset' (string) + + 'callbacks' (pointer) + + 'unloading' (integer) + + 'prev_script' (pointer, hdata: 'lua_script') + + 'next_script' (pointer, hdata: 'lua_script') | + '*last_script' + + '*scripts' + +| perl | perl_script | Liste der Skripten | + 'filename' (string) + + 'interpreter' (pointer) + + 'name' (string) + + 'author' (string) + + 'version' (string) + + 'license' (string) + + 'description' (string) + + 'shutdown_func' (string) + + 'charset' (string) + + 'callbacks' (pointer) + + 'unloading' (integer) + + 'prev_script' (pointer, hdata: 'perl_script') + + 'next_script' (pointer, hdata: 'perl_script') | + '*last_script' + + '*scripts' + +| python | python_script | Liste der Skripten | + 'filename' (string) + + 'interpreter' (pointer) + + 'name' (string) + + 'author' (string) + + 'version' (string) + + 'license' (string) + + 'description' (string) + + 'shutdown_func' (string) + + 'charset' (string) + + 'callbacks' (pointer) + + 'unloading' (integer) + + 'prev_script' (pointer, hdata: 'python_script') + + 'next_script' (pointer, hdata: 'python_script') | + '*last_script' + + '*scripts' + +| ruby | ruby_script | Liste der Skripten | + 'filename' (string) + + 'interpreter' (pointer) + + 'name' (string) + + 'author' (string) + + 'version' (string) + + 'license' (string) + + 'description' (string) + + 'shutdown_func' (string) + + 'charset' (string) + + 'callbacks' (pointer) + + 'unloading' (integer) + + 'prev_script' (pointer, hdata: 'ruby_script') + + 'next_script' (pointer, hdata: 'ruby_script') | + '*last_script' + + '*scripts' + +| tcl | tcl_script | Liste der Skripten | + 'filename' (string) + + 'interpreter' (pointer) + + 'name' (string) + + 'author' (string) + + 'version' (string) + + 'license' (string) + + 'description' (string) + + 'shutdown_func' (string) + + 'charset' (string) + + 'callbacks' (pointer) + + 'unloading' (integer) + + 'prev_script' (pointer, hdata: 'tcl_script') + + 'next_script' (pointer, hdata: 'tcl_script') | + '*last_script' + + '*scripts' + | weechat | bar | Bar | 'name' (string) + 'options' (pointer) + diff --git a/doc/en/autogen/plugin_api/hdata.txt b/doc/en/autogen/plugin_api/hdata.txt index 92cd55129..e4402ad20 100644 --- a/doc/en/autogen/plugin_api/hdata.txt +++ b/doc/en/autogen/plugin_api/hdata.txt @@ -2,6 +2,23 @@ |======================================== | Plugin | Name | Description | Variables | Lists +| guile | guile_script | list of scripts | + 'filename' (string) + + 'interpreter' (pointer) + + 'name' (string) + + 'author' (string) + + 'version' (string) + + 'license' (string) + + 'description' (string) + + 'shutdown_func' (string) + + 'charset' (string) + + 'callbacks' (pointer) + + 'unloading' (integer) + + 'prev_script' (pointer, hdata: 'guile_script') + + 'next_script' (pointer, hdata: 'guile_script') | + '*last_script' + + '*scripts' + | irc | irc_channel | irc channel | 'type' (integer) + 'name' (string) + @@ -172,6 +189,91 @@ 'irc_servers' + 'last_irc_server' +| lua | lua_script | list of scripts | + 'filename' (string) + + 'interpreter' (pointer) + + 'name' (string) + + 'author' (string) + + 'version' (string) + + 'license' (string) + + 'description' (string) + + 'shutdown_func' (string) + + 'charset' (string) + + 'callbacks' (pointer) + + 'unloading' (integer) + + 'prev_script' (pointer, hdata: 'lua_script') + + 'next_script' (pointer, hdata: 'lua_script') | + '*last_script' + + '*scripts' + +| perl | perl_script | list of scripts | + 'filename' (string) + + 'interpreter' (pointer) + + 'name' (string) + + 'author' (string) + + 'version' (string) + + 'license' (string) + + 'description' (string) + + 'shutdown_func' (string) + + 'charset' (string) + + 'callbacks' (pointer) + + 'unloading' (integer) + + 'prev_script' (pointer, hdata: 'perl_script') + + 'next_script' (pointer, hdata: 'perl_script') | + '*last_script' + + '*scripts' + +| python | python_script | list of scripts | + 'filename' (string) + + 'interpreter' (pointer) + + 'name' (string) + + 'author' (string) + + 'version' (string) + + 'license' (string) + + 'description' (string) + + 'shutdown_func' (string) + + 'charset' (string) + + 'callbacks' (pointer) + + 'unloading' (integer) + + 'prev_script' (pointer, hdata: 'python_script') + + 'next_script' (pointer, hdata: 'python_script') | + '*last_script' + + '*scripts' + +| ruby | ruby_script | list of scripts | + 'filename' (string) + + 'interpreter' (pointer) + + 'name' (string) + + 'author' (string) + + 'version' (string) + + 'license' (string) + + 'description' (string) + + 'shutdown_func' (string) + + 'charset' (string) + + 'callbacks' (pointer) + + 'unloading' (integer) + + 'prev_script' (pointer, hdata: 'ruby_script') + + 'next_script' (pointer, hdata: 'ruby_script') | + '*last_script' + + '*scripts' + +| tcl | tcl_script | list of scripts | + 'filename' (string) + + 'interpreter' (pointer) + + 'name' (string) + + 'author' (string) + + 'version' (string) + + 'license' (string) + + 'description' (string) + + 'shutdown_func' (string) + + 'charset' (string) + + 'callbacks' (pointer) + + 'unloading' (integer) + + 'prev_script' (pointer, hdata: 'tcl_script') + + 'next_script' (pointer, hdata: 'tcl_script') | + '*last_script' + + '*scripts' + | weechat | bar | bar | 'name' (string) + 'options' (pointer) + diff --git a/doc/fr/autogen/plugin_api/hdata.txt b/doc/fr/autogen/plugin_api/hdata.txt index a7ce609ba..f4b48ab37 100644 --- a/doc/fr/autogen/plugin_api/hdata.txt +++ b/doc/fr/autogen/plugin_api/hdata.txt @@ -2,6 +2,23 @@ |======================================== | Extension | Nom | Description | Variables | Listes +| guile | guile_script | liste des scripts | + 'filename' (string) + + 'interpreter' (pointer) + + 'name' (string) + + 'author' (string) + + 'version' (string) + + 'license' (string) + + 'description' (string) + + 'shutdown_func' (string) + + 'charset' (string) + + 'callbacks' (pointer) + + 'unloading' (integer) + + 'prev_script' (pointer, hdata: 'guile_script') + + 'next_script' (pointer, hdata: 'guile_script') | + '*last_script' + + '*scripts' + | irc | irc_channel | canal irc | 'type' (integer) + 'name' (string) + @@ -172,6 +189,91 @@ 'irc_servers' + 'last_irc_server' +| lua | lua_script | liste des scripts | + 'filename' (string) + + 'interpreter' (pointer) + + 'name' (string) + + 'author' (string) + + 'version' (string) + + 'license' (string) + + 'description' (string) + + 'shutdown_func' (string) + + 'charset' (string) + + 'callbacks' (pointer) + + 'unloading' (integer) + + 'prev_script' (pointer, hdata: 'lua_script') + + 'next_script' (pointer, hdata: 'lua_script') | + '*last_script' + + '*scripts' + +| perl | perl_script | liste des scripts | + 'filename' (string) + + 'interpreter' (pointer) + + 'name' (string) + + 'author' (string) + + 'version' (string) + + 'license' (string) + + 'description' (string) + + 'shutdown_func' (string) + + 'charset' (string) + + 'callbacks' (pointer) + + 'unloading' (integer) + + 'prev_script' (pointer, hdata: 'perl_script') + + 'next_script' (pointer, hdata: 'perl_script') | + '*last_script' + + '*scripts' + +| python | python_script | liste des scripts | + 'filename' (string) + + 'interpreter' (pointer) + + 'name' (string) + + 'author' (string) + + 'version' (string) + + 'license' (string) + + 'description' (string) + + 'shutdown_func' (string) + + 'charset' (string) + + 'callbacks' (pointer) + + 'unloading' (integer) + + 'prev_script' (pointer, hdata: 'python_script') + + 'next_script' (pointer, hdata: 'python_script') | + '*last_script' + + '*scripts' + +| ruby | ruby_script | liste des scripts | + 'filename' (string) + + 'interpreter' (pointer) + + 'name' (string) + + 'author' (string) + + 'version' (string) + + 'license' (string) + + 'description' (string) + + 'shutdown_func' (string) + + 'charset' (string) + + 'callbacks' (pointer) + + 'unloading' (integer) + + 'prev_script' (pointer, hdata: 'ruby_script') + + 'next_script' (pointer, hdata: 'ruby_script') | + '*last_script' + + '*scripts' + +| tcl | tcl_script | liste des scripts | + 'filename' (string) + + 'interpreter' (pointer) + + 'name' (string) + + 'author' (string) + + 'version' (string) + + 'license' (string) + + 'description' (string) + + 'shutdown_func' (string) + + 'charset' (string) + + 'callbacks' (pointer) + + 'unloading' (integer) + + 'prev_script' (pointer, hdata: 'tcl_script') + + 'next_script' (pointer, hdata: 'tcl_script') | + '*last_script' + + '*scripts' + | weechat | bar | barre | 'name' (string) + 'options' (pointer) + diff --git a/doc/it/autogen/plugin_api/hdata.txt b/doc/it/autogen/plugin_api/hdata.txt index ec0325cee..fcb04e0ff 100644 --- a/doc/it/autogen/plugin_api/hdata.txt +++ b/doc/it/autogen/plugin_api/hdata.txt @@ -2,6 +2,23 @@ |======================================== | Plugin | Nome | Descrizione | Variabili | Liste +| guile | guile_script | elenco degli script | + 'filename' (string) + + 'interpreter' (pointer) + + 'name' (string) + + 'author' (string) + + 'version' (string) + + 'license' (string) + + 'description' (string) + + 'shutdown_func' (string) + + 'charset' (string) + + 'callbacks' (pointer) + + 'unloading' (integer) + + 'prev_script' (pointer, hdata: 'guile_script') + + 'next_script' (pointer, hdata: 'guile_script') | + '*last_script' + + '*scripts' + | irc | irc_channel | canale irc | 'type' (integer) + 'name' (string) + @@ -172,6 +189,91 @@ 'irc_servers' + 'last_irc_server' +| lua | lua_script | elenco degli script | + 'filename' (string) + + 'interpreter' (pointer) + + 'name' (string) + + 'author' (string) + + 'version' (string) + + 'license' (string) + + 'description' (string) + + 'shutdown_func' (string) + + 'charset' (string) + + 'callbacks' (pointer) + + 'unloading' (integer) + + 'prev_script' (pointer, hdata: 'lua_script') + + 'next_script' (pointer, hdata: 'lua_script') | + '*last_script' + + '*scripts' + +| perl | perl_script | elenco degli script | + 'filename' (string) + + 'interpreter' (pointer) + + 'name' (string) + + 'author' (string) + + 'version' (string) + + 'license' (string) + + 'description' (string) + + 'shutdown_func' (string) + + 'charset' (string) + + 'callbacks' (pointer) + + 'unloading' (integer) + + 'prev_script' (pointer, hdata: 'perl_script') + + 'next_script' (pointer, hdata: 'perl_script') | + '*last_script' + + '*scripts' + +| python | python_script | elenco degli script | + 'filename' (string) + + 'interpreter' (pointer) + + 'name' (string) + + 'author' (string) + + 'version' (string) + + 'license' (string) + + 'description' (string) + + 'shutdown_func' (string) + + 'charset' (string) + + 'callbacks' (pointer) + + 'unloading' (integer) + + 'prev_script' (pointer, hdata: 'python_script') + + 'next_script' (pointer, hdata: 'python_script') | + '*last_script' + + '*scripts' + +| ruby | ruby_script | elenco degli script | + 'filename' (string) + + 'interpreter' (pointer) + + 'name' (string) + + 'author' (string) + + 'version' (string) + + 'license' (string) + + 'description' (string) + + 'shutdown_func' (string) + + 'charset' (string) + + 'callbacks' (pointer) + + 'unloading' (integer) + + 'prev_script' (pointer, hdata: 'ruby_script') + + 'next_script' (pointer, hdata: 'ruby_script') | + '*last_script' + + '*scripts' + +| tcl | tcl_script | elenco degli script | + 'filename' (string) + + 'interpreter' (pointer) + + 'name' (string) + + 'author' (string) + + 'version' (string) + + 'license' (string) + + 'description' (string) + + 'shutdown_func' (string) + + 'charset' (string) + + 'callbacks' (pointer) + + 'unloading' (integer) + + 'prev_script' (pointer, hdata: 'tcl_script') + + 'next_script' (pointer, hdata: 'tcl_script') | + '*last_script' + + '*scripts' + | weechat | bar | barra | 'name' (string) + 'options' (pointer) + diff --git a/src/plugins/guile/weechat-guile.c b/src/plugins/guile/weechat-guile.c index 704e0c086..071c5252c 100644 --- a/src/plugins/guile/weechat-guile.c +++ b/src/plugins/guile/weechat-guile.c @@ -656,6 +656,21 @@ weechat_guile_completion_cb (void *data, const char *completion_item, return WEECHAT_RC_OK; } +/* + * weechat_guile_hdata_cb: callback for hdata + */ + +struct t_hdata * +weechat_guile_hdata_cb (void *data, const char *hdata_name) +{ + /* make C compiler happy */ + (void) data; + + return plugin_script_hdata_script (weechat_plugin, + &guile_scripts, &last_guile_script, + hdata_name); +} + /* * weechat_guile_infolist_cb: callback for infolist */ @@ -870,6 +885,7 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[]) init.callback_command = &weechat_guile_command_cb; init.callback_completion = &weechat_guile_completion_cb; + init.callback_hdata = &weechat_guile_hdata_cb; init.callback_infolist = &weechat_guile_infolist_cb; init.callback_signal_debug_dump = &weechat_guile_signal_debug_dump_cb; init.callback_signal_buffer_closed = &weechat_guile_signal_buffer_closed_cb; diff --git a/src/plugins/lua/weechat-lua.c b/src/plugins/lua/weechat-lua.c index 654462d27..a1e9110bb 100644 --- a/src/plugins/lua/weechat-lua.c +++ b/src/plugins/lua/weechat-lua.c @@ -615,6 +615,21 @@ weechat_lua_completion_cb (void *data, const char *completion_item, return WEECHAT_RC_OK; } +/* + * weechat_lua_hdata_cb: callback for hdata + */ + +struct t_hdata * +weechat_lua_hdata_cb (void *data, const char *hdata_name) +{ + /* make C compiler happy */ + (void) data; + + return plugin_script_hdata_script (weechat_plugin, + &lua_scripts, &last_lua_script, + hdata_name); +} + /* * weechat_lua_infolist_cb: callback for infolist */ @@ -761,6 +776,7 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[]) init.callback_command = &weechat_lua_command_cb; init.callback_completion = &weechat_lua_completion_cb; + init.callback_hdata = &weechat_lua_hdata_cb; init.callback_infolist = &weechat_lua_infolist_cb; init.callback_signal_debug_dump = &weechat_lua_signal_debug_dump_cb; init.callback_signal_buffer_closed = &weechat_lua_signal_buffer_closed_cb; diff --git a/src/plugins/perl/weechat-perl.c b/src/plugins/perl/weechat-perl.c index 42e3606c5..baf921191 100644 --- a/src/plugins/perl/weechat-perl.c +++ b/src/plugins/perl/weechat-perl.c @@ -778,6 +778,21 @@ weechat_perl_completion_cb (void *data, const char *completion_item, return WEECHAT_RC_OK; } +/* + * weechat_perl_hdata_cb: callback for hdata + */ + +struct t_hdata * +weechat_perl_hdata_cb (void *data, const char *hdata_name) +{ + /* make C compiler happy */ + (void) data; + + return plugin_script_hdata_script (weechat_plugin, + &perl_scripts, &last_perl_script, + hdata_name); +} + /* * weechat_perl_infolist_cb: callback for infolist */ @@ -974,6 +989,7 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[]) init.callback_command = &weechat_perl_command_cb; init.callback_completion = &weechat_perl_completion_cb; + init.callback_hdata = &weechat_perl_hdata_cb; init.callback_infolist = &weechat_perl_infolist_cb; init.callback_signal_debug_dump = &weechat_perl_signal_debug_dump_cb; init.callback_signal_buffer_closed = &weechat_perl_signal_buffer_closed_cb; diff --git a/src/plugins/plugin-script.c b/src/plugins/plugin-script.c index be35c605e..44f5208e4 100644 --- a/src/plugins/plugin-script.c +++ b/src/plugins/plugin-script.c @@ -22,6 +22,7 @@ */ #include +#include #include #include #include @@ -162,7 +163,7 @@ plugin_script_init (struct t_weechat_plugin *weechat_plugin, if (completion) free (completion); - /* add completion and infolist */ + /* add completion, hdata and infolist */ length = strlen (weechat_plugin->name) + 16; string = malloc (length); if (string) @@ -170,6 +171,8 @@ plugin_script_init (struct t_weechat_plugin *weechat_plugin, snprintf (string, length, "%s_script", weechat_plugin->name); weechat_hook_completion (string, N_("list of scripts"), init->callback_completion, NULL); + weechat_hook_hdata (string, N_("list of scripts"), + init->callback_hdata, NULL); weechat_hook_infolist (string, N_("list of scripts"), N_("script pointer (optional)"), N_("script name (can start or end with \"*\" as wildcard) (optional)"), @@ -1147,6 +1150,40 @@ plugin_script_display_short_list (struct t_weechat_plugin *weechat_plugin, } } +/* + * plugin_script_hdata_script: return hdata for script + */ + +struct t_hdata * +plugin_script_hdata_script (struct t_weechat_plugin *weechat_plugin, + struct t_plugin_script **scripts, + struct t_plugin_script **last_script, + const char *hdata_name) +{ + struct t_hdata *hdata; + + hdata = weechat_hdata_new (hdata_name, "prev_script", "next_script"); + if (hdata) + { + WEECHAT_HDATA_VAR(struct t_plugin_script, filename, STRING, NULL, NULL); + WEECHAT_HDATA_VAR(struct t_plugin_script, interpreter, POINTER, NULL, NULL); + WEECHAT_HDATA_VAR(struct t_plugin_script, name, STRING, NULL, NULL); + WEECHAT_HDATA_VAR(struct t_plugin_script, author, STRING, NULL, NULL); + WEECHAT_HDATA_VAR(struct t_plugin_script, version, STRING, NULL, NULL); + WEECHAT_HDATA_VAR(struct t_plugin_script, license, STRING, NULL, NULL); + WEECHAT_HDATA_VAR(struct t_plugin_script, description, STRING, NULL, NULL); + WEECHAT_HDATA_VAR(struct t_plugin_script, shutdown_func, STRING, NULL, NULL); + WEECHAT_HDATA_VAR(struct t_plugin_script, charset, STRING, NULL, NULL); + WEECHAT_HDATA_VAR(struct t_plugin_script, callbacks, POINTER, NULL, NULL); + WEECHAT_HDATA_VAR(struct t_plugin_script, unloading, INTEGER, NULL, NULL); + WEECHAT_HDATA_VAR(struct t_plugin_script, prev_script, POINTER, NULL, hdata_name); + WEECHAT_HDATA_VAR(struct t_plugin_script, next_script, POINTER, NULL, hdata_name); + WEECHAT_HDATA_LIST(*scripts); + WEECHAT_HDATA_LIST(*last_script); + } + return hdata; +} + /* * plugin_script_add_to_infolist: add a script in an infolist * return 1 if ok, 0 if error diff --git a/src/plugins/plugin-script.h b/src/plugins/plugin-script.h index f031af422..923a964ba 100644 --- a/src/plugins/plugin-script.h +++ b/src/plugins/plugin-script.h @@ -74,6 +74,8 @@ struct t_plugin_script_init int (*callback_completion)(void *data, const char *completion_item, struct t_gui_buffer *buffer, struct t_gui_completion *completion); + struct t_hdata *(*callback_hdata)(void *data, + const char *hdata_name); struct t_infolist *(*callback_infolist)(void *data, const char *infolist_name, void *pointer, @@ -146,6 +148,10 @@ extern void plugin_script_display_list (struct t_weechat_plugin *weechat_plugin, const char *name, int full); extern void plugin_script_display_short_list (struct t_weechat_plugin *weechat_plugin, struct t_plugin_script *scripts); +extern struct t_hdata *plugin_script_hdata_script (struct t_weechat_plugin *weechat_plugin, + struct t_plugin_script **scripts, + struct t_plugin_script **last_script, + const char *hdata_name); extern int plugin_script_add_to_infolist (struct t_weechat_plugin *weechat_plugin, struct t_infolist *infolist, struct t_plugin_script *script); diff --git a/src/plugins/python/weechat-python.c b/src/plugins/python/weechat-python.c index d56eebfd1..ef19891d9 100644 --- a/src/plugins/python/weechat-python.c +++ b/src/plugins/python/weechat-python.c @@ -1012,6 +1012,21 @@ weechat_python_info_cb (void *data, const char *info_name, return NULL; } +/* + * weechat_python_hdata_cb: callback for hdata + */ + +struct t_hdata * +weechat_python_hdata_cb (void *data, const char *hdata_name) +{ + /* make C compiler happy */ + (void) data; + + return plugin_script_hdata_script (weechat_plugin, + &python_scripts, &last_python_script, + hdata_name); +} + /* * weechat_python_infolist_cb: callback for infolist */ @@ -1201,6 +1216,7 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[]) init.callback_command = &weechat_python_command_cb; init.callback_completion = &weechat_python_completion_cb; + init.callback_hdata = &weechat_python_hdata_cb; init.callback_infolist = &weechat_python_infolist_cb; init.callback_signal_debug_dump = &weechat_python_signal_debug_dump_cb; init.callback_signal_buffer_closed = &weechat_python_signal_buffer_closed_cb; diff --git a/src/plugins/ruby/weechat-ruby.c b/src/plugins/ruby/weechat-ruby.c index 37074646a..248f2f564 100644 --- a/src/plugins/ruby/weechat-ruby.c +++ b/src/plugins/ruby/weechat-ruby.c @@ -828,6 +828,21 @@ weechat_ruby_completion_cb (void *data, const char *completion_item, return WEECHAT_RC_OK; } +/* + * weechat_ruby_hdata_cb: callback for hdata + */ + +struct t_hdata * +weechat_ruby_hdata_cb (void *data, const char *hdata_name) +{ + /* make C compiler happy */ + (void) data; + + return plugin_script_hdata_script (weechat_plugin, + &ruby_scripts, &last_ruby_script, + hdata_name); +} + /* * weechat_ruby_infolist_cb: callback for infolist */ @@ -1072,6 +1087,7 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[]) init.callback_command = &weechat_ruby_command_cb; init.callback_completion = &weechat_ruby_completion_cb; + init.callback_hdata = &weechat_ruby_hdata_cb; init.callback_infolist = &weechat_ruby_infolist_cb; init.callback_signal_debug_dump = &weechat_ruby_signal_debug_dump_cb; init.callback_signal_buffer_closed = &weechat_ruby_signal_buffer_closed_cb; diff --git a/src/plugins/tcl/weechat-tcl.c b/src/plugins/tcl/weechat-tcl.c index 84fbcbdcb..e6dde9041 100644 --- a/src/plugins/tcl/weechat-tcl.c +++ b/src/plugins/tcl/weechat-tcl.c @@ -574,6 +574,21 @@ weechat_tcl_completion_cb (void *data, const char *completion_item, return WEECHAT_RC_OK; } +/* + * weechat_tcl_hdata_cb: callback for hdata + */ + +struct t_hdata * +weechat_tcl_hdata_cb (void *data, const char *hdata_name) +{ + /* make C compiler happy */ + (void) data; + + return plugin_script_hdata_script (weechat_plugin, + &tcl_scripts, &last_tcl_script, + hdata_name); +} + /* * weechat_tcl_infolist_cb: callback for infolist */ @@ -720,6 +735,7 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[]) init.callback_command = &weechat_tcl_command_cb; init.callback_completion = &weechat_tcl_completion_cb; + init.callback_hdata = &weechat_tcl_hdata_cb; init.callback_infolist = &weechat_tcl_infolist_cb; init.callback_signal_debug_dump = &weechat_tcl_signal_debug_dump_cb; init.callback_signal_buffer_closed = &weechat_tcl_signal_buffer_closed_cb;