From 46bc18193397a8a3d5b756f1ffeda8c5f725d9b4 Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Wed, 8 Aug 2012 11:38:27 +0200 Subject: scripts: add signals for scripts loaded/unloaded/installed/removed --- src/plugins/tcl/weechat-tcl.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/plugins/tcl') 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); } /* -- cgit v1.2.3