mirror of
https://github.com/weechat/weechat.git
synced 2026-06-12 14:14:48 +02:00
script plugins: use new macros to reduce code length
This commit is contained in:
+1006
-3342
File diff suppressed because it is too large
Load Diff
@@ -380,7 +380,7 @@ weechat_lua_load_cb (void *data, const char *filename)
|
||||
void
|
||||
weechat_lua_unload (struct t_plugin_script *script)
|
||||
{
|
||||
int *r;
|
||||
int *rc;
|
||||
void *interpreter;
|
||||
|
||||
if ((weechat_lua_plugin->debug >= 1) || !lua_quiet)
|
||||
@@ -392,12 +392,12 @@ weechat_lua_unload (struct t_plugin_script *script)
|
||||
|
||||
if (script->shutdown_func && script->shutdown_func[0])
|
||||
{
|
||||
r = weechat_lua_exec (script,
|
||||
WEECHAT_SCRIPT_EXEC_INT,
|
||||
script->shutdown_func,
|
||||
NULL, NULL);
|
||||
if (r)
|
||||
free (r);
|
||||
rc = (int *)weechat_lua_exec (script,
|
||||
WEECHAT_SCRIPT_EXEC_INT,
|
||||
script->shutdown_func,
|
||||
NULL, NULL);
|
||||
if (rc)
|
||||
free (rc);
|
||||
}
|
||||
|
||||
interpreter = script->interpreter;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -555,7 +555,7 @@ weechat_perl_load_cb (void *data, const char *filename)
|
||||
void
|
||||
weechat_perl_unload (struct t_plugin_script *script)
|
||||
{
|
||||
int *r;
|
||||
int *rc;
|
||||
void *interpreter;
|
||||
|
||||
if ((weechat_perl_plugin->debug >= 1) || !perl_quiet)
|
||||
@@ -573,12 +573,12 @@ weechat_perl_unload (struct t_plugin_script *script)
|
||||
|
||||
if (script->shutdown_func && script->shutdown_func[0])
|
||||
{
|
||||
r = (int *) weechat_perl_exec (script,
|
||||
rc = (int *)weechat_perl_exec (script,
|
||||
WEECHAT_SCRIPT_EXEC_INT,
|
||||
script->shutdown_func,
|
||||
NULL, NULL);
|
||||
if (r)
|
||||
free (r);
|
||||
if (rc)
|
||||
free (rc);
|
||||
}
|
||||
|
||||
interpreter = script->interpreter;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -642,7 +642,7 @@ weechat_python_load_cb (void *data, const char *filename)
|
||||
void
|
||||
weechat_python_unload (struct t_plugin_script *script)
|
||||
{
|
||||
int *r;
|
||||
int *rc;
|
||||
void *interpreter;
|
||||
PyThreadState *old_interpreter;
|
||||
|
||||
@@ -655,12 +655,12 @@ weechat_python_unload (struct t_plugin_script *script)
|
||||
|
||||
if (script->shutdown_func && script->shutdown_func[0])
|
||||
{
|
||||
r = (int *) weechat_python_exec (script, WEECHAT_SCRIPT_EXEC_INT,
|
||||
script->shutdown_func, NULL, NULL);
|
||||
if (r)
|
||||
free (r);
|
||||
rc = (int *) weechat_python_exec (script, WEECHAT_SCRIPT_EXEC_INT,
|
||||
script->shutdown_func, NULL, NULL);
|
||||
if (rc)
|
||||
free (rc);
|
||||
}
|
||||
|
||||
|
||||
old_interpreter = PyThreadState_Swap (NULL);
|
||||
interpreter = script->interpreter;
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -327,7 +327,7 @@ weechat_ruby_exec (struct t_plugin_script *script,
|
||||
argv2[i] = INT2FIX (*((int *)argv[i]));
|
||||
break;
|
||||
case 'h': /* hash */
|
||||
argv2[i] = (VALUE)argv[i];
|
||||
argv2[i] = weechat_ruby_hashtable_to_hash (argv[i]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -615,7 +615,7 @@ weechat_ruby_load_cb (void *data, const char *filename)
|
||||
void
|
||||
weechat_ruby_unload (struct t_plugin_script *script)
|
||||
{
|
||||
int *r;
|
||||
int *rc;
|
||||
void *interpreter;
|
||||
|
||||
if ((weechat_ruby_plugin->debug >= 1) || !ruby_quiet)
|
||||
@@ -627,12 +627,12 @@ weechat_ruby_unload (struct t_plugin_script *script)
|
||||
|
||||
if (script->shutdown_func && script->shutdown_func[0])
|
||||
{
|
||||
r = (int *) weechat_ruby_exec (script,
|
||||
rc = (int *)weechat_ruby_exec (script,
|
||||
WEECHAT_SCRIPT_EXEC_INT,
|
||||
script->shutdown_func,
|
||||
0, NULL);
|
||||
if (r)
|
||||
free (r);
|
||||
if (rc)
|
||||
free (rc);
|
||||
}
|
||||
|
||||
interpreter = script->interpreter;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -367,7 +367,7 @@ void
|
||||
weechat_tcl_unload (struct t_plugin_script *script)
|
||||
{
|
||||
Tcl_Interp* interp;
|
||||
void *pointer;
|
||||
int *rc;
|
||||
|
||||
if ((weechat_tcl_plugin->debug >= 1) || !tcl_quiet)
|
||||
{
|
||||
@@ -378,12 +378,12 @@ weechat_tcl_unload (struct t_plugin_script *script)
|
||||
|
||||
if (script->shutdown_func && script->shutdown_func[0])
|
||||
{
|
||||
pointer = weechat_tcl_exec (script,
|
||||
WEECHAT_SCRIPT_EXEC_INT,
|
||||
script->shutdown_func,
|
||||
NULL, NULL);
|
||||
if (pointer)
|
||||
free (pointer);
|
||||
rc = (int *)weechat_tcl_exec (script,
|
||||
WEECHAT_SCRIPT_EXEC_INT,
|
||||
script->shutdown_func,
|
||||
NULL, NULL);
|
||||
if (rc)
|
||||
free (rc);
|
||||
}
|
||||
|
||||
interp = (Tcl_Interp*)script->interpreter;
|
||||
|
||||
Reference in New Issue
Block a user