Add of "modifier" hook, migration of charset plugin to new API, SIGHUP signal catched (reload all config files), better config files reloading

v2.8-utf8proc
Sebastien Helleu 2008-01-24 16:50:20 +01:00
parent 25c5bc6421
commit ed26a0389c
48 changed files with 2335 additions and 1113 deletions

View File

@ -1,7 +1,7 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
ChangeLog - 2008-01-01
ChangeLog - 2008-01-24
Version 0.2.7 (under dev!):
@ -9,9 +9,10 @@ Version 0.2.7 (under dev!):
* added backlog option in logger plugin
* improved main loop: higher timout in select(), less CPU usage
* added /reload command to reload WeeChat and plugins config files
(signal SIGHUP is catched to reload config files)
* new plugins: IRC, alias, demo, fifo, logger, trigger
* added hooks: command, timer, file descriptor, print, signal, config,
completion
completion, modifier
* new plugin API with many new functions: hooks, buffer management,
config files, lists
* new display engine, with prefix and message for each line

View File

@ -80,6 +80,7 @@
./src/plugins/aspell/aspell.c
./src/plugins/aspell/aspell.h
./src/plugins/charset/charset.c
./src/plugins/charset/charset.h
./src/plugins/demo/demo.c
./src/plugins/fifo/fifo.c
./src/plugins/irc/irc-buffer.c

150
po/cs.po
View File

@ -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-01-19 17:18+0100\n"
"POT-Creation-Date: 2008-01-24 16:42+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"
@ -218,7 +218,7 @@ msgid "Key:"
msgstr "Klávesa: \n"
#, fuzzy
msgid "No key found."
msgid "No key found"
msgstr "Žádná klávesa nenalezena.\n"
#, fuzzy, c-format
@ -305,7 +305,11 @@ msgid " completions hooked:"
msgstr " obsluhovače příkazu:\n"
#, fuzzy
msgid "No plugin found."
msgid " modifiers hooked:"
msgstr " obsluhovače časovače:\n"
#, fuzzy
msgid "No plugin found"
msgstr "Nebyl nalezen žádný plugin\n"
#, fuzzy
@ -321,35 +325,19 @@ msgid "%sError: wrong argument count for \"%s\" command"
msgstr "%s špatný počet parametrů pro příkaz \"%s\"\n"
#, fuzzy, c-format
msgid "%sWeeChat configuration file reloaded"
msgstr "Konfigurační soubor uložen\n"
#, fuzzy, c-format
msgid "%sError: failed to reload WeeChat configuration file"
msgstr "%s selhalo uložení konfiguračního souboru\n"
#, fuzzy, c-format
msgid "%sPlugins options reloaded"
msgid "%sOptions reloaded from %s"
msgstr "Možnosti pluginů uloženy\n"
#, fuzzy, c-format
msgid "%sError: failed to reload plugins options"
msgid "%sError: failed to reload options from %s"
msgstr "%s selhalo uložení nastavení pluginů\n"
#, fuzzy, c-format
msgid "%sWeeChat configuration file saved"
msgstr "Konfigurační soubor uložen\n"
#, fuzzy, c-format
msgid "%sError: failed to save WeeChat configuration file"
msgstr "%s selhalo uložení konfiguračního souboru\n"
#, fuzzy, c-format
msgid "%sPlugins options saved"
msgid "%sOptions saved to %s"
msgstr "Možnosti pluginů uloženy\n"
#, fuzzy, c-format
msgid "%sError: failed to save plugins options"
msgid "%sError: failed to save options to %s"
msgstr "%s selhalo uložení nastavení pluginů\n"
msgid "(unknown)"
@ -439,7 +427,7 @@ msgstr "konec /who seznamu"
#, fuzzy, c-format
msgid ""
"%sError: can not merge windows, there's no other window with same size near "
"current one."
"current one"
msgstr ""
"%s nemohu spojit okna, není zde další okno se stejnou velikostí poblíž "
"aktuálního okna.\n"
@ -1308,8 +1296,8 @@ msgid ""
"\".dll\" under Microsoft Windows)"
msgstr ""
#, fuzzy
msgid "Saving WeeChat configuration to disk"
#, fuzzy, c-format
msgid "Saving WeeChat configuration to disk (%s)"
msgstr "Ukládám konfiguraci na disk\n"
#, fuzzy, c-format
@ -1672,14 +1660,6 @@ msgstr "%s nedostatek paměti pro klávesovou zkratku\n"
msgid "%s%s: error, circular reference when calling alias \"%s\""
msgstr "%s cyklický odkaz při volání aliasu \"/%s\"\n"
#, fuzzy, c-format
msgid "%s%s: configuration file reloaded"
msgstr "Konfigurační soubor uložen\n"
#, fuzzy, c-format
msgid "%s%s: failed to reload configuration file"
msgstr "%s selhalo uložení konfiguračního souboru\n"
#, fuzzy, c-format
msgid "%s%s: error creating alias \"%s\" => \"%s\""
msgstr "%s nedostatek paměti pro infobar zprávu\n"
@ -1748,6 +1728,70 @@ msgstr "jméno_aliasu"
msgid "alias_name: name of alias to remove"
msgstr "jméno_aliasu: jméno aliasu pro odebrání"
#, fuzzy, c-format
msgid "%s%s: error creating charset \"%s\" => \"%s\""
msgstr "%s nedostatek paměti pro infobar zprávu\n"
#, fuzzy, c-format
msgid "%sCharset \"%s\" => \"%s\""
msgstr "Alias \"%s\" => \"%s\" vytvořen\n"
#, fuzzy, c-format
msgid "%s%s: charset \"%s\" not found"
msgstr "%s server \"%s\" nenalezen\n"
#, fuzzy, c-format
msgid "%sCharset \"%s\" removed"
msgstr "Alias \"%s\" odebrán\n"
#, fuzzy
msgid "List of charsets:"
msgstr "Seznam pro aliasy:\n"
#, fuzzy, c-format
msgid "List of charsets with \"%s\":"
msgstr "Seznam pro aliasy:\n"
#, fuzzy
msgid "No charset found"
msgstr "Žádná klávesa nenalezena.\n"
#, fuzzy
msgid "No charset defined"
msgstr "Žádné aliasy nejsou definovány.\n"
#, fuzzy, c-format
msgid "%s%s: terminal: %s, internal: %s"
msgstr "%s plugin \"%s\" nenalezen\n"
#, fuzzy, c-format
msgid "%s%s: error creating configuration file \"%s\""
msgstr "říct serveru, aby znovu načetl svůj konfigurační soubor"
#, fuzzy
msgid "manage charsets"
msgstr "řídit buffery"
msgid "[[type.]plugin.string [= charset]]"
msgstr ""
msgid ""
" type: \"decode\" or \"encode\" (if type is omitted, then both \"decode\" "
"and \"encode\" are set)\n"
" plugin: plugin name\n"
" string: string specific to plugin (for example a server name or server."
"channel for IRC plugin)\n"
"charset: charset to use (if empty, then charset is removed)\n"
"\n"
"Examples :\n"
"/charset decode iso-8859-15 => set global decode charset to iso-8859-15\n"
"/charset encode iso-8859-15 => set global encode charset to iso-8859-15\n"
"/charset decode.irc.freenode => set decode charset to iso-8859-15 for IRC "
"server \"freenode\" (all channels)\n"
"/charset decode.irc.freenode.#weechat => set decode charset to iso-8859-15 "
"for IRC channel \"#weechat\" on server \"freenode\""
msgstr ""
msgid "demo message without prefix"
msgstr ""
@ -2775,6 +2819,12 @@ msgstr ""
msgid "%sirc: too few arguments for \"%s\" command"
msgstr "%s špatné parametry pro příkaz \"%s\"\n"
#, c-format
msgid ""
"%s%s: warning: server \"%s\" not found in configuration file, not deleted in "
"memory because it's currently used"
msgstr ""
#, fuzzy, c-format
msgid "%s%s: value \"%s\" is invalid for option \"%s\""
msgstr "%s %s, řádek %d: nevalidní volba \"%s\"\n"
@ -3021,12 +3071,6 @@ msgstr ""
"(formát: #kanál:1,..), jméno serveru '*' je rezervováno pro defaultní "
"hodnotu levelu upozornění"
#, c-format
msgid ""
"%s%s: warning: server \"%s\" not found in configuration file. It has not "
"been deleted because it's used now."
msgstr ""
msgid "Waiting"
msgstr "Čekám"
@ -3911,7 +3955,7 @@ msgid "%s%s: no command to execute"
msgstr "%s Žádný příkaz pro provedení!\n"
#, fuzzy, c-format
msgid "%s%s: unknown command: cmd=\"%s\", host=\"%s\", args=\"%s\""
msgid "%s%s: unknown command: cmd=\"%s\", host=\"%s\", arguments=\"%s\""
msgstr "%s Neznámý příkaz: příkaz=\"%s\", host=\"%s\", parametry=\"%s\"\n"
#, fuzzy, c-format
@ -4292,6 +4336,30 @@ msgstr ""
msgid "%s%s: wrong arguments for function \"%s\""
msgstr "%s špatné parametry pro příkaz \"%s\"\n"
#, fuzzy
#~ msgid "%sWeeChat configuration file reloaded"
#~ msgstr "Konfigurační soubor uložen\n"
#, fuzzy
#~ msgid "%sError: failed to reload WeeChat configuration file"
#~ msgstr "%s selhalo uložení konfiguračního souboru\n"
#, fuzzy
#~ msgid "%sWeeChat configuration file saved"
#~ msgstr "Konfigurační soubor uložen\n"
#, fuzzy
#~ msgid "%sError: failed to save WeeChat configuration file"
#~ msgstr "%s selhalo uložení konfiguračního souboru\n"
#, fuzzy
#~ msgid "%s%s: configuration file reloaded"
#~ msgstr "Konfigurační soubor uložen\n"
#, fuzzy
#~ msgid "%s%s: failed to reload configuration file"
#~ msgstr "%s selhalo uložení konfiguračního souboru\n"
#, fuzzy
#~ msgid "clear buffer(s)"
#~ msgstr " [C] Vyčistit buffer"

150
po/de.po
View File

@ -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-01-19 17:18+0100\n"
"POT-Creation-Date: 2008-01-24 16:42+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"
@ -224,7 +224,7 @@ msgid "Key:"
msgstr "Taste:\n"
#, fuzzy
msgid "No key found."
msgid "No key found"
msgstr "Keine Taste gefunden.\n"
#, fuzzy, c-format
@ -311,7 +311,11 @@ msgid " completions hooked:"
msgstr " Befehls-Handler:\n"
#, fuzzy
msgid "No plugin found."
msgid " modifiers hooked:"
msgstr " Timer-Handler:\n"
#, fuzzy
msgid "No plugin found"
msgstr "Kein Plugin gefunden.\n"
#, fuzzy
@ -327,35 +331,19 @@ msgid "%sError: wrong argument count for \"%s\" command"
msgstr "%s fehlerhafte Anzahl von Argumenten für der \"%s\"-Befehl\n"
#, fuzzy, c-format
msgid "%sWeeChat configuration file reloaded"
msgstr "Konfigurationsdatei gesichert\n"
#, fuzzy, c-format
msgid "%sError: failed to reload WeeChat configuration file"
msgstr "%s konnte die Konfigurationsdatei nicht sichern\n"
#, fuzzy, c-format
msgid "%sPlugins options reloaded"
msgid "%sOptions reloaded from %s"
msgstr "Plugin-Optionen gesichert\n"
#, fuzzy, c-format
msgid "%sError: failed to reload plugins options"
msgid "%sError: failed to reload options from %s"
msgstr "%s konnte die Plugin-Konfigurationsdatei nicht sichern\n"
#, fuzzy, c-format
msgid "%sWeeChat configuration file saved"
msgstr "Konfigurationsdatei gesichert\n"
#, fuzzy, c-format
msgid "%sError: failed to save WeeChat configuration file"
msgstr "%s konnte die Konfigurationsdatei nicht sichern\n"
#, fuzzy, c-format
msgid "%sPlugins options saved"
msgid "%sOptions saved to %s"
msgstr "Plugin-Optionen gesichert\n"
#, fuzzy, c-format
msgid "%sError: failed to save plugins options"
msgid "%sError: failed to save options to %s"
msgstr "%s konnte die Plugin-Konfigurationsdatei nicht sichern\n"
msgid "(unknown)"
@ -447,7 +435,7 @@ msgstr "Ende der /who-Liste"
#, fuzzy, c-format
msgid ""
"%sError: can not merge windows, there's no other window with same size near "
"current one."
"current one"
msgstr ""
"%s kann Fenster nicht vereinigen, es ist kein Fenster mit der gleichen Größe "
"in der Nähe des aktuellen Fensters.\n"
@ -1299,8 +1287,8 @@ msgid ""
"\".dll\" under Microsoft Windows)"
msgstr ""
#, fuzzy
msgid "Saving WeeChat configuration to disk"
#, fuzzy, c-format
msgid "Saving WeeChat configuration to disk (%s)"
msgstr "Konfiguration wird gespeichert\n"
#, fuzzy, c-format
@ -1675,14 +1663,6 @@ msgstr "%s nicht genügend Speicher für Tastenzuordnung\n"
msgid "%s%s: error, circular reference when calling alias \"%s\""
msgstr "%s Zirkelbezug beim Aufruf des Aliases \"/%s\"\n"
#, fuzzy, c-format
msgid "%s%s: configuration file reloaded"
msgstr "Konfigurationsdatei gesichert\n"
#, fuzzy, c-format
msgid "%s%s: failed to reload configuration file"
msgstr "%s konnte die Konfigurationsdatei nicht sichern\n"
#, fuzzy, c-format
msgid "%s%s: error creating alias \"%s\" => \"%s\""
msgstr "%s nicht genügend Speicher für Infobar-Nachricht\n"
@ -1751,6 +1731,70 @@ msgstr "Aliasname"
msgid "alias_name: name of alias to remove"
msgstr "Aliasname: Name des zu löschenden Aliases"
#, fuzzy, c-format
msgid "%s%s: error creating charset \"%s\" => \"%s\""
msgstr "%s nicht genügend Speicher für Infobar-Nachricht\n"
#, fuzzy, c-format
msgid "%sCharset \"%s\" => \"%s\""
msgstr "Alias \"%s\" => \"%s\" angelegt\n"
#, fuzzy, c-format
msgid "%s%s: charset \"%s\" not found"
msgstr "%s Server \"%s\" nicht gefunden\n"
#, fuzzy, c-format
msgid "%sCharset \"%s\" removed"
msgstr "Alias \"%s\" entfernt\n"
#, fuzzy
msgid "List of charsets:"
msgstr "Liste der Aliases:\n"
#, fuzzy, c-format
msgid "List of charsets with \"%s\":"
msgstr "Liste der Aliases:\n"
#, fuzzy
msgid "No charset found"
msgstr "Keine Taste gefunden.\n"
#, fuzzy
msgid "No charset defined"
msgstr "Keine Aliases definiert.\n"
#, fuzzy, c-format
msgid "%s%s: terminal: %s, internal: %s"
msgstr "%s Plugin \"%s\" nicht gefunden\n"
#, fuzzy, c-format
msgid "%s%s: error creating configuration file \"%s\""
msgstr "den Server dazu bringen, seine Konfigurationsdatei neu zu laden"
#, fuzzy
msgid "manage charsets"
msgstr "Puffer verwalten"
msgid "[[type.]plugin.string [= charset]]"
msgstr ""
msgid ""
" type: \"decode\" or \"encode\" (if type is omitted, then both \"decode\" "
"and \"encode\" are set)\n"
" plugin: plugin name\n"
" string: string specific to plugin (for example a server name or server."
"channel for IRC plugin)\n"
"charset: charset to use (if empty, then charset is removed)\n"
"\n"
"Examples :\n"
"/charset decode iso-8859-15 => set global decode charset to iso-8859-15\n"
"/charset encode iso-8859-15 => set global encode charset to iso-8859-15\n"
"/charset decode.irc.freenode => set decode charset to iso-8859-15 for IRC "
"server \"freenode\" (all channels)\n"
"/charset decode.irc.freenode.#weechat => set decode charset to iso-8859-15 "
"for IRC channel \"#weechat\" on server \"freenode\""
msgstr ""
msgid "demo message without prefix"
msgstr ""
@ -2753,6 +2797,12 @@ msgstr ""
msgid "%sirc: too few arguments for \"%s\" command"
msgstr "%s fehlerhafte Argumente für der \"%s\"-Befehl\n"
#, c-format
msgid ""
"%s%s: warning: server \"%s\" not found in configuration file, not deleted in "
"memory because it's currently used"
msgstr ""
#, fuzzy, c-format
msgid "%s%s: value \"%s\" is invalid for option \"%s\""
msgstr "%s %s, Zeile %d: ungültige Option \"%s\"\n"
@ -3010,12 +3060,6 @@ msgstr ""
"Server (Format: #channel:1,...), der Channelname '*' ist für den Default-"
"Server-Notify-Level"
#, c-format
msgid ""
"%s%s: warning: server \"%s\" not found in configuration file. It has not "
"been deleted because it's used now."
msgstr ""
msgid "Waiting"
msgstr "warten"
@ -3905,7 +3949,7 @@ msgid "%s%s: no command to execute"
msgstr "%s Kein Befehl zum Ausführen!\n"
#, fuzzy, c-format
msgid "%s%s: unknown command: cmd=\"%s\", host=\"%s\", args=\"%s\""
msgid "%s%s: unknown command: cmd=\"%s\", host=\"%s\", arguments=\"%s\""
msgstr "%s Unbekannter Befehl: cmd=\"%s\", host=\"%s\", args=\"%s\"\n"
#, fuzzy, c-format
@ -4288,6 +4332,30 @@ msgstr ""
msgid "%s%s: wrong arguments for function \"%s\""
msgstr "%s fehlerhafte Argumente für der \"%s\"-Befehl\n"
#, fuzzy
#~ msgid "%sWeeChat configuration file reloaded"
#~ msgstr "Konfigurationsdatei gesichert\n"
#, fuzzy
#~ msgid "%sError: failed to reload WeeChat configuration file"
#~ msgstr "%s konnte die Konfigurationsdatei nicht sichern\n"
#, fuzzy
#~ msgid "%sWeeChat configuration file saved"
#~ msgstr "Konfigurationsdatei gesichert\n"
#, fuzzy
#~ msgid "%sError: failed to save WeeChat configuration file"
#~ msgstr "%s konnte die Konfigurationsdatei nicht sichern\n"
#, fuzzy
#~ msgid "%s%s: configuration file reloaded"
#~ msgstr "Konfigurationsdatei gesichert\n"
#, fuzzy
#~ msgid "%s%s: failed to reload configuration file"
#~ msgstr "%s konnte die Konfigurationsdatei nicht sichern\n"
#, fuzzy
#~ msgid "clear buffer(s)"
#~ msgstr " [C] Puffer löschen"

151
po/es.po
View File

@ -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-01-19 17:18+0100\n"
"POT-Creation-Date: 2008-01-24 16:42+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"
@ -220,7 +220,7 @@ msgid "Key:"
msgstr ""
#, fuzzy
msgid "No key found."
msgid "No key found"
msgstr "Ningún alias definido.\n"
#, fuzzy, c-format
@ -307,7 +307,11 @@ msgid " completions hooked:"
msgstr " manejadores de comando:\n"
#, fuzzy
msgid "No plugin found."
msgid " modifiers hooked:"
msgstr " manejadores de temporización:\n"
#, fuzzy
msgid "No plugin found"
msgstr "Ninguna opción de plugin encontrada\n"
#, fuzzy
@ -323,35 +327,19 @@ msgid "%sError: wrong argument count for \"%s\" command"
msgstr "%s número de argumentos incorrecto para el comando \"%s\"\n"
#, fuzzy, c-format
msgid "%sWeeChat configuration file reloaded"
msgstr "Archivo de configuración guardado\n"
#, fuzzy, c-format
msgid "%sError: failed to reload WeeChat configuration file"
msgstr "%s falló al salvar el archivo de configuración\n"
#, fuzzy, c-format
msgid "%sPlugins options reloaded"
msgid "%sOptions reloaded from %s"
msgstr "opción/opciones de plugin encontrada(s)\n"
#, fuzzy, c-format
msgid "%sError: failed to reload plugins options"
msgid "%sError: failed to reload options from %s"
msgstr "%s falló al salvar el archivo de configuración\n"
#, fuzzy, c-format
msgid "%sWeeChat configuration file saved"
msgstr "Archivo de configuración guardado\n"
#, fuzzy, c-format
msgid "%sError: failed to save WeeChat configuration file"
msgstr "%s falló al salvar el archivo de configuración\n"
#, fuzzy, c-format
msgid "%sPlugins options saved"
msgid "%sOptions saved to %s"
msgstr "opción/opciones de plugin encontrada(s)\n"
#, fuzzy, c-format
msgid "%sError: failed to save plugins options"
msgid "%sError: failed to save options to %s"
msgstr "%s falló al salvar el archivo de configuración\n"
msgid "(unknown)"
@ -444,7 +432,7 @@ msgstr "fin de la lista /who"
#, fuzzy, c-format
msgid ""
"%sError: can not merge windows, there's no other window with same size near "
"current one."
"current one"
msgstr ""
"%s no puede fusionar ventanas, no hay ninguna otra ventana con el mismo tamaÃ"
"±o que la actual.\n"
@ -1294,8 +1282,8 @@ msgid ""
"\".dll\" under Microsoft Windows)"
msgstr ""
#, fuzzy
msgid "Saving WeeChat configuration to disk"
#, fuzzy, c-format
msgid "Saving WeeChat configuration to disk (%s)"
msgstr "Guardar configuración a disco\n"
#, fuzzy, c-format
@ -1667,14 +1655,6 @@ msgstr "%s no hay suficiente memoria para atar la clave\n"
msgid "%s%s: error, circular reference when calling alias \"%s\""
msgstr "%s referencia circular al llamar alias \"/%s\"\n"
#, fuzzy, c-format
msgid "%s%s: configuration file reloaded"
msgstr "Archivo de configuración guardado\n"
#, fuzzy, c-format
msgid "%s%s: failed to reload configuration file"
msgstr "%s falló al salvar el archivo de configuración\n"
#, fuzzy, c-format
msgid "%s%s: error creating alias \"%s\" => \"%s\""
msgstr ""
@ -1737,6 +1717,71 @@ msgstr "alias"
msgid "alias_name: name of alias to remove"
msgstr "alias: nombre del alias a suprimir"
#, fuzzy, c-format
msgid "%s%s: error creating charset \"%s\" => \"%s\""
msgstr ""
"No hay suficiente memoria para el mensaje de la barra de información\n"
#, fuzzy, c-format
msgid "%sCharset \"%s\" => \"%s\""
msgstr "Alias \"%s\" => \"%s\" creado\n"
#, fuzzy, c-format
msgid "%s%s: charset \"%s\" not found"
msgstr "%s servidor \"%s\" no encontrado\n"
#, fuzzy, c-format
msgid "%sCharset \"%s\" removed"
msgstr "Alias \"%s\" eliminado\n"
#, fuzzy
msgid "List of charsets:"
msgstr "Lista de alias:\n"
#, fuzzy, c-format
msgid "List of charsets with \"%s\":"
msgstr "Lista de alias:\n"
#, fuzzy
msgid "No charset found"
msgstr "Ningún alias definido.\n"
#, fuzzy
msgid "No charset defined"
msgstr "Ningún alias definido.\n"
#, fuzzy, c-format
msgid "%s%s: terminal: %s, internal: %s"
msgstr "%s plugin \"%s\" no encontrado\n"
#, fuzzy, c-format
msgid "%s%s: error creating configuration file \"%s\""
msgstr "pedir al servidor que recargue su archivo de configuración"
#, fuzzy
msgid "manage charsets"
msgstr "gestionar los búfers"
msgid "[[type.]plugin.string [= charset]]"
msgstr ""
msgid ""
" type: \"decode\" or \"encode\" (if type is omitted, then both \"decode\" "
"and \"encode\" are set)\n"
" plugin: plugin name\n"
" string: string specific to plugin (for example a server name or server."
"channel for IRC plugin)\n"
"charset: charset to use (if empty, then charset is removed)\n"
"\n"
"Examples :\n"
"/charset decode iso-8859-15 => set global decode charset to iso-8859-15\n"
"/charset encode iso-8859-15 => set global encode charset to iso-8859-15\n"
"/charset decode.irc.freenode => set decode charset to iso-8859-15 for IRC "
"server \"freenode\" (all channels)\n"
"/charset decode.irc.freenode.#weechat => set decode charset to iso-8859-15 "
"for IRC channel \"#weechat\" on server \"freenode\""
msgstr ""
msgid "demo message without prefix"
msgstr ""
@ -2756,6 +2801,12 @@ msgstr ""
msgid "%sirc: too few arguments for \"%s\" command"
msgstr "%s argumentos incorrectos para el comando \"%s\"\n"
#, c-format
msgid ""
"%s%s: warning: server \"%s\" not found in configuration file, not deleted in "
"memory because it's currently used"
msgstr ""
#, fuzzy, c-format
msgid "%s%s: value \"%s\" is invalid for option \"%s\""
msgstr "%s %s, línea %d: opción \"%s\" inválida\n"
@ -3013,12 +3064,6 @@ msgstr ""
"lista separada por comas de niveles de notificación para canales de este "
"servidor (formato: #canal:1,...)"
#, c-format
msgid ""
"%s%s: warning: server \"%s\" not found in configuration file. It has not "
"been deleted because it's used now."
msgstr ""
msgid "Waiting"
msgstr "Esperando"
@ -3919,7 +3964,7 @@ msgid "%s%s: no command to execute"
msgstr "%s ¡Ningún comando para ejecutar!\n"
#, fuzzy, c-format
msgid "%s%s: unknown command: cmd=\"%s\", host=\"%s\", args=\"%s\""
msgid "%s%s: unknown command: cmd=\"%s\", host=\"%s\", arguments=\"%s\""
msgstr "%s Comando desconocido: cmd=\"%s\", host=\"%s\", params=\"%s\"\n"
#, fuzzy, c-format
@ -4303,6 +4348,30 @@ msgstr ""
msgid "%s%s: wrong arguments for function \"%s\""
msgstr "%s argumentos incorrectos para el comando \"%s\"\n"
#, fuzzy
#~ msgid "%sWeeChat configuration file reloaded"
#~ msgstr "Archivo de configuración guardado\n"
#, fuzzy
#~ msgid "%sError: failed to reload WeeChat configuration file"
#~ msgstr "%s falló al salvar el archivo de configuración\n"
#, fuzzy
#~ msgid "%sWeeChat configuration file saved"
#~ msgstr "Archivo de configuración guardado\n"
#, fuzzy
#~ msgid "%sError: failed to save WeeChat configuration file"
#~ msgstr "%s falló al salvar el archivo de configuración\n"
#, fuzzy
#~ msgid "%s%s: configuration file reloaded"
#~ msgstr "Archivo de configuración guardado\n"
#, fuzzy
#~ msgid "%s%s: failed to reload configuration file"
#~ msgstr "%s falló al salvar el archivo de configuración\n"
#, fuzzy
#~ msgid "clear buffer(s)"
#~ msgstr "saltar al búfer DCC"

180
po/fr.po
View File

@ -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-01-19 17:18+0100\n"
"PO-Revision-Date: 2008-01-19 17:19+0100\n"
"POT-Creation-Date: 2008-01-24 16:42+0100\n"
"PO-Revision-Date: 2008-01-24 16:42+0100\n"
"Last-Translator: FlashCode <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
"MIME-Version: 1.0\n"
@ -204,8 +204,8 @@ msgstr "%sErreur: fonction de touche \"%s\" inconnue"
msgid "Key:"
msgstr "Touche:"
msgid "No key found."
msgstr "Aucune touche trouvée."
msgid "No key found"
msgstr "Aucune touche trouvée"
#, c-format
msgid "%sError: unable to bind key \"%s\""
@ -279,8 +279,11 @@ msgstr " options de configuration accrochées:"
msgid " completions hooked:"
msgstr " completion accrochées:"
msgid "No plugin found."
msgstr "Aucune extension trouvée."
msgid " modifiers hooked:"
msgstr " modificateurs accrochés:"
msgid "No plugin found"
msgstr "Aucune extension trouvée"
msgid " (no plugin)"
msgstr " (aucune extension)"
@ -294,36 +297,20 @@ msgid "%sError: wrong argument count for \"%s\" command"
msgstr "%sErreur: nombre de paramètres erroné pour la commande \"%s\""
#, c-format
msgid "%sWeeChat configuration file reloaded"
msgstr "%sFichier de configuration WeeChat rechargé"
msgid "%sOptions reloaded from %s"
msgstr "%sOptions rechargées depuis %s"
#, c-format
msgid "%sError: failed to reload WeeChat configuration file"
msgstr "%sErreur: impossible de recharger le fichier de configuration WeeChat"
msgid "%sError: failed to reload options from %s"
msgstr "%sErreur: impossible de recharger les options depuis %s"
#, c-format
msgid "%sPlugins options reloaded"
msgstr "%sOptions des extensions rechargées"
msgid "%sOptions saved to %s"
msgstr "%sOptions sauvées dans %s"
#, c-format
msgid "%sError: failed to reload plugins options"
msgstr "%sErreur: impossible de recharger les options des extensions"
#, c-format
msgid "%sWeeChat configuration file saved"
msgstr "%sFichier de configuration WeeChat sauvé"
#, c-format
msgid "%sError: failed to save WeeChat configuration file"
msgstr "%sErreur: impossible de sauver le fichier de configuration WeeChat"
#, c-format
msgid "%sPlugins options saved"
msgstr "%sOptions des extensions sauvées"
#, c-format
msgid "%sError: failed to save plugins options"
msgstr "%sErreur: impossible de sauver les options des extensions"
msgid "%sError: failed to save options to %s"
msgstr "%sErreur: impossible de sauver les options dans %s"
msgid "(unknown)"
msgstr "(inconnu)"
@ -408,10 +395,10 @@ msgstr "Liste des fenêtres:"
#, c-format
msgid ""
"%sError: can not merge windows, there's no other window with same size near "
"current one."
"current one"
msgstr ""
"%sErreur: impossible de fusionner les fenêtres, aucun autre fenêtre avec la "
"même taille à coté de la fenêtre actuelle."
"même taille à coté de la fenêtre actuelle"
msgid "manage buffers"
msgstr "gestion des tampons"
@ -1210,8 +1197,9 @@ msgstr ""
"extension par défaut des extensions (par example \".so\" sous Linux ou \".dll"
"\" sous Microsoft Windows)"
msgid "Saving WeeChat configuration to disk"
msgstr "Sauvegarde de la configuration WeeChat sur disque"
#, c-format
msgid "Saving WeeChat configuration to disk (%s)"
msgstr "Sauvegarde de la configuration WeeChat sur disque (%s)"
#, c-format
msgid "%sError: cannot create file \"%s\""
@ -1573,14 +1561,6 @@ msgstr "Erreur: pas assez de mémoire pour la touche"
msgid "%s%s: error, circular reference when calling alias \"%s\""
msgstr "%s%s: erreur, référence circulaire lors de l'appel à l'alias \"%s\""
#, c-format
msgid "%s%s: configuration file reloaded"
msgstr "%s%s: fichier de configuration rechargé"
#, c-format
msgid "%s%s: failed to reload configuration file"
msgstr "%s%s: impossible de recharger le fichier de configuration"
#, c-format
msgid "%s%s: error creating alias \"%s\" => \"%s\""
msgstr "%s%s: erreur en création de l'alias \"%s\" => \"%s\""
@ -1646,6 +1626,83 @@ msgstr "nom_alias"
msgid "alias_name: name of alias to remove"
msgstr "nom_alias: nom de l'alias à supprimer"
#, c-format
msgid "%s%s: error creating charset \"%s\" => \"%s\""
msgstr "%s%s: erreur en création du charset \"%s\" => \"%s\""
#, c-format
msgid "%sCharset \"%s\" => \"%s\""
msgstr "%sCharset \"%s\" => \"%s\""
#, c-format
msgid "%s%s: charset \"%s\" not found"
msgstr "%s%s: charset \"%s\" non trouvé"
#, c-format
msgid "%sCharset \"%s\" removed"
msgstr "%sCharset \"%s\" supprimé"
msgid "List of charsets:"
msgstr "Liste des charsets:"
#, c-format
msgid "List of charsets with \"%s\":"
msgstr "Liste des charsets avec \"%s\":"
msgid "No charset found"
msgstr "Aucun charset trouvé"
msgid "No charset defined"
msgstr "Aucun charset défini"
#, c-format
msgid "%s%s: terminal: %s, internal: %s"
msgstr "%s%s: terminal: %s, interne: %s"
#, c-format
msgid "%s%s: error creating configuration file \"%s\""
msgstr "%s%s: erreur de création du fichier de configuration \"%s\""
msgid "manage charsets"
msgstr "gestion des charsets"
msgid "[[type.]plugin.string [= charset]]"
msgstr "[[type.]extension.chaine [= charset]]"
msgid ""
" type: \"decode\" or \"encode\" (if type is omitted, then both \"decode\" "
"and \"encode\" are set)\n"
" plugin: plugin name\n"
" string: string specific to plugin (for example a server name or server."
"channel for IRC plugin)\n"
"charset: charset to use (if empty, then charset is removed)\n"
"\n"
"Examples :\n"
"/charset decode iso-8859-15 => set global decode charset to iso-8859-15\n"
"/charset encode iso-8859-15 => set global encode charset to iso-8859-15\n"
"/charset decode.irc.freenode => set decode charset to iso-8859-15 for IRC "
"server \"freenode\" (all channels)\n"
"/charset decode.irc.freenode.#weechat => set decode charset to iso-8859-15 "
"for IRC channel \"#weechat\" on server \"freenode\""
msgstr ""
" type: \"decode\" ou \"encode\" (si le type est omis, alors \"decode\" "
"et \"encode\" sont définis)\n"
"extension: nom d'une extension\n"
" chaine: chaine spécifique à une extension (par exemple un nom de serveur "
"ou serveur.canal pour l'extension IRC)\n"
" charset: charset à utiliser (si non renseigné, alors le charset est "
"supprimé)\n"
"\n"
"Exemples :\n"
"/charset decode iso-8859-15 => définit le charset de décodage global à iso-"
"8859-15\n"
"/charset encode iso-8859-15 => définit le charset d'encodage global à iso-"
"8859-15\n"
"/charset decode.irc.freenode => définit le charset de décodage à iso-8859-15 "
"pour le serveur IRC \"freenode\" (tous les serveurs)\n"
"/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 "demo message without prefix"
msgstr "message de démonstration sans préfixe"
@ -2677,6 +2734,14 @@ msgstr ""
msgid "%sirc: too few arguments for \"%s\" command"
msgstr "%sirc: pas assez de paramètres pour la commande \"%s\""
#, c-format
msgid ""
"%s%s: warning: server \"%s\" not found in configuration file, not deleted in "
"memory because it's currently used"
msgstr ""
"%s%s: attention: le serveur \"%s\" n'a pas été trouvé dans le fichier de "
"configuration, non supprimé en mémoire car il est en cours d'utilisation"
#, c-format
msgid "%s%s: value \"%s\" is invalid for option \"%s\""
msgstr "%s%s: valeur \"%s\" invalide pour l'option \"%s\""
@ -2929,14 +2994,6 @@ msgstr ""
"canaux de ce serveur (format: #canal:1,..), un nom de canal '*' est réservé "
"pour la notification par défaut du serveur"
#, c-format
msgid ""
"%s%s: warning: server \"%s\" not found in configuration file. It has not "
"been deleted because it's used now."
msgstr ""
"%s%s: attention: le serveur \"%s\" n'a pas été trouvé dans le fichier de "
"configuration. Il n'a pas été supprimé car il est actuellement utilisé."
msgid "Waiting"
msgstr "Attente"
@ -3831,8 +3888,8 @@ msgid "%s%s: no command to execute"
msgstr "%s%s: pas de commande à exécuter"
#, c-format
msgid "%s%s: unknown command: cmd=\"%s\", host=\"%s\", args=\"%s\""
msgstr "%s%s: commande inconnue: cmd=\"%s\", hôte=\"%s\", params=\"%s\""
msgid "%s%s: unknown command: cmd=\"%s\", host=\"%s\", arguments=\"%s\""
msgstr "%s%s: commande inconnue: cmd=\"%s\", hôte=\"%s\", paramètres=\"%s\""
#, c-format
msgid "%s%s: cannot read data from socket, disconnecting from server..."
@ -4225,6 +4282,25 @@ msgstr ""
msgid "%s%s: wrong arguments for function \"%s\""
msgstr "%s%s: paramètres invalides pour la fonction \"%s\""
#~ msgid "%sWeeChat configuration file reloaded"
#~ msgstr "%sFichier de configuration WeeChat rechargé"
#~ msgid "%sError: failed to reload WeeChat configuration file"
#~ msgstr ""
#~ "%sErreur: impossible de recharger le fichier de configuration WeeChat"
#~ msgid "%sWeeChat configuration file saved"
#~ msgstr "%sFichier de configuration WeeChat sauvé"
#~ msgid "%sError: failed to save WeeChat configuration file"
#~ msgstr "%sErreur: impossible de sauver le fichier de configuration WeeChat"
#~ msgid "%s%s: configuration file reloaded"
#~ msgstr "%s%s: fichier de configuration rechargé"
#~ msgid "%s%s: failed to reload configuration file"
#~ msgstr "%s%s: impossible de recharger le fichier de configuration"
#~ msgid "clear buffer(s)"
#~ msgstr "effacer le(s) tampon(s)"

150
po/hu.po
View File

@ -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-01-19 17:18+0100\n"
"POT-Creation-Date: 2008-01-24 16:42+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"
@ -223,7 +223,7 @@ msgid "Key:"
msgstr "Billentyű:\n"
#, fuzzy
msgid "No key found."
msgid "No key found"
msgstr "Nem találtam billentyűt.\n"
#, fuzzy, c-format
@ -310,7 +310,11 @@ msgid " completions hooked:"
msgstr " parancskezelők:\n"
#, fuzzy
msgid "No plugin found."
msgid " modifiers hooked:"
msgstr " időkezelők:\n"
#, fuzzy
msgid "No plugin found"
msgstr "Nem található modul.\n"
#, fuzzy
@ -326,35 +330,19 @@ msgid "%sError: wrong argument count for \"%s\" command"
msgstr "%s rossz argumentum szám a \"%s\" parancsnak\n"
#, fuzzy, c-format
msgid "%sWeeChat configuration file reloaded"
msgstr "Konfigurációs fájl elmentve\n"
#, fuzzy, c-format
msgid "%sError: failed to reload WeeChat configuration file"
msgstr "%s nem sikerült a konfigurációs fájlt elmenteni\n"
#, fuzzy, c-format
msgid "%sPlugins options reloaded"
msgid "%sOptions reloaded from %s"
msgstr "Modul beállítások elmentve\n"
#, fuzzy, c-format
msgid "%sError: failed to reload plugins options"
msgid "%sError: failed to reload options from %s"
msgstr "%s nem sikerült a modul opciókat elmenteni\n"
#, fuzzy, c-format
msgid "%sWeeChat configuration file saved"
msgstr "Konfigurációs fájl elmentve\n"
#, fuzzy, c-format
msgid "%sError: failed to save WeeChat configuration file"
msgstr "%s nem sikerült a konfigurációs fájlt elmenteni\n"
#, fuzzy, c-format
msgid "%sPlugins options saved"
msgid "%sOptions saved to %s"
msgstr "Modul beállítások elmentve\n"
#, fuzzy, c-format
msgid "%sError: failed to save plugins options"
msgid "%sError: failed to save options to %s"
msgstr "%s nem sikerült a modul opciókat elmenteni\n"
msgid "(unknown)"
@ -445,7 +433,7 @@ msgstr "a /who lista vége"
#, fuzzy, c-format
msgid ""
"%sError: can not merge windows, there's no other window with same size near "
"current one."
"current one"
msgstr ""
"%s nem sikerült az ablakokat összefésülni: nincs a közelben azonos méretű "
"ablak.\n"
@ -1312,8 +1300,8 @@ msgid ""
"\".dll\" under Microsoft Windows)"
msgstr ""
#, fuzzy
msgid "Saving WeeChat configuration to disk"
#, fuzzy, c-format
msgid "Saving WeeChat configuration to disk (%s)"
msgstr "Beállítások mentése a lemezre\n"
#, fuzzy, c-format
@ -1678,14 +1666,6 @@ msgstr "%s nincs elég memória a billentyűhozzárendeléshez\n"
msgid "%s%s: error, circular reference when calling alias \"%s\""
msgstr "%s körreferencia a \"/%s\" aliasz hívásakor\n"
#, fuzzy, c-format
msgid "%s%s: configuration file reloaded"
msgstr "Konfigurációs fájl elmentve\n"
#, fuzzy, c-format
msgid "%s%s: failed to reload configuration file"
msgstr "%s nem sikerült a konfigurációs fájlt elmenteni\n"
#, fuzzy, c-format
msgid "%s%s: error creating alias \"%s\" => \"%s\""
msgstr "%s nincs elég memória az információs pult üzenethez\n"
@ -1755,6 +1735,70 @@ msgstr "alias_név"
msgid "alias_name: name of alias to remove"
msgstr "alias_név: az eltávolítandó alias neve"
#, fuzzy, c-format
msgid "%s%s: error creating charset \"%s\" => \"%s\""
msgstr "%s nincs elég memória az információs pult üzenethez\n"
#, fuzzy, c-format
msgid "%sCharset \"%s\" => \"%s\""
msgstr "A \"%s\" => \"%s\" aliasz elkészült\n"
#, fuzzy, c-format
msgid "%s%s: charset \"%s\" not found"
msgstr "%s a \"%s\" szerver nem található\n"
#, fuzzy, c-format
msgid "%sCharset \"%s\" removed"
msgstr "A \"%s\" aliasz eltávolítva\n"
#, fuzzy
msgid "List of charsets:"
msgstr "Aliaszok listája:\n"
#, fuzzy, c-format
msgid "List of charsets with \"%s\":"
msgstr "Aliaszok listája:\n"
#, fuzzy
msgid "No charset found"
msgstr "Nem találtam billentyűt.\n"
#, fuzzy
msgid "No charset defined"
msgstr "Nincs aliasz definiálva.\n"
#, fuzzy, c-format
msgid "%s%s: terminal: %s, internal: %s"
msgstr "%s a \"%s\" modul nem található\n"
#, fuzzy, c-format
msgid "%s%s: error creating configuration file \"%s\""
msgstr "szerver konfigurációs fájljának újraolvastatása"
#, fuzzy
msgid "manage charsets"
msgstr "pufferek kezelése"
msgid "[[type.]plugin.string [= charset]]"
msgstr ""
msgid ""
" type: \"decode\" or \"encode\" (if type is omitted, then both \"decode\" "
"and \"encode\" are set)\n"
" plugin: plugin name\n"
" string: string specific to plugin (for example a server name or server."
"channel for IRC plugin)\n"
"charset: charset to use (if empty, then charset is removed)\n"
"\n"
"Examples :\n"
"/charset decode iso-8859-15 => set global decode charset to iso-8859-15\n"
"/charset encode iso-8859-15 => set global encode charset to iso-8859-15\n"
"/charset decode.irc.freenode => set decode charset to iso-8859-15 for IRC "
"server \"freenode\" (all channels)\n"
"/charset decode.irc.freenode.#weechat => set decode charset to iso-8859-15 "
"for IRC channel \"#weechat\" on server \"freenode\""
msgstr ""
msgid "demo message without prefix"
msgstr ""
@ -2785,6 +2829,12 @@ msgstr ""
msgid "%sirc: too few arguments for \"%s\" command"
msgstr "%s rossz argumentum a \"%s\" parancsnak\n"
#, c-format
msgid ""
"%s%s: warning: server \"%s\" not found in configuration file, not deleted in "
"memory because it's currently used"
msgstr ""
#, fuzzy, c-format
msgid "%s%s: value \"%s\" is invalid for option \"%s\""
msgstr "%s %s, %d. sor: érvénytelen opció: \"%s\"\n"
@ -3020,12 +3070,6 @@ msgstr ""
"#szoba:1,...), a '*' szobanév a szerver alapértelmezett értesítési "
"szintjének van fenntartva"
#, c-format
msgid ""
"%s%s: warning: server \"%s\" not found in configuration file. It has not "
"been deleted because it's used now."
msgstr ""
msgid "Waiting"
msgstr "Várakozás"
@ -3905,7 +3949,7 @@ msgid "%s%s: no command to execute"
msgstr "%s A futtatandó parancs nem található!\n"
#, fuzzy, c-format
msgid "%s%s: unknown command: cmd=\"%s\", host=\"%s\", args=\"%s\""
msgid "%s%s: unknown command: cmd=\"%s\", host=\"%s\", arguments=\"%s\""
msgstr ""
"%s Ismeretlen parancs: parancs=\"%s\", gépnév=\"%s\", argumentum=\"%s\"\n"
@ -4292,6 +4336,30 @@ msgstr ""
msgid "%s%s: wrong arguments for function \"%s\""
msgstr "%s rossz argumentum a \"%s\" parancsnak\n"
#, fuzzy
#~ msgid "%sWeeChat configuration file reloaded"
#~ msgstr "Konfigurációs fájl elmentve\n"
#, fuzzy
#~ msgid "%sError: failed to reload WeeChat configuration file"
#~ msgstr "%s nem sikerült a konfigurációs fájlt elmenteni\n"
#, fuzzy
#~ msgid "%sWeeChat configuration file saved"
#~ msgstr "Konfigurációs fájl elmentve\n"
#, fuzzy
#~ msgid "%sError: failed to save WeeChat configuration file"
#~ msgstr "%s nem sikerült a konfigurációs fájlt elmenteni\n"
#, fuzzy
#~ msgid "%s%s: configuration file reloaded"
#~ msgstr "Konfigurációs fájl elmentve\n"
#, fuzzy
#~ msgid "%s%s: failed to reload configuration file"
#~ msgstr "%s nem sikerült a konfigurációs fájlt elmenteni\n"
#, fuzzy
#~ msgid "clear buffer(s)"
#~ msgstr " [C] Puffer törlése"

150
po/ru.po
View File

@ -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-01-19 17:18+0100\n"
"POT-Creation-Date: 2008-01-24 16:42+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"
@ -220,7 +220,7 @@ msgid "Key:"
msgstr "Клавиша:\n"
#, fuzzy
msgid "No key found."
msgid "No key found"
msgstr "Клавиши не найдены.\n"
#, fuzzy, c-format
@ -307,7 +307,11 @@ msgid " completions hooked:"
msgstr " обработчики команд:\n"
#, fuzzy
msgid "No plugin found."
msgid " modifiers hooked:"
msgstr " обработчики таймера:\n"
#, fuzzy
msgid "No plugin found"
msgstr "Plugin не найден\n"
#, fuzzy
@ -323,35 +327,19 @@ msgid "%sError: wrong argument count for \"%s\" command"
msgstr "%s некорректное количество аргументов команды \"%s\"\n"
#, fuzzy, c-format
msgid "%sWeeChat configuration file reloaded"
msgstr "Конфигурационный файл сохранён\n"
#, fuzzy, c-format
msgid "%sError: failed to reload WeeChat configuration file"
msgstr "%s не могу сохранить конфигурационный файл\n"
#, fuzzy, c-format
msgid "%sPlugins options reloaded"
msgid "%sOptions reloaded from %s"
msgstr "Настройки pluginов сохранены\n"
#, fuzzy, c-format
msgid "%sError: failed to reload plugins options"
msgid "%sError: failed to reload options from %s"
msgstr "%s не могу сохранить конфигурационный файл pluginов\n"
#, fuzzy, c-format
msgid "%sWeeChat configuration file saved"
msgstr "Конфигурационный файл сохранён\n"
#, fuzzy, c-format
msgid "%sError: failed to save WeeChat configuration file"
msgstr "%s не могу сохранить конфигурационный файл\n"
#, fuzzy, c-format
msgid "%sPlugins options saved"
msgid "%sOptions saved to %s"
msgstr "Настройки pluginов сохранены\n"
#, fuzzy, c-format
msgid "%sError: failed to save plugins options"
msgid "%sError: failed to save options to %s"
msgstr "%s не могу сохранить конфигурационный файл pluginов\n"
msgid "(unknown)"
@ -441,7 +429,7 @@ msgstr "конец списка /who"
#, fuzzy, c-format
msgid ""
"%sError: can not merge windows, there's no other window with same size near "
"current one."
"current one"
msgstr ""
"%s не могу объединить окна, есть другое окно такого-же размера рядом с "
"текущим.\n"
@ -1313,8 +1301,8 @@ msgid ""
"\".dll\" under Microsoft Windows)"
msgstr ""
#, fuzzy
msgid "Saving WeeChat configuration to disk"
#, fuzzy, c-format
msgid "Saving WeeChat configuration to disk (%s)"
msgstr "Сохраняю конфигурацию\n"
#, fuzzy, c-format
@ -1681,14 +1669,6 @@ msgstr "%s недостаточно памяти для установки кл
msgid "%s%s: error, circular reference when calling alias \"%s\""
msgstr "%s рекурсия при вызове сокращения \"/%s\"\n"
#, fuzzy, c-format
msgid "%s%s: configuration file reloaded"
msgstr "Конфигурационный файл сохранён\n"
#, fuzzy, c-format
msgid "%s%s: failed to reload configuration file"
msgstr "%s не могу сохранить конфигурационный файл\n"
#, fuzzy, c-format
msgid "%s%s: error creating alias \"%s\" => \"%s\""
msgstr "%s недостаточно памяти для сообщения в строке информации\n"
@ -1757,6 +1737,70 @@ msgstr "сокращение"
msgid "alias_name: name of alias to remove"
msgstr "сокращение: удаляемое сокращение"
#, fuzzy, c-format
msgid "%s%s: error creating charset \"%s\" => \"%s\""
msgstr "%s недостаточно памяти для сообщения в строке информации\n"
#, fuzzy, c-format
msgid "%sCharset \"%s\" => \"%s\""
msgstr "Сокращение \"%s\" => \"%s\" создано\n"
#, fuzzy, c-format
msgid "%s%s: charset \"%s\" not found"
msgstr "%s сервер \"%s\" не найден\n"
#, fuzzy, c-format
msgid "%sCharset \"%s\" removed"
msgstr "Сокращение \"%s\" удалено\n"
#, fuzzy
msgid "List of charsets:"
msgstr "Список сокращений:\n"
#, fuzzy, c-format
msgid "List of charsets with \"%s\":"
msgstr "Список сокращений:\n"
#, fuzzy
msgid "No charset found"
msgstr "Клавиши не найдены.\n"
#, fuzzy
msgid "No charset defined"
msgstr "Сокращения не заданы.\n"
#, fuzzy, c-format
msgid "%s%s: terminal: %s, internal: %s"
msgstr "%s plugin \"%s\" не найден\n"
#, fuzzy, c-format
msgid "%s%s: error creating configuration file \"%s\""
msgstr "перезагрузить конфигурационный файл сервера"
#, fuzzy
msgid "manage charsets"
msgstr "управление буферами"
msgid "[[type.]plugin.string [= charset]]"
msgstr ""
msgid ""
" type: \"decode\" or \"encode\" (if type is omitted, then both \"decode\" "
"and \"encode\" are set)\n"
" plugin: plugin name\n"
" string: string specific to plugin (for example a server name or server."
"channel for IRC plugin)\n"
"charset: charset to use (if empty, then charset is removed)\n"
"\n"
"Examples :\n"
"/charset decode iso-8859-15 => set global decode charset to iso-8859-15\n"
"/charset encode iso-8859-15 => set global encode charset to iso-8859-15\n"
"/charset decode.irc.freenode => set decode charset to iso-8859-15 for IRC "
"server \"freenode\" (all channels)\n"
"/charset decode.irc.freenode.#weechat => set decode charset to iso-8859-15 "
"for IRC channel \"#weechat\" on server \"freenode\""
msgstr ""
msgid "demo message without prefix"
msgstr ""
@ -2776,6 +2820,12 @@ msgstr ""
msgid "%sirc: too few arguments for \"%s\" command"
msgstr "%s некорректные аргументы команды \"%s\"\n"
#, c-format
msgid ""
"%s%s: warning: server \"%s\" not found in configuration file, not deleted in "
"memory because it's currently used"
msgstr ""
#, fuzzy, c-format
msgid "%s%s: value \"%s\" is invalid for option \"%s\""
msgstr "%s %s, строка %d: некорректный параметр \"%s\"\n"
@ -3015,12 +3065,6 @@ msgstr ""
"#канал:1,..), название канала '*' зарезервировано для уровня уведомления "
"сервера"
#, c-format
msgid ""
"%s%s: warning: server \"%s\" not found in configuration file. It has not "
"been deleted because it's used now."
msgstr ""
msgid "Waiting"
msgstr "Ожидание"
@ -3892,7 +3936,7 @@ msgid "%s%s: no command to execute"
msgstr "%s Нет команд для запуска!\n"
#, fuzzy, c-format
msgid "%s%s: unknown command: cmd=\"%s\", host=\"%s\", args=\"%s\""
msgid "%s%s: unknown command: cmd=\"%s\", host=\"%s\", arguments=\"%s\""
msgstr ""
"%s Неизвестная команда: команда=\"%s\", хост=\"%s\", аргументы=\"%s\"\n"
@ -4274,6 +4318,30 @@ msgstr ""
msgid "%s%s: wrong arguments for function \"%s\""
msgstr "%s некорректные аргументы команды \"%s\"\n"
#, fuzzy
#~ msgid "%sWeeChat configuration file reloaded"
#~ msgstr "Конфигурационный файл сохранён\n"
#, fuzzy
#~ msgid "%sError: failed to reload WeeChat configuration file"
#~ msgstr "%s не могу сохранить конфигурационный файл\n"
#, fuzzy
#~ msgid "%sWeeChat configuration file saved"
#~ msgstr "Конфигурационный файл сохранён\n"
#, fuzzy
#~ msgid "%sError: failed to save WeeChat configuration file"
#~ msgstr "%s не могу сохранить конфигурационный файл\n"
#, fuzzy
#~ msgid "%s%s: configuration file reloaded"
#~ msgstr "Конфигурационный файл сохранён\n"
#, fuzzy
#~ msgid "%s%s: failed to reload configuration file"
#~ msgstr "%s не могу сохранить конфигурационный файл\n"
#, fuzzy
#~ msgid "clear buffer(s)"
#~ msgstr " [C] Очистить буфер"

View File

@ -81,6 +81,7 @@ SET(WEECHAT_SOURCES
./src/plugins/aspell/aspell.c
./src/plugins/aspell/aspell.h
./src/plugins/charset/charset.c
./src/plugins/charset/charset.h
./src/plugins/demo/demo.c
./src/plugins/fifo/fifo.c
./src/plugins/irc/irc-buffer.c

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2008-01-19 17:18+0100\n"
"POT-Creation-Date: 2008-01-24 16:42+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"
@ -185,7 +185,7 @@ msgstr ""
msgid "Key:"
msgstr ""
msgid "No key found."
msgid "No key found"
msgstr ""
#, c-format
@ -260,7 +260,10 @@ msgstr ""
msgid " completions hooked:"
msgstr ""
msgid "No plugin found."
msgid " modifiers hooked:"
msgstr ""
msgid "No plugin found"
msgstr ""
msgid " (no plugin)"
@ -275,35 +278,19 @@ msgid "%sError: wrong argument count for \"%s\" command"
msgstr ""
#, c-format
msgid "%sWeeChat configuration file reloaded"
msgid "%sOptions reloaded from %s"
msgstr ""
#, c-format
msgid "%sError: failed to reload WeeChat configuration file"
msgid "%sError: failed to reload options from %s"
msgstr ""
#, c-format
msgid "%sPlugins options reloaded"
msgid "%sOptions saved to %s"
msgstr ""
#, c-format
msgid "%sError: failed to reload plugins options"
msgstr ""
#, c-format
msgid "%sWeeChat configuration file saved"
msgstr ""
#, c-format
msgid "%sError: failed to save WeeChat configuration file"
msgstr ""
#, c-format
msgid "%sPlugins options saved"
msgstr ""
#, c-format
msgid "%sError: failed to save plugins options"
msgid "%sError: failed to save options to %s"
msgstr ""
msgid "(unknown)"
@ -389,7 +376,7 @@ msgstr ""
#, c-format
msgid ""
"%sError: can not merge windows, there's no other window with same size near "
"current one."
"current one"
msgstr ""
msgid "manage buffers"
@ -1031,7 +1018,8 @@ msgid ""
"\".dll\" under Microsoft Windows)"
msgstr ""
msgid "Saving WeeChat configuration to disk"
#, c-format
msgid "Saving WeeChat configuration to disk (%s)"
msgstr ""
#, c-format
@ -1380,14 +1368,6 @@ msgstr ""
msgid "%s%s: error, circular reference when calling alias \"%s\""
msgstr ""
#, c-format
msgid "%s%s: configuration file reloaded"
msgstr ""
#, c-format
msgid "%s%s: failed to reload configuration file"
msgstr ""
#, c-format
msgid "%s%s: error creating alias \"%s\" => \"%s\""
msgstr ""
@ -1443,6 +1423,66 @@ msgstr ""
msgid "alias_name: name of alias to remove"
msgstr ""
#, c-format
msgid "%s%s: error creating charset \"%s\" => \"%s\""
msgstr ""
#, c-format
msgid "%sCharset \"%s\" => \"%s\""
msgstr ""
#, c-format
msgid "%s%s: charset \"%s\" not found"
msgstr ""
#, c-format
msgid "%sCharset \"%s\" removed"
msgstr ""
msgid "List of charsets:"
msgstr ""
#, c-format
msgid "List of charsets with \"%s\":"
msgstr ""
msgid "No charset found"
msgstr ""
msgid "No charset defined"
msgstr ""
#, c-format
msgid "%s%s: terminal: %s, internal: %s"
msgstr ""
#, c-format
msgid "%s%s: error creating configuration file \"%s\""
msgstr ""
msgid "manage charsets"
msgstr ""
msgid "[[type.]plugin.string [= charset]]"
msgstr ""
msgid ""
" type: \"decode\" or \"encode\" (if type is omitted, then both \"decode\" "
"and \"encode\" are set)\n"
" plugin: plugin name\n"
" string: string specific to plugin (for example a server name or server."
"channel for IRC plugin)\n"
"charset: charset to use (if empty, then charset is removed)\n"
"\n"
"Examples :\n"
"/charset decode iso-8859-15 => set global decode charset to iso-8859-15\n"
"/charset encode iso-8859-15 => set global encode charset to iso-8859-15\n"
"/charset decode.irc.freenode => set decode charset to iso-8859-15 for IRC "
"server \"freenode\" (all channels)\n"
"/charset decode.irc.freenode.#weechat => set decode charset to iso-8859-15 "
"for IRC channel \"#weechat\" on server \"freenode\""
msgstr ""
msgid "demo message without prefix"
msgstr ""
@ -2306,6 +2346,12 @@ msgstr ""
msgid "%sirc: too few arguments for \"%s\" command"
msgstr ""
#, c-format
msgid ""
"%s%s: warning: server \"%s\" not found in configuration file, not deleted in "
"memory because it's currently used"
msgstr ""
#, c-format
msgid "%s%s: value \"%s\" is invalid for option \"%s\""
msgstr ""
@ -2510,12 +2556,6 @@ msgid ""
"level"
msgstr ""
#, c-format
msgid ""
"%s%s: warning: server \"%s\" not found in configuration file. It has not "
"been deleted because it's used now."
msgstr ""
msgid "Waiting"
msgstr ""
@ -3377,7 +3417,7 @@ msgid "%s%s: no command to execute"
msgstr ""
#, c-format
msgid "%s%s: unknown command: cmd=\"%s\", host=\"%s\", args=\"%s\""
msgid "%s%s: unknown command: cmd=\"%s\", host=\"%s\", arguments=\"%s\""
msgstr ""
#, c-format

View File

@ -31,6 +31,7 @@
#include "weechat.h"
#include "wee-command.h"
#include "wee-config.h"
#include "wee-config-file.h"
#include "wee-hook.h"
#include "wee-input.h"
#include "wee-log.h"
@ -818,7 +819,7 @@ command_key (void *data, struct t_gui_buffer *buffer,
else
{
gui_chat_printf (NULL,
_("No key found."));
_("No key found"));
}
if (internal_code)
free (internal_code);
@ -1034,13 +1035,30 @@ command_plugin_list (char *name, int full)
HOOK_COMPLETION(ptr_hook, completion));
}
}
/* modifier hooked */
hook_found = 0;
for (ptr_hook = weechat_hooks[HOOK_TYPE_MODIFIER]; ptr_hook;
ptr_hook = ptr_hook->next_hook)
{
if (!ptr_hook->deleted && (ptr_hook->plugin == ptr_plugin))
{
if (!hook_found)
gui_chat_printf (NULL,
_(" modifiers hooked:"));
hook_found = 1;
gui_chat_printf (NULL,
" %s",
HOOK_MODIFIER(ptr_hook, modifier));
}
}
}
}
}
if (plugins_found == 0)
{
if (name)
gui_chat_printf (NULL, _("No plugin found."));
gui_chat_printf (NULL, _("No plugin found"));
else
gui_chat_printf (NULL, _(" (no plugin)"));
}
@ -1142,6 +1160,8 @@ int
command_reload (void *data, struct t_gui_buffer *buffer,
int argc, char **argv, char **argv_eol)
{
struct t_config_file *ptr_config_file;
/* make C compiler happy */
(void) data;
(void) buffer;
@ -1149,28 +1169,26 @@ command_reload (void *data, struct t_gui_buffer *buffer,
(void) argv;
(void) argv_eol;
/* reload WeeChat configuration */
if (config_weechat_reload () == 0)
gui_chat_printf (NULL,
_("%sWeeChat configuration file reloaded"),
gui_chat_prefix[GUI_CHAT_PREFIX_INFO]);
else
gui_chat_printf (NULL,
_("%sError: failed to reload WeeChat configuration "
"file"),
gui_chat_prefix[GUI_CHAT_PREFIX_ERROR]);
/* reload plugins configuration */
if (plugin_config_reload () == 0)
gui_chat_printf (NULL, _("%sPlugins options reloaded"),
gui_chat_prefix[GUI_CHAT_PREFIX_INFO]);
else
gui_chat_printf (NULL,
_("%sError: failed to reload plugins options"),
gui_chat_prefix[GUI_CHAT_PREFIX_ERROR]);
/* tell to plugins to reload their configuration */
hook_signal_send ("config_reload", WEECHAT_HOOK_SIGNAL_STRING, NULL);
for (ptr_config_file = config_files; ptr_config_file;
ptr_config_file = ptr_config_file->next_config)
{
if (ptr_config_file->callback_reload)
{
if ((int) (ptr_config_file->callback_reload) (ptr_config_file) == 0)
{
gui_chat_printf (NULL, _("%sOptions reloaded from %s"),
gui_chat_prefix[GUI_CHAT_PREFIX_INFO],
ptr_config_file->filename);
}
else
{
gui_chat_printf (NULL,
_("%sError: failed to reload options from %s"),
gui_chat_prefix[GUI_CHAT_PREFIX_ERROR],
ptr_config_file->filename);
}
}
}
return WEECHAT_RC_OK;
}
@ -1183,32 +1201,32 @@ int
command_save (void *data, struct t_gui_buffer *buffer,
int argc, char **argv, char **argv_eol)
{
struct t_config_file *ptr_config_file;
/* make C compiler happy */
(void) data;
(void) buffer;
(void) argc;
(void) argv;
(void) argv_eol;
/* save WeeChat configuration */
if (config_weechat_write () == 0)
gui_chat_printf (NULL,
_("%sWeeChat configuration file saved"),
gui_chat_prefix[GUI_CHAT_PREFIX_INFO]);
else
gui_chat_printf (NULL,
_("%sError: failed to save WeeChat configuration "
"file"),
gui_chat_prefix[GUI_CHAT_PREFIX_ERROR]);
/* save plugins configuration */
if (plugin_config_write () == 0)
gui_chat_printf (NULL, _("%sPlugins options saved"),
gui_chat_prefix[GUI_CHAT_PREFIX_INFO]);
else
gui_chat_printf (NULL,
_("%sError: failed to save plugins options"),
gui_chat_prefix[GUI_CHAT_PREFIX_ERROR]);
for (ptr_config_file = config_files; ptr_config_file;
ptr_config_file = ptr_config_file->next_config)
{
if (config_file_write (ptr_config_file) == 0)
{
gui_chat_printf (NULL, _("%sOptions saved to %s"),
gui_chat_prefix[GUI_CHAT_PREFIX_INFO],
ptr_config_file->filename);
}
else
{
gui_chat_printf (NULL,
_("%sError: failed to save options to %s"),
gui_chat_prefix[GUI_CHAT_PREFIX_ERROR],
ptr_config_file->filename);
}
}
return WEECHAT_RC_OK;
}
@ -1826,7 +1844,7 @@ command_window (void *data, struct t_gui_buffer *buffer,
gui_chat_printf (NULL,
_("%sError: can not merge windows, "
"there's no other window with same "
"size near current one."),
"size near current one"),
gui_chat_prefix[GUI_CHAT_PREFIX_ERROR]);
return WEECHAT_RC_ERROR;
}
@ -1972,7 +1990,7 @@ command_init ()
"all plugins, then autoload plugins)\n"
" unload: unload one or all plugins\n\n"
"Without argument, /plugin command lists loaded plugins."),
"list|listfull|load|autoload|reload|unload %p",
"list|listfull|load|autoload|reload|unload %f|%p",
command_plugin, NULL);
hook_command (NULL, "quit",
N_("quit WeeChat"),

View File

@ -20,6 +20,10 @@
#ifndef __WEECHAT_COMMAND_H
#define __WEECHAT_COMMAND_H 1
struct t_gui_buffer;
extern int command_reload (void *data, struct t_gui_buffer *buffer,
int argc, char **argv, char **argv_eol);
extern void command_init ();
extern void command_print_stdout ();

View File

@ -69,7 +69,8 @@ config_file_search (char *filename)
*/
struct t_config_file *
config_file_new (struct t_weechat_plugin *plugin, char *filename)
config_file_new (struct t_weechat_plugin *plugin, char *filename,
int (*callback_reload)(struct t_config_file *config_file))
{
struct t_config_file *new_config_file;
@ -86,6 +87,7 @@ config_file_new (struct t_weechat_plugin *plugin, char *filename)
new_config_file->plugin = plugin;
new_config_file->filename = strdup (filename);
new_config_file->file = NULL;
new_config_file->callback_reload = callback_reload;
new_config_file->sections = NULL;
new_config_file->last_section = NULL;

View File

@ -40,6 +40,8 @@ struct t_config_file
struct t_weechat_plugin *plugin; /* plugin which created this cfg */
char *filename; /* config filename (without path)*/
FILE *file; /* file pointer */
int (*callback_reload) /* callback for reloading file */
(struct t_config_file *config_file);
struct t_config_section *sections; /* config sections */
struct t_config_section *last_section; /* last config section */
struct t_config_file *prev_config; /* link to previous config file */
@ -87,8 +89,12 @@ struct t_config_option
struct t_config_option *next_option; /* link to next option */
};
extern struct t_config_file *config_files;
extern struct t_config_file *last_config_file;
extern struct t_config_file *config_file_new (struct t_weechat_plugin *plugin,
char *filename);
char *filename,
int (*callback_reload)(struct t_config_file *config_file));
extern int config_file_valid_for_plugin (struct t_weechat_plugin *plugin,
struct t_config_file *config_file);
extern struct t_config_section *config_file_new_section (struct t_config_file *config_file,

View File

@ -414,6 +414,25 @@ config_change_day_change ()
}
}
/*
* config_weechat_reload: reload WeeChat configuration file
* return: 0 = successful
* -1 = config file file not found
* -2 = error in config file
*/
int
config_weechat_reload (struct t_config_file *config_file)
{
/* make C compiler happy */
(void) config_file;
/* remove all keys */
gui_keyboard_free_all ();
return config_file_reload (weechat_config_file);
}
/*
* config_weechat_read_key: read a key in configuration file
*/
@ -495,7 +514,8 @@ config_weechat_init ()
{
struct t_config_section *ptr_section;
weechat_config_file = config_file_new (NULL, WEECHAT_CONFIG_FILENAME);
weechat_config_file = config_file_new (NULL, WEECHAT_CONFIG_FILENAME,
&config_weechat_reload);
if (!weechat_config_file)
return 0;
@ -1159,23 +1179,6 @@ config_weechat_read ()
return rc;
}
/*
* config_weechat_reload: reload WeeChat configuration file
* return: 0 = successful
* -1 = configuration file file not found
* -2 = error in configuration file
*/
int
config_weechat_reload ()
{
/* remove all keys */
gui_keyboard_free_all ();
/* reload configuration file */
return config_file_reload (weechat_config_file);
}
/*
* config_weechat_write: write WeeChat configuration file
* return: 0 if ok
@ -1185,6 +1188,7 @@ config_weechat_reload ()
int
config_weechat_write ()
{
log_printf (_("Saving WeeChat configuration to disk"));
log_printf (_("Saving WeeChat configuration to disk (%s)"),
weechat_config_file->filename);
return config_file_write (weechat_config_file);
}

View File

@ -256,6 +256,30 @@ hook_valid_for_plugin (struct t_weechat_plugin *plugin, struct t_hook *hook)
return 0;
}
/*
* hook_exec_start: code executed before a hook exec
*/
void
hook_exec_start ()
{
hook_exec_recursion++;
}
/*
* hook_exec_end: code executed after a hook exec
*/
void
hook_exec_end ()
{
if (hook_exec_recursion > 0)
hook_exec_recursion--;
if (hook_exec_recursion == 0)
hook_remove_deleted ();
}
/*
* hook_search_command: search command hook in list
*/
@ -362,7 +386,7 @@ hook_command_exec (struct t_gui_buffer *buffer, char *string, int only_builtin)
}
argv_eol = string_explode (string, " ", 1, 0, NULL);
hook_exec_recursion++;
hook_exec_start ();
ptr_hook = weechat_hooks[HOOK_TYPE_COMMAND];
while (ptr_hook)
@ -383,10 +407,9 @@ hook_command_exec (struct t_gui_buffer *buffer, char *string, int only_builtin)
rc = (int) (HOOK_COMMAND(ptr_hook, callback))
(ptr_hook->callback_data, buffer, argc, argv, argv_eol);
ptr_hook->running = 0;
if (hook_exec_recursion > 0)
hook_exec_recursion--;
if (hook_exec_recursion == 0)
hook_remove_deleted ();
string_free_exploded (argv);
string_free_exploded (argv_eol);
hook_exec_end ();
if (rc == WEECHAT_RC_ERROR)
return 0;
else
@ -399,11 +422,7 @@ hook_command_exec (struct t_gui_buffer *buffer, char *string, int only_builtin)
string_free_exploded (argv);
string_free_exploded (argv_eol);
if (hook_exec_recursion > 0)
hook_exec_recursion--;
if (hook_exec_recursion == 0)
hook_remove_deleted ();
hook_exec_end ();
/* no hook found */
return -1;
@ -530,7 +549,7 @@ hook_timer_exec ()
gettimeofday (&tv_time, NULL);
hook_exec_recursion++;
hook_exec_start ();
ptr_hook = weechat_hooks[HOOK_TYPE_TIMER];
while (ptr_hook)
@ -566,11 +585,7 @@ hook_timer_exec ()
ptr_hook = next_hook;
}
if (hook_exec_recursion > 0)
hook_exec_recursion--;
if (hook_exec_recursion == 0)
hook_remove_deleted ();
hook_exec_end ();
}
/*
@ -686,7 +701,7 @@ hook_fd_exec (fd_set *read_fds, fd_set *write_fds, fd_set *exception_fds)
{
struct t_hook *ptr_hook, *next_hook;
hook_exec_recursion++;
hook_exec_start ();
ptr_hook = weechat_hooks[HOOK_TYPE_FD];
while (ptr_hook)
@ -710,11 +725,7 @@ hook_fd_exec (fd_set *read_fds, fd_set *write_fds, fd_set *exception_fds)
ptr_hook = next_hook;
}
if (hook_exec_recursion > 0)
hook_exec_recursion--;
if (hook_exec_recursion == 0)
hook_remove_deleted ();
hook_exec_end ();
}
/*
@ -776,7 +787,7 @@ hook_print_exec (struct t_gui_buffer *buffer, time_t date, char *prefix,
return;
}
hook_exec_recursion++;
hook_exec_start ();
ptr_hook = weechat_hooks[HOOK_TYPE_PRINT];
while (ptr_hook)
@ -802,11 +813,7 @@ hook_print_exec (struct t_gui_buffer *buffer, time_t date, char *prefix,
ptr_hook = next_hook;
}
if (hook_exec_recursion > 0)
hook_exec_recursion--;
if (hook_exec_recursion == 0)
hook_remove_deleted ();
hook_exec_end ();
}
/*
@ -853,7 +860,7 @@ hook_signal_send (char *signal, char *type_data, void *signal_data)
{
struct t_hook *ptr_hook, *next_hook;
hook_exec_recursion++;
hook_exec_start ();
ptr_hook = weechat_hooks[HOOK_TYPE_SIGNAL];
while (ptr_hook)
@ -874,11 +881,7 @@ hook_signal_send (char *signal, char *type_data, void *signal_data)
ptr_hook = next_hook;
}
if (hook_exec_recursion > 0)
hook_exec_recursion--;
if (hook_exec_recursion == 0)
hook_remove_deleted ();
hook_exec_end ();
}
/*
@ -923,7 +926,7 @@ hook_config_exec (char *type, char *option, char *value)
{
struct t_hook *ptr_hook, *next_hook;
hook_exec_recursion++;
hook_exec_start ();
ptr_hook = weechat_hooks[HOOK_TYPE_CONFIG];
while (ptr_hook)
@ -948,11 +951,7 @@ hook_config_exec (char *type, char *option, char *value)
ptr_hook = next_hook;
}
if (hook_exec_recursion > 0)
hook_exec_recursion--;
if (hook_exec_recursion == 0)
hook_remove_deleted ();
hook_exec_end ();
}
/*
@ -1003,7 +1002,7 @@ hook_completion_exec (struct t_weechat_plugin *plugin, char *completion,
/* make C compiler happy */
(void) plugin;
hook_exec_recursion++;
hook_exec_start ();
ptr_hook = weechat_hooks[HOOK_TYPE_COMPLETION];
while (ptr_hook)
@ -1024,11 +1023,103 @@ hook_completion_exec (struct t_weechat_plugin *plugin, char *completion,
ptr_hook = next_hook;
}
if (hook_exec_recursion > 0)
hook_exec_recursion--;
hook_exec_end ();
}
/*
* hook_modifier: hook a modifier
*/
struct t_hook *
hook_modifier (struct t_weechat_plugin *plugin, char *modifier,
t_hook_callback_modifier *callback, void *callback_data)
{
struct t_hook *new_hook;
struct t_hook_modifier *new_hook_modifier;
if (hook_exec_recursion == 0)
hook_remove_deleted ();
if (!modifier || !modifier[0])
return NULL;
new_hook = (struct t_hook *)malloc (sizeof (struct t_hook));
if (!new_hook)
return NULL;
new_hook_modifier = (struct t_hook_modifier *)malloc (sizeof (struct t_hook_modifier));
if (!new_hook_modifier)
{
free (new_hook);
return NULL;
}
hook_init_data (new_hook, plugin, HOOK_TYPE_MODIFIER, callback_data);
new_hook->hook_data = new_hook_modifier;
new_hook_modifier->callback = callback;
new_hook_modifier->modifier = strdup (modifier);
hook_add_to_list (new_hook);
return new_hook;
}
/*
* hook_modifier_exec: execute modifier hook
*/
char *
hook_modifier_exec (struct t_weechat_plugin *plugin, char *modifier,
char *modifier_data, char *string)
{
struct t_hook *ptr_hook, *next_hook;
char *new_msg, *message_modified;
/* make C compiler happy */
(void) plugin;
new_msg = NULL;
message_modified = strdup (string);
if (!message_modified)
return NULL;
hook_exec_start ();
ptr_hook = weechat_hooks[HOOK_TYPE_MODIFIER];
while (ptr_hook)
{
next_hook = ptr_hook->next_hook;
if (!ptr_hook->deleted
&& !ptr_hook->running
&& (string_strcasecmp (HOOK_MODIFIER(ptr_hook, modifier),
modifier) == 0))
{
ptr_hook->running = 1;
new_msg = (HOOK_MODIFIER(ptr_hook, callback))
(ptr_hook->callback_data, modifier, modifier_data,
message_modified);
ptr_hook->running = 0;
/* empty string returned => message dropped */
if (new_msg && !new_msg[0])
{
free (message_modified);
hook_exec_end ();
return new_msg;
}
/* new message => keep it as base for next modifier */
if (new_msg)
{
free (message_modified);
message_modified = new_msg;
}
}
ptr_hook = next_hook;
}
hook_exec_end ();
return message_modified;
}
/*
@ -1104,6 +1195,11 @@ unhook (struct t_hook *hook)
free (HOOK_COMPLETION(hook, completion));
free ((struct t_hook_completion *)hook->hook_data);
break;
case HOOK_TYPE_MODIFIER:
if (HOOK_MODIFIER(hook, modifier))
free (HOOK_MODIFIER(hook, modifier));
free ((struct t_hook_modifier *)hook->hook_data);
break;
case HOOK_NUM_TYPES:
/* this constant is used to count types only,
it is never used as type */
@ -1288,6 +1384,16 @@ hook_print_log ()
log_printf (" completion . . . . . : '%s'", HOOK_COMPLETION(ptr_hook, completion));
}
break;
case HOOK_TYPE_MODIFIER:
log_printf (" type . . . . . . . . . : %d (modifier)", ptr_hook->type);
log_printf (" callback_data. . . . . : 0x%x", ptr_hook->callback_data);
if (!ptr_hook->deleted)
{
log_printf (" modifier data:");
log_printf (" callback . . . . . . : 0x%x", HOOK_MODIFIER(ptr_hook, callback));
log_printf (" modifier . . . . . . : '%s'", HOOK_MODIFIER(ptr_hook, modifier));
}
break;
case HOOK_NUM_TYPES:
/* this constant is used to count types only,
it is never used as type */

View File

@ -34,6 +34,7 @@ enum t_hook_type
HOOK_TYPE_SIGNAL, /* signal */
HOOK_TYPE_CONFIG, /* config option */
HOOK_TYPE_COMPLETION, /* custom completions */
HOOK_TYPE_MODIFIER, /* stirng modifier */
/* number of hook types */
HOOK_NUM_TYPES,
};
@ -49,6 +50,7 @@ enum t_hook_type
#define HOOK_SIGNAL(hook, var) (((struct t_hook_signal *)hook->hook_data)->var)
#define HOOK_CONFIG(hook, var) (((struct t_hook_config *)hook->hook_data)->var)
#define HOOK_COMPLETION(hook, var) (((struct t_hook_completion *)hook->hook_data)->var)
#define HOOK_MODIFIER(hook, var) (((struct t_hook_modifier *)hook->hook_data)->var)
struct t_hook
{
@ -139,7 +141,16 @@ typedef int (t_hook_callback_completion)(void *data, char *completion,
struct t_hook_completion
{
t_hook_callback_completion *callback; /* completion callback */
char *completion; /* name of completion */
char *completion; /* name of completion */
};
typedef char *(t_hook_callback_modifier)(void *data, char *modifier,
char *modifier_data, char *string);
struct t_hook_modifier
{
t_hook_callback_modifier *callback; /* modifier callback */
char *modifier; /* name of modifier */
};
/* hook variables */
@ -203,6 +214,13 @@ extern void hook_completion_exec (struct t_weechat_plugin *plugin,
char *completion,
struct t_gui_buffer *buffer,
struct t_weelist *list);
extern struct t_hook *hook_modifier (struct t_weechat_plugin *plugin,
char *modifier,
t_hook_callback_modifier *callback,
void *callback_data);
extern char *hook_modifier_exec (struct t_weechat_plugin *plugin,
char *modifier, char *modifier_data,
char *string);
extern void unhook (struct t_hook *hook);
extern void unhook_all_plugin (struct t_weechat_plugin *plugin);
extern void unhook_all ();

View File

@ -47,12 +47,12 @@
/*
* strndup: define strndup function if not existing (FreeBSD and maybe other)
* string_strndup: define strndup function for systems where this function does
* not exist (FreeBSD and maybe other)
*/
#ifndef HAVE_STRNDUP
char *
strndup (char *string, int length)
string_strndup (char *string, int length)
{
char *result;
@ -68,7 +68,6 @@ strndup (char *string, int length)
return result;
}
#endif
/*
* string_tolower: locale independant string conversion to lower case
@ -337,7 +336,7 @@ string_remove_quotes (char *string, char *quotes)
{
if (pos_end == (pos_start + 1))
return strdup ("");
return strndup (pos_start + 1, pos_end - pos_start - 1);
return string_strndup (pos_start + 1, pos_end - pos_start - 1);
}
return strdup (string);

View File

@ -20,9 +20,7 @@
#ifndef __WEECHAT_STRING_H
#define __WEECHAT_STRING_H 1
#ifndef HAVE_STRNDUP
extern char *strndup (char *string, int length);
#endif
extern char *string_strndup (char *string, int length);
extern void string_tolower (char *string);
extern void string_toupper (char *string);
extern int string_strcasecmp (char *string1, char *string2);

View File

@ -98,7 +98,7 @@ gui_color_get_fg_bg (char *string, char **fg, char **bg)
{
pos_end_fg--;
}
*fg = strndup (string, pos_end_fg - string + 1);
*fg = string_strndup (string, pos_end_fg - string + 1);
}
else
*fg = strudp ("default");

View File

@ -30,6 +30,7 @@
#include <signal.h>
#include "../../core/weechat.h"
#include "../../core/wee-command.h"
#include "../../core/wee-config.h"
#include "../../core/wee-hook.h"
#include "../../core/wee-string.h"
@ -119,7 +120,7 @@ gui_main_init ()
}
/*
* gui_main_quit: quit weechat (signal received)
* gui_main_quit: quit WeeChat
*/
void
@ -128,6 +129,16 @@ gui_main_quit ()
quit_weechat = 1;
}
/*
* gui_main_reload: reload WeeChat configuration
*/
void
gui_main_reload ()
{
command_reload (NULL, NULL, 0, NULL, NULL);
}
/*
* gui_main_loop: main loop for WeeChat with ncurses GUI
*/
@ -147,8 +158,8 @@ gui_main_loop ()
/* catch SIGTERM signal: quit program */
util_catch_signal (SIGTERM, &gui_main_quit);
/* cach SIGHUP signal: reload configuration */
util_catch_signal (SIGHUP, &gui_main_quit);
/* catch SIGHUP signal: reload configuration */
util_catch_signal (SIGHUP, &gui_main_reload);
/* catch SIGWINCH signal: redraw screen */
util_catch_signal (SIGWINCH, &gui_window_refresh_screen_sigwinch);

View File

@ -24,10 +24,7 @@
#endif
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <signal.h>
#include <libgen.h>
#include "../../core/weechat.h"
#include "../../core/wee-config.h"
@ -1334,7 +1331,6 @@ gui_window_refresh_screen_sigwinch ()
{
gui_window_refresh_needed = 1;
//gui_window_refresh_screen (0);
signal (SIGWINCH, &gui_window_refresh_screen_sigwinch);
}
/*

View File

@ -710,8 +710,8 @@ gui_completion_build_list_template (struct t_gui_completion *completion,
{
if (pos_end > pos)
{
custom_completion = strndup (pos,
pos_end - pos);
custom_completion = string_strndup (pos,
pos_end - pos);
if (custom_completion)
{
gui_completion_custom (completion,

View File

@ -405,7 +405,7 @@ gui_keyboard_new (char *key, char *command, t_gui_key_func *function, char *args
{
length = strlen (args);
if ((length > 1) && (args[length - 1] == '"'))
new_key->args = strndup (args + 1, length - 2);
new_key->args = string_strndup (args + 1, length - 2);
else
new_key->args = strdup (args);
}
@ -544,7 +544,7 @@ gui_keyboard_bind (char *key, char *command)
{
ptr_args = strchr (command, ' ');
if (ptr_args)
command2 = strndup (command, ptr_args - command);
command2 = string_strndup (command, ptr_args - command);
else
command2 = strdup (command);
if (command2)

View File

@ -309,7 +309,8 @@ alias_new (char *name, char *command)
return ptr_alias;
}
if ((new_alias = ((struct t_alias *)malloc (sizeof (struct t_alias)))))
new_alias = (struct t_alias *)malloc (sizeof (struct t_alias));
if (new_alias)
{
new_hook = weechat_hook_command (name, "[alias]", NULL, NULL, NULL,
alias_cb, new_alias);
@ -331,11 +332,9 @@ alias_new (char *name, char *command)
else
alias_list = new_alias;
last_alias = new_alias;
return new_alias;
}
return NULL;
return new_alias;
}
/*
@ -372,7 +371,7 @@ alias_get_final_command (struct t_alias *alias)
}
/*
* alias_free: free an alias and reomve it from list
* alias_free: free an alias and remove it from list
*/
void
@ -390,7 +389,6 @@ alias_free (struct t_alias *alias)
}
else
new_alias_list = alias->next_alias;
if (alias->next_alias)
(alias->next_alias)->prev_alias = alias->prev_alias;
@ -402,6 +400,7 @@ alias_free (struct t_alias *alias)
if (alias->command)
free (alias->command);
free (alias);
alias_list = new_alias_list;
}
@ -416,6 +415,20 @@ alias_free_all ()
alias_free (alias_list);
}
/*
* alias_config_reaload: reload alias configuration file
*/
int
alias_config_reload (struct t_config_file *config_file)
{
/* make C compiler happy */
(void) config_file;
alias_free_all ();
return weechat_config_reload (alias_config_file);
}
/*
* alias_config_read_line: read an alias in configuration file
*/
@ -510,7 +523,8 @@ alias_config_init ()
{
struct t_config_section *ptr_section;
alias_config_file = weechat_config_new (ALIAS_CONFIG_FILENAME);
alias_config_file = weechat_config_new (ALIAS_CONFIG_FILENAME,
&alias_config_reload);
if (!alias_config_file)
return 0;
@ -537,34 +551,6 @@ alias_config_read ()
return weechat_config_read (alias_config_file);
}
/*
* alias_config_reaload_signal_cb: reload alias configuration file
*/
int
alias_config_reload_signal_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;
alias_free_all ();
if (weechat_config_reload (alias_config_file) == 0)
{
weechat_printf (NULL,
_("%s%s: configuration file reloaded"),
weechat_prefix ("info"), "alias");
return WEECHAT_RC_OK;
}
weechat_printf (NULL,
_("%s%s: failed to reload configuration file"),
weechat_prefix ("error"), "alias");
return WEECHAT_RC_ERROR;
}
/*
* alias_config_write: write alias configuration file
*/
@ -651,7 +637,8 @@ alias_command_cb (void *data, struct t_gui_buffer *buffer, int argc,
else
weechat_printf (NULL, _("No alias defined"));
}
return 0;
return WEECHAT_RC_OK;
}
/*
@ -755,8 +742,6 @@ weechat_plugin_init (struct t_weechat_plugin *plugin)
"%(alias)",
&unalias_command_cb, NULL);
weechat_hook_signal ("config_reload", &alias_config_reload_signal_cb, NULL);
weechat_hook_completion ("alias", &alias_completion_cb, NULL);
return WEECHAT_RC_OK;
@ -767,8 +752,11 @@ weechat_plugin_init (struct t_weechat_plugin *plugin)
*/
int
weechat_plugin_end ()
weechat_plugin_end (struct t_weechat_plugin *plugin)
{
/* make C compiler happy */
(void) plugin;
alias_config_write ();
alias_free_all ();
weechat_config_free (alias_config_file);

View File

@ -20,6 +20,6 @@ libdir = ${weechat_libdir}/plugins
lib_LTLIBRARIES = charset.la
charset_la_SOURCES = charset.c
charset_la_SOURCES = charset.c charset.h
charset_la_LDFLAGS = -module
charset_la_LIBADD = $(CHARSET_LFLAGS)

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,33 @@
/*
* 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_CHARSET_H
#define __WEECHAT_CHARSET_H 1
#define CHARSET_CONFIG_FILENAME "charset.rc"
struct t_charset
{
char *name; /* charset name (identifier) */
char *charset; /* charset value for name */
struct t_charset *prev_charset; /* link to previous charset */
struct t_charset *next_charset; /* link to next charset */
};
#endif /* charset.h */

View File

@ -387,7 +387,10 @@ weechat_plugin_init (struct t_weechat_plugin *plugin)
*/
int
weechat_plugin_end ()
weechat_plugin_end (struct t_weechat_plugin *plugin)
{
/* make C compiler happy */
(void) plugin;
return WEECHAT_RC_OK;
}

View File

@ -368,8 +368,11 @@ weechat_plugin_init (struct t_weechat_plugin *plugin)
*/
int
weechat_plugin_end ()
weechat_plugin_end (struct t_weechat_plugin *plugin)
{
/* make C compiler happy */
(void) plugin;
fifo_remove ();
return WEECHAT_RC_OK;

View File

@ -207,6 +207,64 @@ irc_config_change_notify_levels ()
{
}
/*
* irc_config_reload: reload IRC configuration file
*/
int
irc_config_reload (struct t_config_file *config_file)
{
struct t_irc_server *ptr_server, *next_server;
int rc;
/* make C compiler happy */
(void) config_file;
irc_config_server = NULL;
irc_config_reload_flag = 1;
for (ptr_server = irc_servers; ptr_server;
ptr_server = ptr_server->next_server)
{
ptr_server->reloaded_from_config = 0;
}
rc = weechat_config_reload (irc_config_file);
if (rc == 0)
{
if (irc_config_server)
irc_server_init_with_config_options (irc_config_server,
irc_config_section_server,
irc_config_reload_flag);
ptr_server = irc_servers;
while (ptr_server)
{
next_server = ptr_server->next_server;
if (!ptr_server->reloaded_from_config)
{
if (ptr_server->is_connected)
{
weechat_printf (NULL,
_("%s%s: warning: server \"%s\" not found "
"in configuration file, not deleted in "
"memory because it's currently used"),
weechat_prefix ("error"), "irc",
ptr_server->name);
}
else
irc_server_free (ptr_server);
}
ptr_server = next_server;
}
}
return rc;
}
/*
* irc_config_read_server_line: read a server line in configuration file
*/
@ -410,7 +468,8 @@ irc_config_init ()
{
struct t_config_section *ptr_section;
irc_config_file = weechat_config_new (IRC_CONFIG_FILENAME);
irc_config_file = weechat_config_new (IRC_CONFIG_FILENAME,
&irc_config_reload);
if (!irc_config_file)
return 0;
@ -726,74 +785,6 @@ irc_config_read ()
return rc;
}
/*
* irc_config_reload_cb: read IRC configuration file
*/
int
irc_config_reload_cb (void *data, char *event, void *pointer)
{
struct t_irc_server *ptr_server, *next_server;
int rc;
/* make C compiler happy */
(void) data;
(void) event;
(void) pointer;
irc_config_server = NULL;
irc_config_reload_flag = 1;
for (ptr_server = irc_servers; ptr_server;
ptr_server = ptr_server->next_server)
{
ptr_server->reloaded_from_config = 0;
}
rc = weechat_config_reload (irc_config_file);
if (rc == 0)
{
if (irc_config_server)
irc_server_init_with_config_options (irc_config_server,
irc_config_section_server,
irc_config_reload_flag);
ptr_server = irc_servers;
while (ptr_server)
{
next_server = ptr_server->next_server;
if (!ptr_server->reloaded_from_config)
{
if (ptr_server->is_connected)
{
weechat_printf (NULL,
_("%s%s: warning: server \"%s\" not found "
"in configuration file. It has not been "
"deleted because it's used now."),
weechat_prefix ("info"), "irc",
ptr_server->name);
}
else
irc_server_free (ptr_server);
}
ptr_server = next_server;
}
weechat_printf (NULL,
_("%s%s: configuration file reloaded"),
weechat_prefix ("info"), "irc");
return WEECHAT_RC_OK;
}
weechat_printf (NULL,
_("%s%s: failed to reload configuration file"),
weechat_prefix ("error"), "irc");
return WEECHAT_RC_ERROR;
}
/*
* irc_config_write: write IRC configuration file
* return: 0 if ok

View File

@ -69,7 +69,6 @@ struct t_config_option *irc_config_log_hide_nickserv_pwd;
int irc_config_init ();
int irc_config_read ();
int irc_config_reload_cb ();
int irc_config_write ();
#endif /* irc-config.h */

View File

@ -499,7 +499,7 @@ irc_protocol_recv_command (struct t_irc_server *server, char *entire_line,
if (!command)
return -2;
/* look for IRC command */
cmd_found = -1;
for (i = 0; irc_protocol_messages[i].name; i++)

View File

@ -37,8 +37,8 @@ struct t_irc_protocol_msg
t_irc_recv_func2 *recv_function2; /* function called when msg is received */
};
extern int irc_protocol_is_highlight (char *, char *);
extern int irc_protocol_recv_command (struct t_irc_server *, char *, char *, char *, char *);
extern int irc_protocol_is_highlight (char *message, char *nick);
extern int irc_protocol_recv_command (struct t_irc_server *server, char *entire_line, char *host, char *command, char *arguments);
extern int irc_protocol_cmd_error (struct t_irc_server *server, int argc, char **argv, char **argv_eol, int ignore, int highlight);
extern int irc_protocol_cmd_invite (struct t_irc_server *server, int argc, char **argv, char **argv_eol, int ignore, int highlight);
extern int irc_protocol_cmd_join (struct t_irc_server *server, int argc, char **argv, char **argv_eol, int ignore, int highlight);

View File

@ -986,24 +986,33 @@ irc_server_sendf (struct t_irc_server *server, char *format, ...)
/*
* irc_server_parse_message: parse IRC message and return pointer to
* host, command and arguments (if any)
* host, command, channel, target nick and arguments
* (if any)
*/
void
irc_server_parse_message (char *message, char **host, char **command, char **args)
irc_server_parse_message (char *message, char **nick, char **host,
char **command, char **channel, char **arguments)
{
char *pos, *pos2;
char *pos, *pos2, *pos3, *pos4;
*nick = NULL;
*host = NULL;
*command = NULL;
*args = NULL;
*channel = NULL;
*arguments = NULL;
if (message[0] == ':')
{
pos2 = strchr (message, '!');
pos = strchr (message, ' ');
if (pos2)
*nick = weechat_strndup (message + 1, pos2 - (message + 1));
else if (pos)
*nick = weechat_strndup (message + 1, pos - (message + 1));
if (pos)
{
*host = strndup (message + 1, pos - (message + 1));
*host = weechat_strndup (message + 1, pos - (message + 1));
pos++;
}
else
@ -1019,11 +1028,47 @@ irc_server_parse_message (char *message, char **host, char **command, char **arg
pos2 = strchr (pos, ' ');
if (pos2)
{
*command = strndup (pos, pos2 - pos);
*command = weechat_strndup (pos, pos2 - pos);
pos2++;
while (pos2[0] == ' ')
pos2++;
*args = strdup (pos2);
*arguments = strdup (pos2);
if (pos2[0] != ':')
{
if (irc_channel_is_channel (pos2))
{
pos3 = strchr (pos2, ' ');
if (pos3)
*channel = weechat_strndup (pos2, pos3 - pos2);
else
*channel = strdup (pos2);
}
else
{
pos3 = strchr (pos2, ' ');
if (!*nick)
{
if (pos3)
*nick = weechat_strndup (pos2, pos3 - pos2);
else
*nick = strdup (pos2);
}
if (pos3)
{
pos3++;
while (pos3[0] == ' ')
pos3++;
if (irc_channel_is_channel (pos3))
{
pos4 = strchr (pos3, ' ');
if (pos4)
*channel = weechat_strndup (pos3, pos4 - pos3);
else
*channel = strdup (pos3);
}
}
}
}
}
}
}
@ -1171,7 +1216,9 @@ irc_server_msgq_flush ()
{
struct t_irc_message *next;
char *ptr_data, *new_msg, *ptr_msg, *pos;
char *host, *command, *args;
char *nick, *host, *command, *channel, *arguments, *msg_decoded;
char *modifier_data, *ptr_chan_nick;
int length;
while (irc_recv_msgq)
{
@ -1220,17 +1267,48 @@ irc_server_msgq_flush ()
pos = strchr (ptr_msg, '\n');
if (pos)
pos[0] = '\0';
//if (new_msg)
// gui_chat_printf_raw_data (irc_recv_msgq->server,
// 0, 1, ptr_msg);
irc_server_parse_message (ptr_msg, &host,
&command, &args);
irc_server_parse_message (ptr_msg, &nick, &host,
&command, &channel,
&arguments);
/* convert charset for message */
msg_decoded = NULL;
ptr_chan_nick = (channel) ? channel : nick;
length = strlen (weechat_plugin->name) + 1 +
strlen (irc_recv_msgq->server->name) + 1 +
((ptr_chan_nick) ? strlen (ptr_chan_nick) : 0) + 1;
modifier_data = (char *)malloc (length);
if (modifier_data)
{
if (ptr_chan_nick)
{
snprintf (modifier_data, length, "%s.%s.%s",
weechat_plugin->name,
irc_recv_msgq->server->name,
ptr_chan_nick);
}
else
{
snprintf (modifier_data, length, "%s.%s.%s",
weechat_plugin->name,
irc_recv_msgq->server->name,
ptr_chan_nick);
}
msg_decoded = weechat_hook_modifier_exec ("charset_decode",
modifier_data,
ptr_msg);
free (modifier_data);
}
switch (irc_protocol_recv_command (irc_recv_msgq->server,
ptr_msg,
host, command, args))
(msg_decoded) ?
msg_decoded : ptr_msg,
host, command,
arguments))
{
case -1:
weechat_printf (irc_recv_msgq->server->buffer,
@ -1251,9 +1329,9 @@ irc_server_msgq_flush ()
_("%s%s: unknown command: "
"cmd=\"%s\", "
"host=\"%s\", "
"args=\"%s\""),
"arguments=\"%s\""),
weechat_prefix ("error"),
"irc", command, host, args);
"irc", command, host, arguments);
break;
}
@ -1261,8 +1339,8 @@ irc_server_msgq_flush ()
free (host);
if (command)
free (command);
if (args)
free (args);
if (arguments)
free (arguments);
if (pos)
{

View File

@ -161,8 +161,9 @@ extern int irc_server_send (struct t_irc_server *server, char *buffer,
int size_buf);
extern void irc_server_outqueue_send (struct t_irc_server *server);
extern void irc_server_sendf (struct t_irc_server *server, char *format, ...);
extern void irc_server_parse_message (char *message, char **host,
char **command, char **args);
extern void irc_server_parse_message (char *message, char **nick,
char **host, char **command,
char **channel, char **arguments);
extern int irc_server_recv_cb (void *arg_server);
extern void irc_server_timer_cb (void *empty);
extern void irc_server_timer_check_away (void *empty);

View File

@ -16,7 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* irc-core.c: main IRC functions */
/* irc.c: IRC plugin for WeeChat */
#ifdef HAVE_CONFIG_H
@ -185,7 +185,6 @@ weechat_plugin_init (struct t_weechat_plugin *plugin)
/* hook signals */
weechat_hook_signal ("dump_data", &irc_dump_data_cb, NULL);
weechat_hook_signal ("config_reload", &irc_config_reload_cb, NULL);
weechat_hook_signal ("quit", &irc_quit_cb, NULL);
weechat_hook_signal ("debug", &irc_debug_cb, NULL);
@ -213,8 +212,11 @@ weechat_plugin_init (struct t_weechat_plugin *plugin)
*/
int
weechat_plugin_end ()
weechat_plugin_end (struct t_weechat_plugin *plugin)
{
/* make C compiler happy */
(void) plugin;
irc_config_write ();
irc_server_disconnect_all ();

View File

@ -659,8 +659,11 @@ weechat_plugin_init (struct t_weechat_plugin *plugin)
*/
int
weechat_plugin_end ()
weechat_plugin_end (struct t_weechat_plugin *plugin)
{
/* make C compiler happy */
(void) plugin;
logger_stop_all ();
return WEECHAT_RC_OK;

View File

@ -281,6 +281,26 @@ plugin_config_free_all ()
plugin_config_free (plugin_options);
}
/*
* plugin_config_reload: reload plugins configuration file
* return: 0 = successful
* -1 = config file file not found
* -2 = error in config file
*/
int
plugin_config_reload (struct t_config_file *config_file)
{
/* make C compiler happy */
(void) config_file;
/* remove all plugin options */
plugin_config_free_all ();
/* reload plugins config file */
return config_file_reload (plugin_config);
}
/*
* plugin_config_read_option: read an option in config file
* Return: 0 = successful
@ -335,7 +355,8 @@ plugin_config_write_options (struct t_config_file *config_file,
void
plugin_config_init ()
{
plugin_config = config_file_new (NULL, PLUGIN_CONFIG_FILENAME);
plugin_config = config_file_new (NULL, PLUGIN_CONFIG_FILENAME,
&plugin_config_reload);
if (plugin_config)
{
config_file_new_section (plugin_config, "plugins",
@ -358,23 +379,6 @@ plugin_config_read ()
return config_file_read (plugin_config);
}
/*
* plugin_config_reload: read plugins configuration file
* return: 0 = successful
* -1 = config file file not found
* -2 = error in config file
*/
int
plugin_config_reload ()
{
/* remove all plugin options */
plugin_config_free_all ();
/* reload plugins config file */
return config_file_reload (plugin_config);
}
/*
* plugin_config_write: write plugins configuration file
* return: 0 if ok

View File

@ -233,6 +233,7 @@ plugin_load (char *filename)
new_plugin->iconv_from_internal = &string_iconv_from_internal;
new_plugin->gettext = &plugin_api_gettext;
new_plugin->ngettext = &plugin_api_ngettext;
new_plugin->strndup = &string_strndup;
new_plugin->strcasecmp = &string_strcasecmp;
new_plugin->strncasecmp = &string_strncasecmp;
new_plugin->strcmp_ignore_chars = &string_strcmp_ignore_chars;
@ -315,6 +316,8 @@ plugin_load (char *filename)
new_plugin->hook_signal_send = &hook_signal_send;
new_plugin->hook_config = &hook_config;
new_plugin->hook_completion = &hook_completion;
new_plugin->hook_modifier = &hook_modifier;
new_plugin->hook_modifier_exec = &hook_modifier_exec;
new_plugin->unhook = &unhook;
new_plugin->unhook_all = &unhook_all_plugin;
@ -517,7 +520,7 @@ plugin_remove (struct t_weechat_plugin *plugin)
/* remove all hooks */
unhook_all_plugin (plugin);
/* remove pointer to this plugin on buffers */
for (ptr_buffer = gui_buffers; ptr_buffer;
ptr_buffer = ptr_buffer->next_buffer)

View File

@ -1671,7 +1671,7 @@ weechat_lua_api_hook_config (lua_State *L)
}
/*
* weechat_lua_api_hook_completion_cb: callback for completion option hooked
* weechat_lua_api_hook_completion_cb: callback for completion hooked
*/
int
@ -1752,6 +1752,114 @@ weechat_lua_api_hook_completion (lua_State *L)
LUA_RETURN_STRING_FREE(result);
}
/*
* weechat_lua_api_hook_modifier_cb: callback for modifier hooked
*/
char *
weechat_lua_api_hook_modifier_cb (void *data, char *modifier,
char *modifier_data, char *string)
{
struct t_script_callback *script_callback;
char *lua_argv[4];
script_callback = (struct t_script_callback *)data;
lua_argv[0] = modifier;
lua_argv[1] = modifier_data;
lua_argv[2] = string;
lua_argv[3] = NULL;
return (char *)weechat_lua_exec (script_callback->script,
WEECHAT_SCRIPT_EXEC_STRING,
script_callback->function,
lua_argv);
}
/*
* weechat_lua_api_hook_modifier: hook a modifier
*/
static int
weechat_lua_api_hook_modifier (lua_State *L)
{
const char *modifier, *function;
char *result;
int n;
/* make C compiler happy */
(void) L;
if (!lua_current_script)
{
WEECHAT_SCRIPT_MSG_NOT_INITIALIZED("hook_modifier");
LUA_RETURN_EMPTY;
}
modifier = NULL;
function = NULL;
n = lua_gettop (lua_current_interpreter);
if (n < 2)
{
WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("hook_modifier");
LUA_RETURN_EMPTY;
}
modifier = lua_tostring (lua_current_interpreter, -2);
function = lua_tostring (lua_current_interpreter, -1);
result = script_ptr2str (script_api_hook_modifier (weechat_lua_plugin,
lua_current_script,
(char *)modifier,
&weechat_lua_api_hook_modifier_cb,
(char *)function));
LUA_RETURN_STRING_FREE(result);
}
/*
* weechat_lua_api_hook_modifier_exec: execute a modifier hook
*/
static int
weechat_lua_api_hook_modifier_exec (lua_State *L)
{
const char *modifier, *modifier_data, *string;
char *result;
int n;
/* make C compiler happy */
(void) L;
if (!lua_current_script)
{
WEECHAT_SCRIPT_MSG_NOT_INITIALIZED("hook_modifier_exec");
LUA_RETURN_EMPTY;
}
modifier = NULL;
modifier_data = NULL;
string = NULL;
n = lua_gettop (lua_current_interpreter);
if (n < 3)
{
WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("hook_modifier_exec");
LUA_RETURN_ERROR;
}
modifier = lua_tostring (lua_current_interpreter, -3);
modifier_data = lua_tostring (lua_current_interpreter, -2);
string = lua_tostring (lua_current_interpreter, -1);
result = weechat_hook_modifier_exec ((char *)modifier,
(char *)modifier_data,
(char *)string);
LUA_RETURN_STRING_FREE(result);
}
/*
* weechat_lua_api_unhook: unhook something
*/
@ -3539,6 +3647,8 @@ const struct luaL_reg weechat_lua_api_funcs[] = {
{ "hook_signal_send", &weechat_lua_api_hook_signal_send },
{ "hook_config", &weechat_lua_api_hook_config },
{ "hook_completion", &weechat_lua_api_hook_completion },
{ "hook_modifier", &weechat_lua_api_hook_modifier },
{ "hook_modifier_exec", &weechat_lua_api_hook_modifier_exec },
{ "unhook", &weechat_lua_api_unhook },
{ "unhook_all", &weechat_lua_api_unhook_all },
{ "buffer_new", &weechat_lua_api_buffer_new },

View File

@ -1422,6 +1422,92 @@ static XS (XS_weechat_hook_completion)
PERL_RETURN_STRING_FREE(result);
}
/*
* weechat_perl_api_hook_modifier_cb: callback for modifier hooked
*/
char *
weechat_perl_api_hook_modifier_cb (void *data, char *modifier,
char *modifier_data, char *string)
{
struct t_script_callback *script_callback;
char *perl_argv[4];
script_callback = (struct t_script_callback *)data;
perl_argv[0] = modifier;
perl_argv[1] = modifier_data;
perl_argv[2] = string;
perl_argv[3] = NULL;
return (char *)weechat_perl_exec (script_callback->script,
WEECHAT_SCRIPT_EXEC_STRING,
script_callback->function,
perl_argv);
}
/*
* weechat::hook_modifier: hook a modifier
*/
static XS (XS_weechat_hook_modifier)
{
char *result;
dXSARGS;
/* make C compiler happy */
(void) cv;
if (!perl_current_script)
{
WEECHAT_SCRIPT_MSG_NOT_INITIALIZED("hook_modifier");
PERL_RETURN_EMPTY;
}
if (items < 2)
{
WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("hook_modifier");
PERL_RETURN_EMPTY;
}
result = script_ptr2str (script_api_hook_modifier (weechat_perl_plugin,
perl_current_script,
SvPV (ST (0), PL_na), /* modifier */
&weechat_perl_api_hook_modifier_cb,
SvPV (ST (1), PL_na))); /* perl function */
PERL_RETURN_STRING_FREE(result);
}
/*
* weechat::hook_modifier_exec: execute a modifier hook
*/
static XS (XS_weechat_hook_modifier_exec)
{
char *result;
dXSARGS;
/* make C compiler happy */
(void) cv;
if (!perl_current_script)
{
WEECHAT_SCRIPT_MSG_NOT_INITIALIZED("hook_modifier_exec");
PERL_RETURN_EMPTY;
}
if (items < 3)
{
WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("hook_modifier_exec");
PERL_RETURN_EMPTY;
}
result = weechat_hook_modifier_exec (SvPV (ST (0), PL_na), /* modifier */
SvPV (ST (1), PL_na), /* modifier_data */
SvPV (ST (2), PL_na)); /* string */
PERL_RETURN_STRING_FREE(result);
}
/*
* weechat::unhook: unhook something
*/
@ -1487,7 +1573,7 @@ weechat_perl_api_input_data_cb (void *data, struct t_gui_buffer *buffer,
{
struct t_script_callback *script_callback;
char *perl_argv[3];
int *r, ret;
int *rc, ret;
script_callback = (struct t_script_callback *)data;
@ -1495,16 +1581,16 @@ weechat_perl_api_input_data_cb (void *data, struct t_gui_buffer *buffer,
perl_argv[1] = input_data;
perl_argv[2] = NULL;
r = (int *) weechat_perl_exec (script_callback->script,
WEECHAT_SCRIPT_EXEC_INT,
script_callback->function,
perl_argv);
if (!r)
rc = (int *) weechat_perl_exec (script_callback->script,
WEECHAT_SCRIPT_EXEC_INT,
script_callback->function,
perl_argv);
if (!rc)
ret = WEECHAT_RC_ERROR;
else
{
ret = *r;
free (r);
ret = *rc;
free (rc);
}
if (perl_argv[0])
free (perl_argv[0]);
@ -2723,6 +2809,8 @@ weechat_perl_api_init (pTHX)
newXS ("weechat::hook_signal_send", XS_weechat_hook_signal_send, "weechat");
newXS ("weechat::hook_config", XS_weechat_hook_config, "weechat");
newXS ("weechat::hook_completion", XS_weechat_hook_completion, "weechat");
newXS ("weechat::hook_modifier", XS_weechat_hook_modifier, "weechat");
newXS ("weechat::hook_modifier_exec", XS_weechat_hook_modifier_exec, "weechat");
newXS ("weechat::unhook", XS_weechat_unhook, "weechat");
newXS ("weechat::unhook_all", XS_weechat_unhook_all, "weechat");
newXS ("weechat::buffer_new", XS_weechat_buffer_new, "weechat");

View File

@ -110,19 +110,20 @@ weechat_perl_exec (struct t_plugin_script *script,
char *func;
unsigned int count;
void *ret_value;
int *ret_i, mem_err;
int *ret_i, mem_err, length;
SV *ret_s;
/* this code is placed here to conform ISO C90 */
dSP;
#ifndef MULTIPLICITY
int size = strlen (script->interpreter) + strlen(function) + 3;
func = (char *)malloc (size * sizeof(char));
int length = strlen (script->interpreter) + strlen (function) + 3;
func = (char *)malloc (length * sizeof(char));
if (!func)
return NULL;
snprintf (func, size, "%s::%s", (char *) script->interpreter, function);
snprintf (func, length, "%s::%s", (char *) script->interpreter, function);
#else
(void) length;
func = function;
PERL_SET_CONTEXT (script->interpreter);
#endif

View File

@ -1551,6 +1551,99 @@ weechat_python_api_hook_completion (PyObject *self, PyObject *args)
PYTHON_RETURN_STRING_FREE(result);
}
/*
* weechat_python_api_hook_modifier_cb: callback for modifier hooked
*/
char *
weechat_python_api_hook_modifier_cb (void *data, char *modifier,
char *modifier_data, char *string)
{
struct t_script_callback *script_callback;
char *python_argv[4];
script_callback = (struct t_script_callback *)data;
python_argv[0] = modifier;
python_argv[1] = modifier_data;
python_argv[2] = string;
python_argv[3] = NULL;
return (char *)weechat_python_exec (script_callback->script,
WEECHAT_SCRIPT_EXEC_STRING,
script_callback->function,
python_argv);
}
/*
* weechat_python_api_hook_modifier: hook a modifier
*/
static PyObject *
weechat_python_api_hook_modifier (PyObject *self, PyObject *args)
{
char *modifier, *function, *result;
PyObject *object;
/* make C compiler happy */
(void) self;
if (!python_current_script)
{
WEECHAT_SCRIPT_MSG_NOT_INITIALIZED("hook_modifier");
PYTHON_RETURN_EMPTY;
}
modifier = NULL;
function = NULL;
if (!PyArg_ParseTuple (args, "ss", &modifier, &function))
{
WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("hook_modifier");
PYTHON_RETURN_EMPTY;
}
result = script_ptr2str(script_api_hook_modifier (weechat_python_plugin,
python_current_script,
modifier,
&weechat_python_api_hook_modifier_cb,
function));
PYTHON_RETURN_STRING_FREE(result);
}
/*
* weechat_python_api_hook_modifier_exec: execute a modifier hook
*/
static PyObject *
weechat_python_api_hook_modifier_exec (PyObject *self, PyObject *args)
{
char *modifier, *modifier_data, *string, *result;
PyObject *object;
/* make C compiler happy */
(void) self;
if (!python_current_script)
{
WEECHAT_SCRIPT_MSG_NOT_INITIALIZED("hook_modifier_exec");
PYTHON_RETURN_EMPTY;
}
modifier = NULL;
modifier_data = NULL;
string = NULL;
if (!PyArg_ParseTuple (args, "sss", &modifier, &modifier_data, &string))
{
WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("hook_modifier_exec");
PYTHON_RETURN_EMPTY;
}
result = weechat_hook_modifier_exec (modifier, modifier_data, string);
PYTHON_RETURN_STRING_FREE(result);
}
/*
* weechat_python_api_unhook: unhook something
*/
@ -3160,6 +3253,8 @@ PyMethodDef weechat_python_funcs[] =
{ "hook_signal_send", &weechat_python_api_hook_signal_send, METH_VARARGS, "" },
{ "hook_config", &weechat_python_api_hook_config, METH_VARARGS, "" },
{ "hook_completion", &weechat_python_api_hook_completion, METH_VARARGS, "" },
{ "hook_modifier", &weechat_python_api_hook_modifier, METH_VARARGS, "" },
{ "hook_modifier_exec", &weechat_python_api_hook_modifier_exec, METH_VARARGS, "" },
{ "unhook", &weechat_python_api_unhook, METH_VARARGS, "" },
{ "unhook_all", &weechat_python_api_unhook_all, METH_VARARGS, "" },
{ "buffer_new", &weechat_python_api_buffer_new, METH_VARARGS, "" },

View File

@ -1777,6 +1777,114 @@ weechat_ruby_api_hook_completion (VALUE class, VALUE completion,
RUBY_RETURN_STRING_FREE(result);
}
/*
* weechat_ruby_api_hook_modifier_cb: callback for modifier hooked
*/
char *
weechat_ruby_api_hook_modifier_cb (void *data, char *modifier,
char *modifier_data, char *string)
{
struct t_script_callback *script_callback;
char *ruby_argv[4];
script_callback = (struct t_script_callback *)data;
ruby_argv[0] = modifier;
ruby_argv[1] = modifier_data;
ruby_argv[2] = string;
ruby_argv[3] = NULL;
return (char *)weechat_ruby_exec (script_callback->script,
WEECHAT_SCRIPT_EXEC_STRING,
script_callback->function,
ruby_argv);
}
/*
* weechat_ruby_api_hook_modifier: hook a modifier
*/
static VALUE
weechat_ruby_api_hook_modifier (VALUE class, VALUE modifier, VALUE function)
{
char *c_modifier, *c_function, *result;
VALUE return_value;
/* make C compiler happy */
(void) class;
if (!ruby_current_script)
{
WEECHAT_SCRIPT_MSG_NOT_INITIALIZED("hook_modifier");
RUBY_RETURN_EMPTY;
}
c_modifier = NULL;
c_function = NULL;
if (NIL_P (modifier) || NIL_P (function))
{
WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("hook_modifier");
RUBY_RETURN_EMPTY;
}
Check_Type (modifier, T_STRING);
Check_Type (function, T_STRING);
c_modifier = STR2CSTR (modifier);
c_function = STR2CSTR (function);
result = script_ptr2str (script_api_hook_modifier (weechat_ruby_plugin,
ruby_current_script,
c_modifier,
&weechat_ruby_api_hook_modifier_cb,
c_function));
RUBY_RETURN_STRING_FREE(result);
}
/*
* weechat_ruby_api_hook_modifier_exec: execute a modifier hook
*/
static VALUE
weechat_ruby_api_hook_modifier_exec (VALUE class, VALUE modifier,
VALUE modifier_data, VALUE string)
{
char *c_modifier, *c_modifier_data, *c_string, *result;
VALUE return_value;
/* make C compiler happy */
(void) class;
if (!ruby_current_script)
{
WEECHAT_SCRIPT_MSG_NOT_INITIALIZED("hook_modifier_exec");
RUBY_RETURN_EMPTY;
}
c_modifier = NULL;
c_modifier_data = NULL;
c_string = NULL;
if (NIL_P (modifier) || NIL_P (modifier_data) || NIL_P (string))
{
WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("hook_modifier_exec");
RUBY_RETURN_EMPTY;
}
Check_Type (modifier, T_STRING);
Check_Type (modifier_data, T_STRING);
Check_Type (string, T_STRING);
c_modifier = STR2CSTR (modifier);
c_modifier_data = STR2CSTR (modifier_data);
c_string = STR2CSTR (string);
result = weechat_hook_modifier_exec (c_modifier, c_modifier_data, c_string);
RUBY_RETURN_STRING_FREE(result);
}
/*
* weechat_ruby_api_unhook: unhook something
*/
@ -3300,6 +3408,8 @@ weechat_ruby_api_init (VALUE ruby_mWeechat)
rb_define_module_function (ruby_mWeechat, "hook_signal_send", &weechat_ruby_api_hook_signal_send, 3);
rb_define_module_function (ruby_mWeechat, "hook_config", &weechat_ruby_api_hook_config, 3);
rb_define_module_function (ruby_mWeechat, "hook_completion", &weechat_ruby_api_hook_completion, 2);
rb_define_module_function (ruby_mWeechat, "hook_modifier", &weechat_ruby_api_hook_modifier, 2);
rb_define_module_function (ruby_mWeechat, "hook_modifier_exec", &weechat_ruby_api_hook_modifier_exec, 3);
rb_define_module_function (ruby_mWeechat, "unhook", &weechat_ruby_api_unhook, 1);
rb_define_module_function (ruby_mWeechat, "unhook_all", &weechat_ruby_api_unhook_all, 0);
rb_define_module_function (ruby_mWeechat, "buffer_new", &weechat_ruby_api_buffer_new, 3);

View File

@ -385,6 +385,42 @@ script_api_hook_completion (struct t_weechat_plugin *weechat_plugin,
return new_hook;
}
/*
* script_api_hook_modifier: hook a modifier
* return new hook, NULL if error
*/
struct t_hook *
script_api_hook_modifier (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
char *modifier,
char *(*callback)(void *data, char *modifier,
char *modifier_data, char *string),
char *function)
{
struct t_script_callback *new_script_callback;
struct t_hook *new_hook;
new_script_callback = script_callback_alloc ();
if (!new_script_callback)
return NULL;
new_hook = weechat_hook_modifier (modifier, callback, new_script_callback);
if (!new_hook)
{
free (new_script_callback);
return NULL;
}
new_script_callback->script = script;
new_script_callback->function = strdup (function);
new_script_callback->hook = new_hook;
script_callback_add (script, new_script_callback);
return new_hook;
}
/*
* script_api_unhook: unhook something
* return 1 if ok, 0 if error

View File

@ -87,6 +87,14 @@ extern struct t_hook *script_api_hook_completion (struct t_weechat_plugin *weech
struct t_gui_buffer *buffer,
struct t_weelist *list),
char *function);
extern struct t_hook *script_api_hook_modifier (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
char *modifier,
char *(*callback)(void *data,
char *modifier,
char *modifier_data,
char *string),
char *function);
extern int script_api_unhook (struct t_weechat_plugin *weechat_plugin,
struct t_plugin_script *script,
struct t_hook *hook);

View File

@ -94,6 +94,7 @@ struct t_weechat_plugin
char *(*iconv_from_internal) (char *charset, char *string);
char *(*gettext) (char *string);
char *(*ngettext) (char *single, char *plural, int count);
char *(*strndup) (char *string, int length);
int (*strcasecmp) (char *string1, char *string2);
int (*strncasecmp) (char *string1, char *string2, int max);
int (*strcmp_ignore_chars) (char *string1, char *string2,
@ -155,7 +156,8 @@ struct t_weechat_plugin
/* config files */
struct t_config_file *(*config_new) (struct t_weechat_plugin *plugin,
char *filename);
char *filename,
int (*callback_reload)(struct t_config_file *config_file));
struct t_config_section *(*config_new_section) (struct t_config_file *config_file,
char *name,
void (*callback_read)
@ -257,6 +259,16 @@ struct t_weechat_plugin
struct t_gui_buffer *buffer,
struct t_weelist *list),
void *callback_data);
struct t_hook *(*hook_modifier) (struct t_weechat_plugin *plugin,
char *modifier,
char *(*callback)(void *data,
char *modifier,
char *modifier_data,
char *string),
void *callback_data);
char *(*hook_modifier_exec) (struct t_weechat_plugin *plugin,
char *modifier, char *modifier_data,
char *string);
void (*unhook) (struct t_hook *hook);
void (*unhook_all) (struct t_weechat_plugin *plugin);
@ -336,6 +348,8 @@ struct t_weechat_plugin
#define weechat_gettext(string) weechat_plugin->gettext(string)
#define weechat_ngettext(single,plural,number) \
weechat_plugin->ngettext(single, plural, number)
#define weechat_strndup(__string, __length) \
weechat_plugin->strndup(__string, __length)
#define weechat_strcasecmp(__string1, __string2) \
weechat_plugin->strcasecmp(__string1, __string2)
#define weechat_strncasecmp(__string1, __string2, __max) \
@ -435,8 +449,9 @@ struct t_weechat_plugin
weechat_plugin->list_free(__list)
/* config files */
#define weechat_config_new(__filename) \
weechat_plugin->config_new(weechat_plugin, __filename)
#define weechat_config_new(__filename, __callback_reload) \
weechat_plugin->config_new(weechat_plugin, __filename, \
__callback_reload)
#define weechat_config_new_section(__config, __name, __cb_read, \
__cb_write_std, __cb_write_def) \
weechat_plugin->config_new_section(__config, __name, __cb_read, \
@ -535,6 +550,13 @@ struct t_weechat_plugin
#define weechat_hook_completion(__completion, __callback, __data) \
weechat_plugin->hook_completion(weechat_plugin, __completion, \
__callback, __data)
#define weechat_hook_modifier(__modifier, __callback, __data) \
weechat_plugin->hook_modifier(weechat_plugin, __modifier, \
__callback, __data)
#define weechat_hook_modifier_exec(__modifier, __modifier_data, \
__string) \
weechat_plugin->hook_modifier_exec(weechat_plugin, __modifier, \
__modifier_data, __string)
#define weechat_unhook(__hook) \
weechat_plugin->unhook( __hook)
#define weechat_unhook_all() \