diff options
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/scripts/lua/weechat-lua-api.c | 12 | ||||
-rw-r--r-- | src/plugins/scripts/perl/weechat-perl-api.c | 15 | ||||
-rw-r--r-- | src/plugins/scripts/python/weechat-python-api.c | 12 | ||||
-rw-r--r-- | src/plugins/scripts/ruby/weechat-ruby-api.c | 12 | ||||
-rw-r--r-- | src/plugins/scripts/script-api.c | 1 | ||||
-rw-r--r-- | src/plugins/scripts/script-api.h | 1 | ||||
-rw-r--r-- | src/plugins/scripts/tcl/weechat-tcl-api.c | 16 |
7 files changed, 46 insertions, 23 deletions
diff --git a/src/plugins/scripts/lua/weechat-lua-api.c b/src/plugins/scripts/lua/weechat-lua-api.c index 503f2f10f..84dca4110 100644 --- a/src/plugins/scripts/lua/weechat-lua-api.c +++ b/src/plugins/scripts/lua/weechat-lua-api.c @@ -1088,10 +1088,11 @@ weechat_lua_api_config_new (lua_State *L) void weechat_lua_api_config_read_cb (void *data, struct t_config_file *config_file, + struct t_config_section *section, const char *option_name, const char *value) { struct t_script_callback *script_callback; - char *lua_argv[4]; + char *lua_argv[5]; int *rc; script_callback = (struct t_script_callback *)data; @@ -1099,9 +1100,10 @@ weechat_lua_api_config_read_cb (void *data, if (script_callback->function && script_callback->function[0]) { lua_argv[0] = script_ptr2str (config_file); - lua_argv[1] = (char *)option_name; - lua_argv[2] = (char *)value; - lua_argv[3] = NULL; + lua_argv[1] = script_ptr2str (section); + lua_argv[2] = (char *)option_name; + lua_argv[3] = (char *)value; + lua_argv[4] = NULL; rc = (int *) weechat_lua_exec (script_callback->script, WEECHAT_SCRIPT_EXEC_INT, @@ -1112,6 +1114,8 @@ weechat_lua_api_config_read_cb (void *data, free (rc); if (lua_argv[0]) free (lua_argv[0]); + if (lua_argv[1]) + free (lua_argv[1]); } } diff --git a/src/plugins/scripts/perl/weechat-perl-api.c b/src/plugins/scripts/perl/weechat-perl-api.c index eb4dd7851..aaecfd70c 100644 --- a/src/plugins/scripts/perl/weechat-perl-api.c +++ b/src/plugins/scripts/perl/weechat-perl-api.c @@ -896,10 +896,12 @@ static XS (XS_weechat_api_config_new) void weechat_perl_api_config_section_read_cb (void *data, struct t_config_file *config_file, - const char *option_name, const char *value) + struct t_config_section *section, + const char *option_name, + const char *value) { struct t_script_callback *script_callback; - char *perl_argv[4]; + char *perl_argv[5]; int *rc; script_callback = (struct t_script_callback *)data; @@ -907,9 +909,10 @@ weechat_perl_api_config_section_read_cb (void *data, if (script_callback->function && script_callback->function[0]) { perl_argv[0] = script_ptr2str (config_file); - perl_argv[1] = (char *)option_name; - perl_argv[2] = (char *)value; - perl_argv[3] = NULL; + perl_argv[1] = script_ptr2str (section); + perl_argv[2] = (char *)option_name; + perl_argv[3] = (char *)value; + perl_argv[4] = NULL; rc = (int *) weechat_perl_exec (script_callback->script, WEECHAT_SCRIPT_EXEC_INT, @@ -920,6 +923,8 @@ weechat_perl_api_config_section_read_cb (void *data, free (rc); if (perl_argv[0]) free (perl_argv[0]); + if (perl_argv[1]) + free (perl_argv[1]); } } diff --git a/src/plugins/scripts/python/weechat-python-api.c b/src/plugins/scripts/python/weechat-python-api.c index 9cf06796b..0848cf284 100644 --- a/src/plugins/scripts/python/weechat-python-api.c +++ b/src/plugins/scripts/python/weechat-python-api.c @@ -952,10 +952,11 @@ weechat_python_api_config_new (PyObject *self, PyObject *args) void weechat_python_api_config_read_cb (void *data, struct t_config_file *config_file, + struct t_config_section *section, const char *option_name, const char *value) { struct t_script_callback *script_callback; - char *python_argv[4]; + char *python_argv[5]; int *rc; script_callback = (struct t_script_callback *)data; @@ -963,9 +964,10 @@ weechat_python_api_config_read_cb (void *data, if (script_callback->function && script_callback->function[0]) { python_argv[0] = script_ptr2str (config_file); - python_argv[1] = (char *)option_name; - python_argv[2] = (char *)value; - python_argv[3] = NULL; + python_argv[1] = script_ptr2str (section); + python_argv[2] = (char *)option_name; + python_argv[3] = (char *)value; + python_argv[4] = NULL; rc = (int *) weechat_python_exec (script_callback->script, WEECHAT_SCRIPT_EXEC_INT, @@ -976,6 +978,8 @@ weechat_python_api_config_read_cb (void *data, free (rc); if (python_argv[0]) free (python_argv[0]); + if (python_argv[1]) + free (python_argv[1]); } } diff --git a/src/plugins/scripts/ruby/weechat-ruby-api.c b/src/plugins/scripts/ruby/weechat-ruby-api.c index 2dac97f1e..72845827a 100644 --- a/src/plugins/scripts/ruby/weechat-ruby-api.c +++ b/src/plugins/scripts/ruby/weechat-ruby-api.c @@ -1085,10 +1085,11 @@ weechat_ruby_api_config_new (VALUE class, VALUE name, VALUE function) void weechat_ruby_api_config_read_cb (void *data, struct t_config_file *config_file, + struct t_config_section *section, const char *option_name, const char *value) { struct t_script_callback *script_callback; - char *ruby_argv[4]; + char *ruby_argv[5]; int *rc; script_callback = (struct t_script_callback *)data; @@ -1096,9 +1097,10 @@ weechat_ruby_api_config_read_cb (void *data, if (script_callback->function && script_callback->function[0]) { ruby_argv[0] = script_ptr2str (config_file); - ruby_argv[1] = (char *)option_name; - ruby_argv[2] = (char *)value; - ruby_argv[3] = NULL; + ruby_argv[1] = script_ptr2str (section); + ruby_argv[2] = (char *)option_name; + ruby_argv[3] = (char *)value; + ruby_argv[4] = NULL; rc = (int *) weechat_ruby_exec (script_callback->script, WEECHAT_SCRIPT_EXEC_INT, @@ -1109,6 +1111,8 @@ weechat_ruby_api_config_read_cb (void *data, free (rc); if (ruby_argv[0]) free (ruby_argv[0]); + if (ruby_argv[1]) + free (ruby_argv[1]); } } diff --git a/src/plugins/scripts/script-api.c b/src/plugins/scripts/script-api.c index 9f408d703..742e5fe18 100644 --- a/src/plugins/scripts/script-api.c +++ b/src/plugins/scripts/script-api.c @@ -102,6 +102,7 @@ script_api_config_new_section (struct t_weechat_plugin *weechat_plugin, int user_can_delete_options, void (*callback_read)(void *data, struct t_config_file *config_file, + struct t_config_section *section, const char *option_name, const char *value), char *function_read, diff --git a/src/plugins/scripts/script-api.h b/src/plugins/scripts/script-api.h index 70b542968..fd6918cdf 100644 --- a/src/plugins/scripts/script-api.h +++ b/src/plugins/scripts/script-api.h @@ -35,6 +35,7 @@ extern struct t_config_section *script_api_config_new_section (struct t_weechat_ int user_can_delete_options, void (*callback_read)(void *data, struct t_config_file *config_file, + struct t_config_section *section, const char *option_name, const char *value), const char *function_read, diff --git a/src/plugins/scripts/tcl/weechat-tcl-api.c b/src/plugins/scripts/tcl/weechat-tcl-api.c index 65e77cdde..b9560d323 100644 --- a/src/plugins/scripts/tcl/weechat-tcl-api.c +++ b/src/plugins/scripts/tcl/weechat-tcl-api.c @@ -1099,11 +1099,12 @@ weechat_tcl_api_config_new (ClientData clientData, Tcl_Interp *interp, void weechat_tcl_api_config_section_read_cb (void *data, - struct t_config_file *config_file, - const char *option_name, const char *value) + struct t_config_file *config_file, + struct t_config_section *section, + const char *option_name, const char *value) { struct t_script_callback *script_callback; - char *tcl_argv[4]; + char *tcl_argv[5]; int *rc; script_callback = (struct t_script_callback *)data; @@ -1111,9 +1112,10 @@ weechat_tcl_api_config_section_read_cb (void *data, if (script_callback->function && script_callback->function[0]) { tcl_argv[0] = script_ptr2str (config_file); - tcl_argv[1] = (char *)option_name; - tcl_argv[2] = (char *)value; - tcl_argv[3] = NULL; + tcl_argv[1] = script_ptr2str (section); + tcl_argv[2] = (char *)option_name; + tcl_argv[3] = (char *)value; + tcl_argv[4] = NULL; rc = (int *) weechat_tcl_exec (script_callback->script, WEECHAT_SCRIPT_EXEC_INT, @@ -1124,6 +1126,8 @@ weechat_tcl_api_config_section_read_cb (void *data, free (rc); if (tcl_argv[0]) free (tcl_argv[0]); + if (tcl_argv[1]) + free (tcl_argv[1]); } } |