mirror of
https://github.com/weechat/weechat.git
synced 2026-06-29 11:45:43 +02:00
Remove debug plugin (merged to core), new debug variable for each plugin (no more signals for setting debug)
This commit is contained in:
@@ -44,7 +44,6 @@ OPTION(DISABLE_LARGEFILE "Disable Large File Support")
|
||||
OPTION(DISABLE_ALIAS "Disable Alias plugin")
|
||||
OPTION(DISABLE_ASPELL "Disable Aspell plugin")
|
||||
OPTION(DISABLE_CHARSET "Disable Charset plugin")
|
||||
OPTION(DISABLE_DEBUG "Disable Debug plugin")
|
||||
OPTION(ENABLE_DEMO "Enable Demo plugin")
|
||||
OPTION(DISABLE_FIFO "Disable FIFO plugin")
|
||||
OPTION(DISABLE_IRC "Disable IRC plugin")
|
||||
|
||||
@@ -96,7 +96,6 @@ AH_VERBATIM([HAVE_FLOCK], [#undef HAVE_FLOCK])
|
||||
AH_VERBATIM([PLUGIN_ALIAS], [#undef PLUGIN_ALIAS])
|
||||
AH_VERBATIM([PLUGIN_ASPELL], [#undef PLUGIN_ASPELL])
|
||||
AH_VERBATIM([PLUGIN_CHARSET], [#undef PLUGIN_CHARSET])
|
||||
AH_VERBATIM([PLUGIN_DEBUG], [#undef PLUGIN_DEBUG])
|
||||
AH_VERBATIM([PLUGIN_DEMO], [#undef PLUGIN_DEMO])
|
||||
AH_VERBATIM([PLUGIN_FIFO], [#undef PLUGIN_FIFO])
|
||||
AH_VERBATIM([PLUGIN_IRC], [#undef PLUGIN_IRC])
|
||||
@@ -122,7 +121,6 @@ AC_ARG_ENABLE(largefile, [ --disable-largefile turn off Large File Suppo
|
||||
AC_ARG_ENABLE(alias, [ --disable-alias turn off Alias plugin (default=compiled)],enable_alias=$enableval,enable_alias=yes)
|
||||
AC_ARG_ENABLE(aspell, [ --disable-aspell turn off Aspell plugin (default=compiled)],enable_aspell=$enableval,enable_aspell=yes)
|
||||
AC_ARG_ENABLE(charset, [ --disable-charset turn off Charset plugin (default=compiled if found)],enable_charset=$enableval,enable_charset=yes)
|
||||
AC_ARG_ENABLE(debug, [ --enable-debug turn on Debug plugin (default=on)],enable_debug=$enableval,enable_debug=yes)
|
||||
AC_ARG_ENABLE(demo, [ --enable-demo turn on Demo plugin (default=off)],enable_demo=$enableval,enable_demo=no)
|
||||
AC_ARG_ENABLE(fifo, [ --disable-fifo turn off Fifo plugin (default=compiled)],enable_fifo=$enableval,enable_fifo=yes)
|
||||
AC_ARG_ENABLE(irc, [ --disable-irc turn off IRC plugin (default=compiled)],enable_irc=$enableval,enable_irc=yes)
|
||||
@@ -342,18 +340,6 @@ else
|
||||
not_asked="$not_asked charset"
|
||||
fi
|
||||
|
||||
# ---------------------------------- debug -------------------------------------
|
||||
|
||||
if test "x$enable_debug" = "xyes" ; then
|
||||
DEBUG_CFLAGS=""
|
||||
DEBUG_LFLAGS=""
|
||||
AC_SUBST(DEBUG_CFLAGS)
|
||||
AC_SUBST(DEBUG_LFLAGS)
|
||||
AC_DEFINE(PLUGIN_DEBUG)
|
||||
else
|
||||
not_asked="$not_asked debug"
|
||||
fi
|
||||
|
||||
# ---------------------------------- demo --------------------------------------
|
||||
|
||||
if test "x$enable_demo" = "xyes" ; then
|
||||
@@ -970,7 +956,6 @@ AM_CONDITIONAL(GUI_QT, test "$enable_qt" = "yes")
|
||||
AM_CONDITIONAL(PLUGIN_ALIAS, test "$enable_alias" = "yes")
|
||||
AM_CONDITIONAL(PLUGIN_ASPELL, test "$enable_aspell" = "yes")
|
||||
AM_CONDITIONAL(PLUGIN_CHARSET, test "$enable_charset" = "yes")
|
||||
AM_CONDITIONAL(PLUGIN_DEBUG, test "$enable_debug" = "yes")
|
||||
AM_CONDITIONAL(PLUGIN_DEMO, test "$enable_demo" = "yes")
|
||||
AM_CONDITIONAL(PLUGIN_FIFO, test "$enable_fifo" = "yes")
|
||||
AM_CONDITIONAL(PLUGIN_IRC, test "$enable_irc" = "yes")
|
||||
@@ -1001,7 +986,6 @@ AC_OUTPUT([Makefile
|
||||
src/plugins/alias/Makefile
|
||||
src/plugins/aspell/Makefile
|
||||
src/plugins/charset/Makefile
|
||||
src/plugins/debug/Makefile
|
||||
src/plugins/demo/Makefile
|
||||
src/plugins/fifo/Makefile
|
||||
src/plugins/irc/Makefile
|
||||
@@ -1057,9 +1041,6 @@ fi
|
||||
if test "x$enable_charset" = "xyes"; then
|
||||
listplugins="$listplugins charset"
|
||||
fi
|
||||
if test "x$enable_debug" = "xyes"; then
|
||||
listplugins="$listplugins debug"
|
||||
fi
|
||||
if test "x$enable_demo" = "xyes"; then
|
||||
listplugins="$listplugins demo"
|
||||
fi
|
||||
|
||||
@@ -90,7 +90,6 @@
|
||||
./src/plugins/aspell/weechat-aspell-speller.c
|
||||
./src/plugins/aspell/weechat-aspell-speller.h
|
||||
./src/plugins/charset/charset.c
|
||||
./src/plugins/debug/debug.c
|
||||
./src/plugins/demo/demo.c
|
||||
./src/plugins/fifo/fifo.c
|
||||
./src/plugins/fifo/fifo.h
|
||||
|
||||
@@ -91,7 +91,6 @@ SET(WEECHAT_SOURCES
|
||||
./src/plugins/aspell/weechat-aspell-speller.c
|
||||
./src/plugins/aspell/weechat-aspell-speller.h
|
||||
./src/plugins/charset/charset.c
|
||||
./src/plugins/debug/debug.c
|
||||
./src/plugins/demo/demo.c
|
||||
./src/plugins/fifo/fifo.c
|
||||
./src/plugins/fifo/fifo.h
|
||||
|
||||
+24
-23
@@ -7,7 +7,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
|
||||
"POT-Creation-Date: 2008-11-01 17:55+0100\n"
|
||||
"POT-Creation-Date: 2008-11-02 18:48+0100\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
@@ -202,6 +202,10 @@ msgstr ""
|
||||
msgid "%sPlugin \"%s\" not found"
|
||||
msgstr ""
|
||||
|
||||
#, c-format
|
||||
msgid "Debug disabled for \"%s\""
|
||||
msgstr ""
|
||||
|
||||
#, c-format
|
||||
msgid " %s[%s%s%s]%s buffer: %s%s%s / tags: %s / regex: %s %s"
|
||||
msgstr ""
|
||||
@@ -706,6 +710,22 @@ msgid ""
|
||||
"beginning of command)"
|
||||
msgstr ""
|
||||
|
||||
msgid "control debug for core/plugins"
|
||||
msgstr ""
|
||||
|
||||
msgid "[list | plugin level | dump | buffer | windows]"
|
||||
msgstr ""
|
||||
|
||||
msgid ""
|
||||
" plugin: name of plugin (\"core\" for WeeChat core)\n"
|
||||
" level: debug level for plugin (0 = disable debug)\n"
|
||||
" dump: save memory dump in WeeChat log file (same dump is written when "
|
||||
"WeeChat crashes)\n"
|
||||
" buffer: dump buffer content with hexadecimal values in log file\n"
|
||||
"windows: display windows tree\n"
|
||||
" text: send \"debug\" signal with \"text\" as argument"
|
||||
msgstr ""
|
||||
|
||||
msgid ""
|
||||
"filter messages in buffers, to hide/show them according to tags or regex"
|
||||
msgstr ""
|
||||
@@ -928,6 +948,9 @@ msgstr ""
|
||||
msgid "\t\tDay changed to %s"
|
||||
msgstr ""
|
||||
|
||||
msgid "debug level for plugin (\"core\" for WeeChat core)"
|
||||
msgstr ""
|
||||
|
||||
msgid "command executed when WeeChat starts, after loading plugins"
|
||||
msgstr ""
|
||||
|
||||
@@ -1710,14 +1733,6 @@ msgstr ""
|
||||
msgid "list of alias"
|
||||
msgstr ""
|
||||
|
||||
#, c-format
|
||||
msgid "%s: debug enabled"
|
||||
msgstr ""
|
||||
|
||||
#, c-format
|
||||
msgid "%s: debug disabled"
|
||||
msgstr ""
|
||||
|
||||
#, c-format
|
||||
msgid "%s: \"%s\" removed"
|
||||
msgstr ""
|
||||
@@ -1844,20 +1859,6 @@ msgid ""
|
||||
" reset: reset charsets for current buffer"
|
||||
msgstr ""
|
||||
|
||||
msgid "print debug messages"
|
||||
msgstr ""
|
||||
|
||||
msgid "dump | buffer | windows | text"
|
||||
msgstr ""
|
||||
|
||||
msgid ""
|
||||
" dump: save memory dump in WeeChat log file (same dump is written when "
|
||||
"WeeChat crashes)\n"
|
||||
" buffer: dump buffer content with hexadecimal values in log file\n"
|
||||
"windows: display windows tree\n"
|
||||
" text: send \"debug\" signal with \"text\" as argument"
|
||||
msgstr ""
|
||||
|
||||
msgid "demo message without prefix"
|
||||
msgstr ""
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
+161
-1
File diff suppressed because it is too large
Load Diff
@@ -190,6 +190,10 @@ extern struct t_config_option *config_plugin_path;
|
||||
extern struct t_config_option *config_plugin_save_config_on_unload;
|
||||
|
||||
|
||||
extern struct t_config_option *config_weechat_debug_get (const char *plugin_name);
|
||||
extern int config_weechat_debug_set (const char *plugin_name,
|
||||
const char *value);
|
||||
extern void config_weechat_debug_set_all ();
|
||||
extern int config_weechat_init ();
|
||||
extern int config_weechat_read ();
|
||||
extern int config_weechat_reload ();
|
||||
|
||||
@@ -24,6 +24,7 @@ struct t_gui_window_tree;
|
||||
|
||||
extern void debug_dump (int crash);
|
||||
extern void debug_sigsegv ();
|
||||
extern void debug_windows_tree ();
|
||||
extern void debug_init ();
|
||||
|
||||
#endif /* wee-debug.h */
|
||||
|
||||
@@ -69,6 +69,7 @@
|
||||
#include "../plugins/plugin.h"
|
||||
|
||||
|
||||
int weechat_debug_core = 0; /* debug level for core */
|
||||
char *weechat_argv0 = NULL; /* WeeChat binary file name (argv[0])*/
|
||||
int weechat_upgrading; /* =1 if WeeChat is upgrading */
|
||||
time_t weechat_start_time; /* start time (used by /uptime cmd) */
|
||||
|
||||
@@ -98,6 +98,7 @@
|
||||
|
||||
/* global variables and functions */
|
||||
|
||||
extern int weechat_debug_core;
|
||||
extern char *weechat_argv0;
|
||||
extern time_t weechat_start_time;
|
||||
extern int weechat_quit;
|
||||
|
||||
@@ -50,10 +50,6 @@ IF(ENABLE_DEMO)
|
||||
ADD_SUBDIRECTORY( demo )
|
||||
ENDIF(ENABLE_DEMO)
|
||||
|
||||
IF(NOT DISABLE_DEBUG)
|
||||
ADD_SUBDIRECTORY( debug )
|
||||
ENDIF(NOT DISABLE_DEBUG)
|
||||
|
||||
IF(NOT DISABLE_FIFO)
|
||||
ADD_SUBDIRECTORY( fifo )
|
||||
ENDIF(NOT DISABLE_FIFO)
|
||||
|
||||
@@ -38,10 +38,6 @@ if PLUGIN_CHARSET
|
||||
charset_dir = charset
|
||||
endif
|
||||
|
||||
if PLUGIN_DEBUG
|
||||
debug_dir = debug
|
||||
endif
|
||||
|
||||
if PLUGIN_DEMO
|
||||
demo_dir = demo
|
||||
endif
|
||||
@@ -90,6 +86,6 @@ if PLUGIN_XFER
|
||||
xfer_dir = xfer
|
||||
endif
|
||||
|
||||
SUBDIRS = . $(alias_dir) $(aspell_dir) $(charset_dir) $(debug_dir) \
|
||||
$(demo_dir) $(fifo_dir) $(irc_dir) $(logger_dir) $(notify_dir) \
|
||||
$(script_dir) $(trigger_dir) $(xfer_dir)
|
||||
SUBDIRS = . $(alias_dir) $(aspell_dir) $(charset_dir) $(demo_dir) $(fifo_dir) \
|
||||
$(irc_dir) $(logger_dir) $(notify_dir) $(script_dir) \
|
||||
$(trigger_dir) $(xfer_dir)
|
||||
|
||||
@@ -132,7 +132,7 @@ weechat_aspell_speller_new (const char *lang)
|
||||
if (!lang)
|
||||
return NULL;
|
||||
|
||||
if (aspell_debug)
|
||||
if (weechat_aspell_plugin->debug)
|
||||
{
|
||||
weechat_printf (NULL,
|
||||
"%s: creating new speller for lang \"%s\"",
|
||||
@@ -194,7 +194,7 @@ weechat_aspell_speller_free (struct t_aspell_speller *speller)
|
||||
if (!speller)
|
||||
return;
|
||||
|
||||
if (aspell_debug)
|
||||
if (weechat_aspell_plugin->debug)
|
||||
{
|
||||
weechat_printf (NULL,
|
||||
"%s: removing speller for lang \"%s\"",
|
||||
|
||||
@@ -40,8 +40,6 @@ WEECHAT_PLUGIN_LICENSE("GPL3");
|
||||
|
||||
struct t_weechat_plugin *weechat_aspell_plugin = NULL;
|
||||
|
||||
int aspell_debug = 0;
|
||||
|
||||
char *aspell_last_modifier_string = NULL; /* last str. received by modifier */
|
||||
char *aspell_last_modifier_result = NULL; /* last str. built by modifier */
|
||||
|
||||
@@ -153,39 +151,6 @@ struct t_aspell_code countries_avail[] =
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* weechat_aspell_debug_cb: callback for "debug" signal
|
||||
*/
|
||||
|
||||
int
|
||||
weechat_aspell_debug_cb (void *data, const char *signal, const char *type_data,
|
||||
void *signal_data)
|
||||
{
|
||||
/* make C compiler happy */
|
||||
(void) data;
|
||||
(void) signal;
|
||||
|
||||
if (strcmp (type_data, WEECHAT_HOOK_SIGNAL_STRING) == 0)
|
||||
{
|
||||
if (weechat_strcasecmp ((char *)signal_data, ASPELL_PLUGIN_NAME) == 0)
|
||||
{
|
||||
aspell_debug ^= 1;
|
||||
if (aspell_debug)
|
||||
{
|
||||
weechat_printf (NULL, _("%s: debug enabled"),
|
||||
ASPELL_PLUGIN_NAME);
|
||||
}
|
||||
else
|
||||
{
|
||||
weechat_printf (NULL, _("%s: debug disabled"),
|
||||
ASPELL_PLUGIN_NAME);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* weechat_aspell_build_option_name: build option name with a buffer
|
||||
*/
|
||||
@@ -981,9 +946,6 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
|
||||
if (weechat_aspell_config_read () < 0)
|
||||
return WEECHAT_RC_ERROR;
|
||||
|
||||
/* callback for debug */
|
||||
weechat_hook_signal ("debug", &weechat_aspell_debug_cb, NULL);
|
||||
|
||||
/* command /aspell */
|
||||
weechat_hook_command ("aspell",
|
||||
N_("aspell plugin configuration"),
|
||||
|
||||
@@ -31,8 +31,6 @@ struct t_aspell_code
|
||||
char *name;
|
||||
};
|
||||
|
||||
extern int aspell_debug;
|
||||
|
||||
extern struct t_weechat_plugin *weechat_aspell_plugin;
|
||||
|
||||
extern struct t_aspell_code langs_avail[];
|
||||
|
||||
@@ -53,41 +53,6 @@ struct t_config_section *charset_config_section_encode = NULL;
|
||||
char *charset_terminal = NULL;
|
||||
char *charset_internal = NULL;
|
||||
|
||||
int charset_debug = 0;
|
||||
|
||||
|
||||
/*
|
||||
* charset_debug_cb: callback for "debug" signal
|
||||
*/
|
||||
|
||||
int
|
||||
charset_debug_cb (void *data, const char *signal, const char *type_data,
|
||||
void *signal_data)
|
||||
{
|
||||
/* make C compiler happy */
|
||||
(void) data;
|
||||
(void) signal;
|
||||
|
||||
if (strcmp (type_data, WEECHAT_HOOK_SIGNAL_STRING) == 0)
|
||||
{
|
||||
if (weechat_strcasecmp ((char *)signal_data, CHARSET_PLUGIN_NAME) == 0)
|
||||
{
|
||||
charset_debug ^= 1;
|
||||
if (charset_debug)
|
||||
{
|
||||
weechat_printf (NULL, _("%s: debug enabled"),
|
||||
CHARSET_PLUGIN_NAME);
|
||||
}
|
||||
else
|
||||
{
|
||||
weechat_printf (NULL, _("%s: debug disabled"),
|
||||
CHARSET_PLUGIN_NAME);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* charset_config_reaload: reload charset configuration file
|
||||
@@ -349,7 +314,7 @@ charset_decode_cb (void *data, const char *modifier, const char *modifier_data,
|
||||
|
||||
charset = charset_get (charset_config_section_decode, modifier_data,
|
||||
charset_default_decode);
|
||||
if (charset_debug)
|
||||
if (weechat_charset_plugin->debug)
|
||||
{
|
||||
weechat_printf (NULL,
|
||||
"charset: debug: using 'decode' charset: %s "
|
||||
@@ -378,7 +343,7 @@ charset_encode_cb (void *data, const char *modifier, const char *modifier_data,
|
||||
|
||||
charset = charset_get (charset_config_section_encode, modifier_data,
|
||||
charset_default_encode);
|
||||
if (charset_debug)
|
||||
if (weechat_charset_plugin->debug)
|
||||
{
|
||||
weechat_printf (NULL,
|
||||
"charset: debug: using 'encode' charset: %s "
|
||||
@@ -525,8 +490,6 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
|
||||
|
||||
weechat_plugin = plugin;
|
||||
|
||||
charset_debug = weechat_config_boolean (weechat_config_get ("weechat.plugin.debug"));
|
||||
|
||||
/* get terminal & internal charsets */
|
||||
charset_terminal = weechat_info_get ("charset_terminal", "");
|
||||
charset_internal = weechat_info_get ("charset_internal", "");
|
||||
@@ -560,9 +523,6 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
|
||||
weechat_hook_modifier ("charset_decode", &charset_decode_cb, NULL);
|
||||
weechat_hook_modifier ("charset_encode", &charset_encode_cb, NULL);
|
||||
|
||||
/* callback for debug */
|
||||
weechat_hook_signal ("debug", &charset_debug_cb, NULL);
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
# Copyright (c) 2003-2008 FlashCode <flashcode@flashtux.org>
|
||||
#
|
||||
# This program 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.
|
||||
#
|
||||
# This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
ADD_LIBRARY(debug MODULE debug.c)
|
||||
SET_TARGET_PROPERTIES(debug PROPERTIES PREFIX "")
|
||||
|
||||
TARGET_LINK_LIBRARIES(debug)
|
||||
|
||||
INSTALL(TARGETS debug LIBRARY DESTINATION lib/${PROJECT_NAME}/plugins)
|
||||
@@ -1,25 +0,0 @@
|
||||
# Copyright (c) 2003-2008 FlashCode <flashcode@flashtux.org>
|
||||
#
|
||||
# This program 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.
|
||||
#
|
||||
# This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
INCLUDES = -DLOCALEDIR=\"$(datadir)/locale\" $(DEBUG_CFLAGS)
|
||||
|
||||
libdir = ${weechat_libdir}/plugins
|
||||
|
||||
lib_LTLIBRARIES = debug.la
|
||||
|
||||
debug_la_SOURCES = debug.c
|
||||
debug_la_LDFLAGS = -module
|
||||
debug_la_LIBADD = $(DEBUG_LFLAGS)
|
||||
File diff suppressed because it is too large
Load Diff
+2
-34
@@ -43,35 +43,6 @@ WEECHAT_PLUGIN_LICENSE("GPL3");
|
||||
struct t_weechat_plugin *weechat_demo_plugin = NULL;
|
||||
#define weechat_plugin weechat_demo_plugin
|
||||
|
||||
int demo_debug = 0;
|
||||
|
||||
|
||||
/*
|
||||
* demo_debug_signal_debug_cb: callback for "debug" signal
|
||||
*/
|
||||
|
||||
int
|
||||
demo_debug_signal_debug_cb (void *data, const char *signal,
|
||||
const char *type_data, void *signal_data)
|
||||
{
|
||||
/* make C compiler happy */
|
||||
(void) data;
|
||||
(void) signal;
|
||||
|
||||
if (strcmp (type_data, WEECHAT_HOOK_SIGNAL_STRING) == 0)
|
||||
{
|
||||
if (weechat_strcasecmp ((char *)signal_data, DEMO_PLUGIN_NAME) == 0)
|
||||
{
|
||||
demo_debug ^= 1;
|
||||
if (demo_debug)
|
||||
weechat_printf (NULL, _("%s: debug enabled"), DEMO_PLUGIN_NAME);
|
||||
else
|
||||
weechat_printf (NULL, _("%s: debug disabled"), DEMO_PLUGIN_NAME);
|
||||
}
|
||||
}
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* demo_printf_command_cb: demo command for printf
|
||||
@@ -139,7 +110,7 @@ demo_buffer_close_cb (void *data, struct t_gui_buffer *buffer)
|
||||
/* make C compiler happy */
|
||||
(void) data;
|
||||
|
||||
if (demo_debug)
|
||||
if (weechat_demo_plugin->debug)
|
||||
{
|
||||
weechat_printf (NULL,
|
||||
"buffer_close_cb: buffer = %x (%s)",
|
||||
@@ -368,7 +339,7 @@ demo_signal_cb (void *data, const char *signal, const char *type_data,
|
||||
/* make C compiler happy */
|
||||
(void) data;
|
||||
|
||||
if (demo_debug)
|
||||
if (weechat_demo_plugin->debug)
|
||||
{
|
||||
if (strcmp (type_data, WEECHAT_HOOK_SIGNAL_STRING) == 0)
|
||||
{
|
||||
@@ -416,8 +387,6 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
|
||||
|
||||
weechat_plugin = plugin;
|
||||
|
||||
demo_debug = weechat_config_boolean (weechat_config_get ("weechat.plugin.debug"));
|
||||
|
||||
weechat_hook_command ("demo_printf",
|
||||
N_("print some messages on current ubffer"),
|
||||
N_("[text]"),
|
||||
@@ -459,7 +428,6 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
|
||||
"%I",
|
||||
&demo_infolist_command_cb, NULL);
|
||||
|
||||
weechat_hook_signal ("debug", &demo_debug_signal_debug_cb, NULL);
|
||||
weechat_hook_signal ("*", &demo_signal_cb, NULL);
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
#include "irc-server.h"
|
||||
|
||||
|
||||
int irc_debug = 0;
|
||||
struct t_gui_buffer *irc_debug_buffer = NULL;
|
||||
|
||||
|
||||
@@ -58,7 +57,7 @@ irc_debug_printf (struct t_irc_server *server, int send, int modified,
|
||||
{
|
||||
char *buf;
|
||||
|
||||
if (!irc_debug || !message)
|
||||
if (!weechat_irc_plugin->debug || !message)
|
||||
return;
|
||||
|
||||
if (!irc_debug_buffer)
|
||||
@@ -100,33 +99,6 @@ irc_debug_printf (struct t_irc_server *server, int send, int modified,
|
||||
free (buf);
|
||||
}
|
||||
|
||||
/*
|
||||
* irc_debug_signal_debug_cb: callback for "debug" signal
|
||||
*/
|
||||
|
||||
int
|
||||
irc_debug_signal_debug_cb (void *data, const char *signal,
|
||||
const char *type_data, void *signal_data)
|
||||
{
|
||||
/* make C compiler happy */
|
||||
(void) data;
|
||||
(void) signal;
|
||||
|
||||
if (strcmp (type_data, WEECHAT_HOOK_SIGNAL_STRING) == 0)
|
||||
{
|
||||
if (weechat_strcasecmp ((char *)signal_data, IRC_PLUGIN_NAME) == 0)
|
||||
{
|
||||
irc_debug ^= 1;
|
||||
if (irc_debug)
|
||||
weechat_printf (NULL, _("%s: debug enabled"), IRC_PLUGIN_NAME);
|
||||
else
|
||||
weechat_printf (NULL, _("%s: debug disabled"), IRC_PLUGIN_NAME);
|
||||
}
|
||||
}
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* irc_debug_signal_debug_dump_cb: dump IRC data in WeeChat log file
|
||||
*/
|
||||
@@ -161,7 +133,5 @@ irc_debug_signal_debug_dump_cb (void *data, const char *signal,
|
||||
void
|
||||
irc_debug_init ()
|
||||
{
|
||||
irc_debug = weechat_config_boolean (weechat_config_get ("weechat.plugin.debug"));
|
||||
weechat_hook_signal ("debug", &irc_debug_signal_debug_cb, NULL);
|
||||
weechat_hook_signal ("debug_dump", &irc_debug_signal_debug_dump_cb, NULL);
|
||||
}
|
||||
|
||||
@@ -828,7 +828,7 @@ irc_server_new (const char *name, int autoconnect, int autoreconnect,
|
||||
if (!name || !addresses)
|
||||
return NULL;
|
||||
|
||||
if (irc_debug)
|
||||
if (weechat_irc_plugin->debug)
|
||||
{
|
||||
weechat_log_printf ("Creating new server (name:%s, addresses:%s, "
|
||||
"pwd:%s, nicks:%s, username:%s, realname:%s, "
|
||||
|
||||
@@ -68,6 +68,4 @@
|
||||
extern struct t_weechat_plugin *weechat_irc_plugin;
|
||||
extern struct t_hook *irc_hook_timer_check_away;
|
||||
|
||||
extern int irc_debug;
|
||||
|
||||
#endif /* irc.h */
|
||||
|
||||
@@ -73,7 +73,7 @@ logger_buffer_add (struct t_gui_buffer *buffer, int log_level)
|
||||
if (!buffer)
|
||||
return NULL;
|
||||
|
||||
if (logger_debug)
|
||||
if (weechat_logger_plugin->debug)
|
||||
{
|
||||
weechat_printf (NULL,
|
||||
"%s: start logging for buffer \"%s\"",
|
||||
@@ -157,7 +157,7 @@ logger_buffer_free (struct t_logger_buffer *logger_buffer)
|
||||
{
|
||||
struct t_logger_buffer *new_logger_buffers;
|
||||
|
||||
if (logger_debug)
|
||||
if (weechat_logger_plugin->debug)
|
||||
{
|
||||
weechat_printf (NULL,
|
||||
"%s: stop logging for buffer \"%s\"",
|
||||
|
||||
@@ -52,44 +52,9 @@ WEECHAT_PLUGIN_LICENSE("GPL3");
|
||||
|
||||
struct t_weechat_plugin *weechat_logger_plugin = NULL;
|
||||
|
||||
int logger_debug = 0;
|
||||
|
||||
char *logger_buf_write = NULL; /* buffer for writing a line */
|
||||
|
||||
|
||||
/*
|
||||
* logger_debug_cb: callback for "debug" signal
|
||||
*/
|
||||
|
||||
int
|
||||
logger_debug_cb (void *data, const char *signal, const char *type_data,
|
||||
void *signal_data)
|
||||
{
|
||||
/* make C compiler happy */
|
||||
(void) data;
|
||||
(void) signal;
|
||||
|
||||
if (strcmp (type_data, WEECHAT_HOOK_SIGNAL_STRING) == 0)
|
||||
{
|
||||
if (weechat_strcasecmp ((char *)signal_data, LOGGER_PLUGIN_NAME) == 0)
|
||||
{
|
||||
logger_debug ^= 1;
|
||||
if (logger_debug)
|
||||
{
|
||||
weechat_printf (NULL, _("%s: debug enabled"),
|
||||
LOGGER_PLUGIN_NAME);
|
||||
}
|
||||
else
|
||||
{
|
||||
weechat_printf (NULL, _("%s: debug disabled"),
|
||||
LOGGER_PLUGIN_NAME);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* logger_create_directory: create logger directory
|
||||
* return 1 if success (directory created or already
|
||||
@@ -293,7 +258,7 @@ logger_get_filename (struct t_gui_buffer *buffer)
|
||||
if (!mask_decoded)
|
||||
return NULL;
|
||||
|
||||
if (logger_debug)
|
||||
if (weechat_logger_plugin->debug)
|
||||
{
|
||||
weechat_printf (NULL,
|
||||
"%s: buffer = \"%s\", mask = \"%s\", "
|
||||
@@ -963,9 +928,6 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
|
||||
if (logger_config_read () < 0)
|
||||
return WEECHAT_RC_ERROR;
|
||||
|
||||
/* callback for debug */
|
||||
weechat_hook_signal ("debug", &logger_debug_cb, NULL);
|
||||
|
||||
/* command /logger */
|
||||
weechat_hook_command ("logger",
|
||||
N_("logger plugin configuration"),
|
||||
|
||||
@@ -26,8 +26,6 @@
|
||||
#define LOGGER_BUF_WRITE_SIZE (16*1024)
|
||||
#define LOGGER_LEVEL_DEFAULT 9
|
||||
|
||||
extern int logger_debug;
|
||||
|
||||
extern struct t_weechat_plugin *weechat_logger_plugin;
|
||||
|
||||
extern void logger_start_buffer_all ();
|
||||
|
||||
@@ -49,8 +49,6 @@ struct t_config_section *notify_config_section_buffer = NULL;
|
||||
char *notify_string[NOTIFY_NUM_LEVELS] =
|
||||
{ "none", "highlight", "message", "all" };
|
||||
|
||||
int notify_debug = 0;
|
||||
|
||||
|
||||
/*
|
||||
* notify_search: search a notify level by name
|
||||
@@ -94,33 +92,6 @@ notify_build_option_name (struct t_gui_buffer *buffer)
|
||||
return option_name;
|
||||
}
|
||||
|
||||
/*
|
||||
* notify_debug_cb: callback for "debug" signal
|
||||
*/
|
||||
|
||||
int
|
||||
notify_debug_cb (void *data, const char *signal, const char *type_data,
|
||||
void *signal_data)
|
||||
{
|
||||
/* make C compiler happy */
|
||||
(void) data;
|
||||
(void) signal;
|
||||
|
||||
if (strcmp (type_data, WEECHAT_HOOK_SIGNAL_STRING) == 0)
|
||||
{
|
||||
if (weechat_strcasecmp ((char *)signal_data, NOTIFY_PLUGIN_NAME) == 0)
|
||||
{
|
||||
notify_debug ^= 1;
|
||||
if (notify_debug)
|
||||
weechat_printf (NULL, _("%s: debug enabled"), NOTIFY_PLUGIN_NAME);
|
||||
else
|
||||
weechat_printf (NULL, _("%s: debug disabled"), NOTIFY_PLUGIN_NAME);
|
||||
}
|
||||
}
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* notify_get: read a notify level in config file
|
||||
* we first try with all arguments, then remove one by one
|
||||
@@ -183,7 +154,7 @@ notify_set_buffer (struct t_gui_buffer *buffer)
|
||||
if (option_name)
|
||||
{
|
||||
notify = notify_get (option_name);
|
||||
if (notify_debug)
|
||||
if (weechat_notify_plugin->debug)
|
||||
{
|
||||
weechat_printf (NULL,
|
||||
_("notify: debug: set notify for buffer %s to "
|
||||
@@ -479,8 +450,6 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
|
||||
|
||||
weechat_plugin = plugin;
|
||||
|
||||
notify_debug = weechat_config_boolean (weechat_config_get ("weechat.plugin.debug"));
|
||||
|
||||
if (!notify_config_init ())
|
||||
{
|
||||
weechat_printf (NULL,
|
||||
@@ -511,9 +480,6 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
|
||||
/* callback when a config option is changed */
|
||||
weechat_hook_config ("notify.buffer.*", ¬ify_config_cb, NULL);
|
||||
|
||||
/* callback for debug */
|
||||
weechat_hook_signal ("debug", ¬ify_debug_cb, NULL);
|
||||
|
||||
/* set notify for open buffers */
|
||||
notify_set_buffer_all ();
|
||||
|
||||
|
||||
@@ -138,6 +138,7 @@ plugin_load (const char *filename)
|
||||
int rc, i, argc;
|
||||
char **argv;
|
||||
struct t_weechat_plugin *new_plugin;
|
||||
struct t_config_option *ptr_option;
|
||||
|
||||
if (!filename)
|
||||
return NULL;
|
||||
@@ -316,6 +317,8 @@ plugin_load (const char *filename)
|
||||
new_plugin->weechat_version = strdup (weechat_version);
|
||||
new_plugin->license = strdup (license);
|
||||
new_plugin->charset = (charset) ? strdup (charset) : NULL;
|
||||
ptr_option = config_weechat_debug_get (name);
|
||||
new_plugin->debug = (ptr_option) ? CONFIG_INTEGER(ptr_option) : 0;
|
||||
|
||||
/* functions */
|
||||
new_plugin->plugin_get_name = &plugin_get_name;
|
||||
@@ -923,6 +926,8 @@ plugin_add_to_infolist (struct t_infolist *infolist,
|
||||
return 0;
|
||||
if (!infolist_new_var_string (ptr_item, "charset", plugin->charset))
|
||||
return 0;
|
||||
if (!infolist_new_var_integer (ptr_item, "debug", plugin->debug))
|
||||
return 0;
|
||||
|
||||
return 1;
|
||||
}
|
||||
@@ -947,6 +952,7 @@ plugin_print_log ()
|
||||
log_printf (" description. . . . . . : '%s'", ptr_plugin->description);
|
||||
log_printf (" version. . . . . . . . : '%s'", ptr_plugin->version);
|
||||
log_printf (" charset. . . . . . . . : '%s'", ptr_plugin->charset);
|
||||
log_printf (" debug. . . . . . . . . : %d", ptr_plugin->debug);
|
||||
log_printf (" prev_plugin. . . . . . : 0x%x", ptr_plugin->prev_plugin);
|
||||
log_printf (" next_plugin. . . . . . : 0x%x", ptr_plugin->next_plugin);
|
||||
}
|
||||
|
||||
@@ -111,6 +111,7 @@ struct t_weechat_plugin
|
||||
char *weechat_version; /* weechat version required */
|
||||
char *license; /* license */
|
||||
char *charset; /* charset used by plugin */
|
||||
int debug; /* debug level for plugin (0=off) */
|
||||
struct t_weechat_plugin *prev_plugin; /* link to previous plugin */
|
||||
struct t_weechat_plugin *next_plugin; /* link to next plugin */
|
||||
|
||||
|
||||
@@ -70,8 +70,6 @@ struct t_xfer *xfer_list = NULL; /* list of files/chats */
|
||||
struct t_xfer *last_xfer = NULL; /* last file/chat in list */
|
||||
int xfer_count = 0; /* number of xfer */
|
||||
|
||||
int xfer_debug = 0;
|
||||
|
||||
int xfer_signal_upgrade_received = 0; /* signal "upgrade" received ? */
|
||||
|
||||
|
||||
@@ -1366,8 +1364,6 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
|
||||
(void) argv;
|
||||
|
||||
weechat_plugin = plugin;
|
||||
|
||||
xfer_debug = weechat_config_boolean (weechat_config_get ("weechat.plugin.debug"));
|
||||
|
||||
if (!xfer_config_init ())
|
||||
return WEECHAT_RC_ERROR;
|
||||
|
||||
@@ -153,7 +153,6 @@ extern char *xfer_protocol_string[];
|
||||
extern char *xfer_status_string[];
|
||||
extern struct t_xfer *xfer_list, *last_xfer;
|
||||
extern int xfer_count;
|
||||
extern int xfer_debug;
|
||||
|
||||
extern int xfer_valid (struct t_xfer *xfer);
|
||||
extern struct t_xfer *xfer_search_by_number (int number);
|
||||
|
||||
Reference in New Issue
Block a user