mirror of
https://github.com/weechat/weechat.git
synced 2026-06-25 20:36:38 +02:00
Added preliminary support of new buffer type, with free content
This commit is contained in:
@@ -68,6 +68,17 @@ script_callback_add (struct t_plugin_script *script,
|
||||
script->callbacks = callback;
|
||||
}
|
||||
|
||||
/*
|
||||
* 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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user