summaryrefslogtreecommitdiff
path: root/src/plugins/fset
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2017-07-02 12:57:55 +0200
committerSébastien Helleu <flashcode@flashtux.org>2017-07-02 12:58:12 +0200
commit448112f3e62b34693e1106f48c7b638468b42675 (patch)
tree08bd4dbef1b5e9e09d16faa1f561fdea99332952 /src/plugins/fset
parent093032bc8d63eb26bf50fb916f41d20cb9da1527 (diff)
downloadweechat-448112f3e62b34693e1106f48c7b638468b42675.zip
fset: hook signal "debug_dump"
Diffstat (limited to 'src/plugins/fset')
-rw-r--r--src/plugins/fset/fset.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/plugins/fset/fset.c b/src/plugins/fset/fset.c
index e7045921f..404dc8ce9 100644
--- a/src/plugins/fset/fset.c
+++ b/src/plugins/fset/fset.c
@@ -51,6 +51,38 @@ struct t_hdata *fset_hdata_fset_option = NULL;
/*
+ * Callback for signal "debug_dump".
+ */
+
+int
+fset_debug_dump_cb (const void *pointer, void *data,
+ const char *signal, const char *type_data,
+ void *signal_data)
+{
+ /* make C compiler happy */
+ (void) pointer;
+ (void) data;
+ (void) signal;
+ (void) type_data;
+
+ if (!signal_data
+ || (weechat_strcasecmp ((char *)signal_data, FSET_PLUGIN_NAME) == 0))
+ {
+ weechat_log_printf ("");
+ weechat_log_printf ("***** \"%s\" plugin dump *****",
+ weechat_plugin->name);
+
+ fset_option_print_log ();
+
+ weechat_log_printf ("");
+ weechat_log_printf ("***** End of \"%s\" plugin dump *****",
+ weechat_plugin->name);
+ }
+
+ return WEECHAT_RC_OK;
+}
+
+/*
* Adds the fset bar.
*/
@@ -108,6 +140,8 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
fset_hdata_fset_option = weechat_hdata_get ("fset_option");
+ /* hook some signals */
+ weechat_hook_signal ("debug_dump", &fset_debug_dump_cb, NULL, NULL);
weechat_hook_signal ("window_scrolled",
&fset_buffer_window_scrolled_cb, NULL, NULL);