summaryrefslogtreecommitdiff
path: root/src/plugins/rmodifier/rmodifier-debug.c
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2010-08-11 15:43:20 +0200
committerSebastien Helleu <flashcode@flashtux.org>2010-08-11 15:43:20 +0200
commitd59d099e82378669a2bea5aac5c9d9862438f51e (patch)
tree21d0b98a4c3e0423b18b457be53f22ef17120ffe /src/plugins/rmodifier/rmodifier-debug.c
parent6f063c95f1ed3f0f3c7071aeb4a6e2094439bc23 (diff)
downloadweechat-d59d099e82378669a2bea5aac5c9d9862438f51e.zip
Add new plugin "rmodifier": alter modifier strings with regular expressions (bug #26964)
Diffstat (limited to 'src/plugins/rmodifier/rmodifier-debug.c')
-rw-r--r--src/plugins/rmodifier/rmodifier-debug.c68
1 files changed, 68 insertions, 0 deletions
diff --git a/src/plugins/rmodifier/rmodifier-debug.c b/src/plugins/rmodifier/rmodifier-debug.c
new file mode 100644
index 000000000..3820edaa6
--- /dev/null
+++ b/src/plugins/rmodifier/rmodifier-debug.c
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2010 Sebastien Helleu <flashcode@flashtux.org>
+ *
+ * This file is part of WeeChat, the extensible chat client.
+ *
+ * WeeChat is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * WeeChat is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with WeeChat. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * rmodifier-debug.c: debug functions for rmodifier plugin
+ */
+
+#include <stdlib.h>
+#include <string.h>
+
+#include "../weechat-plugin.h"
+#include "rmodifier.h"
+#include "rmodifier-debug.h"
+
+
+/*
+ * rmodifier_debug_signal_debug_dump_cb: dump rmodifier data in WeeChat log file
+ */
+
+int
+rmodifier_debug_signal_debug_dump_cb (void *data, const char *signal,
+ const char *type_data, void *signal_data)
+{
+ /* make C compiler happy */
+ (void) data;
+ (void) signal;
+ (void) type_data;
+ (void) signal_data;
+
+ weechat_log_printf ("");
+ weechat_log_printf ("***** \"%s\" plugin dump *****",
+ weechat_plugin->name);
+
+ rmodifier_print_log ();
+
+ weechat_log_printf ("");
+ weechat_log_printf ("***** End of \"%s\" plugin dump *****",
+ weechat_plugin->name);
+
+ return WEECHAT_RC_OK;
+}
+
+/*
+ * rmodifier_debug_init: initialize debug for rmodifier plugin
+ */
+
+void
+rmodifier_debug_init ()
+{
+ weechat_hook_signal ("debug_dump",
+ &rmodifier_debug_signal_debug_dump_cb, NULL);
+}