mirror of
https://github.com/weechat/weechat.git
synced 2026-06-29 06:16:40 +02:00
Fixed crash with scripts when WeeChat calls functions of many scripts at same time with callbacks (bug #23109)
This commit is contained in:
@@ -2657,7 +2657,7 @@ weechat_lua_api_hook_signal_cb (void *data, char *signal, char *type_data,
|
||||
{
|
||||
struct t_script_callback *script_callback;
|
||||
char *lua_argv[3];
|
||||
static char value_str[64];
|
||||
static char value_str[64], empty_value[1] = { '\0' };
|
||||
int *rc, ret, free_needed;
|
||||
|
||||
script_callback = (struct t_script_callback *)data;
|
||||
@@ -2666,7 +2666,7 @@ weechat_lua_api_hook_signal_cb (void *data, char *signal, char *type_data,
|
||||
free_needed = 0;
|
||||
if (strcmp (type_data, WEECHAT_HOOK_SIGNAL_STRING) == 0)
|
||||
{
|
||||
lua_argv[1] = (char *)signal_data;
|
||||
lua_argv[1] = (signal_data) ? (char *)signal_data : empty_value;
|
||||
}
|
||||
else if (strcmp (type_data, WEECHAT_HOOK_SIGNAL_INT) == 0)
|
||||
{
|
||||
|
||||
@@ -57,10 +57,13 @@ weechat_lua_exec (struct t_plugin_script *script,
|
||||
{
|
||||
void *ret_value;
|
||||
int argc, *ret_i;
|
||||
struct t_plugin_script *old_lua_current_script;
|
||||
|
||||
lua_current_interpreter = script->interpreter;
|
||||
|
||||
lua_getglobal (lua_current_interpreter, function);
|
||||
|
||||
old_lua_current_script = lua_current_script;
|
||||
lua_current_script = script;
|
||||
|
||||
if (argv && argv[0])
|
||||
@@ -98,6 +101,7 @@ weechat_lua_exec (struct t_plugin_script *script,
|
||||
weechat_gettext ("%s%s: error: %s"),
|
||||
weechat_prefix ("error"), "lua",
|
||||
lua_tostring (lua_current_interpreter, -1));
|
||||
lua_current_script = old_lua_current_script;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -113,9 +117,12 @@ weechat_lua_exec (struct t_plugin_script *script,
|
||||
else
|
||||
{
|
||||
WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS(function);
|
||||
lua_current_script = old_lua_current_script;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
lua_current_script = old_lua_current_script;
|
||||
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
@@ -257,6 +264,7 @@ weechat_lua_unload (struct t_plugin_script *script)
|
||||
{
|
||||
int *r;
|
||||
char *lua_argv[1] = { NULL };
|
||||
void *interpreter;
|
||||
|
||||
weechat_printf (NULL,
|
||||
weechat_gettext ("%s: unloading script \"%s\""),
|
||||
@@ -272,9 +280,11 @@ weechat_lua_unload (struct t_plugin_script *script)
|
||||
free (r);
|
||||
}
|
||||
|
||||
lua_close (script->interpreter);
|
||||
interpreter = script->interpreter;
|
||||
|
||||
script_remove (weechat_lua_plugin, &lua_scripts, script);
|
||||
|
||||
lua_close (script->interpreter);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -436,6 +446,25 @@ weechat_lua_debug_dump_cb (void *data, char *signal, char *type_data,
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_lua_buffer_closed_cb: callback called when a buffer is closed
|
||||
*/
|
||||
|
||||
int
|
||||
weechat_lua_buffer_closed_cb (void *data, char *signal, char *type_data,
|
||||
void *signal_data)
|
||||
{
|
||||
/* make C compiler happy */
|
||||
(void) data;
|
||||
(void) signal;
|
||||
(void) type_data;
|
||||
|
||||
if (signal_data)
|
||||
script_remove_buffer_callbacks (lua_scripts, signal_data);
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_plugin_init: initialize Lua plugin
|
||||
*/
|
||||
@@ -450,6 +479,7 @@ weechat_plugin_init (struct t_weechat_plugin *plugin)
|
||||
&weechat_lua_command_cb,
|
||||
&weechat_lua_completion_cb,
|
||||
&weechat_lua_debug_dump_cb,
|
||||
&weechat_lua_buffer_closed_cb,
|
||||
&weechat_lua_load_cb);
|
||||
|
||||
/* init ok */
|
||||
|
||||
@@ -2192,7 +2192,7 @@ weechat_perl_api_hook_signal_cb (void *data, char *signal, char *type_data,
|
||||
{
|
||||
struct t_script_callback *script_callback;
|
||||
char *perl_argv[3];
|
||||
static char value_str[64];
|
||||
static char value_str[64], empty_value[1] = { '\0' };
|
||||
int *rc, ret, free_needed;
|
||||
|
||||
script_callback = (struct t_script_callback *)data;
|
||||
@@ -2201,7 +2201,7 @@ weechat_perl_api_hook_signal_cb (void *data, char *signal, char *type_data,
|
||||
free_needed = 0;
|
||||
if (strcmp (type_data, WEECHAT_HOOK_SIGNAL_STRING) == 0)
|
||||
{
|
||||
perl_argv[1] = (char *)signal_data;
|
||||
perl_argv[1] = (signal_data) ? (char *)signal_data : empty_value;
|
||||
}
|
||||
else if (strcmp (type_data, WEECHAT_HOOK_SIGNAL_INT) == 0)
|
||||
{
|
||||
|
||||
@@ -113,7 +113,8 @@ weechat_perl_exec (struct t_plugin_script *script,
|
||||
void *ret_value;
|
||||
int *ret_i, mem_err, length;
|
||||
SV *ret_s;
|
||||
|
||||
struct t_plugin_script *old_perl_current_script;
|
||||
|
||||
/* this code is placed here to conform ISO C90 */
|
||||
dSP;
|
||||
|
||||
@@ -133,6 +134,8 @@ weechat_perl_exec (struct t_plugin_script *script,
|
||||
SAVETMPS;
|
||||
PUSHMARK(sp);
|
||||
|
||||
old_perl_current_script = perl_current_script;
|
||||
|
||||
/* are we loading the script file ? */
|
||||
if (strcmp (function, "weechat_perl_load_eval_file") != 0)
|
||||
perl_current_script = script;
|
||||
@@ -203,6 +206,15 @@ weechat_perl_exec (struct t_plugin_script *script,
|
||||
weechat_prefix ("error"), "perl", function);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (strcmp (function, "weechat_perl_load_eval_file") != 0)
|
||||
{
|
||||
perl_current_script = old_perl_current_script;
|
||||
#ifdef MULTIPLICITY
|
||||
if (perl_current_script)
|
||||
PERL_SET_CONTEXT (perl_current_script->interpreter);
|
||||
#endif
|
||||
}
|
||||
|
||||
return ret_value;
|
||||
}
|
||||
@@ -381,6 +393,7 @@ weechat_perl_unload (struct t_plugin_script *script)
|
||||
{
|
||||
int *r;
|
||||
char *perl_argv[1] = { NULL };
|
||||
void *interpreter;
|
||||
|
||||
weechat_printf (NULL,
|
||||
weechat_gettext ("%s: unloading script \"%s\""),
|
||||
@@ -391,7 +404,7 @@ weechat_perl_unload (struct t_plugin_script *script)
|
||||
#else
|
||||
eval_pv (script->interpreter, TRUE);
|
||||
#endif
|
||||
|
||||
|
||||
if (script->shutdown_func && script->shutdown_func[0])
|
||||
{
|
||||
r = (int *) weechat_perl_exec (script,
|
||||
@@ -402,15 +415,17 @@ weechat_perl_unload (struct t_plugin_script *script)
|
||||
free (r);
|
||||
}
|
||||
|
||||
#ifdef MULTIPLICITY
|
||||
perl_destruct (script->interpreter);
|
||||
perl_free (script->interpreter);
|
||||
#else
|
||||
if (script->interpreter)
|
||||
free (script->interpreter);
|
||||
#endif
|
||||
interpreter = script->interpreter;
|
||||
|
||||
script_remove (weechat_perl_plugin, &perl_scripts, script);
|
||||
|
||||
#ifdef MULTIPLICITY
|
||||
perl_destruct (interpreter);
|
||||
perl_free (interpreter);
|
||||
#else
|
||||
if (interpreter)
|
||||
free (interpreter);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -572,6 +587,25 @@ weechat_perl_debug_dump_cb (void *data, char *signal, char *type_data,
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_perl_buffer_closed_cb: callback called when a buffer is closed
|
||||
*/
|
||||
|
||||
int
|
||||
weechat_perl_buffer_closed_cb (void *data, char *signal, char *type_data,
|
||||
void *signal_data)
|
||||
{
|
||||
/* make C compiler happy */
|
||||
(void) data;
|
||||
(void) signal;
|
||||
(void) type_data;
|
||||
|
||||
if (signal_data)
|
||||
script_remove_buffer_callbacks (perl_scripts, signal_data);
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_plugin_init: initialize Perl plugin
|
||||
*/
|
||||
@@ -605,6 +639,7 @@ weechat_plugin_init (struct t_weechat_plugin *plugin)
|
||||
&weechat_perl_command_cb,
|
||||
&weechat_perl_completion_cb,
|
||||
&weechat_perl_debug_dump_cb,
|
||||
&weechat_perl_buffer_closed_cb,
|
||||
&weechat_perl_load_cb);
|
||||
|
||||
/* init ok */
|
||||
|
||||
@@ -2341,7 +2341,7 @@ weechat_python_api_hook_signal_cb (void *data, char *signal, char *type_data,
|
||||
{
|
||||
struct t_script_callback *script_callback;
|
||||
char *python_argv[3];
|
||||
static char value_str[64];
|
||||
static char value_str[64], empty_value[1] = { '\0' };
|
||||
int *rc, ret, free_needed;
|
||||
|
||||
script_callback = (struct t_script_callback *)data;
|
||||
@@ -2350,7 +2350,7 @@ weechat_python_api_hook_signal_cb (void *data, char *signal, char *type_data,
|
||||
free_needed = 0;
|
||||
if (strcmp (type_data, WEECHAT_HOOK_SIGNAL_STRING) == 0)
|
||||
{
|
||||
python_argv[1] = (char *)signal_data;
|
||||
python_argv[1] = (signal_data) ? (char *)signal_data : empty_value;
|
||||
}
|
||||
else if (strcmp (type_data, WEECHAT_HOOK_SIGNAL_INT) == 0)
|
||||
{
|
||||
|
||||
@@ -59,6 +59,7 @@ weechat_python_exec (struct t_plugin_script *script,
|
||||
PyObject *rc;
|
||||
void *ret_value;
|
||||
int *ret_i;
|
||||
struct t_plugin_script *old_python_current_script;
|
||||
|
||||
/* PyEval_AcquireLock (); */
|
||||
PyThreadState_Swap (script->interpreter);
|
||||
@@ -75,7 +76,8 @@ weechat_python_exec (struct t_plugin_script *script,
|
||||
/* PyEval_ReleaseThread (python_current_script->interpreter); */
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
old_python_current_script = python_current_script;
|
||||
python_current_script = script;
|
||||
|
||||
if (argv && argv[0])
|
||||
@@ -151,6 +153,9 @@ weechat_python_exec (struct t_plugin_script *script,
|
||||
"a valid value"),
|
||||
weechat_prefix ("error"), "python", function);
|
||||
/* PyEval_ReleaseThread (python_current_script->interpreter); */
|
||||
python_current_script = old_python_current_script;
|
||||
if (python_current_script)
|
||||
PyThreadState_Swap (python_current_script->interpreter);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -161,13 +166,21 @@ weechat_python_exec (struct t_plugin_script *script,
|
||||
"function \"%s\""),
|
||||
weechat_prefix ("error"), "python", function);
|
||||
/* PyEval_ReleaseThread (python_current_script->interpreter); */
|
||||
python_current_script = old_python_current_script;
|
||||
if (python_current_script)
|
||||
PyThreadState_Swap (python_current_script->interpreter);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (PyErr_Occurred ()) PyErr_Print ();
|
||||
if (PyErr_Occurred ())
|
||||
PyErr_Print ();
|
||||
|
||||
/* PyEval_ReleaseThread (python_current_script->interpreter); */
|
||||
|
||||
python_current_script = old_python_current_script;
|
||||
if (python_current_script)
|
||||
PyThreadState_Swap (python_current_script->interpreter);
|
||||
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
@@ -426,6 +439,7 @@ void
|
||||
weechat_python_unload (struct t_plugin_script *script)
|
||||
{
|
||||
int *r;
|
||||
void *interpreter;
|
||||
|
||||
weechat_printf (NULL,
|
||||
weechat_gettext ("%s: unloading script \"%s\""),
|
||||
@@ -438,11 +452,13 @@ weechat_python_unload (struct t_plugin_script *script)
|
||||
if (r)
|
||||
free (r);
|
||||
}
|
||||
|
||||
PyThreadState_Swap (script->interpreter);
|
||||
Py_EndInterpreter (script->interpreter);
|
||||
|
||||
interpreter = script->interpreter;
|
||||
|
||||
script_remove (weechat_python_plugin, &python_scripts, script);
|
||||
|
||||
PyThreadState_Swap (interpreter);
|
||||
Py_EndInterpreter (interpreter);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -604,6 +620,25 @@ weechat_python_debug_dump_cb (void *data, char *signal, char *type_data,
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_python_buffer_closed_cb: callback called when a buffer is closed
|
||||
*/
|
||||
|
||||
int
|
||||
weechat_python_buffer_closed_cb (void *data, char *signal, char *type_data,
|
||||
void *signal_data)
|
||||
{
|
||||
/* make C compiler happy */
|
||||
(void) data;
|
||||
(void) signal;
|
||||
(void) type_data;
|
||||
|
||||
if (signal_data)
|
||||
script_remove_buffer_callbacks (python_scripts, signal_data);
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_plugin_init: initialize Python plugin
|
||||
*/
|
||||
@@ -644,6 +679,7 @@ weechat_plugin_init (struct t_weechat_plugin *plugin)
|
||||
&weechat_python_command_cb,
|
||||
&weechat_python_completion_cb,
|
||||
&weechat_python_debug_dump_cb,
|
||||
&weechat_python_buffer_closed_cb,
|
||||
&weechat_python_load_cb);
|
||||
|
||||
/* init ok */
|
||||
|
||||
@@ -2708,7 +2708,7 @@ weechat_ruby_api_hook_signal_cb (void *data, char *signal, char *type_data,
|
||||
{
|
||||
struct t_script_callback *script_callback;
|
||||
char *ruby_argv[3];
|
||||
static char value_str[64];
|
||||
static char value_str[64], empty_value[1] = { '\0' };
|
||||
int *rc, ret, free_needed;
|
||||
|
||||
script_callback = (struct t_script_callback *)data;
|
||||
@@ -2717,7 +2717,7 @@ weechat_ruby_api_hook_signal_cb (void *data, char *signal, char *type_data,
|
||||
free_needed = 0;
|
||||
if (strcmp (type_data, WEECHAT_HOOK_SIGNAL_STRING) == 0)
|
||||
{
|
||||
ruby_argv[1] = (char *)signal_data;
|
||||
ruby_argv[1] = (signal_data) ? (char *)signal_data : empty_value;
|
||||
}
|
||||
else if (strcmp (type_data, WEECHAT_HOOK_SIGNAL_INT) == 0)
|
||||
{
|
||||
|
||||
@@ -112,7 +112,9 @@ weechat_ruby_exec (struct t_plugin_script *script,
|
||||
VALUE rc, err;
|
||||
int ruby_error, *ret_i;
|
||||
void *ret_value;
|
||||
|
||||
struct t_plugin_script *old_ruby_current_script;
|
||||
|
||||
old_ruby_current_script = ruby_current_script;
|
||||
ruby_current_script = script;
|
||||
|
||||
if (argv && argv[0])
|
||||
@@ -209,6 +211,7 @@ weechat_ruby_exec (struct t_plugin_script *script,
|
||||
weechat_gettext ("%s%s: function \"%s\" must return a "
|
||||
"valid value"),
|
||||
weechat_prefix ("error"), "ruby", function);
|
||||
ruby_current_script = old_ruby_current_script;
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
@@ -218,9 +221,12 @@ weechat_ruby_exec (struct t_plugin_script *script,
|
||||
weechat_gettext ("%s%s: not enough memory in function "
|
||||
"\"%s\""),
|
||||
weechat_prefix ("error"), "ruby", function);
|
||||
ruby_current_script = old_ruby_current_script;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ruby_current_script = old_ruby_current_script;
|
||||
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
@@ -433,7 +439,8 @@ weechat_ruby_unload (struct t_plugin_script *script)
|
||||
{
|
||||
int *r;
|
||||
char *ruby_argv[1] = { NULL };
|
||||
|
||||
void *interpreter;
|
||||
|
||||
weechat_printf (NULL,
|
||||
weechat_gettext ("%s: unloading script \"%s\""),
|
||||
"ruby", script->name);
|
||||
@@ -448,10 +455,12 @@ weechat_ruby_unload (struct t_plugin_script *script)
|
||||
free (r);
|
||||
}
|
||||
|
||||
if (script->interpreter)
|
||||
rb_gc_unregister_address (script->interpreter);
|
||||
interpreter = script->interpreter;
|
||||
|
||||
script_remove (weechat_ruby_plugin, &ruby_scripts, script);
|
||||
|
||||
if (interpreter)
|
||||
rb_gc_unregister_address (interpreter);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -613,6 +622,25 @@ weechat_ruby_debug_dump_cb (void *data, char *signal, char *type_data,
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_ruby_buffer_closed_cb: callback called when a buffer is closed
|
||||
*/
|
||||
|
||||
int
|
||||
weechat_ruby_buffer_closed_cb (void *data, char *signal, char *type_data,
|
||||
void *signal_data)
|
||||
{
|
||||
/* make C compiler happy */
|
||||
(void) data;
|
||||
(void) signal;
|
||||
(void) type_data;
|
||||
|
||||
if (signal_data)
|
||||
script_remove_buffer_callbacks (ruby_scripts, signal_data);
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_plugin_init: initialize Ruby plugin
|
||||
*/
|
||||
@@ -704,6 +732,7 @@ weechat_plugin_init (struct t_weechat_plugin *plugin)
|
||||
&weechat_ruby_command_cb,
|
||||
&weechat_ruby_completion_cb,
|
||||
&weechat_ruby_debug_dump_cb,
|
||||
&weechat_ruby_buffer_closed_cb,
|
||||
&weechat_ruby_load_cb);
|
||||
|
||||
/* init ok */
|
||||
|
||||
@@ -90,6 +90,9 @@ script_init (struct t_weechat_plugin *weechat_plugin,
|
||||
int (*callback_signal_debug_dump)(void *data, char *signal,
|
||||
char *type_data,
|
||||
void *signal_data),
|
||||
int (*callback_signal_buffer_closed)(void *data, char *signal,
|
||||
char *type_data,
|
||||
void *signal_data),
|
||||
int (*callback_load_file)(void *data, char *filename))
|
||||
{
|
||||
char *string, *completion = "list|listfull|load|autoload|reload|unload %f";
|
||||
@@ -155,6 +158,9 @@ script_init (struct t_weechat_plugin *weechat_plugin,
|
||||
/* add signal for "debug_dump" */
|
||||
weechat_hook_signal ("debug_dump", callback_signal_debug_dump, NULL);
|
||||
|
||||
/* add signal for "buffer_closed" */
|
||||
weechat_hook_signal ("buffer_closed", callback_signal_buffer_closed, NULL);
|
||||
|
||||
/* autoload scripts */
|
||||
script_auto_load (weechat_plugin, callback_load_file);
|
||||
}
|
||||
@@ -400,6 +406,34 @@ script_add (struct t_weechat_plugin *weechat_plugin,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* script_remove_buffer_callbacks: remove callbacks for a buffer (called when a
|
||||
* buffer is closed by user)
|
||||
*/
|
||||
|
||||
void
|
||||
script_remove_buffer_callbacks (struct t_plugin_script *scripts,
|
||||
struct t_gui_buffer *buffer)
|
||||
{
|
||||
struct t_plugin_script *ptr_script;
|
||||
struct t_script_callback *ptr_script_callback, *next_script_callback;
|
||||
|
||||
for (ptr_script = scripts; ptr_script;
|
||||
ptr_script = ptr_script->next_script)
|
||||
{
|
||||
ptr_script_callback = ptr_script->callbacks;
|
||||
while (ptr_script_callback)
|
||||
{
|
||||
next_script_callback = ptr_script_callback->next_callback;
|
||||
|
||||
if (ptr_script_callback->buffer == buffer)
|
||||
script_callback_remove (ptr_script, ptr_script_callback);
|
||||
|
||||
ptr_script_callback = next_script_callback;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* script_remove: remove a script from list of scripts
|
||||
*/
|
||||
@@ -409,7 +443,7 @@ script_remove (struct t_weechat_plugin *weechat_plugin,
|
||||
struct t_plugin_script **scripts,
|
||||
struct t_plugin_script *script)
|
||||
{
|
||||
struct t_script_callback *ptr_script_callback;
|
||||
struct t_script_callback *ptr_script_callback, *next_script_callback;
|
||||
|
||||
for (ptr_script_callback = script->callbacks; ptr_script_callback;
|
||||
ptr_script_callback = ptr_script_callback->next_callback)
|
||||
@@ -419,6 +453,12 @@ script_remove (struct t_weechat_plugin *weechat_plugin,
|
||||
{
|
||||
weechat_unhook (ptr_script_callback->hook);
|
||||
}
|
||||
}
|
||||
|
||||
ptr_script_callback = script->callbacks;
|
||||
while (ptr_script_callback)
|
||||
{
|
||||
next_script_callback = ptr_script_callback->next_callback;
|
||||
|
||||
/* free config file */
|
||||
if (ptr_script_callback->config_file
|
||||
@@ -433,6 +473,21 @@ script_remove (struct t_weechat_plugin *weechat_plugin,
|
||||
/* remove bar item */
|
||||
if (ptr_script_callback->bar_item)
|
||||
weechat_bar_item_remove (ptr_script_callback->bar_item);
|
||||
|
||||
/* remove buffer */
|
||||
if (ptr_script_callback->buffer)
|
||||
{
|
||||
for (next_script_callback = ptr_script_callback->next_callback;
|
||||
next_script_callback;
|
||||
next_script_callback = next_script_callback->next_callback)
|
||||
{
|
||||
if (next_script_callback->buffer != ptr_script_callback->buffer)
|
||||
break;
|
||||
}
|
||||
weechat_buffer_close (ptr_script_callback->buffer, 1);
|
||||
}
|
||||
|
||||
ptr_script_callback = next_script_callback;
|
||||
}
|
||||
|
||||
/* remove all callbacks created by this script */
|
||||
|
||||
@@ -68,6 +68,10 @@ extern void script_init (struct t_weechat_plugin *weechat_plugin,
|
||||
char *signal,
|
||||
char *type_data,
|
||||
void *signal_data),
|
||||
int (*callback_signal_buffer_closed)(void *data,
|
||||
char *signal,
|
||||
char *type_data,
|
||||
void *signal_data),
|
||||
int (*callback_load_file)(void *data, char *filename));
|
||||
extern char *script_ptr2str (void *pointer);
|
||||
extern void *script_str2ptr (char *pointer_str);
|
||||
@@ -84,6 +88,8 @@ extern struct t_plugin_script *script_add (struct t_weechat_plugin *weechat_plug
|
||||
char *author, char *version,
|
||||
char *license, char *description,
|
||||
char *shutdown_func, char *charset);
|
||||
extern void script_remove_buffer_callbacks (struct t_plugin_script *scripts,
|
||||
struct t_gui_buffer *buffer);
|
||||
extern void script_remove (struct t_weechat_plugin *weechat_plugin,
|
||||
struct t_plugin_script **scripts,
|
||||
struct t_plugin_script *script);
|
||||
|
||||
Reference in New Issue
Block a user