summaryrefslogtreecommitdiff
path: root/src/plugins/tcl
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2012-08-08 11:38:27 +0200
committerSebastien Helleu <flashcode@flashtux.org>2012-08-08 11:38:27 +0200
commit46bc18193397a8a3d5b756f1ffeda8c5f725d9b4 (patch)
tree8c934b370b6a1743d9e1d24cf6ddf5d9a3d0437e /src/plugins/tcl
parent068d0df56b299d0cc023309c1a6c3cd3fee30bde (diff)
downloadweechat-46bc18193397a8a3d5b756f1ffeda8c5f725d9b4.zip
scripts: add signals for scripts loaded/unloaded/installed/removed
Diffstat (limited to 'src/plugins/tcl')
-rw-r--r--src/plugins/tcl/weechat-tcl.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/plugins/tcl/weechat-tcl.c b/src/plugins/tcl/weechat-tcl.c
index e6dde9041..549e1acd0 100644
--- a/src/plugins/tcl/weechat-tcl.c
+++ b/src/plugins/tcl/weechat-tcl.c
@@ -343,6 +343,9 @@ weechat_tcl_load (const char *filename)
&weechat_tcl_api_buffer_input_data_cb,
&weechat_tcl_api_buffer_close_cb);
+ weechat_hook_signal_send ("tcl_script_loaded", WEECHAT_HOOK_SIGNAL_STRING,
+ tcl_current_script->filename);
+
return 1;
}
@@ -368,6 +371,7 @@ weechat_tcl_unload (struct t_plugin_script *script)
{
Tcl_Interp* interp;
int *rc;
+ char *filename;
if ((weechat_tcl_plugin->debug >= 2) || !tcl_quiet)
{
@@ -386,6 +390,7 @@ weechat_tcl_unload (struct t_plugin_script *script)
free (rc);
}
+ filename = strdup (script->filename);
interp = (Tcl_Interp*)script->interpreter;
if (tcl_current_script == script)
@@ -395,6 +400,11 @@ weechat_tcl_unload (struct t_plugin_script *script)
plugin_script_remove (weechat_tcl_plugin, &tcl_scripts, &last_tcl_script, script);
Tcl_DeleteInterp(interp);
+
+ weechat_hook_signal_send ("tcl_script_unloaded",
+ WEECHAT_HOOK_SIGNAL_STRING, filename);
+ if (filename)
+ free (filename);
}
/*