diff options
31 files changed, 885 insertions, 498 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index c3a345261..3ef2a0562 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,11 +35,13 @@ OPTION(DISABLE_NCURSES "Disable Ncurses interface") OPTION(ENABLE_GTK "Enable GTK interface") OPTION(DISABLE_NLS "Disable Native Language Support") OPTION(DISABLE_GNUTLS "Disable SSLv3/TLS connection support") -OPTION(DISABLE_IRC "Disable IRC plugin") 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") OPTION(DISABLE_LOGGER "Disable Logger plugin") OPTION(DISABLE_TRIGGER "Disable Trigger plugin") OPTION(DISABLE_SCRIPTS "Disable script plugins") @@ -47,7 +49,6 @@ OPTION(DISABLE_PERL "Disable Perl scripting language") OPTION(DISABLE_PYTHON "Disable Python scripting language") OPTION(DISABLE_RUBY "Disable Ruby scripting language") OPTION(DISABLE_LUA "Disable Lua scripting language") -OPTION(ENABLE_DEMO "Enable Demo plugin") OPTION(DISABLE_DOC "Disable Doc") ADD_SUBDIRECTORY( po ) diff --git a/configure.in b/configure.in index c8b5f7464..4407afc69 100644 --- a/configure.in +++ b/configure.in @@ -91,47 +91,48 @@ AC_CHECK_FUNCS([gethostbyname gethostname getsockname gettimeofday inet_ntoa mem AH_VERBATIM([PREFIX], [#undef PREFIX]) AH_VERBATIM([WEECHAT_LIBDIR], [#undef WEECHAT_LIBDIR]) AH_VERBATIM([WEECHAT_SHAREDIR], [#undef WEECHAT_SHAREDIR]) -AH_VERBATIM([PLUGIN_IRC], [#undef PLUGIN_IRC]) 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]) AH_VERBATIM([PLUGIN_LOGGER], [#undef PLUGIN_LOGGER]) AH_VERBATIM([PLUGIN_TRIGGER], [#undef PLUGIN_TRIGGER]) AH_VERBATIM([PLUGIN_PERL], [#undef PLUGIN_PERL]) AH_VERBATIM([PLUGIN_PYTHON], [#undef PLUGIN_PYTHON]) AH_VERBATIM([PLUGIN_RUBY], [#undef PLUGIN_RUBY]) AH_VERBATIM([PLUGIN_LUA], [#undef PLUGIN_LUA]) -AH_VERBATIM([PLUGIN_DEMO], [#undef PLUGIN_DEMO]) AH_VERBATIM([HAVE_GNUTLS], [#undef HAVE_GNUTLS]) AH_VERBATIM([HAVE_FLOCK], [#undef HAVE_FLOCK]) -AH_VERBATIM([DEBUG], [#undef DEBUG]) # Arguments for ./configure -AC_ARG_ENABLE(ncurses, [ --disable-ncurses Turn off ncurses interface (default=compiled if found)],enable_ncurses=$enableval,enable_ncurses=yes) -AC_ARG_ENABLE(wxwidgets, [ --enable-wxwidgets Turn on WxWidgets interface (default=off)],enable_wxwidgets=$enableval,enable_wxwidgets=no) -AC_ARG_ENABLE(gtk, [ --enable-gtk Turn on Gtk interface (default=off)],enable_gtk=$enableval,enable_gtk=no) -AC_ARG_ENABLE(qt, [ --enable-qt Turn on Qt interface (default=off)],enable_qt=$enableval,enable_qt=no) -AC_ARG_ENABLE(gnutls, [ --disable-gnutls Turn off gnutls support (default=compiled if found)],enable_gnutls=$enableval,enable_gnutls=yes) -AC_ARG_ENABLE(irc, [ --disable-irc Turn off IRC plugin (default=compiled)],enable_irc=$enableval,enable_irc=yes) -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 if found)],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(fifo, [ --disable-fifo Turn off Fifo plugin (default=compiled)],enable_fifo=$enableval,enable_fifo=yes) -AC_ARG_ENABLE(logger, [ --disable-logger Turn off Logger plugin (default=compiled)],enable_logger=$enableval,enable_logger=yes) -AC_ARG_ENABLE(trigger, [ --disable-trigger Turn off Trigger plugin (default=compiled if found)],enable_trigger=$enableval,enable_trigger=yes) -AC_ARG_ENABLE(scripts, [ --disable-scripts Turn off script plugins (default=compiled if found)],enable_scripts=$enableval,enable_scripts=yes) -AC_ARG_ENABLE(perl, [ --disable-perl Turn off Perl script plugin (default=compiled if found)],enable_perl=$enableval,enable_perl=yes) -AC_ARG_ENABLE(python, [ --disable-python Turn off Python script plugin (default=compiled if found)],enable_python=$enableval,enable_python=yes) -AC_ARG_ENABLE(ruby, [ --disable-ruby Turn off Ruby script plugin (default=compiled if found)],enable_ruby=$enableval,enable_ruby=yes) -AC_ARG_ENABLE(lua, [ --disable-lua Turn off Lua script plugin (default=compiled if found)],enable_lua=$enableval,enable_lua=yes) -AC_ARG_WITH(lua-inc, [ --with-lua-inc=DIR, Lua include files are in DIR (default=autodetect)],lua_inc=$withval,lua_inc='') -AC_ARG_WITH(lua-lib, [ --with-lua-lib=DIR, Lua library files are in DIR (default=autodetect)],lua_lib=$withval,lua_lib='') -AC_ARG_WITH(lua-suffix, [ --with-lua-suffix=ARG Lua is suffixed with ARG (default=autodetect)],lua_suffix=$withval,lua_suffix='') -AC_ARG_ENABLE(demo, [ --enable-demo Turn on Demo plugin (default=off)],enable_demo=$enableval,enable_demo=no) -AC_ARG_WITH(doc_xsl_prefix, [ --with-doc-xsl-prefix=DIR Docbook html/chunk.xsl is in DIR (default=autodetect)],doc_xsl_prefix=$withval,doc_xsl_prefix='') -AC_ARG_WITH(debug, [ --with-debug Debugging: 0=no debug, 1=debug compilation, 2=debug compilation + verbose msgs (default=1)],debug=$withval,debug=1) +AC_ARG_ENABLE(ncurses, [ --disable-ncurses turn off ncurses interface (default=compiled if found)],enable_ncurses=$enableval,enable_ncurses=yes) +AC_ARG_ENABLE(wxwidgets, [ --enable-wxwidgets turn on WxWidgets interface (default=off)],enable_wxwidgets=$enableval,enable_wxwidgets=no) +AC_ARG_ENABLE(gtk, [ --enable-gtk turn on Gtk interface (default=off)],enable_gtk=$enableval,enable_gtk=no) +AC_ARG_ENABLE(qt, [ --enable-qt turn on Qt interface (default=off)],enable_qt=$enableval,enable_qt=no) +AC_ARG_ENABLE(gnutls, [ --disable-gnutls turn off gnutls support (default=compiled if found)],enable_gnutls=$enableval,enable_gnutls=yes) +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 if found)],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) +AC_ARG_ENABLE(logger, [ --disable-logger turn off Logger plugin (default=compiled)],enable_logger=$enableval,enable_logger=yes) +AC_ARG_ENABLE(scripts, [ --disable-scripts turn off script plugins (default=compiled if found)],enable_scripts=$enableval,enable_scripts=yes) +AC_ARG_ENABLE(perl, [ --disable-perl turn off Perl script plugin (default=compiled if found)],enable_perl=$enableval,enable_perl=yes) +AC_ARG_ENABLE(python, [ --disable-python turn off Python script plugin (default=compiled if found)],enable_python=$enableval,enable_python=yes) +AC_ARG_ENABLE(ruby, [ --disable-ruby turn off Ruby script plugin (default=compiled if found)],enable_ruby=$enableval,enable_ruby=yes) +AC_ARG_ENABLE(lua, [ --disable-lua turn off Lua script plugin (default=compiled if found)],enable_lua=$enableval,enable_lua=yes) +AC_ARG_ENABLE(trigger, [ --disable-trigger turn off Trigger plugin (default=compiled if found)],enable_trigger=$enableval,enable_trigger=yes) +AC_ARG_WITH(lua-inc, [ --with-lua-inc=DIR, lua include files are in DIR (default=autodetect)],lua_inc=$withval,lua_inc='') +AC_ARG_WITH(lua-lib, [ --with-lua-lib=DIR, lua library files are in DIR (default=autodetect)],lua_lib=$withval,lua_lib='') +AC_ARG_WITH(lua-suffix, [ --with-lua-suffix=ARG lua is suffixed with ARG (default=autodetect)],lua_suffix=$withval,lua_suffix='') +AC_ARG_WITH(doc_xsl_prefix, [ --with-doc-xsl-prefix=DIR docbook html/chunk.xsl is in DIR (default=autodetect)],doc_xsl_prefix=$withval,doc_xsl_prefix='') +AC_ARG_WITH(debug, [ --with-debug debugging: 0=no debug, 1=debug compilation (default=1)],debug=$withval,debug=1) not_asked="" not_found="" @@ -275,14 +276,6 @@ if test "x$enable_scripts" = "xno" ; then enable_lua="no" fi -# ----------------------------------- irc -------------------------------------- - -if test "x$enable_irc" = "xyes" ; then - AC_DEFINE(PLUGIN_IRC) -else - not_asked="$not_asked irc" -fi - # ---------------------------------- alias ------------------------------------- if test "x$enable_alias" = "xyes" ; then @@ -339,6 +332,30 @@ 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 + DEMO_CFLAGS="" + DEMO_LFLAGS="" + AC_SUBST(DEMO_CFLAGS) + AC_SUBST(DEMO_LFLAGS) + AC_DEFINE(PLUGIN_DEMO) +else + not_asked="$not_asked demo" +fi + # ---------------------------------- fifo -------------------------------------- if test "x$enable_fifo" = "xyes" ; then @@ -351,6 +368,14 @@ else not_asked="$not_asked fifo" fi +# ----------------------------------- irc -------------------------------------- + +if test "x$enable_irc" = "xyes" ; then + AC_DEFINE(PLUGIN_IRC) +else + not_asked="$not_asked irc" +fi + # --------------------------------- logger ------------------------------------- if test "x$enable_logger" = "xyes" ; then @@ -363,18 +388,6 @@ else not_asked="$not_asked logger" fi -# --------------------------------- trigger ------------------------------------ - -if test "x$enable_trigger" = "xyes" ; then - TRIGGER_CFLAGS="" - TRIGGER_LFLAGS="" - AC_SUBST(TRIGGER_CFLAGS) - AC_SUBST(TRIGGER_LFLAGS) - AC_DEFINE(PLUGIN_TRIGGER) -else - not_asked="$not_asked trigger" -fi - # ---------------------------------- perl -------------------------------------- PERL_VERSION= @@ -652,16 +665,16 @@ if test "x$enable_lua" = "xyes" ; then AC_DEFINE(PLUGIN_LUA) fi -# ---------------------------------- demo -------------------------------------- +# --------------------------------- trigger ------------------------------------ -if test "x$enable_demo" = "xyes" ; then - DEMO_CFLAGS="" - DEMO_LFLAGS="" - AC_SUBST(DEMO_CFLAGS) - AC_SUBST(DEMO_LFLAGS) - AC_DEFINE(PLUGIN_DEMO) +if test "x$enable_trigger" = "xyes" ; then + TRIGGER_CFLAGS="" + TRIGGER_LFLAGS="" + AC_SUBST(TRIGGER_CFLAGS) + AC_SUBST(TRIGGER_LFLAGS) + AC_DEFINE(PLUGIN_TRIGGER) else - not_asked="$not_asked demo" + not_asked="$not_asked trigger" fi # ------------------------------------------------------------------------------ @@ -801,14 +814,10 @@ else fi CFLAGS=`echo $CFLAGS | sed s/-g//g` -if test "x$debug" = "x1" || test "x$debug" = "x2" ; then - CFLAGS="$COMMON_CFLAGS $CFLAGS -g -O0" -else +if test "x$debug" = "x0" ; then CFLAGS="$COMMON_CFLAGS $CFLAGS" -fi - -if test "x$debug" = "x2" ; then - AC_DEFINE(DEBUG) +else + CFLAGS="$COMMON_CFLAGS $CFLAGS -g -O0" fi LIBS="$LIBS $INTLLIBS" @@ -846,18 +855,19 @@ AM_CONDITIONAL(GUI_NCURSES, test "$enable_ncurses" = "yes") AM_CONDITIONAL(GUI_WXWIDGETS, test "$enable_wxwidgets" = "yes") AM_CONDITIONAL(GUI_GTK, test "$enable_gtk" = "yes") AM_CONDITIONAL(GUI_QT, test "$enable_qt" = "yes") -AM_CONDITIONAL(PLUGIN_IRC, test "$enable_irc" = "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") AM_CONDITIONAL(PLUGIN_LOGGER, test "$enable_logger" = "yes") -AM_CONDITIONAL(PLUGIN_TRIGGER, test "$enable_trigger" = "yes") AM_CONDITIONAL(PLUGIN_PERL, test "$enable_perl" = "yes") AM_CONDITIONAL(PLUGIN_PYTHON, test "$enable_python" = "yes") AM_CONDITIONAL(PLUGIN_RUBY, test "$enable_ruby" = "yes") AM_CONDITIONAL(PLUGIN_LUA, test "$enable_lua" = "yes") -AM_CONDITIONAL(PLUGIN_DEMO, test "$enable_demo" = "yes") +AM_CONDITIONAL(PLUGIN_TRIGGER, test "$enable_trigger" = "yes") AM_CONDITIONAL(HAVE_GNUTLS, test "$enable_gnutls" = "yes") AM_CONDITIONAL(HAVE_FLOCK, test "$enable_flock" = "yes") AM_CONDITIONAL(DBLATEX_FOUND, test "$DBLATEX_FOUND" = "yes") @@ -875,11 +885,13 @@ AC_OUTPUT([Makefile src/Makefile src/core/Makefile src/plugins/Makefile - src/plugins/irc/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 src/plugins/logger/Makefile src/plugins/trigger/Makefile src/plugins/scripts/Makefile @@ -887,7 +899,6 @@ AC_OUTPUT([Makefile src/plugins/scripts/python/Makefile src/plugins/scripts/ruby/Makefile src/plugins/scripts/lua/Makefile - src/plugins/demo/Makefile src/gui/Makefile src/gui/curses/Makefile src/gui/wxwidgets/Makefile @@ -921,9 +932,6 @@ if test "x$listgui" = "x" ; then fi listplugins="" -if test "x$enable_irc" = "xyes" ; then - listplugins="$listplugins irc" -fi if test "x$enable_alias" = "xyes"; then listplugins="$listplugins alias" fi @@ -933,15 +941,21 @@ 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 if test "x$enable_fifo" = "xyes"; then listplugins="$listplugins fifo" fi +if test "x$enable_irc" = "xyes" ; then + listplugins="$listplugins irc" +fi if test "x$enable_logger" = "xyes"; then listplugins="$listplugins logger" fi -if test "x$enable_trigger" = "xyes"; then - listplugins="$listplugins trigger" -fi if test "x$enable_perl" = "xyes"; then listplugins="$listplugins perl($PERL_VERSION)" fi @@ -954,8 +968,8 @@ fi if test "x$enable_lua" = "xyes"; then listplugins="$listplugins lua($LUA_VERSION)" fi -if test "x$enable_demo" = "xyes"; then - listplugins="$listplugins demo" +if test "x$enable_trigger" = "xyes"; then + listplugins="$listplugins trigger" fi listoptional="" @@ -970,12 +984,9 @@ if test "x$enable_backtrace" = "xyes"; then fi msg_debug="no" -if test "x$debug" = "x1"; then +if test "x$debug" != "x0"; then msg_debug="yes" fi -if test "x$debug" = "x2" ; then - msg_debug="yes (with verbose messages)" -fi if test "x$msg_doc" = "x"; then msg_doc="no" diff --git a/po/POTFILES.in b/po/POTFILES.in index 134316f78..8cfdcfce0 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -8,6 +8,8 @@ ./src/core/wee-config-file.c ./src/core/wee-config-file.h ./src/core/wee-config.h +./src/core/wee-debug.c +./src/core/wee-debug.h ./src/core/wee-hook.c ./src/core/wee-hook.h ./src/core/wee-input.c @@ -81,6 +83,7 @@ ./src/plugins/aspell/aspell.h ./src/plugins/charset/charset.c ./src/plugins/charset/charset.h +./src/plugins/debug/debug.c ./src/plugins/demo/demo.c ./src/plugins/fifo/fifo.c ./src/plugins/irc/irc-buffer.c @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.2.7-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2008-02-03 16:29+0100\n" +"POT-Creation-Date: 2008-02-21 07:54+0100\n" "PO-Revision-Date: 2007-09-06 12:44+0200\n" "Last-Translator: Jiri Golembiovsky <golemj@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -521,26 +521,6 @@ msgstr "" "příkaz: příkaz, který spustit ('/' je automaticky dodáno, pokud není " "nalezeno na začátku příkazu)\n" -msgid "print debug messages" -msgstr "vypsat debug zprávy" - -#, fuzzy -msgid "dump | buffer | windows | text" -msgstr "dump | buffer | windows" - -#, fuzzy -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 "" -" dump: uloží výpis paměti do WeeChat log souboru (stejný výpis jako když " -"Weechat havaruje)\n" -" buffer: vypíše obsah bufferu s hexadecimálními hodnotami do log souboru\n" -"windows: zobrazit strom oken" - msgid "display help about commands" msgstr "zobrazí nápovědu k příkazům" @@ -1815,6 +1795,26 @@ msgid "" "for IRC channel \"#weechat\" on server \"freenode\"" msgstr "" +msgid "print debug messages" +msgstr "vypsat debug zprávy" + +#, fuzzy +msgid "dump | buffer | windows | text" +msgstr "dump | buffer | windows" + +#, fuzzy +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 "" +" dump: uloží výpis paměti do WeeChat log souboru (stejný výpis jako když " +"Weechat havaruje)\n" +" buffer: vypíše obsah bufferu s hexadecimálními hodnotami do log souboru\n" +"windows: zobrazit strom oken" + msgid "demo message without prefix" msgstr "" @@ -1941,6 +1941,14 @@ msgid "%s%s: error opening file, closing it" msgstr "%s chyba při čtení FIFO roury, zavírám ji\n" #, fuzzy, c-format +msgid "%s: debug enabled" +msgstr "FIFO roura je otevřena\n" + +#, c-format +msgid "%s: debug disabled" +msgstr "" + +#, fuzzy, c-format msgid "%s%s: cannot allocate new channel" msgstr "%s nemohu přidělit nový kanál" @@ -4329,6 +4337,14 @@ msgstr "" msgid "%s%s: wrong arguments for function \"%s\"" msgstr "%s špatné parametry pro příkaz \"%s\"\n" +#, fuzzy +#~ msgid "debug command" +#~ msgstr "příkaz" + +#, fuzzy +#~ msgid "[test]" +#~ msgstr "text" + #~ msgid "IP address or hostname of IRC server" #~ msgstr "IP adresa nebo jeméno hosta IRC serveru" @@ -4462,10 +4478,6 @@ msgstr "%s špatné parametry pro příkaz \"%s\"\n" #~ msgid "%s%s: loading Perl script \"%s\"" #~ msgstr "sezeni: načítám server \"%s\"\n" -#, fuzzy -#~ msgid "%s%s: plugin ended" -#~ msgstr "FIFO roura je otevřena\n" - #~ msgid "%s cannot find nick for sending message\n" #~ msgstr "%s nemohu najít přezdívku pro poslání zprávy\n" @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.2.7-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2008-02-03 16:29+0100\n" +"POT-Creation-Date: 2008-02-21 07:54+0100\n" "PO-Revision-Date: 2007-09-06 12:44+0200\n" "Last-Translator: Thomas Schuetz <i18n@internet-villa.de>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -513,25 +513,6 @@ msgstr "" "Befehl: auszuführender Befehl (falls nicht vorhanden wird automatisch ein " "'/' vorangestellt)\n" -msgid "print debug messages" -msgstr "Debugging-Nachricht ausgeben" - -#, fuzzy -msgid "dump | buffer | windows | text" -msgstr "dump | windows" - -#, fuzzy -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 "" -"dump: Speicherabbild im WeeChat-Logfile ablegen (wie nach einem " -"Programmabsturz)\n" -"windows: zeigt Fensterdaten an" - msgid "display help about commands" msgstr "Hilfe zu Befehlen abfragen" @@ -1818,6 +1799,25 @@ msgid "" "for IRC channel \"#weechat\" on server \"freenode\"" msgstr "" +msgid "print debug messages" +msgstr "Debugging-Nachricht ausgeben" + +#, fuzzy +msgid "dump | buffer | windows | text" +msgstr "dump | windows" + +#, fuzzy +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 "" +"dump: Speicherabbild im WeeChat-Logfile ablegen (wie nach einem " +"Programmabsturz)\n" +"windows: zeigt Fensterdaten an" + msgid "demo message without prefix" msgstr "" @@ -1944,6 +1944,14 @@ msgid "%s%s: error opening file, closing it" msgstr "%s Fehler beim Lesen vom FIFO, FIFO wird geschlossen\n" #, fuzzy, c-format +msgid "%s: debug enabled" +msgstr "FIFO ist offen\n" + +#, c-format +msgid "%s: debug disabled" +msgstr "" + +#, fuzzy, c-format msgid "%s%s: cannot allocate new channel" msgstr "%s Neuer Channel konnte nicht alloziert werden" @@ -4322,6 +4330,14 @@ msgstr "" msgid "%s%s: wrong arguments for function \"%s\"" msgstr "%s fehlerhafte Argumente für der \"%s\"-Befehl\n" +#, fuzzy +#~ msgid "debug command" +#~ msgstr "Befehl" + +#, fuzzy +#~ msgid "[test]" +#~ msgstr "Text" + #~ msgid "IP address or hostname of IRC server" #~ msgstr "IP-Adresse oder Hostname des IRC-Servers" @@ -4458,10 +4474,6 @@ msgstr "%s fehlerhafte Argumente für der \"%s\"-Befehl\n" #~ msgid "%s%s: loading Perl script \"%s\"" #~ msgstr "Sitzung: Lade Server \"%s\"\n" -#, fuzzy -#~ msgid "%s%s: plugin ended" -#~ msgstr "FIFO ist offen\n" - #~ msgid "%s cannot find nick for sending message\n" #~ msgstr "" #~ "%s kann keinen Nickname finden, an den die Nachricht gesendet werden " @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.2.7-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2008-02-03 16:29+0100\n" +"POT-Creation-Date: 2008-02-21 07:54+0100\n" "PO-Revision-Date: 2007-09-19 12:09+0200\n" "Last-Translator: Roberto González Cardenete <robert.glez@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -511,25 +511,6 @@ msgstr "" "comando: comando a ejecutar (se añade un '/' automáticamente si no se " "encuentra al principio del comando)\n" -msgid "print debug messages" -msgstr "imprime mensajes de depuración" - -#, fuzzy -msgid "dump | buffer | windows | text" -msgstr "volcar | ventanas" - -#, fuzzy -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 "" -" volcar: guardar el volcado de memoria en el archivo de registro de Weechat " -"(el mismo volcado se escribe cuando Weechat se cuelga)\n" -"ventanas: mostrar árbol de ventanas" - msgid "display help about commands" msgstr "mostrar ayuda sobre los comandos" @@ -1805,6 +1786,25 @@ msgid "" "for IRC channel \"#weechat\" on server \"freenode\"" msgstr "" +msgid "print debug messages" +msgstr "imprime mensajes de depuración" + +#, fuzzy +msgid "dump | buffer | windows | text" +msgstr "volcar | ventanas" + +#, fuzzy +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 "" +" volcar: guardar el volcado de memoria en el archivo de registro de Weechat " +"(el mismo volcado se escribe cuando Weechat se cuelga)\n" +"ventanas: mostrar árbol de ventanas" + msgid "demo message without prefix" msgstr "" @@ -1932,6 +1932,14 @@ msgid "%s%s: error opening file, closing it" msgstr "%s error al leer la tuberÃa FIFO, cerrándola\n" #, fuzzy, c-format +msgid "%s: debug enabled" +msgstr "La tuberÃa FIFO está abierta\n" + +#, c-format +msgid "%s: debug disabled" +msgstr "" + +#, fuzzy, c-format msgid "%s%s: cannot allocate new channel" msgstr "%s no ha sido posible crear un nuevo canal" @@ -4334,6 +4342,14 @@ msgstr "" msgid "%s%s: wrong arguments for function \"%s\"" msgstr "%s argumentos incorrectos para el comando \"%s\"\n" +#, fuzzy +#~ msgid "debug command" +#~ msgstr "comando" + +#, fuzzy +#~ msgid "[test]" +#~ msgstr "texto" + #~ msgid "IP address or hostname of IRC server" #~ msgstr "dirección IP o nombre de máquina del servidor IRC" @@ -4463,10 +4479,6 @@ msgstr "%s argumentos incorrectos para el comando \"%s\"\n" #~ msgid "%s%s: loading Perl script \"%s\"" #~ msgstr "sesión: cargando servidor \"%s\"\n" -#, fuzzy -#~ msgid "%s%s: plugin ended" -#~ msgstr "La tuberÃa FIFO está abierta\n" - #~ msgid "%s cannot find nick for sending message\n" #~ msgstr "" #~ "%s no ha sido posible encontrar el usuario al que enviar el mensaje\n" @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.2.7-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2008-02-03 16:29+0100\n" -"PO-Revision-Date: 2008-02-03 16:29+0100\n" +"POT-Creation-Date: 2008-02-21 07:54+0100\n" +"PO-Revision-Date: 2008-02-21 07:55+0100\n" "Last-Translator: FlashCode <flashcode@flashtux.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" "MIME-Version: 1.0\n" @@ -488,26 +488,6 @@ msgstr "" "commande: commande à exécuter (un '/' est automatiquement ajouté s'il n'est " "pas trouvé au début de la commande)" -msgid "print debug messages" -msgstr "affiche des messages de debogage" - -msgid "dump | buffer | windows | text" -msgstr "dump | buffer | windows | texte" - -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 "" -" dump: affiche les variables mémoire WeeChat dans le fichier log (les " -"mêmes messages sont affichés lorsque WeeChat plante)\n" -" buffer: affiche le contenu du tampon en valeurs hexadécimales dans le " -"fichier log\n" -"windows: affiche l'arbre des fenêtres<\n" -" texte: envoie le signal \"debug\" avec \"texte\" comme paramètre" - msgid "display help about commands" msgstr "afficher l'aide sur les commandes" @@ -1729,6 +1709,26 @@ msgstr "" "/charset decode.irc.freenode.#weechat => définit le charset de décodage à " "iso-8859-15 pour le canal IRC \"#weechat\" sur le serveur \"freenode\"" +msgid "print debug messages" +msgstr "affiche des messages de debogage" + +msgid "dump | buffer | windows | text" +msgstr "dump | buffer | windows | texte" + +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 "" +" dump: affiche les variables mémoire WeeChat dans le fichier log (les " +"mêmes messages sont affichés lorsque WeeChat plante)\n" +" buffer: affiche le contenu du tampon en valeurs hexadécimales dans le " +"fichier log\n" +"windows: affiche l'arbre des fenêtres<\n" +" texte: envoie le signal \"debug\" avec \"texte\" comme paramètre" + msgid "demo message without prefix" msgstr "message de démonstration sans préfixe" @@ -1850,6 +1850,14 @@ msgid "%s%s: error opening file, closing it" msgstr "%s%s: erreur d'ouverture du fichier, fermeture" #, c-format +msgid "%s: debug enabled" +msgstr "%s: debug activé" + +#, c-format +msgid "%s: debug disabled" +msgstr "%s: debug désactivé" + +#, c-format msgid "%s%s: cannot allocate new channel" msgstr "%s%s: impossible d'allouer un nouveau canal" @@ -4267,6 +4275,15 @@ msgstr "" msgid "%s%s: wrong arguments for function \"%s\"" msgstr "%s%s: paramètres invalides pour la fonction \"%s\"" +#~ msgid "debug command" +#~ msgstr "commande debug" + +#~ msgid "[test]" +#~ msgstr "[test]" + +#~ msgid "test: test" +#~ msgstr "test: test" + #~ msgid "IP address or hostname of IRC server" #~ msgstr "adresse IP ou nom du serveur IRC" @@ -12,7 +12,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.2.7-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2008-02-03 16:29+0100\n" +"POT-Creation-Date: 2008-02-21 07:54+0100\n" "PO-Revision-Date: 2007-10-10 18:07+0200\n" "Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -527,26 +527,6 @@ msgstr "" "parancs: futtatandó parancs (egy '/' autómatikusan hozzáadódik, ha nincs " "megadva a parancs elején)\n" -msgid "print debug messages" -msgstr "hibakereső üzenetek megjelenítése" - -#, fuzzy -msgid "dump | buffer | windows | text" -msgstr "dump | buffer | windows" - -#, fuzzy -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 "" -" dump: memóriatartalom mentése a WeeChat logba (ugyanez a tartalom íródik " -"a WeeChat összeomlásakor)\n" -" buffer: hexadecimális puffertartalom logba írása\n" -"windows: ablakfa megjelenítése" - msgid "display help about commands" msgstr "segítség megjelenítése a parancsokhoz" @@ -1822,6 +1802,26 @@ msgid "" "for IRC channel \"#weechat\" on server \"freenode\"" msgstr "" +msgid "print debug messages" +msgstr "hibakereső üzenetek megjelenítése" + +#, fuzzy +msgid "dump | buffer | windows | text" +msgstr "dump | buffer | windows" + +#, fuzzy +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 "" +" dump: memóriatartalom mentése a WeeChat logba (ugyanez a tartalom íródik " +"a WeeChat összeomlásakor)\n" +" buffer: hexadecimális puffertartalom logba írása\n" +"windows: ablakfa megjelenítése" + msgid "demo message without prefix" msgstr "" @@ -1948,6 +1948,14 @@ msgid "%s%s: error opening file, closing it" msgstr "%s hiba a FIFO cső olvasása közben, bezárás\n" #, fuzzy, c-format +msgid "%s: debug enabled" +msgstr "FIFO cső nyitva\n" + +#, c-format +msgid "%s: debug disabled" +msgstr "" + +#, fuzzy, c-format msgid "%s%s: cannot allocate new channel" msgstr "%s nem sikerült új csatornát lefoglalni" @@ -4337,6 +4345,14 @@ msgstr "" msgid "%s%s: wrong arguments for function \"%s\"" msgstr "%s rossz argumentum a \"%s\" parancsnak\n" +#, fuzzy +#~ msgid "debug command" +#~ msgstr "parancs" + +#, fuzzy +#~ msgid "[test]" +#~ msgstr "szöveg" + #~ msgid "IP address or hostname of IRC server" #~ msgstr "IRC szerver IP-címe vagy hosztneve" @@ -4465,10 +4481,6 @@ msgstr "%s rossz argumentum a \"%s\" parancsnak\n" #~ msgid "%s%s: loading Perl script \"%s\"" #~ msgstr "folyamat: \"%s\" szerver betöltése\n" -#, fuzzy -#~ msgid "%s%s: plugin ended" -#~ msgstr "FIFO cső nyitva\n" - #~ msgid "%s cannot find nick for sending message\n" #~ msgstr "%s nem található név az üzenet küldéséhez\n" @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.2.7-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2008-02-03 16:29+0100\n" +"POT-Creation-Date: 2008-02-21 07:54+0100\n" "PO-Revision-Date: 2007-09-06 12:44+0200\n" "Last-Translator: Pavel Shevchuk <stlwrt@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -522,27 +522,6 @@ msgstr "" "команда: исполняемая команда ('/' автоматически добавляется в начало " "команды)\n" -msgid "print debug messages" -msgstr "выводить отладочные сообщения" - -#, fuzzy -msgid "dump | buffer | windows | text" -msgstr "dump | buffer | windows" - -#, fuzzy -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 "" -" dump: сохранить дамп памяти в журнал WeeChat (аналогично дампу при крахе " -"WeeChat)\n" -" buffer: сохранить содержимое буфера с шестнадцатеричными значениями в log-" -"файл\n" -"windows: отобразить дерево окон" - msgid "display help about commands" msgstr "отобразить помощь по командам" @@ -1824,6 +1803,27 @@ msgid "" "for IRC channel \"#weechat\" on server \"freenode\"" msgstr "" +msgid "print debug messages" +msgstr "выводить отладочные сообщения" + +#, fuzzy +msgid "dump | buffer | windows | text" +msgstr "dump | buffer | windows" + +#, fuzzy +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 "" +" dump: сохранить дамп памяти в журнал WeeChat (аналогично дампу при крахе " +"WeeChat)\n" +" buffer: сохранить содержимое буфера с шестнадцатеричными значениями в log-" +"файл\n" +"windows: отобразить дерево окон" + msgid "demo message without prefix" msgstr "" @@ -1950,6 +1950,14 @@ msgid "%s%s: error opening file, closing it" msgstr "%s ошибка чтения FIFO pipe, закрываю его\n" #, fuzzy, c-format +msgid "%s: debug enabled" +msgstr "FIFO pipe открыт\n" + +#, c-format +msgid "%s: debug disabled" +msgstr "" + +#, fuzzy, c-format msgid "%s%s: cannot allocate new channel" msgstr "%s не могу расположить новый канал" @@ -4319,6 +4327,14 @@ msgstr "" msgid "%s%s: wrong arguments for function \"%s\"" msgstr "%s некорректные аргументы команды \"%s\"\n" +#, fuzzy +#~ msgid "debug command" +#~ msgstr "команда" + +#, fuzzy +#~ msgid "[test]" +#~ msgstr "текст" + #~ msgid "IP address or hostname of IRC server" #~ msgstr "IP адрес или хост IRC сервера" @@ -4444,10 +4460,6 @@ msgstr "%s некорректные аргументы команды \"%s\"\n" #~ msgid "%s%s: loading Perl script \"%s\"" #~ msgstr "сессия: загружаю сервер \"%s\"\n" -#, fuzzy -#~ msgid "%s%s: plugin ended" -#~ msgstr "FIFO pipe открыт\n" - #~ msgid "%s cannot find nick for sending message\n" #~ msgstr "%s не могу найти адресата сообщения\n" diff --git a/po/srcfiles.cmake b/po/srcfiles.cmake index 19b79d461..feb474bb0 100644 --- a/po/srcfiles.cmake +++ b/po/srcfiles.cmake @@ -9,6 +9,8 @@ SET(WEECHAT_SOURCES ./src/core/wee-config-file.c ./src/core/wee-config-file.h ./src/core/wee-config.h +./src/core/wee-debug.c +./src/core/wee-debug.h ./src/core/wee-hook.c ./src/core/wee-hook.h ./src/core/wee-input.c @@ -82,6 +84,7 @@ SET(WEECHAT_SOURCES ./src/plugins/aspell/aspell.h ./src/plugins/charset/charset.c ./src/plugins/charset/charset.h +./src/plugins/debug/debug.c ./src/plugins/demo/demo.c ./src/plugins/fifo/fifo.c ./src/plugins/irc/irc-buffer.c diff --git a/po/weechat.pot b/po/weechat.pot index 46751203d..c59a74b27 100644 --- a/po/weechat.pot +++ b/po/weechat.pot @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2008-02-03 16:29+0100\n" +"POT-Creation-Date: 2008-02-21 07:54+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" @@ -434,20 +434,6 @@ msgid "" "beginning of command)" 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 "display help about commands" msgstr "" @@ -1505,6 +1491,20 @@ msgid "" "for IRC channel \"#weechat\" on server \"freenode\"" 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 "" @@ -1622,6 +1622,14 @@ msgid "%s%s: error opening file, closing it" msgstr "" #, c-format +msgid "%s: debug enabled" +msgstr "" + +#, c-format +msgid "%s: debug disabled" +msgstr "" + +#, c-format msgid "%s%s: cannot allocate new channel" msgstr "" diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 580d29061..22ab230bc 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -16,9 +16,9 @@ SET(LIB_CORE_SRC weechat.c weechat.h wee-backtrace.c wee-backtrace.h wee-command.c wee-command.h wee-config.c wee-config.h wee-config-file.c -wee-config-file.h wee-hook.c wee-hook.h wee-input.c wee-input.h wee-list.c -wee-list.h wee-log.c wee-log.h wee-string.c wee-string.h wee-upgrade.c -wee-upgrade.h wee-utf8.c wee-utf8.h wee-util.c wee-util.h) +wee-config-file.h wee-debug.c wee-debug.h wee-hook.c wee-hook.h wee-input.c +wee-input.h wee-list.c wee-list.h wee-log.c wee-log.h wee-string.c wee-string.h +wee-upgrade.c wee-upgrade.h wee-utf8.c wee-utf8.h wee-util.c wee-util.h) # Check for flock support INCLUDE(CheckSymbolExists) diff --git a/src/core/Makefile.am b/src/core/Makefile.am index dd59ffe9b..aff3c408c 100644 --- a/src/core/Makefile.am +++ b/src/core/Makefile.am @@ -28,6 +28,8 @@ lib_weechat_core_a_SOURCES = weechat.c \ wee-config.h \ wee-config-file.c \ wee-config-file.h \ + wee-debug.c \ + wee-debug.h \ wee-hook.c \ wee-hook.h \ wee-input.c \ diff --git a/src/core/wee-command.c b/src/core/wee-command.c index cbe85cf82..cad279d1f 100644 --- a/src/core/wee-command.c +++ b/src/core/wee-command.c @@ -32,6 +32,7 @@ #include "wee-command.h" #include "wee-config.h" #include "wee-config-file.h" +#include "wee-debug.h" #include "wee-hook.h" #include "wee-input.h" #include "wee-log.h" @@ -376,97 +377,6 @@ command_builtin (void *data, struct t_gui_buffer *buffer, } /* - * command_debug_display_windows: display tree of windows - */ - -void -command_debug_display_windows (struct t_gui_window_tree *tree, int indent) -{ - char format[128]; - - if (tree) - { - if (tree->window) - { - /* leaf */ - snprintf (format, - sizeof (format), - "%%-%dsleaf: 0x%%X (parent:0x%%X), win=0x%%X, " - "child1=0x%%X, child2=0x%%X, %%d,%%d %%dx%%d, " - "%%d%%%%x%%d%%%%", - indent * 2); - gui_chat_printf (NULL, - format, - " ", tree, tree->parent_node, tree->window, - tree->child1, tree->child2, - tree->window->win_x, tree->window->win_y, - tree->window->win_width, tree->window->win_height, - tree->window->win_width_pct, - tree->window->win_height_pct); - } - else - { - /* node */ - snprintf (format, - sizeof (format), - "%%-%dsnode: 0x%%X (parent:0x%%X), win=0x%%X, " - "child1=0x%%X, child2=0x%%X)", - indent * 2); - gui_chat_printf (NULL, - format, - " ", tree, tree->parent_node, tree->window, - tree->child1, tree->child2); - } - - if (tree->child1) - command_debug_display_windows (tree->child1, indent + 1); - if (tree->child2) - command_debug_display_windows (tree->child2, indent + 1); - } -} - -/* - * command_debug: print debug messages - */ - -int -command_debug (void *data, struct t_gui_buffer *buffer, - int argc, char **argv, char **argv_eol) -{ - /* make C compiler happy */ - (void) data; - (void) argv_eol; - - if (argc >= 2) - { - if (string_strcasecmp (argv[1], "dump") == 0) - { - weechat_dump (0); - } - else if (string_strcasecmp (argv[1], "buffer") == 0) - { - gui_buffer_dump_hexa (buffer); - gui_chat_printf (NULL, - "DEBUG: buffer content written in WeeChat " - "log file"); - } - else if (string_strcasecmp (argv[1], "windows") == 0) - { - gui_chat_printf (NULL, ""); - gui_chat_printf (NULL, "DEBUG: windows tree:"); - command_debug_display_windows (gui_windows_tree, 1); - } - else - { - hook_signal_send ("debug", - WEECHAT_HOOK_SIGNAL_STRING, argv_eol[1]); - } - } - - return WEECHAT_RC_OK; -} - -/* * command_help: display help about commands */ @@ -1995,7 +1905,7 @@ command_init () " scroll 20 msgs up: /buffer scroll -20\n" " jump to #weechat: /buffer #weechat"), "clear|move|close|list|notify|scroll|set|%b|%c %b|%c", - command_buffer, NULL); + &command_buffer, NULL); hook_command (NULL, "builtin", N_("launch WeeChat builtin command (do not look at commands " "hooked)"), @@ -2003,32 +1913,20 @@ command_init () N_("command: command to execute (a '/' is automatically " "added if not found at beginning of command)"), "%w", - command_builtin, NULL); - hook_command (NULL, "debug", - N_("print debug messages"), - N_("dump | buffer | windows | text"), - 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"), - "dump|buffer|windows", - command_debug, NULL); + &command_builtin, NULL); hook_command (NULL, "help", N_("display help about commands"), N_("[command]"), N_("command: name of a WeeChat or IRC command"), "%w|%h", - command_help, NULL); + &command_help, NULL); hook_command (NULL, "history", N_("show buffer command history"), N_("[clear | value]"), N_("clear: clear history\n" "value: number of history entries to show"), "-clear", - command_history, NULL); + &command_history, NULL); hook_command (NULL, "key", N_("bind/unbind keys"), N_("[key [function/command]] [unbind key] [functions] " @@ -2042,7 +1940,7 @@ command_init () " reset: restore bindings to the default values and " "delete ALL personal bindings (use carefully!)"), "unbind|functions|call|reset %k", - command_key, NULL); + &command_key, NULL); hook_command (NULL, "plugin", N_("list/load/unload plugins"), N_("[list [name]] | [listfull [name]] | [load filename] | " @@ -2057,12 +1955,12 @@ command_init () " unload: unload one or all plugins\n\n" "Without argument, /plugin command lists loaded plugins."), "list|listfull|load|autoload|reload|unload %f|%p", - command_plugin, NULL); + &command_plugin, NULL); hook_command (NULL, "quit", N_("quit WeeChat"), "", "", "%q", - command_quit, NULL); + &command_quit, NULL); hook_command (NULL, "reload", N_("reload configuration files from disk"), N_("[file [file...]]"), @@ -2070,7 +1968,7 @@ command_init () "Without argument, all files (WeeChat and plugins) are " "reloaded."), "%C|%*", - command_reload, NULL); + &command_reload, NULL); hook_command (NULL, "save", N_("save configuration files to disk"), N_("[file [file...]]"), @@ -2078,7 +1976,7 @@ command_init () "Without argument, all files (WeeChat and plugins) are " "saved."), "%C|%*", - command_save, NULL); + &command_save, NULL); hook_command (NULL, "set", N_("set config options"), N_("[option [ = value]]"), @@ -2090,7 +1988,7 @@ command_init () "\"servername\" is an internal server name and \"xxx\" " "an option for this server."), "%o = %v", - command_set, NULL); + &command_set, NULL); hook_command (NULL, "setp", N_("set plugin config options"), N_("[option [ = value]]"), @@ -2099,7 +1997,7 @@ command_init () "Option is format: plugin.option, example: " "perl.myscript.item1"), "%O = %V", - command_setp, NULL); + &command_setp, NULL); hook_command (NULL, "upgrade", N_("upgrade WeeChat without disconnecting from servers"), N_("[path_to_binary]"), @@ -2109,13 +2007,13 @@ command_init () "have been compiled or installed with a package manager " "before running this command."), "%f", - command_upgrade, NULL); + &command_upgrade, NULL); hook_command (NULL, "uptime", N_("show WeeChat uptime"), N_("[-o]"), N_("-o: send uptime on current channel as an IRC message"), "-o", - command_uptime, NULL); + &command_uptime, NULL); hook_command (NULL, "window", N_("manage windows"), N_("[list | -1 | +1 | b# | up | down | left | right | " @@ -2141,7 +2039,7 @@ command_init () "window as size reference. For example 25 means create a " "new window with size = current_size / 4"), "list|-1|+1|up|down|left|right|splith|splitv|resize|merge all", - command_window, NULL); + &command_window, NULL); } /* @@ -2165,16 +2063,22 @@ command_print_stdout () HOOK_COMMAND(ptr_hook, command)); if (HOOK_COMMAND(ptr_hook, args) && HOOK_COMMAND(ptr_hook, args)[0]) + { string_iconv_fprintf (stdout, " %s\n\n", _(HOOK_COMMAND(ptr_hook, args))); + } else + { string_iconv_fprintf (stdout, "\n\n"); + } string_iconv_fprintf (stdout, "%s\n\n", _(HOOK_COMMAND(ptr_hook, description))); if (HOOK_COMMAND(ptr_hook, args_description) && HOOK_COMMAND(ptr_hook, args_description)[0]) + { string_iconv_fprintf (stdout, "%s\n\n", _(HOOK_COMMAND(ptr_hook, args_description))); + } } } } diff --git a/src/core/wee-debug.c b/src/core/wee-debug.c new file mode 100644 index 000000000..d10039849 --- /dev/null +++ b/src/core/wee-debug.c @@ -0,0 +1,211 @@ +/* + * Copyright (c) 2003-2008 by FlashCode <flashcode@flashtux.org> + * See README for License detail, AUTHORS for developers list. + * + * 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/>. + */ + +/* wee-debug.c: some debug functions for WeeChat */ + + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <stdlib.h> + +#include "weechat.h" +#include "wee-config-file.h" +#include "wee-log.h" +#include "wee-hook.h" +#include "../gui/gui-buffer.h" +#include "../gui/gui-chat.h" +#include "../gui/gui-hotlist.h" +#include "../gui/gui-window.h" +#include "../plugins/plugin.h" + + +int debug_dump_active = 0; + + +/* + * debug_dump: write dump to WeeChat log file + */ + +void +debug_dump (int crash) +{ + /* prevent reentrance */ + if (debug_dump_active) + exit (EXIT_FAILURE); + + if (crash) + { + debug_dump_active = 1; + log_printf ("Very bad, WeeChat is crashing (SIGSEGV received)..."); + } + + log_printf (""); + if (crash) + { + log_printf ("****** WeeChat CRASH DUMP ******"); + log_printf ("****** Please send this file to WeeChat developers ******"); + log_printf ("****** and explain when this crash happened ******"); + } + else + { + log_printf ("****** WeeChat dump request ******"); + } + + gui_window_print_log (); + gui_buffer_print_log (); + gui_hotlist_print_log (); + + hook_print_log (); + + config_file_print_log (); + + plugin_print_log (); + + log_printf (""); + log_printf ("****** End of WeeChat dump ******"); + log_printf (""); +} + +/* + * debug_dump_cb: callback for "debug_dump" signal hooked + */ + +int +debug_dump_cb (void *data, char *signal, char *type_data, void *signal_data) +{ + /* make C compiler happy */ + (void) data; + (void) signal; + (void) type_data; + (void) signal_data; + + debug_dump (0); + + return WEECHAT_RC_OK; +} + +/* + * debug_buffer_cb: callback for "debug_buffer" signal hooked + */ + +int +debug_buffer_cb (void *data, char *signal, char *type_data, void *signal_data) +{ + /* make C compiler happy */ + (void) data; + (void) signal; + (void) type_data; + + gui_buffer_dump_hexa ((struct t_gui_buffer *)signal_data); + + return WEECHAT_RC_OK; +} + +/* + * debug_windows_tree_display: display tree of windows + */ + +void +debug_windows_tree_display (struct t_gui_window_tree *tree, int indent) +{ + char format[128]; + + if (tree) + { + if (tree->window) + { + /* leaf */ + snprintf (format, + sizeof (format), + "%%-%dsleaf: 0x%%X (parent:0x%%X), win=0x%%X, " + "child1=0x%%X, child2=0x%%X, %%d,%%d %%dx%%d, " + "%%d%%%%x%%d%%%%", + indent * 2); + gui_chat_printf (NULL, + format, + " ", tree, tree->parent_node, tree->window, + tree->child1, tree->child2, + tree->window->win_x, tree->window->win_y, + tree->window->win_width, tree->window->win_height, + tree->window->win_width_pct, + tree->window->win_height_pct); + } + else + { + /* node */ + snprintf (format, + sizeof (format), + "%%-%dsnode: 0x%%X (parent:0x%%X), win=0x%%X, " + "child1=0x%%X, child2=0x%%X)", + indent * 2); + gui_chat_printf (NULL, + format, + " ", tree, tree->parent_node, tree->window, + tree->child1, tree->child2); + } + + if (tree->child1) + debug_windows_tree_display (tree->child1, indent + 1); + if (tree->child2) + debug_windows_tree_display (tree->child2, indent + 1); + } +} + +/* + * debug_windows_tree_display: display tree of windows + */ + +void +debug_windows_tree () +{ + gui_chat_printf (NULL, ""); + gui_chat_printf (NULL, "DEBUG: windows tree:"); + debug_windows_tree_display (gui_windows_tree, 1); +} + +/* + * debug_windows_cb: callback for "debug_windows" signal hooked + */ + +int +debug_windows_cb (void *data, char *signal, char *type_data, void *signal_data) +{ + /* make C compiler happy */ + (void) data; + (void) signal; + (void) type_data; + (void) signal_data; + + debug_windows_tree (); + + return WEECHAT_RC_OK; +} + +/* + * debug_init: hook signals for debug + */ + +void +debug_init () +{ + hook_signal (NULL, "debug_dump", debug_dump_cb, NULL); + hook_signal (NULL, "debug_buffer", debug_buffer_cb, NULL); + hook_signal (NULL, "debug_windows", debug_windows_cb, NULL); +} diff --git a/src/core/wee-debug.h b/src/core/wee-debug.h new file mode 100644 index 000000000..2878ccb1d --- /dev/null +++ b/src/core/wee-debug.h @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2003-2008 by FlashCode <flashcode@flashtux.org> + * See README for License detail, AUTHORS for developers list. + * + * 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/>. + */ + + +#ifndef __WEECHAT_DEBUG_H +#define __WEECHAT_DEBUG_H 1 + +struct t_gui_window_tree; + +extern void debug_dump (int crash); +extern void debug_init (); + +#endif /* wee-debug.h */ diff --git a/src/core/weechat.c b/src/core/weechat.c index 4ee1284e2..bf115989b 100644 --- a/src/core/weechat.c +++ b/src/core/weechat.c @@ -1,18 +1,18 @@ -/* ############################################################################ - * ### ___ __ ______________ _____ ### - * ### __ | / /___________ ____/__ /_______ __ /_ ### - * ### __ | /| / /_ _ \ _ \ / __ __ \ __ `/ __/ ### - * ### __ |/ |/ / / __/ __/ /___ _ / / / /_/ // /_ ### - * ### ____/|__/ \___/\___/\____/ /_/ /_/\__,_/ \__/ ### - * ### ### - * ### WeeChat - Wee Enhanced Environment for Chat ### - * ### Fast & light environment for Chat ### - * ### ### - * ### By FlashCode <flashcode@flashtux.org> ### - * ### ### - * ### http://weechat.flashtux.org ### - * ### ### - * ############################################################################ +/* ########################################################################## + * ## ___ __ ______________ _____ ## + * ## __ | / /___________ ____/__ /_______ __ /_ ## + * ## __ | /| / /_ _ \ _ \ / __ __ \ __ `/ __/ ## + * ## __ |/ |/ / / __/ __/ /___ _ / / / /_/ // /_ ## + * ## ____/|__/ \___/\___/\____/ /_/ /_/\__,_/ \__/ ## + * ## ## + * ## WeeChat - Wee Enhanced Environment for Chat ## + * ## Fast, light, extensible chat client ## + * ## ## + * ## By FlashCode <flashcode@flashtux.org> ## + * ## ## + * ## http://weechat.flashtux.org ## + * ## ## + * ########################################################################## * * Copyright (c) 2003-2008 by FlashCode <flashcode@flashtux.org> * See README for License detail, AUTHORS for developers list. @@ -54,19 +54,16 @@ #include "wee-backtrace.h" #include "wee-command.h" #include "wee-config.h" +#include "wee-debug.h" #include "wee-hook.h" #include "wee-log.h" -#include "wee-upgrade.h" #include "wee-string.h" #include "wee-utf8.h" #include "wee-util.h" -#include "../gui/gui-buffer.h" #include "../gui/gui-chat.h" #include "../gui/gui-color.h" -#include "../gui/gui-hotlist.h" #include "../gui/gui-main.h" #include "../gui/gui-keyboard.h" -#include "../gui/gui-window.h" #include "../plugins/plugin.h" @@ -483,52 +480,6 @@ weechat_shutdown (int return_code, int crash) } /* - * weechat_dump: write dump to WeeChat log file - */ - -void -weechat_dump (int crash) -{ - /* prevent reentrance */ - if (sigsegv) - exit (EXIT_FAILURE); - - if (crash) - { - sigsegv = 1; - log_printf ("Very bad, WeeChat is crashing (SIGSEGV received)..."); - } - - log_printf (""); - if (crash) - { - log_printf ("****** WeeChat CRASH DUMP ******"); - log_printf ("****** Please send this file to WeeChat developers ******"); - log_printf ("****** and explain when this crash happened ******"); - } - else - { - log_printf ("****** WeeChat dump request ******"); - } - - gui_window_print_log (); - gui_buffer_print_log (); - gui_hotlist_print_log (); - - hook_print_log (); - - config_file_print_log (); - - plugin_print_log (); - - hook_signal_send ("dump_data", WEECHAT_HOOK_SIGNAL_STRING, NULL); - - log_printf (""); - log_printf ("****** End of WeeChat dump ******"); - log_printf (""); -} - -/* * weechat_sigsegv: SIGSEGV handler: save crash log to * <weechat_home>/weechat.log and exit */ @@ -536,7 +487,7 @@ weechat_dump (int crash) void weechat_sigsegv () { - weechat_dump (1); + debug_dump (1); unhook_all (); gui_main_end (); @@ -588,6 +539,7 @@ main (int argc, char *argv[]) util_catch_signal (SIGSEGV, &weechat_sigsegv); /* crash dump for SIGSEGV signal */ hook_init (); /* initialize hooks */ + debug_init (); /* hook signals for debug */ gui_main_pre_init (&argc, &argv); /* pre-initiliaze interface */ weechat_init_vars (); /* initialize some variables */ command_init (); /* initialize WeeChat commands */ diff --git a/src/gui/curses/Makefile.am b/src/gui/curses/Makefile.am index 6388b2982..614295899 100644 --- a/src/gui/curses/Makefile.am +++ b/src/gui/curses/Makefile.am @@ -23,6 +23,7 @@ weechat_curses_LDADD = ../../core/weechat.o \ ../../core/wee-command.o \ ../../core/wee-config.o \ ../../core/wee-config-file.o \ + ../../core/wee-debug.o \ ../../core/wee-hook.o \ ../../core/wee-input.o \ ../../core/wee-list.o \ diff --git a/src/gui/gtk/Makefile.am b/src/gui/gtk/Makefile.am index 246d60762..6d58071c3 100644 --- a/src/gui/gtk/Makefile.am +++ b/src/gui/gtk/Makefile.am @@ -23,6 +23,7 @@ weechat_gtk_LDADD = ../../core/weechat.o \ ../../core/wee-command.o \ ../../core/wee-config.o \ ../../core/wee-config-file.o \ + ../../core/wee-debug.o \ ../../core/wee-hook.o \ ../../core/wee-input.o \ ../../core/wee-list.o \ diff --git a/src/plugins/CMakeLists.txt b/src/plugins/CMakeLists.txt index b8118f19c..dd04d0006 100644 --- a/src/plugins/CMakeLists.txt +++ b/src/plugins/CMakeLists.txt @@ -25,10 +25,6 @@ INCLUDE(CheckIncludeFiles) INCLUDE(CheckFunctionExists) INCLUDE(CheckLibraryExists) -IF(NOT DISABLE_IRC) - ADD_SUBDIRECTORY( irc ) -ENDIF(NOT DISABLE_IRC) - IF(NOT DISABLE_ALIAS) ADD_SUBDIRECTORY( alias ) ENDIF(NOT DISABLE_ALIAS) @@ -52,18 +48,26 @@ 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) +IF(NOT DISABLE_IRC) + ADD_SUBDIRECTORY( irc ) +ENDIF(NOT DISABLE_IRC) + IF(NOT DISABLE_LOGGER) ADD_SUBDIRECTORY( logger ) ENDIF(NOT DISABLE_LOGGER) -IF(NOT DISABLE_TRIGGER) - ADD_SUBDIRECTORY( trigger ) -ENDIF(NOT DISABLE_TRIGGER) - IF(NOT DISABLE_SCRIPTS AND NOT DISABLE_PERL AND NOT DISABLE_PYTHON AND NOT DISABLE_RUBY AND NOT DISABLE_LUA) ADD_SUBDIRECTORY( scripts ) ENDIF(NOT DISABLE_SCRIPTS AND NOT DISABLE_PERL AND NOT DISABLE_PYTHON AND NOT DISABLE_RUBY AND NOT DISABLE_LUA) + +IF(NOT DISABLE_TRIGGER) + ADD_SUBDIRECTORY( trigger ) +ENDIF(NOT DISABLE_TRIGGER) diff --git a/src/plugins/Makefile.am b/src/plugins/Makefile.am index ff2ca74fc..ce6fdd4b9 100644 --- a/src/plugins/Makefile.am +++ b/src/plugins/Makefile.am @@ -19,7 +19,7 @@ INCLUDES = -DLOCALEDIR=\"$(datadir)/locale\" noinst_LIBRARIES = lib_weechat_plugins.a lib_weechat_plugins_a_SOURCES = weechat-plugin.h \ - plugin.c \ + plugin.c \ plugin.h \ plugin-api.c \ plugin-api.h \ @@ -28,10 +28,6 @@ lib_weechat_plugins_a_SOURCES = weechat-plugin.h \ plugin-infolist.c \ plugin-infolist.h -if PLUGIN_IRC -irc_dir = irc -endif - if PLUGIN_ALIAS alias_dir = alias endif @@ -44,16 +40,24 @@ if PLUGIN_CHARSET charset_dir = charset endif +if PLUGIN_DEBUG +debug_dir = debug +endif + +if PLUGIN_DEMO +demo_dir = demo +endif + if PLUGIN_FIFO fifo_dir = fifo endif -if PLUGIN_LOGGER -logger_dir = logger +if PLUGIN_IRC +irc_dir = irc endif -if PLUGIN_TRIGGER -trigger_dir = trigger +if PLUGIN_LOGGER +logger_dir = logger endif if PLUGIN_PERL @@ -72,9 +76,10 @@ if PLUGIN_LUA script_dir = scripts endif -if PLUGIN_DEMO -demo_dir = demo +if PLUGIN_TRIGGER +trigger_dir = trigger endif -SUBDIRS = . $(irc_dir) $(alias_dir) $(aspell_dir) $(charset_dir) $(fifo_dir) \ - $(logger_dir) $(trigger_dir) $(demo_dir) $(script_dir) +SUBDIRS = . $(alias_dir) $(aspell_dir) $(charset_dir) $(debug_dir) \ + $(demo_dir) $(fifo_dir) $(irc_dir) $(logger_dir) $(script_dir) \ + $(trigger_dir) diff --git a/src/plugins/debug/CMakeLists.txt b/src/plugins/debug/CMakeLists.txt new file mode 100644 index 000000000..7fb9a4e2f --- /dev/null +++ b/src/plugins/debug/CMakeLists.txt @@ -0,0 +1,22 @@ +# 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) diff --git a/src/plugins/debug/Makefile.am b/src/plugins/debug/Makefile.am new file mode 100644 index 000000000..4728f05d1 --- /dev/null +++ b/src/plugins/debug/Makefile.am @@ -0,0 +1,25 @@ +# 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) diff --git a/src/plugins/debug/debug.c b/src/plugins/debug/debug.c new file mode 100644 index 000000000..608a6ae79 --- /dev/null +++ b/src/plugins/debug/debug.c @@ -0,0 +1,123 @@ +/* + * Copyright (c) 2003-2008 by FlashCode <flashcode@flashtux.org> + * See README for License detail, AUTHORS for developers list. + * + * 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/>. + */ + +/* debug.c: Debug plugin for WeeChat */ + + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include <stdlib.h> +#include <string.h> + +#include "../weechat-plugin.h" + + +WEECHAT_PLUGIN_NAME("debug"); +WEECHAT_PLUGIN_DESCRIPTION("Debug plugin for WeeChat"); +WEECHAT_PLUGIN_AUTHOR("FlashCode <flashcode@flashtux.org>"); +WEECHAT_PLUGIN_VERSION("0.1"); +WEECHAT_PLUGIN_LICENSE("GPL"); + +struct t_weechat_plugin *weechat_debug_plugin = NULL; +#define weechat_plugin weechat_debug_plugin + + +/* + * debug_command_cb: callback for /debug command + */ + +int +debug_command_cb (void *data, struct t_gui_buffer *buffer, int argc, + char **argv, char **argv_eol) +{ + /* make C compiler happy */ + (void) data; + (void) buffer; + + if (argc >= 2) + { + if (weechat_strcasecmp (argv[1], "dump") == 0) + { + weechat_hook_signal_send ("debug_dump", + WEECHAT_HOOK_SIGNAL_STRING, NULL); + //debug_dump (0); + } + else if (weechat_strcasecmp (argv[1], "buffer") == 0) + { + weechat_hook_signal_send ("debug_buffer", + WEECHAT_HOOK_SIGNAL_POINTER, buffer); + /*gui_buffer_dump_hexa (buffer); + gui_chat_printf (NULL, + "DEBUG: buffer content written in WeeChat " + "log file"); + */ + } + else if (weechat_strcasecmp (argv[1], "windows") == 0) + { + weechat_hook_signal_send ("debug_windows", + WEECHAT_HOOK_SIGNAL_STRING, NULL); + } + else + { + weechat_hook_signal_send ("debug", + WEECHAT_HOOK_SIGNAL_STRING, argv_eol[1]); + } + } + + return WEECHAT_RC_OK; +} + +/* + * weechat_plugin_init: initialize debug plugin + */ + +int +weechat_plugin_init (struct t_weechat_plugin *plugin) +{ + weechat_plugin = plugin; + + weechat_hook_command ("debug", + N_("print debug messages"), + N_("dump | buffer | windows | text"), + 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"), + "dump|buffer|windows", + &debug_command_cb, NULL); + + return WEECHAT_RC_OK; +} + +/* + * weechat_plugin_end: end debug plugin + */ + +int +weechat_plugin_end (struct t_weechat_plugin *plugin) +{ + /* make C compiler happy */ + (void) plugin; + + return WEECHAT_RC_OK; +} diff --git a/src/plugins/irc/irc.c b/src/plugins/irc/irc.c index 5d7323a3d..5181fff73 100644 --- a/src/plugins/irc/irc.c +++ b/src/plugins/irc/irc.c @@ -60,12 +60,38 @@ gnutls_certificate_credentials gnutls_xcred; /* gnutls client credentials */ /* - * irc_signal_dump_data_cb: dump IRC data in WeeChat log file + * irc_signal_debug_cb: callback for "debug" signal */ int -irc_signal_dump_data_cb (void *data, char *signal, char *type_data, - void *signal_data) +irc_signal_debug_cb (void *data, char *signal, 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") == 0) + irc_debug ^= 1; + } + + if (irc_debug) + weechat_printf (NULL, _("%s: debug enabled"), "irc"); + else + weechat_printf (NULL, _("%s: debug disabled"), "irc"); + + return WEECHAT_RC_OK; +} + +/* + * irc_signal_debug_dump_cb: dump IRC data in WeeChat log file + */ + +int +irc_signal_debug_dump_cb (void *data, char *signal, char *type_data, + void *signal_data) { /* make C compiler happy */ (void) data; @@ -140,27 +166,6 @@ irc_signal_quit_cb (void *data, char *signal, char *type_data, } /* - * irc_signal_debug_cb: callback for "debug" signal - */ - -int -irc_signal_debug_cb (void *data, char *signal, 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") == 0) - irc_debug ^= 1; - } - - return WEECHAT_RC_OK; -} - -/* * weechat_plugin_init: initialize IRC plugin */ @@ -187,9 +192,9 @@ weechat_plugin_init (struct t_weechat_plugin *plugin) irc_command_init (); /* hook some signals */ - weechat_hook_signal ("dump_data", &irc_signal_dump_data_cb, NULL); - weechat_hook_signal ("quit", &irc_signal_quit_cb, NULL); weechat_hook_signal ("debug", &irc_signal_debug_cb, NULL); + weechat_hook_signal ("debug_dump", &irc_signal_debug_dump_cb, NULL); + weechat_hook_signal ("quit", &irc_signal_quit_cb, NULL); /* hook completions */ irc_completion_init (); diff --git a/src/plugins/scripts/lua/weechat-lua.c b/src/plugins/scripts/lua/weechat-lua.c index 8df2f8415..751e3ff9b 100644 --- a/src/plugins/scripts/lua/weechat-lua.c +++ b/src/plugins/scripts/lua/weechat-lua.c @@ -417,12 +417,12 @@ weechat_lua_completion_cb (void *data, char *completion, } /* - * weechat_lua_dump_data_cb: dump Lua plugin data in WeeChat log file + * weechat_lua_debug_dump_cb: dump Lua plugin data in WeeChat log file */ int -weechat_lua_dump_data_cb (void *data, char *signal, char *type_data, - void *signal_data) +weechat_lua_debug_dump_cb (void *data, char *signal, char *type_data, + void *signal_data) { /* make C compiler happy */ (void) data; @@ -448,7 +448,7 @@ weechat_plugin_init (struct t_weechat_plugin *plugin) script_init (weechat_lua_plugin, &weechat_lua_command_cb, &weechat_lua_completion_cb, - &weechat_lua_dump_data_cb, + &weechat_lua_debug_dump_cb, &weechat_lua_load_cb); /* init ok */ diff --git a/src/plugins/scripts/perl/weechat-perl.c b/src/plugins/scripts/perl/weechat-perl.c index 776e8d265..48874363a 100644 --- a/src/plugins/scripts/perl/weechat-perl.c +++ b/src/plugins/scripts/perl/weechat-perl.c @@ -554,12 +554,12 @@ weechat_perl_completion_cb (void *data, char *completion, } /* - * weechat_perl_dump_data_cb: dump Perl plugin data in WeeChat log file + * weechat_perl_debug_dump_cb: dump Perl plugin data in WeeChat log file */ int -weechat_perl_dump_data_cb (void *data, char *signal, char *type_data, - void *signal_data) +weechat_perl_debug_dump_cb (void *data, char *signal, char *type_data, + void *signal_data) { /* make C compiler happy */ (void) data; @@ -602,7 +602,7 @@ weechat_plugin_init (struct t_weechat_plugin *plugin) script_init (weechat_perl_plugin, &weechat_perl_command_cb, &weechat_perl_completion_cb, - &weechat_perl_dump_data_cb, + &weechat_perl_debug_dump_cb, &weechat_perl_load_cb); /* init ok */ diff --git a/src/plugins/scripts/python/weechat-python.c b/src/plugins/scripts/python/weechat-python.c index 51236028f..b117cb9e2 100644 --- a/src/plugins/scripts/python/weechat-python.c +++ b/src/plugins/scripts/python/weechat-python.c @@ -581,12 +581,12 @@ weechat_python_completion_cb (void *data, char *completion, } /* - * weechat_python_dump_data_cb: dump Python plugin data in WeeChat log file + * weechat_python_debug_dump_cb: dump Python plugin data in WeeChat log file */ int -weechat_python_dump_data_cb (void *data, char *signal, char *type_data, - void *signal_data) +weechat_python_debug_dump_cb (void *data, char *signal, char *type_data, + void *signal_data) { /* make C compiler happy */ (void) data; @@ -638,7 +638,7 @@ weechat_plugin_init (struct t_weechat_plugin *plugin) script_init (weechat_python_plugin, &weechat_python_command_cb, &weechat_python_completion_cb, - &weechat_python_dump_data_cb, + &weechat_python_debug_dump_cb, &weechat_python_load_cb); /* init ok */ diff --git a/src/plugins/scripts/ruby/weechat-ruby.c b/src/plugins/scripts/ruby/weechat-ruby.c index 9ec073931..de69dd58d 100644 --- a/src/plugins/scripts/ruby/weechat-ruby.c +++ b/src/plugins/scripts/ruby/weechat-ruby.c @@ -582,12 +582,12 @@ weechat_ruby_completion_cb (void *data, char *completion, } /* - * weechat_ruby_dump_data_cb: dump Ruby plugin data in WeeChat log file + * weechat_ruby_debug_dump_cb: dump Ruby plugin data in WeeChat log file */ int -weechat_ruby_dump_data_cb (void *data, char *signal, char *type_data, - void *signal_data) +weechat_ruby_debug_dump_cb (void *data, char *signal, char *type_data, + void *signal_data) { /* make C compiler happy */ (void) data; @@ -690,7 +690,7 @@ weechat_plugin_init (struct t_weechat_plugin *plugin) script_init (weechat_ruby_plugin, &weechat_ruby_command_cb, &weechat_ruby_completion_cb, - &weechat_ruby_dump_data_cb, + &weechat_ruby_debug_dump_cb, &weechat_ruby_load_cb); /* init ok */ diff --git a/src/plugins/scripts/script.c b/src/plugins/scripts/script.c index b1f918f36..242132e7a 100644 --- a/src/plugins/scripts/script.c +++ b/src/plugins/scripts/script.c @@ -88,9 +88,9 @@ script_init (struct t_weechat_plugin *weechat_plugin, int (*callback_completion)(void *data, char *completion, struct t_gui_buffer *buffer, struct t_weelist *list), - int (*callback_signal_dump)(void *data, char *signal, - char *type_data, - void *signal_data), + int (*callback_signal_debug_dump)(void *data, char *signal, + char *type_data, + void *signal_data), int (*callback_load_file)(void *data, char *filename)) { char *string, *completion = "list|listfull|load|autoload|reload|unload %f"; @@ -154,8 +154,8 @@ script_init (struct t_weechat_plugin *weechat_plugin, free (string); } - /* add signal for "dump_data" */ - weechat_hook_signal ("dump_data", callback_signal_dump, NULL); + /* add signal for "debug_dump" */ + weechat_hook_signal ("debug_dump", callback_signal_debug_dump, NULL); /* autoload scripts */ script_auto_load (weechat_plugin, callback_load_file); diff --git a/src/plugins/scripts/script.h b/src/plugins/scripts/script.h index badc16c6f..7f4ac248f 100644 --- a/src/plugins/scripts/script.h +++ b/src/plugins/scripts/script.h @@ -64,9 +64,10 @@ extern void script_init (struct t_weechat_plugin *weechat_plugin, int (*callback_completion)(void *data, char *completion, struct t_gui_buffer *buffer, struct t_weelist *list), - int (*callback_signal_dump)(void *data, char *signal, - char *type_data, - void *signal_data), + int (*callback_signal_debug_dump)(void *data, + char *signal, + char *type_data, + void *signal_data), int (*callback_load_file)(void *data, char *filename)); extern char *script_ptr2str (void *pointer); extern void *script_str2ptr (char *pointer_str); |