summaryrefslogtreecommitdiff
path: root/src/plugins/scripts/script-callback.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/scripts/script-callback.c')
-rw-r--r--src/plugins/scripts/script-callback.c37
1 files changed, 23 insertions, 14 deletions
diff --git a/src/plugins/scripts/script-callback.c b/src/plugins/scripts/script-callback.c
index fb9ae66ca..a7f89e22e 100644
--- a/src/plugins/scripts/script-callback.c
+++ b/src/plugins/scripts/script-callback.c
@@ -69,6 +69,17 @@ script_callback_add (struct t_plugin_script *script,
}
/*
+ * script_callback_free_data: free data of a script callback
+ */
+
+void
+script_callback_free_data (struct t_script_callback *script_callback)
+{
+ if (script_callback->function)
+ free (script_callback->function);
+}
+
+/*
* script_callback_remove: remove a callback from a script
*/
@@ -86,9 +97,7 @@ script_callback_remove (struct t_plugin_script *script,
if (script->callbacks == script_callback)
script->callbacks = script_callback->next_callback;
- /* free data */
- if (script_callback->function)
- free (script_callback->function);
+ script_callback_free_data (script_callback);
free (script_callback);
}
@@ -115,15 +124,15 @@ script_callback_print_log (struct t_weechat_plugin *weechat_plugin,
struct t_script_callback *script_callback)
{
weechat_log_printf ("");
- weechat_log_printf ("[callback (addr:0x%x)]", script_callback);
- weechat_log_printf (" script. . . . . . . : 0x%x", script_callback->script);
- weechat_log_printf (" function. . . . . . : '%s'", script_callback->function);
- weechat_log_printf (" config_file . . . . : '%s'", script_callback->config_file);
- weechat_log_printf (" config_section. . . : '%s'", script_callback->config_section);
- weechat_log_printf (" config_option . . . : '%s'", script_callback->config_option);
- weechat_log_printf (" hook. . . . . . . . : 0x%x", script_callback->hook);
- weechat_log_printf (" buffer. . . . . . . : 0x%x", script_callback->buffer);
- weechat_log_printf (" bar_item. . . . . . : 0x%x", script_callback->bar_item);
- weechat_log_printf (" prev_callback . . . : 0x%x", script_callback->prev_callback);
- weechat_log_printf (" next_callback . . . : 0x%x", script_callback->next_callback);
+ weechat_log_printf (" [callback (addr:0x%x)]", script_callback);
+ weechat_log_printf (" script. . . . . . . : 0x%x", script_callback->script);
+ weechat_log_printf (" function. . . . . . : '%s'", script_callback->function);
+ weechat_log_printf (" config_file . . . . : 0x%x", script_callback->config_file);
+ weechat_log_printf (" config_section. . . : 0x%x", script_callback->config_section);
+ weechat_log_printf (" config_option . . . : 0x%x", script_callback->config_option);
+ weechat_log_printf (" hook. . . . . . . . : 0x%x", script_callback->hook);
+ weechat_log_printf (" buffer. . . . . . . : 0x%x", script_callback->buffer);
+ weechat_log_printf (" bar_item. . . . . . : 0x%x", script_callback->bar_item);
+ weechat_log_printf (" prev_callback . . . : 0x%x", script_callback->prev_callback);
+ weechat_log_printf (" next_callback . . . : 0x%x", script_callback->next_callback);
}