diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2009-05-02 16:17:31 +0200 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2009-05-02 16:17:31 +0200 |
commit | 5f1c0c8254fdea03f1c42b569a67acd2b1c493ac (patch) | |
tree | 63083dd3268fb2cc6425ed84fe50e3141d80ef07 /src/plugins/scripts/script.c | |
parent | a09fc8472698d6f269a0d3f9f203ecd79f757bfc (diff) | |
download | weechat-5f1c0c8254fdea03f1c42b569a67acd2b1c493ac.zip |
Add data string argument in all callbacks of script API, display script name in error messages for scripts
Diffstat (limited to 'src/plugins/scripts/script.c')
-rw-r--r-- | src/plugins/scripts/script.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/plugins/scripts/script.c b/src/plugins/scripts/script.c index 2ebb4862b..85f6a4093 100644 --- a/src/plugins/scripts/script.c +++ b/src/plugins/scripts/script.c @@ -94,7 +94,8 @@ script_upgrade_set_buffer_callbacks (struct t_weechat_plugin *weechat_plugin, { struct t_infolist *infolist; struct t_gui_buffer *ptr_buffer; - const char *script_name, *script_input_cb, *script_close_cb; + const char *script_name, *script_input_cb, *script_input_cb_data; + const char *script_close_cb, *script_close_cb_data; struct t_plugin_script *ptr_script; struct t_script_callback *new_script_callback_input; struct t_script_callback *new_script_callback_close; @@ -122,8 +123,10 @@ script_upgrade_set_buffer_callbacks (struct t_weechat_plugin *weechat_plugin, new_script_callback_input = script_callback_alloc (); if (new_script_callback_input) { - new_script_callback_input->script = ptr_script; - new_script_callback_input->function = strdup (script_input_cb); + script_callback_init (new_script_callback_input, + ptr_script, + script_input_cb, + script_input_cb_data); new_script_callback_input->buffer = ptr_buffer; script_callback_add (ptr_script, new_script_callback_input); @@ -140,8 +143,10 @@ script_upgrade_set_buffer_callbacks (struct t_weechat_plugin *weechat_plugin, new_script_callback_close = script_callback_alloc (); if (new_script_callback_close) { - new_script_callback_close->script = ptr_script; - new_script_callback_close->function = strdup (script_close_cb); + script_callback_init (new_script_callback_close, + ptr_script, + script_close_cb, + script_close_cb_data); new_script_callback_close->buffer = ptr_buffer; script_callback_add (ptr_script, new_script_callback_close); |