1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-30 06:46:38 +02:00

scripts: add hdata with list of scripts for each language

This commit is contained in:
Sebastien Helleu
2012-08-03 12:13:21 +02:00
parent 746ca9623d
commit b501fd1b24
13 changed files with 550 additions and 2 deletions
+2 -1
View File
@@ -1,7 +1,7 @@
WeeChat ChangeLog
=================
Sébastien Helleu <flashcode@flashtux.org>
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
+102
View File
@@ -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) +
+102
View File
@@ -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) +
+102
View File
@@ -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) +
+102
View File
@@ -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) +
+16
View File
@@ -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;
+16
View File
@@ -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;
+16
View File
@@ -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;
+38 -1
View File
@@ -22,6 +22,7 @@
*/
#include <stdlib.h>
#include <stddef.h>
#include <unistd.h>
#include <stdio.h>
#include <errno.h>
@@ -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
+6
View File
@@ -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);
+16
View File
@@ -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;
+16
View File
@@ -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;
+16
View File
@@ -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;