summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--doc/en/weechat.en.xml194
-rw-r--r--doc/fr/weechat.fr.xml197
-rw-r--r--po/cs.po18
-rw-r--r--po/es.po18
-rw-r--r--po/fr.po18
-rw-r--r--po/hu.po18
-rw-r--r--po/weechat.pot18
-rw-r--r--src/plugins/plugins-interface.c14
-rw-r--r--src/plugins/plugins.c6
-rw-r--r--src/plugins/scripts/lua/weechat-lua.c364
-rw-r--r--src/plugins/scripts/perl/weechat-perl.c365
-rw-r--r--src/plugins/scripts/python/weechat-python.c372
-rw-r--r--src/plugins/scripts/ruby/weechat-ruby.c354
-rw-r--r--src/plugins/weechat-plugin.h16
-rw-r--r--weechat/ChangeLog3
-rw-r--r--weechat/doc/en/weechat.en.xml194
-rw-r--r--weechat/doc/fr/weechat.fr.xml197
-rw-r--r--weechat/po/cs.po18
-rw-r--r--weechat/po/es.po18
-rw-r--r--weechat/po/fr.po18
-rw-r--r--weechat/po/hu.po18
-rw-r--r--weechat/po/weechat.pot18
-rw-r--r--weechat/src/plugins/plugins-interface.c14
-rw-r--r--weechat/src/plugins/plugins.c6
-rw-r--r--weechat/src/plugins/scripts/lua/weechat-lua.c364
-rw-r--r--weechat/src/plugins/scripts/perl/weechat-perl.c365
-rw-r--r--weechat/src/plugins/scripts/python/weechat-python.c372
-rw-r--r--weechat/src/plugins/scripts/ruby/weechat-ruby.c354
-rw-r--r--weechat/src/plugins/weechat-plugin.h16
30 files changed, 2228 insertions, 1722 deletions
diff --git a/ChangeLog b/ChangeLog
index b5594ff2a..f5b956b03 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,10 +1,11 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
-ChangeLog - 2006-02-12
+ChangeLog - 2006-02-16
Version 0.1.8 (under dev!):
+ * many commands allowed for aliases
* many commands allowed when connecting to server
* added Lua script plugin
* added functions in plugins API: get_server_info, free_server_info,
diff --git a/doc/en/weechat.en.xml b/doc/en/weechat.en.xml
index 65988b542..f809b2226 100644
--- a/doc/en/weechat.en.xml
+++ b/doc/en/weechat.en.xml
@@ -1490,7 +1490,7 @@ if (argv != NULL)
<screen>
int callback (t_weechat_plugin *plugin, char *file)
{
- plugin->printf_server (plugin, "file: %s", file);
+ plugin->print_server (plugin, "file: %s", file);
return 1;
}
...
@@ -1499,13 +1499,13 @@ plugin->exec_on_files (plugin, "/tmp", &amp;callback);
</para>
</section>
- <section id="secAPI_printf">
- <title>printf</title>
+ <section id="secAPI_print">
+ <title>print</title>
<para>
Prototype:
<command>
- void printf (t_weechat_plugin *plugin,
+ void print (t_weechat_plugin *plugin,
char *server, char *channel, char *message, ...)
</command>
</para>
@@ -1546,20 +1546,20 @@ plugin->exec_on_files (plugin, "/tmp", &amp;callback);
<para>
Examples:
<screen>
-plugin->printf (plugin, NULL, NULL, "hello");
-plugin->printf (plugin, NULL, "#weechat", "hello");
-plugin->printf (plugin, "freenode", "#weechat", "hello");
+plugin->print (plugin, NULL, NULL, "hello");
+plugin->print (plugin, NULL, "#weechat", "hello");
+plugin->print (plugin, "freenode", "#weechat", "hello");
</screen>
</para>
</section>
- <section id="secAPI_printf_server">
- <title>printf_server</title>
+ <section id="secAPI_print_server">
+ <title>print_server</title>
<para>
Prototype:
<command>
- void printf_server (t_weechat_plugin *plugin,
+ void print_server (t_weechat_plugin *plugin,
char *message, ...)
</command>
</para>
@@ -1585,17 +1585,17 @@ plugin->printf (plugin, "freenode", "#weechat", "hello");
Return value: none.
</para>
<para>
- Example: <screen>plugin->printf_server (plugin, "hello");</screen>
+ Example: <screen>plugin->print_server (plugin, "hello");</screen>
</para>
</section>
- <section id="secAPI_printf_infobar">
- <title>printf_infobar</title>
+ <section id="secAPI_print_infobar">
+ <title>print_infobar</title>
<para>
Prototype:
<command>
- void printf_infobar (t_weechat_plugin *plugin,
+ void print_infobar (t_weechat_plugin *plugin,
int time, char *message, ...)
</command>
</para>
@@ -1624,7 +1624,58 @@ plugin->printf (plugin, "freenode", "#weechat", "hello");
<para>
Example:
<screen>
-plugin->printf_infobar (plugin, 5, "hello");
+plugin->print_infobar (plugin, 5, "hello");
+</screen>
+ </para>
+ </section>
+
+ <section id="secAPI_log">
+ <title>log</title>
+
+ <para>
+ Prototype:
+ <command>
+ void log (t_weechat_plugin *plugin,
+ char *server, char *channel, char *message, ...)
+ </command>
+ </para>
+ <para>
+ Write a message in log file for a server or a channel.
+ </para>
+ <para>
+ Arguments:
+ <itemizedlist>
+ <listitem>
+ <para>
+ <option>plugin</option>: pointer to plugin structure
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <option>server</option>: internal name of server to find
+ buffer for log (may be NULL)
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <option>channel</option>: name of channel to find buffer
+ for log (may be NULL)
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <option>message</option>: message
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ Return value: none.
+ </para>
+ <para>
+ Example:
+<screen>
+plugin->log (plugin, "freenode", "#weechat", "test");
</screen>
</para>
</section>
@@ -1725,7 +1776,7 @@ plugin->printf_infobar (plugin, 5, "hello");
int msg_kick (t_weechat_plugin *plugin, char *server, char *command,
char *arguments, char *handler_args, void *handler_pointer)
{
- plugin->printf (plugin, server, NULL, "KICK received");
+ plugin->print (plugin, server, NULL, "KICK received");
return PLUGIN_RC_OK;
}
...
@@ -1935,9 +1986,9 @@ int cmd_test (t_weechat_plugin *plugin, char *server,
char *command, char *arguments, char *handler_args,
void *handler_pointer)
{
- plugin->printf (plugin, server, NULL,
- "test command, nick: %s",
- (arguments) ? arguments : "none");
+ plugin->print (plugin, server, NULL,
+ "test command, nick: %s",
+ (arguments) ? arguments : "none");
return PLUGIN_RC_OK;
}
...
@@ -2326,8 +2377,8 @@ char *nick = plugin->get_info (plugin, "nick", "freenode");
t_plugin_dcc_info *dcc_info = plugin->get_dcc_info (plugin);
for (ptr_dcc = dcc_info; ptr_dcc; ptr_dcc = ptr_dcc->next_dcc)
{
- plugin->printf_server (plugin, "DCC type=%d, with: %s",
- ptr_dcc->type, ptr_dcc->nick);
+ plugin->print_server (plugin, "DCC type=%d, with: %s",
+ ptr_dcc->type, ptr_dcc->nick);
}
if (dcc_info)
plugin->free_dcc_info (plugin, dcc_info);
@@ -2589,12 +2640,12 @@ if (server_info)
for (ptr_server_info = server_info; ptr_server_info;
ptr_server_info = ptr_server_info->next_server)
{
- plugin->printf (plugin, NULL, NULL,
- "server: %s, address: %s, port: %d %s",
- ptr_server_info->name,
- ptr_server_info->address,
- ptr_server_info->port,
- (ptr_server_info->is_connected) ? "(connected)" : "");
+ plugin->print (plugin, NULL, NULL,
+ "server: %s, address: %s, port: %d %s",
+ ptr_server_info->name,
+ ptr_server_info->address,
+ ptr_server_info->port,
+ (ptr_server_info->is_connected) ? "(connected)" : "");
}
plugin->free_server_info (plugin, server_info);
}
@@ -2743,10 +2794,10 @@ if (channel_info)
for (ptr_chan_info = channel_info; ptr_chan_info;
ptr_chan_info = ptr_chan_info->next_channel)
{
- plugin->printf (plugin, NULL, NULL,
- " %s (type %d)",
- ptr_chan_info->name,
- ptr_chan_info->type);
+ plugin->print (plugin, NULL, NULL,
+ " %s (type %d)",
+ ptr_chan_info->name,
+ ptr_chan_info->type);
}
plugin->free_channel_info (plugin, channel_info);
}
@@ -2879,10 +2930,10 @@ if (nick_info)
for (ptr_nick_info = nick_info; ptr_nick_info;
ptr_nick_info = ptr_nick_info->next_nick)
{
- plugin->printf (plugin, NULL, NULL,
- " %s (flags: %d)",
- ptr_nick_info->nick,
- ptr_nick_info->flags);
+ plugin->print (plugin, NULL, NULL,
+ " %s (flags: %d)",
+ ptr_nick_info->nick,
+ ptr_nick_info->flags);
}
plugin->free_nick_info (plugin, nick_info);
}
@@ -3506,6 +3557,79 @@ weechat.print_infobar (5, "message")
</section>
<section>
+ <title>log</title>
+
+ <para>
+ Perl prototype:
+ <command>
+ weechat::log ( message, [channel, [server]] )
+ </command>
+ </para>
+ <para>
+ Python prototype:
+ <command>
+ weechat.log ( message, [channel, [server]] )
+ </command>
+ </para>
+ <para>
+ Ruby prototype:
+ <command>
+ Weechat.log ( message, [channel, [server]] )
+ </command>
+ </para>
+ <para>
+ Lua prototype:
+ <command>
+ weechat.log ( message, [channel, [server]] )
+ </command>
+ </para>
+ <para>
+ Write a message in log file for a server or a channel.
+ </para>
+ <para>
+ Arguments:
+ <itemizedlist>
+ <listitem>
+ <para>
+ <option>message</option>: message
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <option>channel</option>: name of channel to find buffer
+ for log
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <option>server</option>: internal name of server to find
+ buffer for log
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ Return value: 1 if success, 0 if an error occurred.
+ </para>
+ <para>
+ Examples:
+<screen>
+# perl
+weechat::log ("message", "#weechat", "freenode");
+
+# python
+weechat.log ("message", "#weechat", "freenode")
+
+# ruby
+Weechat.log ("message", "#weechat", "freenode")
+
+-- lua
+weechat.log ("message", "#weechat", "freenode")
+</screen>
+ </para>
+ </section>
+
+ <section>
<title>add_message_handler</title>
<para>
diff --git a/doc/fr/weechat.fr.xml b/doc/fr/weechat.fr.xml
index 77a8e6b17..fd9dad93f 100644
--- a/doc/fr/weechat.fr.xml
+++ b/doc/fr/weechat.fr.xml
@@ -1518,7 +1518,7 @@ if (argv != NULL)
<screen>
int callback (t_weechat_plugin *plugin, char *fichier)
{
- plugin->printf_server (plugin, "fichier: %s", fichier);
+ plugin->print_server (plugin, "fichier: %s", fichier);
return 1;
}
...
@@ -1527,13 +1527,13 @@ plugin->exec_on_files (plugin, "/tmp", &amp;callback);
</para>
</section>
- <section id="secAPI_printf">
- <title>printf</title>
+ <section id="secAPI_print">
+ <title>print</title>
<para>
Prototype :
<command>
- void printf (t_weechat_plugin *plugin,
+ void print (t_weechat_plugin *plugin,
char *serveur, char *canal, char *message, ...)
</command>
</para>
@@ -1575,20 +1575,20 @@ plugin->exec_on_files (plugin, "/tmp", &amp;callback);
<para>
Exemples :
<screen>
-plugin->printf (plugin, NULL, NULL, "hello");
-plugin->printf (plugin, NULL, "#weechat", "hello");
-plugin->printf (plugin, "freenode", "#weechat", "hello");
+plugin->print (plugin, NULL, NULL, "hello");
+plugin->print (plugin, NULL, "#weechat", "hello");
+plugin->print (plugin, "freenode", "#weechat", "hello");
</screen>
</para>
</section>
- <section id="secAPI_printf_server">
- <title>printf_server</title>
+ <section id="secAPI_print_server">
+ <title>print_server</title>
<para>
Prototype :
<command>
- void printf_server (t_weechat_plugin *plugin,
+ void print_server (t_weechat_plugin *plugin,
char *message, ...)
</command>
</para>
@@ -1615,17 +1615,17 @@ plugin->printf (plugin, "freenode", "#weechat", "hello");
Valeur renvoyée : aucune.
</para>
<para>
- Exemple : <screen>plugin->printf_server (plugin, "hello");</screen>
+ Exemple : <screen>plugin->print_server (plugin, "hello");</screen>
</para>
</section>
- <section id="secAPI_printf_infobar">
- <title>printf_infobar</title>
+ <section id="secAPI_print_infobar">
+ <title>print_infobar</title>
<para>
Prototype :
<command>
- void printf_infobar (t_weechat_plugin *plugin,
+ void print_infobar (t_weechat_plugin *plugin,
int temps, char *message, ...)
</command>
</para>
@@ -1653,7 +1653,60 @@ plugin->printf (plugin, "freenode", "#weechat", "hello");
Valeur renvoyée : aucune.
</para>
<para>
- Exemple : <screen>plugin->printf_infobar (plugin, 5, "hello");</screen>
+ Exemple : <screen>plugin->print_infobar (plugin, 5, "hello");</screen>
+ </para>
+ </section>
+
+ <section id="secAPI_log">
+ <title>log</title>
+
+ <para>
+ Prototype :
+ <command>
+ void log (t_weechat_plugin *plugin,
+ char *serveur, char *canal, char *message, ...)
+ </command>
+ </para>
+ <para>
+ Ecrit un message dans le fichier de log pour un serveur ou un
+ canal.
+ </para>
+ <para>
+ Paramètres :
+ <itemizedlist>
+ <listitem>
+ <para>
+ <option>plugin</option> : pointeur vers la structure
+ de l'extension
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <option>serveur</option> : nom interne du serveur pour
+ trouver le log du tampon (peut être NULL)
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <option>canal</option> : nom du canal pour trouver le
+ tampon le log du tampon (peut être NULL)
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <option>message</option> : message
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ Valeur renvoyée : aucune.
+ </para>
+ <para>
+ Exemple :
+<screen>
+plugin->log (plugin, "freenode", "#weechat", "test");
+</screen>
</para>
</section>
@@ -1755,7 +1808,7 @@ plugin->printf (plugin, "freenode", "#weechat", "hello");
int msg_kick (t_weechat_plugin *plugin, char *serveur, char *commande,
char *arguments, char *handler_args, void *handler_pointer)
{
- plugin->printf (plugin, serveur, NULL, "KICK reçu");
+ plugin->print (plugin, serveur, NULL, "KICK reçu");
return PLUGIN_RC_OK;
}
...
@@ -1968,9 +2021,9 @@ int cmd_test (t_weechat_plugin *plugin, char *serveur,
char *commande, char *arguments, char *handler_args,
void *handler_pointer)
{
- plugin->printf (plugin, serveur, NULL,
- "commande test, pseudo: %s",
- (arguments) ? arguments : "aucun");
+ plugin->print (plugin, serveur, NULL,
+ "commande test, pseudo: %s",
+ (arguments) ? arguments : "aucun");
return PLUGIN_RC_OK;
}
...
@@ -2365,8 +2418,8 @@ char *nick = plugin->get_info (plugin, "nick", "freenode");
t_plugin_dcc_info *dcc_info = plugin->get_dcc_info (plugin);
for (ptr_dcc = dcc_info; ptr_dcc; ptr_dcc = ptr_dcc->next_dcc)
{
- plugin->printf_server (plugin, "DCC type=%d, avec: %s",
- ptr_dcc->type, ptr_dcc->nick);
+ plugin->print_server (plugin, "DCC type=%d, avec: %s",
+ ptr_dcc->type, ptr_dcc->nick);
}
if (dcc_info)
plugin->free_dcc_info (plugin, dcc_info);
@@ -2638,12 +2691,12 @@ if (server_info)
for (ptr_server_info = server_info; ptr_server_info;
ptr_server_info = ptr_server_info->next_server)
{
- plugin->printf (plugin, NULL, NULL,
- "serveur: %s, addresse: %s, port: %d %s",
- ptr_server_info->name,
- ptr_server_info->address,
- ptr_server_info->port,
- (ptr_server_info->is_connected) ? "(connecté)" : "");
+ plugin->print (plugin, NULL, NULL,
+ "serveur: %s, addresse: %s, port: %d %s",
+ ptr_server_info->name,
+ ptr_server_info->address,
+ ptr_server_info->port,
+ (ptr_server_info->is_connected) ? "(connecté)" : "");
}
plugin->free_server_info (plugin, server_info);
}
@@ -2794,10 +2847,10 @@ if (channel_info)
for (ptr_chan_info = channel_info; ptr_chan_info;
ptr_chan_info = ptr_chan_info->next_channel)
{
- plugin->printf (plugin, NULL, NULL,
- " %s (type %d)",
- ptr_chan_info->name,
- ptr_chan_info->type);
+ plugin->print (plugin, NULL, NULL,
+ " %s (type %d)",
+ ptr_chan_info->name,
+ ptr_chan_info->type);
}
plugin->free_channel_info (plugin, channel_info);
}
@@ -2933,10 +2986,10 @@ if (nick_info)
for (ptr_nick_info = nick_info; ptr_nick_info;
ptr_nick_info = ptr_nick_info->next_nick)
{
- plugin->printf (plugin, NULL, NULL,
- " %s (flags: %d)",
- ptr_nick_info->nick,
- ptr_nick_info->flags);
+ plugin->print (plugin, NULL, NULL,
+ " %s (flags: %d)",
+ ptr_nick_info->nick,
+ ptr_nick_info->flags);
}
plugin->free_nick_info (plugin, nick_info);
}
@@ -3571,6 +3624,80 @@ weechat.print_infobar (5, "message")
</section>
<section>
+ <title>log</title>
+
+ <para>
+ Prototype Perl :
+ <command>
+ weechat::log ( message, [canal, [serveur]] )
+ </command>
+ </para>
+ <para>
+ Prototype Python :
+ <command>
+ weechat.log ( message, [canal, [serveur]] )
+ </command>
+ </para>
+ <para>
+ Prototype Ruby :
+ <command>
+ Weechat.log ( message, [canal, [serveur]] )
+ </command>
+ </para>
+ <para>
+ Prototype Lua :
+ <command>
+ weechat.log ( message, [canal, [serveur]] )
+ </command>
+ </para>
+ <para>
+ Ecrit un message dans le fichier de log pour un serveur ou un
+ canal.
+ </para>
+ <para>
+ Paramètres :
+ <itemizedlist>
+ <listitem>
+ <para>
+ <option>message</option> : message
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <option>canal</option> : nom du canal pour trouver le
+ log du tampon
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <option>serveur</option> : nom interne du serveur pour
+ trouver le log du tampon
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ Valeur renvoyée : 1 si succès, 0 si une erreur s'est produite.
+ </para>
+ <para>
+ Exemples :
+<screen>
+# perl
+weechat::log ("message", "#weechat", "freenode");
+
+# python
+weechat.log ("message", "#weechat", "freenode")
+
+# ruby
+Weechat.log ("message", "#weechat", "freenode")
+
+-- lua
+weechat.log ("message", "#weechat", "freenode")
+</screen>
+ </para>
+ </section>
+
+ <section>
<title>add_message_handler</title>
<para>
diff --git a/po/cs.po b/po/cs.po
index 710d3cd21..cfb719df8 100644
--- a/po/cs.po
+++ b/po/cs.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.1.8-cvs\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2006-02-16 10:59+0100\n"
+"POT-Creation-Date: 2006-02-16 21:24+0100\n"
"PO-Revision-Date: 2006-01-24 19:25+0100\n"
"Last-Translator: Jiri Golembiovsky <golemj@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -2190,32 +2190,32 @@ msgstr ""
"%s funkce \"weechat_plugin_init\" nebyla v pluginu \"%s\" nalezena, naÄtení "
"selhalo\n"
-#: src/plugins/plugins.c:658
+#: src/plugins/plugins.c:659
#, c-format
msgid "Initializing plugin \"%s\" %s\n"
msgstr "Inicializuji plugin \"%s\" %s\n"
-#: src/plugins/plugins.c:666
+#: src/plugins/plugins.c:667
#, c-format
msgid "%s unable to initialize plugin \"%s\"\n"
msgstr "%s nemohu naÄíst plugin \"%s\"\n"
-#: src/plugins/plugins.c:677
+#: src/plugins/plugins.c:678
#, c-format
msgid "%s unable to load plugin \"%s\" (not enough memory)\n"
msgstr "%s nemohu naÄíst plugin \"%s\" (nedostatek pamÄ›ti)\n"
-#: src/plugins/plugins.c:685
+#: src/plugins/plugins.c:686
#, c-format
msgid "Plugin \"%s\" (%s) loaded.\n"
msgstr "Plugin \"%s\" (%s) naÄten.\n"
-#: src/plugins/plugins.c:852
+#: src/plugins/plugins.c:853
#, c-format
msgid "Plugin \"%s\" unloaded.\n"
msgstr "Plugin \"%s\" odebrán.\n"
-#: src/plugins/plugins.c:858
+#: src/plugins/plugins.c:859
#, c-format
msgid "%s plugin \"%s\" not found\n"
msgstr "%s plugin \"%s\" nenalezen\n"
@@ -2251,12 +2251,12 @@ msgstr ""
"tento soubor při aktualizaci nastavení.\n"
"#\n"
-#: src/plugins/plugins-interface.c:295
+#: src/plugins/plugins-interface.c:321
#, c-format
msgid "%s server/channel (%s/%s) not found for plugin exec command\n"
msgstr "%s server/kanál (%s/%s) nenaleyen pro exec příkaz pluginu\n"
-#: src/plugins/plugins-interface.c:309
+#: src/plugins/plugins-interface.c:335
#, c-format
msgid "%s server not found for plugin exec command\n"
msgstr "%s server nenalezen pro exec příkaz pluginu\n"
diff --git a/po/es.po b/po/es.po
index dac26c0c0..1ef166146 100644
--- a/po/es.po
+++ b/po/es.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.1.8-cvs\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2006-02-16 10:59+0100\n"
+"POT-Creation-Date: 2006-02-16 21:24+0100\n"
"PO-Revision-Date: 2006-01-24 19:24+0100\n"
"Last-Translator: Roberto González Cardenete <robert.glez@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -2211,33 +2211,33 @@ msgstr ""
"%s función \"weechat_plugin_init\" no encontrada en el plugin \"%s\", falló "
"al cargar\n"
-#: src/plugins/plugins.c:658
+#: src/plugins/plugins.c:659
#, c-format
msgid "Initializing plugin \"%s\" %s\n"
msgstr "Inicializando plugin \"%s\" %s\n"
-#: src/plugins/plugins.c:666
+#: src/plugins/plugins.c:667
#, c-format
msgid "%s unable to initialize plugin \"%s\"\n"
msgstr "%s no ha sido posible inicializar el plugin \"%s\"\n"
-#: src/plugins/plugins.c:677
+#: src/plugins/plugins.c:678
#, c-format
msgid "%s unable to load plugin \"%s\" (not enough memory)\n"
msgstr ""
"%s no ha sido posible cargar el plugin \"%s\" (no hay suficiente memoria)\n"
-#: src/plugins/plugins.c:685
+#: src/plugins/plugins.c:686
#, c-format
msgid "Plugin \"%s\" (%s) loaded.\n"
msgstr "Plugin \"%s\" (%s) cargado.\n"
-#: src/plugins/plugins.c:852
+#: src/plugins/plugins.c:853
#, c-format
msgid "Plugin \"%s\" unloaded.\n"
msgstr "Plugin \"%s\" descargado.\n"
-#: src/plugins/plugins.c:858
+#: src/plugins/plugins.c:859
#, c-format
msgid "%s plugin \"%s\" not found\n"
msgstr "%s plugin \"%s\" no encontrado\n"
@@ -2273,12 +2273,12 @@ msgstr ""
"archivo cuando se actualizan las opciones.\n"
"#\n"
-#: src/plugins/plugins-interface.c:295
+#: src/plugins/plugins-interface.c:321
#, c-format
msgid "%s server/channel (%s/%s) not found for plugin exec command\n"
msgstr ""
-#: src/plugins/plugins-interface.c:309
+#: src/plugins/plugins-interface.c:335
#, c-format
msgid "%s server not found for plugin exec command\n"
msgstr ""
diff --git a/po/fr.po b/po/fr.po
index 3c4281235..fe1ddade7 100644
--- a/po/fr.po
+++ b/po/fr.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.1.8-cvs\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2006-02-16 10:59+0100\n"
+"POT-Creation-Date: 2006-02-16 21:24+0100\n"
"PO-Revision-Date: 2006-02-16 11:00+0100\n"
"Last-Translator: FlashCode <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -2208,32 +2208,32 @@ msgstr ""
"%s la fonction \"weechat_plugin_init\" est introuvable dans l'extension \"%s"
"\", échec de chargement\n"
-#: src/plugins/plugins.c:658
+#: src/plugins/plugins.c:659
#, c-format
msgid "Initializing plugin \"%s\" %s\n"
msgstr "Initialisation de l'extension \"%s\" %s\n"
-#: src/plugins/plugins.c:666
+#: src/plugins/plugins.c:667
#, c-format
msgid "%s unable to initialize plugin \"%s\"\n"
msgstr "%s impossible d'initialiser l'extension \"%s\"\n"
-#: src/plugins/plugins.c:677
+#: src/plugins/plugins.c:678
#, c-format
msgid "%s unable to load plugin \"%s\" (not enough memory)\n"
msgstr "%s impossible de charger l'extension \"%s\" (mémoire insuffisante)\n"
-#: src/plugins/plugins.c:685
+#: src/plugins/plugins.c:686
#, c-format
msgid "Plugin \"%s\" (%s) loaded.\n"
msgstr "Extension \"%s\" (%s) chargée.\n"
-#: src/plugins/plugins.c:852
+#: src/plugins/plugins.c:853
#, c-format
msgid "Plugin \"%s\" unloaded.\n"
msgstr "Extension \"%s\" déchargée.\n"
-#: src/plugins/plugins.c:858
+#: src/plugins/plugins.c:859
#, c-format
msgid "%s plugin \"%s\" not found\n"
msgstr "%s extension \"%s\" non trouvée\n"
@@ -2269,14 +2269,14 @@ msgstr ""
"des options sont modifiées.\n"
"#\n"
-#: src/plugins/plugins-interface.c:295
+#: src/plugins/plugins-interface.c:321
#, c-format
msgid "%s server/channel (%s/%s) not found for plugin exec command\n"
msgstr ""
"%s serveur/canal (%s/%s) non trouvé pour l'exécution de commande de "
"l'extension\n"
-#: src/plugins/plugins-interface.c:309
+#: src/plugins/plugins-interface.c:335
#, c-format
msgid "%s server not found for plugin exec command\n"
msgstr "%s serveur non trouvé pour l'exécution de commande de l'extension\n"
diff --git a/po/hu.po b/po/hu.po
index 839c41680..0aeddc4a4 100644
--- a/po/hu.po
+++ b/po/hu.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.1.8-cvs\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2006-02-16 10:59+0100\n"
+"POT-Creation-Date: 2006-02-16 21:24+0100\n"
"PO-Revision-Date: 2006-02-07 18:34+0100\n"
"Last-Translator: voroskoi <voroskoi@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -2180,32 +2180,32 @@ msgstr ""
"%s a \"weechat_plugin_init\" függvény nem található a \"%s\" modulban, "
"betöltés sikertelen\n"
-#: src/plugins/plugins.c:658
+#: src/plugins/plugins.c:659
#, c-format
msgid "Initializing plugin \"%s\" %s\n"
msgstr "Modul betöltése: \"%s\" %s\n"
-#: src/plugins/plugins.c:666
+#: src/plugins/plugins.c:667
#, c-format
msgid "%s unable to initialize plugin \"%s\"\n"
msgstr "%s nem sikerült a modult betölteni \"%s\"\n"
-#: src/plugins/plugins.c:677
+#: src/plugins/plugins.c:678
#, c-format
msgid "%s unable to load plugin \"%s\" (not enough memory)\n"
msgstr "%s nem sikerült a modult betölteni \"%s\" (nincs elég memória)\n"
-#: src/plugins/plugins.c:685
+#: src/plugins/plugins.c:686
#, c-format
msgid "Plugin \"%s\" (%s) loaded.\n"
msgstr "A \"%s\" (%s) modul betöltve.\n"
-#: src/plugins/plugins.c:852
+#: src/plugins/plugins.c:853
#, c-format
msgid "Plugin \"%s\" unloaded.\n"
msgstr "A \"%s\" modul eltávolítva.\n"
-#: src/plugins/plugins.c:858
+#: src/plugins/plugins.c:859
#, c-format
msgid "%s plugin \"%s\" not found\n"
msgstr "%s a \"%s\" modul nem található\n"
@@ -2240,12 +2240,12 @@ msgstr ""
"# FIGYELEM! A WeeChat felülírja ezt a fájlt, ha a beállítások megváltoznak.\n"
"#\n"
-#: src/plugins/plugins-interface.c:295
+#: src/plugins/plugins-interface.c:321
#, c-format
msgid "%s server/channel (%s/%s) not found for plugin exec command\n"
msgstr "%s (%s/%s) szerver/szoba nem található a modul futtatása parancshoz\n"
-#: src/plugins/plugins-interface.c:309
+#: src/plugins/plugins-interface.c:335
#, c-format
msgid "%s server not found for plugin exec command\n"
msgstr "%s szerver nem található a modul futtatása parancshoz\n"
diff --git a/po/weechat.pot b/po/weechat.pot
index 2ed13b2b1..15d9493eb 100644
--- a/po/weechat.pot
+++ b/po/weechat.pot
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2006-02-16 10:59+0100\n"
+"POT-Creation-Date: 2006-02-16 21:24+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"
@@ -2053,32 +2053,32 @@ msgid ""
"load\n"
msgstr ""
-#: src/plugins/plugins.c:658
+#: src/plugins/plugins.c:659
#, c-format
msgid "Initializing plugin \"%s\" %s\n"
msgstr ""
-#: src/plugins/plugins.c:666
+#: src/plugins/plugins.c:667
#, c-format
msgid "%s unable to initialize plugin \"%s\"\n"
msgstr ""
-#: src/plugins/plugins.c:677
+#: src/plugins/plugins.c:678
#, c-format
msgid "%s unable to load plugin \"%s\" (not enough memory)\n"
msgstr ""
-#: src/plugins/plugins.c:685
+#: src/plugins/plugins.c:686
#, c-format
msgid "Plugin \"%s\" (%s) loaded.\n"
msgstr ""
-#: src/plugins/plugins.c:852
+#: src/plugins/plugins.c:853
#, c-format
msgid "Plugin \"%s\" unloaded.\n"
msgstr ""
-#: src/plugins/plugins.c:858
+#: src/plugins/plugins.c:859
#, c-format
msgid "%s plugin \"%s\" not found\n"
msgstr ""
@@ -2109,12 +2109,12 @@ msgid ""
"#\n"
msgstr ""
-#: src/plugins/plugins-interface.c:295
+#: src/plugins/plugins-interface.c:321
#, c-format
msgid "%s server/channel (%s/%s) not found for plugin exec command\n"
msgstr ""
-#: src/plugins/plugins-interface.c:309
+#: src/plugins/plugins-interface.c:335
#, c-format
msgid "%s server not found for plugin exec command\n"
msgstr ""
diff --git a/src/plugins/plugins-interface.c b/src/plugins/plugins-interface.c
index 9c682324d..bd8cdd087 100644
--- a/src/plugins/plugins-interface.c
+++ b/src/plugins/plugins-interface.c
@@ -153,12 +153,12 @@ weechat_plugin_exec_on_files (t_weechat_plugin *plugin, char *directory,
}
/*
- * weechat_plugin_printf: print a message on a server or channel buffer
+ * weechat_plugin_print: print a message on a server or channel buffer
*/
void
-weechat_plugin_printf (t_weechat_plugin *plugin,
- char *server, char *channel, char *message, ...)
+weechat_plugin_print (t_weechat_plugin *plugin,
+ char *server, char *channel, char *message, ...)
{
t_gui_buffer *ptr_buffer;
va_list argptr;
@@ -176,11 +176,11 @@ weechat_plugin_printf (t_weechat_plugin *plugin,
}
/*
- * weechat_plugin_printf_server: print a message on server buffer
+ * weechat_plugin_print_server: print a message on server buffer
*/
void
-weechat_plugin_printf_server (t_weechat_plugin *plugin, char *message, ...)
+weechat_plugin_print_server (t_weechat_plugin *plugin, char *message, ...)
{
va_list argptr;
static char buf[8192];
@@ -196,11 +196,11 @@ weechat_plugin_printf_server (t_weechat_plugin *plugin, char *message, ...)
}
/*
- * weechat_plugin_infobar_printf: print a message in infobar
+ * weechat_plugin_print_infobar: print a message in infobar
*/
void
-weechat_plugin_infobar_printf (t_weechat_plugin *plugin, int time_displayed, char *message, ...)
+weechat_plugin_print_infobar (t_weechat_plugin *plugin, int time_displayed, char *message, ...)
{
va_list argptr;
static char buf[1024];
diff --git a/src/plugins/plugins.c b/src/plugins/plugins.c
index db60c69e5..77ed56b55 100644
--- a/src/plugins/plugins.c
+++ b/src/plugins/plugins.c
@@ -622,9 +622,9 @@ plugin_load (char *filename)
new_plugin->cmd_handler_add = &weechat_plugin_cmd_handler_add;
new_plugin->handler_remove = &weechat_plugin_handler_remove;
new_plugin->handler_remove_all = &weechat_plugin_handler_remove_all;
- new_plugin->printf = &weechat_plugin_printf;
- new_plugin->printf_server = &weechat_plugin_printf_server;
- new_plugin->infobar_printf = &weechat_plugin_infobar_printf;
+ new_plugin->print = &weechat_plugin_print;
+ new_plugin->print_server = &weechat_plugin_print_server;
+ new_plugin->print_infobar = &weechat_plugin_print_infobar;
new_plugin->log = &weechat_plugin_log;
new_plugin->exec_command = &weechat_plugin_exec_command;
new_plugin->get_info = &weechat_plugin_get_info;
diff --git a/src/plugins/scripts/lua/weechat-lua.c b/src/plugins/scripts/lua/weechat-lua.c
index 422908cb3..f4e2751df 100644
--- a/src/plugins/scripts/lua/weechat-lua.c
+++ b/src/plugins/scripts/lua/weechat-lua.c
@@ -67,12 +67,12 @@ weechat_lua_exec (t_weechat_plugin *plugin,
if ( lua_pcall(lua_current_interpreter, 2, 1, 0) != 0)
{
- plugin->printf_server (plugin,
- "Lua error: unable to run function \"%s\"",
- function);
- plugin->printf_server (plugin,
- "Lua error: %s",
- lua_tostring (lua_current_interpreter, -1));
+ plugin->print_server (plugin,
+ "Lua error: unable to run function \"%s\"",
+ function);
+ plugin->print_server (plugin,
+ "Lua error: %s",
+ lua_tostring (lua_current_interpreter, -1));
return PLUGIN_RC_KO;
}
@@ -116,9 +116,9 @@ weechat_lua_register (lua_State *L)
if (n != 4)
{
- lua_plugin->printf_server (lua_plugin,
- "Lua error: wrong parameters for "
- "\"register\" function");
+ lua_plugin->print_server (lua_plugin,
+ "Lua error: wrong parameters for "
+ "\"register\" function");
lua_pushnumber (lua_current_interpreter, 0);
return 1;
}
@@ -131,11 +131,11 @@ weechat_lua_register (lua_State *L)
if (weechat_script_search (lua_plugin, &lua_scripts, (char *) name))
{
/* error: another scripts already exists with this name! */
- lua_plugin->printf_server (lua_plugin,
- "Lua error: unable to register "
- "\"%s\" script (another script "
- "already exists with this name)",
- name);
+ lua_plugin->print_server (lua_plugin,
+ "Lua error: unable to register "
+ "\"%s\" script (another script "
+ "already exists with this name)",
+ name);
lua_pushnumber (lua_current_interpreter, 0);
return 1;
}
@@ -151,17 +151,17 @@ weechat_lua_register (lua_State *L)
(char *) description);
if (lua_current_script)
{
- lua_plugin->printf_server (lua_plugin,
- "Lua: registered script \"%s\", "
- "version %s (%s)",
- name, version, description);
+ lua_plugin->print_server (lua_plugin,
+ "Lua: registered script \"%s\", "
+ "version %s (%s)",
+ name, version, description);
}
else
{
- lua_plugin->printf_server (lua_plugin,
- "Lua error: unable to load script "
- "\"%s\" (not enough memory)",
- name);
+ lua_plugin->print_server (lua_plugin,
+ "Lua error: unable to load script "
+ "\"%s\" (not enough memory)",
+ name);
lua_pushnumber (lua_current_interpreter, 0);
return 1;
}
@@ -184,9 +184,9 @@ weechat_lua_print (lua_State *L)
if (!lua_current_script)
{
- lua_plugin->printf_server (lua_plugin,
- "Lua error: unable to print message, "
- "script not initialized");
+ lua_plugin->print_server (lua_plugin,
+ "Lua error: unable to print message, "
+ "script not initialized");
lua_pushnumber (lua_current_interpreter, 0);
return 1;
}
@@ -212,17 +212,17 @@ weechat_lua_print (lua_State *L)
message = lua_tostring (lua_current_interpreter, -1);
break;
default:
- lua_plugin->printf_server (lua_plugin,
- "Lua error: wrong parameters for "
- "\"print\" function");
+ lua_plugin->print_server (lua_plugin,
+ "Lua error: wrong parameters for "
+ "\"print\" function");
lua_pushnumber (lua_current_interpreter, 0);
return 1;
}
- lua_plugin->printf (lua_plugin,
- (char *) server_name,
- (char *) channel_name,
- "%s", (char *) message);
+ lua_plugin->print (lua_plugin,
+ (char *) server_name,
+ (char *) channel_name,
+ "%s", (char *) message);
lua_pushnumber (lua_current_interpreter, 1);
return 1;
@@ -242,9 +242,9 @@ weechat_lua_print_infobar (lua_State *L)
if (!lua_current_script)
{
- lua_plugin->printf_server (lua_plugin,
- "Lua error: unable to print infobar message, "
- "script not initialized");
+ lua_plugin->print_server (lua_plugin,
+ "Lua error: unable to print infobar message, "
+ "script not initialized");
lua_pushnumber (lua_current_interpreter, 0);
return 1;
}
@@ -256,9 +256,9 @@ weechat_lua_print_infobar (lua_State *L)
if (n != 2)
{
- lua_plugin->printf_server (lua_plugin,
- "Lua error: wrong parameters for "
- "\"print_infobar\" function");
+ lua_plugin->print_server (lua_plugin,
+ "Lua error: wrong parameters for "
+ "\"print_infobar\" function");
lua_pushnumber (lua_current_interpreter, 0);
return 1;
}
@@ -266,7 +266,7 @@ weechat_lua_print_infobar (lua_State *L)
delay = lua_tonumber (lua_current_interpreter, -2);
message = lua_tostring (lua_current_interpreter, -1);
- lua_plugin->infobar_printf (lua_plugin, delay, "%s", (char *) message);
+ lua_plugin->print_infobar (lua_plugin, delay, "%s", (char *) message);
lua_pushnumber (lua_current_interpreter, 1);
return 1;
@@ -286,9 +286,9 @@ weechat_lua_log (lua_State *L)
if (!lua_current_script)
{
- lua_plugin->printf_server (lua_plugin,
- "Lua error: unable to print message, "
- "script not initialized");
+ lua_plugin->print_server (lua_plugin,
+ "Lua error: unable to print message, "
+ "script not initialized");
lua_pushnumber (lua_current_interpreter, 0);
return 1;
}
@@ -314,9 +314,9 @@ weechat_lua_log (lua_State *L)
message = lua_tostring (lua_current_interpreter, -1);
break;
default:
- lua_plugin->printf_server (lua_plugin,
- "Lua error: wrong parameters for "
- "\"log\" function");
+ lua_plugin->print_server (lua_plugin,
+ "Lua error: wrong parameters for "
+ "\"log\" function");
lua_pushnumber (lua_current_interpreter, 0);
return 1;
}
@@ -344,9 +344,9 @@ weechat_lua_command (lua_State *L)
if (!lua_current_script)
{
- lua_plugin->printf_server (lua_plugin,
- "Lua error: unable to run command, "
- "script not initialized");
+ lua_plugin->print_server (lua_plugin,
+ "Lua error: unable to run command, "
+ "script not initialized");
lua_pushnumber (lua_current_interpreter, 0);
return 1;
}
@@ -372,9 +372,9 @@ weechat_lua_command (lua_State *L)
command = lua_tostring (lua_current_interpreter, -1);
break;
default:
- lua_plugin->printf_server (lua_plugin,
- "Lua error: wrong parameters for "
- "\"command\" function");
+ lua_plugin->print_server (lua_plugin,
+ "Lua error: wrong parameters for "
+ "\"command\" function");
lua_pushnumber (lua_current_interpreter, 0);
return 1;
}
@@ -402,9 +402,9 @@ weechat_lua_add_message_handler (lua_State *L)
if (!lua_current_script)
{
- lua_plugin->printf_server (lua_plugin,
- "Lua error: unable to add message handler, "
- "script not initialized");
+ lua_plugin->print_server (lua_plugin,
+ "Lua error: unable to add message handler, "
+ "script not initialized");
lua_pushnumber (lua_current_interpreter, 0);
return 1;
}
@@ -416,9 +416,9 @@ weechat_lua_add_message_handler (lua_State *L)
if (n != 2)
{
- lua_plugin->printf_server (lua_plugin,
- "Lua error: wrong parameters for "
- "\"add_message_handler\" function");
+ lua_plugin->print_server (lua_plugin,
+ "Lua error: wrong parameters for "
+ "\"add_message_handler\" function");
lua_pushnumber (lua_current_interpreter, 0);
return 1;
}
@@ -453,9 +453,9 @@ weechat_lua_add_command_handler (lua_State *L)
if (!lua_current_script)
{
- lua_plugin->printf_server (lua_plugin,
- "Lua error: unable to add command handler, "
- "script not initialized");
+ lua_plugin->print_server (lua_plugin,
+ "Lua error: unable to add command handler, "
+ "script not initialized");
lua_pushnumber (lua_current_interpreter, 0);
return 1;
}
@@ -484,9 +484,9 @@ weechat_lua_add_command_handler (lua_State *L)
completion_template = lua_tostring (lua_current_interpreter, -1);
break;
default:
- lua_plugin->printf_server (lua_plugin,
- "Lua error: wrong parameters for "
- "\"add_command_handler\" function");
+ lua_plugin->print_server (lua_plugin,
+ "Lua error: wrong parameters for "
+ "\"add_command_handler\" function");
lua_pushnumber (lua_current_interpreter, 0);
return 1;
}
@@ -523,9 +523,9 @@ weechat_lua_remove_handler (lua_State *L)
if (!lua_current_script)
{
- lua_plugin->printf_server (lua_plugin,
- "Lua error: unable to remove handler, "
- "script not initialized");
+ lua_plugin->print_server (lua_plugin,
+ "Lua error: unable to remove handler, "
+ "script not initialized");
lua_pushnumber (lua_current_interpreter, 0);
return 1;
}
@@ -537,9 +537,9 @@ weechat_lua_remove_handler (lua_State *L)
if (n != 2)
{
- lua_plugin->printf_server (lua_plugin,
- "Lua error: wrong parameters for "
- "\"remove_handler\" function");
+ lua_plugin->print_server (lua_plugin,
+ "Lua error: wrong parameters for "
+ "\"remove_handler\" function");
lua_pushnumber (lua_current_interpreter, 0);
return 1;
}
@@ -569,9 +569,9 @@ weechat_lua_get_info (lua_State *L)
if (!lua_current_script)
{
- lua_plugin->printf_server (lua_plugin,
- "Lua error: unable to get info, "
- "script not initialized");
+ lua_plugin->print_server (lua_plugin,
+ "Lua error: unable to get info, "
+ "script not initialized");
lua_pushnumber (lua_current_interpreter, 0);
return 1;
}
@@ -591,9 +591,9 @@ weechat_lua_get_info (lua_State *L)
server_name = lua_tostring (lua_current_interpreter, -1);
break;
default:
- lua_plugin->printf_server (lua_plugin,
- "Lua error: wrong parameters for "
- "\"get_info\" function");
+ lua_plugin->print_server (lua_plugin,
+ "Lua error: wrong parameters for "
+ "\"get_info\" function");
lua_pushnumber (lua_current_interpreter, 0);
return 1;
}
@@ -624,9 +624,9 @@ weechat_lua_get_dcc_info (lua_State *L)
if (!lua_current_script)
{
- lua_plugin->printf_server (lua_plugin,
- "Lua error: unable to get DCC info, "
- "script not initialized");
+ lua_plugin->print_server (lua_plugin,
+ "Lua error: unable to get DCC info, "
+ "script not initialized");
lua_pushnil (lua_current_interpreter);
return 1;
}
@@ -738,9 +738,9 @@ weechat_lua_get_config (lua_State *L)
if (!lua_current_script)
{
- lua_plugin->printf_server (lua_plugin,
- "Lua error: unable to get config option, "
- "script not initialized");
+ lua_plugin->print_server (lua_plugin,
+ "Lua error: unable to get config option, "
+ "script not initialized");
lua_pushnumber (lua_current_interpreter, 0);
return 1;
}
@@ -751,9 +751,9 @@ weechat_lua_get_config (lua_State *L)
if (n != 1)
{
- lua_plugin->printf_server (lua_plugin,
- "Lua error: wrong parameters for "
- "\"get_config\" function");
+ lua_plugin->print_server (lua_plugin,
+ "Lua error: wrong parameters for "
+ "\"get_config\" function");
lua_pushnumber (lua_current_interpreter, 0);
return 1;
}
@@ -783,9 +783,9 @@ weechat_lua_set_config (lua_State *L)
if (!lua_current_script)
{
- lua_plugin->printf_server (lua_plugin,
- "Lua error: unable to set config option, "
- "script not initialized");
+ lua_plugin->print_server (lua_plugin,
+ "Lua error: unable to set config option, "
+ "script not initialized");
lua_pushnumber (lua_current_interpreter, 0);
return 1;
}
@@ -797,9 +797,9 @@ weechat_lua_set_config (lua_State *L)
if (n != 2)
{
- lua_plugin->printf_server (lua_plugin,
- "Lua error: wrong parameters for "
- "\"set_config\" function");
+ lua_plugin->print_server (lua_plugin,
+ "Lua error: wrong parameters for "
+ "\"set_config\" function");
lua_pushnumber (lua_current_interpreter, 0);
return 1;
}
@@ -830,9 +830,9 @@ weechat_lua_get_plugin_config (lua_State *L)
if (!lua_current_script)
{
- lua_plugin->printf_server (lua_plugin,
- "Lua error: unable to get plugin config option, "
- "script not initialized");
+ lua_plugin->print_server (lua_plugin,
+ "Lua error: unable to get plugin config option, "
+ "script not initialized");
lua_pushnumber (lua_current_interpreter, 0);
return 1;
}
@@ -843,9 +843,9 @@ weechat_lua_get_plugin_config (lua_State *L)
if (n != 1)
{
- lua_plugin->printf_server (lua_plugin,
- "Lua error: wrong parameters for "
- "\"get_plugin_config\" function");
+ lua_plugin->print_server (lua_plugin,
+ "Lua error: wrong parameters for "
+ "\"get_plugin_config\" function");
lua_pushnumber (lua_current_interpreter, 0);
return 1;
}
@@ -877,9 +877,9 @@ weechat_lua_set_plugin_config (lua_State *L)
if (!lua_current_script)
{
- lua_plugin->printf_server (lua_plugin,
- "Lua error: unable to set plugin config option, "
- "script not initialized");
+ lua_plugin->print_server (lua_plugin,
+ "Lua error: unable to set plugin config option, "
+ "script not initialized");
lua_pushnumber (lua_current_interpreter, 0);
return 1;
}
@@ -891,9 +891,9 @@ weechat_lua_set_plugin_config (lua_State *L)
if (n != 2)
{
- lua_plugin->printf_server (lua_plugin,
- "Lua error: wrong parameters for "
- "\"set_plugin_config\" function");
+ lua_plugin->print_server (lua_plugin,
+ "Lua error: wrong parameters for "
+ "\"set_plugin_config\" function");
lua_pushnumber (lua_current_interpreter, 0);
return 1;
}
@@ -925,9 +925,9 @@ weechat_lua_get_server_info (lua_State *L)
if (!lua_current_script)
{
- lua_plugin->printf_server (lua_plugin,
- "Lua error: unable to get server infos, "
- "script not initialized");
+ lua_plugin->print_server (lua_plugin,
+ "Lua error: unable to get server infos, "
+ "script not initialized");
lua_pushnil (lua_current_interpreter);
return 1;
}
@@ -1079,9 +1079,9 @@ weechat_lua_get_channel_info (lua_State *L)
if (!lua_current_script)
{
- lua_plugin->printf_server (lua_plugin,
- "Lua error: unable to get channel infos, "
- "script not initialized");
+ lua_plugin->print_server (lua_plugin,
+ "Lua error: unable to get channel infos, "
+ "script not initialized");
lua_pushnil (lua_current_interpreter);
return 1;
}
@@ -1092,9 +1092,9 @@ weechat_lua_get_channel_info (lua_State *L)
if (n != 1)
{
- lua_plugin->printf_server (lua_plugin,
- "Lua error: wrong parameters for "
- "\"get_channel_info\" function");
+ lua_plugin->print_server (lua_plugin,
+ "Lua error: wrong parameters for "
+ "\"get_channel_info\" function");
lua_pushnil (lua_current_interpreter);
return 1;
}
@@ -1162,9 +1162,9 @@ weechat_lua_get_nick_info (lua_State *L)
if (!lua_current_script)
{
- lua_plugin->printf_server (lua_plugin,
- "Lua error: unable to get nick infos, "
- "script not initialized");
+ lua_plugin->print_server (lua_plugin,
+ "Lua error: unable to get nick infos, "
+ "script not initialized");
lua_pushnil (lua_current_interpreter);
return 1;
}
@@ -1176,9 +1176,9 @@ weechat_lua_get_nick_info (lua_State *L)
if (n != 2)
{
- lua_plugin->printf_server (lua_plugin,
- "Lua error: wrong parameters for "
- "\"get_nick_info\" function");
+ lua_plugin->print_server (lua_plugin,
+ "Lua error: wrong parameters for "
+ "\"get_nick_info\" function");
lua_pushnil (lua_current_interpreter);
return 1;
}
@@ -1308,13 +1308,13 @@ weechat_lua_load (t_weechat_plugin *plugin, char *filename)
"io.stderr = weechat_outputs\n"
};
- plugin->printf_server (plugin, "Loading Lua script \"%s\"", filename);
+ plugin->print_server (plugin, "Loading Lua script \"%s\"", filename);
if ((fp = fopen (filename, "r")) == NULL)
{
- plugin->printf_server (plugin,
- "Lua error: unable to open file \"%s\"",
- filename);
+ plugin->print_server (plugin,
+ "Lua error: unable to open file \"%s\"",
+ filename);
return 0;
}
@@ -1324,8 +1324,8 @@ weechat_lua_load (t_weechat_plugin *plugin, char *filename)
if (lua_current_interpreter == NULL)
{
- plugin->printf_server (plugin,
- "Lua error: unable to create new sub-interpreter");
+ plugin->print_server (plugin,
+ "Lua error: unable to create new sub-interpreter");
fclose (fp);
return 0;
}
@@ -1340,19 +1340,19 @@ weechat_lua_load (t_weechat_plugin *plugin, char *filename)
luaL_openlib (lua_current_interpreter, "weechat", weechat_lua_funcs, 0);
if (lua_dostring (lua_current_interpreter, weechat_lua_code) != 0)
- plugin->printf_server (plugin,
- "Lua warning: unable to redirect stdout and stderr");
+ plugin->print_server (plugin,
+ "Lua warning: unable to redirect stdout and stderr");
lua_current_script_filename = strdup (filename);
if (luaL_loadfile (lua_current_interpreter, filename) != 0)
{
- plugin->printf_server (plugin,
- "Lua error: unable to load file \"%s\"",
- filename);
- plugin->printf_server (plugin,
- "Lua error: %s",
- lua_tostring (lua_current_interpreter, -1));
+ plugin->print_server (plugin,
+ "Lua error: unable to load file \"%s\"",
+ filename);
+ plugin->print_server (plugin,
+ "Lua error: %s",
+ lua_tostring (lua_current_interpreter, -1));
free (lua_current_script_filename);
lua_close (lua_current_interpreter);
fclose (fp);
@@ -1361,12 +1361,12 @@ weechat_lua_load (t_weechat_plugin *plugin, char *filename)
if (lua_pcall (lua_current_interpreter, 0, 0, 0) != 0)
{
- plugin->printf_server (plugin,
- "Lua error: unable to execute file \"%s\"",
- filename);
- plugin->printf_server (plugin,
- "Lua error: %s",
- lua_tostring (lua_current_interpreter, -1));
+ plugin->print_server (plugin,
+ "Lua error: unable to execute file \"%s\"",
+ filename);
+ plugin->print_server (plugin,
+ "Lua error: %s",
+ lua_tostring (lua_current_interpreter, -1));
free (lua_current_script_filename);
lua_close (lua_current_interpreter);
fclose (fp);
@@ -1381,10 +1381,10 @@ weechat_lua_load (t_weechat_plugin *plugin, char *filename)
if (lua_current_script == NULL)
{
- plugin->printf_server (plugin,
- "Lua error: function \"register\" not found "
- "in file \"%s\"",
- filename);
+ plugin->print_server (plugin,
+ "Lua error: function \"register\" not found "
+ "in file \"%s\"",
+ filename);
lua_close (lua_current_interpreter);
return 0;
}
@@ -1401,9 +1401,9 @@ weechat_lua_load (t_weechat_plugin *plugin, char *filename)
void
weechat_lua_unload (t_weechat_plugin *plugin, t_plugin_script *script)
{
- plugin->printf_server (plugin,
- "Unloading Lua script \"%s\"",
- script->name);
+ plugin->print_server (plugin,
+ "Unloading Lua script \"%s\"",
+ script->name);
if (script->shutdown_func[0])
weechat_lua_exec (plugin, script, script->shutdown_func, "", "");
@@ -1426,15 +1426,15 @@ weechat_lua_unload_name (t_weechat_plugin *plugin, char *name)
if (ptr_script)
{
weechat_lua_unload (plugin, ptr_script);
- plugin->printf_server (plugin,
- "Lua script \"%s\" unloaded",
- name);
+ plugin->print_server (plugin,
+ "Lua script \"%s\" unloaded",
+ name);
}
else
{
- plugin->printf_server (plugin,
- "Lua error: script \"%s\" not loaded",
- name);
+ plugin->print_server (plugin,
+ "Lua error: script \"%s\" not loaded",
+ name);
}
}
@@ -1445,13 +1445,13 @@ weechat_lua_unload_name (t_weechat_plugin *plugin, char *name)
void
weechat_lua_unload_all (t_weechat_plugin *plugin)
{
- plugin->printf_server (plugin,
- "Unloading all Lua scripts");
+ plugin->print_server (plugin,
+ "Unloading all Lua scripts");
while (lua_scripts)
weechat_lua_unload (plugin, lua_scripts);
- plugin->printf_server (plugin,
- "Lua scripts unloaded");
+ plugin->print_server (plugin,
+ "Lua scripts unloaded");
}
/*
@@ -1486,26 +1486,26 @@ weechat_lua_cmd (t_weechat_plugin *plugin,
{
case 0:
/* list registered Lua scripts */
- plugin->printf_server (plugin, "");
- plugin->printf_server (plugin, "Registered Lua scripts:");
+ plugin->print_server (plugin, "");
+ plugin->print_server (plugin, "Registered Lua scripts:");
if (lua_scripts)
{
for (ptr_script = lua_scripts;
ptr_script; ptr_script = ptr_script->next_script)
{
- plugin->printf_server (plugin, " %s v%s%s%s",
- ptr_script->name,
- ptr_script->version,
- (ptr_script->description[0]) ? " - " : "",
- ptr_script->description);
+ plugin->print_server (plugin, " %s v%s%s%s",
+ ptr_script->name,
+ ptr_script->version,
+ (ptr_script->description[0]) ? " - " : "",
+ ptr_script->description);
}
}
else
- plugin->printf_server (plugin, " (none)");
+ plugin->print_server (plugin, " (none)");
/* list Lua message handlers */
- plugin->printf_server (plugin, "");
- plugin->printf_server (plugin, "Lua message handlers:");
+ plugin->print_server (plugin, "");
+ plugin->print_server (plugin, "Lua message handlers:");
handler_found = 0;
for (ptr_handler = plugin->handlers;
ptr_handler; ptr_handler = ptr_handler->next_handler)
@@ -1514,17 +1514,17 @@ weechat_lua_cmd (t_weechat_plugin *plugin,
&& (ptr_handler->handler_args))
{
handler_found = 1;
- plugin->printf_server (plugin, " IRC(%s) => Lua(%s)",
- ptr_handler->irc_command,
- ptr_handler->handler_args);
+ plugin->print_server (plugin, " IRC(%s) => Lua(%s)",
+ ptr_handler->irc_command,
+ ptr_handler->handler_args);
}
}
if (!handler_found)
- plugin->printf_server (plugin, " (none)");
+ plugin->print_server (plugin, " (none)");
/* list Lua command handlers */
- plugin->printf_server (plugin, "");
- plugin->printf_server (plugin, "Lua command handlers:");
+ plugin->print_server (plugin, "");
+ plugin->print_server (plugin, "Lua command handlers:");
handler_found = 0;
for (ptr_handler = plugin->handlers;
ptr_handler; ptr_handler = ptr_handler->next_handler)
@@ -1533,13 +1533,13 @@ weechat_lua_cmd (t_weechat_plugin *plugin,
&& (ptr_handler->handler_args))
{
handler_found = 1;
- plugin->printf_server (plugin, " /%s => Lua(%s)",
- ptr_handler->command,
- ptr_handler->handler_args);
+ plugin->print_server (plugin, " /%s => Lua(%s)",
+ ptr_handler->command,
+ ptr_handler->handler_args);
}
}
if (!handler_found)
- plugin->printf_server (plugin, " (none)");
+ plugin->print_server (plugin, " (none)");
break;
case 1:
if (plugin->ascii_strcasecmp (plugin, argv[0], "autoload") == 0)
@@ -1586,14 +1586,14 @@ weechat_lua_cmd (t_weechat_plugin *plugin,
}
else
{
- plugin->printf_server (plugin,
- "Lua error: unknown option for "
- "\"lua\" command");
+ plugin->print_server (plugin,
+ "Lua error: unknown option for "
+ "\"lua\" command");
}
break;
default:
- plugin->printf_server (plugin,
- "Lua error: wrong argument count for \"lua\" command");
+ plugin->print_server (plugin,
+ "Lua error: wrong argument count for \"lua\" command");
}
if (argv)
@@ -1612,7 +1612,7 @@ weechat_plugin_init (t_weechat_plugin *plugin)
lua_plugin = plugin;
- plugin->printf_server (plugin, "Loading Lua module \"weechat\"");
+ plugin->print_server (plugin, "Loading Lua module \"weechat\"");
plugin->cmd_handler_add (plugin, "lua",
"list/load/unload Lua scripts",
@@ -1641,6 +1641,6 @@ weechat_plugin_end (t_weechat_plugin *plugin)
/* unload all scripts */
weechat_lua_unload_all (plugin);
- lua_plugin->printf_server (lua_plugin,
- "Lua plugin ended");
+ lua_plugin->print_server (lua_plugin,
+ "Lua plugin ended");
}
diff --git a/src/plugins/scripts/perl/weechat-perl.c b/src/plugins/scripts/perl/weechat-perl.c
index d50bf1d8f..5b329a506 100644
--- a/src/plugins/scripts/perl/weechat-perl.c
+++ b/src/plugins/scripts/perl/weechat-perl.c
@@ -146,16 +146,16 @@ weechat_perl_exec (t_weechat_plugin *plugin,
return_code = PLUGIN_RC_KO;
if (SvTRUE (sv))
{
- plugin->printf_server (plugin, "Perl error: %s", SvPV (sv, count));
+ plugin->print_server (plugin, "Perl error: %s", SvPV (sv, count));
POPs;
}
else
{
if (count != 1)
{
- plugin->printf_server (plugin,
- "Perl error: too much values from \"%s\" (%d). Expected: 1.",
- function, count);
+ plugin->print_server (plugin,
+ "Perl error: too much values from \"%s\" (%d). Expected: 1.",
+ function, count);
}
else
return_code = POPi;
@@ -204,9 +204,9 @@ static XS (XS_weechat_register)
if (items != 4)
{
- perl_plugin->printf_server (perl_plugin,
- "Perl error: wrong parameters for "
- "\"register\" function");
+ perl_plugin->print_server (perl_plugin,
+ "Perl error: wrong parameters for "
+ "\"register\" function");
XSRETURN_NO;
}
@@ -218,11 +218,11 @@ static XS (XS_weechat_register)
if (weechat_script_search (perl_plugin, &perl_scripts, name))
{
/* error: another script already exists with this name! */
- perl_plugin->printf_server (perl_plugin,
- "Perl error: unable to register "
- "\"%s\" script (another script "
- "already exists with this name)",
- name);
+ perl_plugin->print_server (perl_plugin,
+ "Perl error: unable to register "
+ "\"%s\" script (another script "
+ "already exists with this name)",
+ name);
XSRETURN_NO;
}
@@ -235,17 +235,17 @@ static XS (XS_weechat_register)
description);
if (perl_current_script)
{
- perl_plugin->printf_server (perl_plugin,
- "Perl: registered script \"%s\", "
- "version %s (%s)",
- name, version, description);
+ perl_plugin->print_server (perl_plugin,
+ "Perl: registered script \"%s\", "
+ "version %s (%s)",
+ name, version, description);
}
else
{
- perl_plugin->printf_server (perl_plugin,
- "Perl error: unable to load script "
- "\"%s\" (not enough memory)",
- name);
+ perl_plugin->print_server (perl_plugin,
+ "Perl error: unable to load script "
+ "\"%s\" (not enough memory)",
+ name);
XSRETURN_NO;
}
@@ -267,17 +267,17 @@ static XS (XS_weechat_print)
if (!perl_current_script)
{
- perl_plugin->printf_server (perl_plugin,
- "Perl error: unable to print message, "
- "script not initialized");
+ perl_plugin->print_server (perl_plugin,
+ "Perl error: unable to print message, "
+ "script not initialized");
XSRETURN_NO;
}
if (items < 1)
{
- perl_plugin->printf_server (perl_plugin,
- "Perl error: wrong parameters for "
- "\"print\" function");
+ perl_plugin->print_server (perl_plugin,
+ "Perl error: wrong parameters for "
+ "\"print\" function");
XSRETURN_NO;
}
@@ -293,9 +293,9 @@ static XS (XS_weechat_print)
server_name = SvPV (ST (2), integer);
}
- perl_plugin->printf (perl_plugin,
- server_name, channel_name,
- "%s", message);
+ perl_plugin->print (perl_plugin,
+ server_name, channel_name,
+ "%s", message);
XSRETURN_YES;
}
@@ -314,24 +314,24 @@ static XS (XS_weechat_print_infobar)
if (!perl_current_script)
{
- perl_plugin->printf_server (perl_plugin,
- "Perl error: unable to print infobar message, "
- "script not initialized");
+ perl_plugin->print_server (perl_plugin,
+ "Perl error: unable to print infobar message, "
+ "script not initialized");
XSRETURN_NO;
}
if (items < 2)
{
- perl_plugin->printf_server (perl_plugin,
- "Perl error: wrong parameters for "
- "\"print_infobar\" function");
+ perl_plugin->print_server (perl_plugin,
+ "Perl error: wrong parameters for "
+ "\"print_infobar\" function");
XSRETURN_NO;
}
- perl_plugin->infobar_printf (perl_plugin,
- SvIV (ST (0)),
- "%s",
- SvPV (ST (1), integer));
+ perl_plugin->print_infobar (perl_plugin,
+ SvIV (ST (0)),
+ "%s",
+ SvPV (ST (1), integer));
XSRETURN_YES;
}
@@ -351,17 +351,17 @@ static XS (XS_weechat_log)
if (!perl_current_script)
{
- perl_plugin->printf_server (perl_plugin,
- "Perl error: unable to print message, "
- "script not initialized");
+ perl_plugin->print_server (perl_plugin,
+ "Perl error: unable to print message, "
+ "script not initialized");
XSRETURN_NO;
}
if (items < 1)
{
- perl_plugin->printf_server (perl_plugin,
- "Perl error: wrong parameters for "
- "\"log\" function");
+ perl_plugin->print_server (perl_plugin,
+ "Perl error: wrong parameters for "
+ "\"log\" function");
XSRETURN_NO;
}
@@ -399,17 +399,17 @@ static XS (XS_weechat_command)
if (!perl_current_script)
{
- perl_plugin->printf_server (perl_plugin,
- "Perl error: unable to run command, "
- "script not initialized");
+ perl_plugin->print_server (perl_plugin,
+ "Perl error: unable to run command, "
+ "script not initialized");
XSRETURN_NO;
}
if (items < 1)
{
- perl_plugin->printf_server (perl_plugin,
- "Perl error: wrong parameters for "
- "\"command\" function");
+ perl_plugin->print_server (perl_plugin,
+ "Perl error: wrong parameters for "
+ "\"command\" function");
XSRETURN_NO;
}
@@ -445,17 +445,17 @@ static XS (XS_weechat_add_message_handler)
if (!perl_current_script)
{
- perl_plugin->printf_server (perl_plugin,
- "Perl error: unable to add message handler, "
- "script not initialized");
+ perl_plugin->print_server (perl_plugin,
+ "Perl error: unable to add message handler, "
+ "script not initialized");
XSRETURN_NO;
}
if (items < 2)
{
- perl_plugin->printf_server (perl_plugin,
- "Perl error: wrong parameters for "
- "\"add_message_handler\" function");
+ perl_plugin->print_server (perl_plugin,
+ "Perl error: wrong parameters for "
+ "\"add_message_handler\" function");
XSRETURN_NO;
}
@@ -486,17 +486,17 @@ static XS (XS_weechat_add_command_handler)
if (!perl_current_script)
{
- perl_plugin->printf_server (perl_plugin,
- "Perl error: unable to add command handler, "
- "script not initialized");
+ perl_plugin->print_server (perl_plugin,
+ "Perl error: unable to add command handler, "
+ "script not initialized");
XSRETURN_NO;
}
if (items < 2)
{
- perl_plugin->printf_server (perl_plugin,
- "Perl error: wrong parameters for "
- "\"add_command_handler\" function");
+ perl_plugin->print_server (perl_plugin,
+ "Perl error: wrong parameters for "
+ "\"add_command_handler\" function");
XSRETURN_NO;
}
@@ -536,17 +536,17 @@ static XS (XS_weechat_remove_handler)
if (!perl_current_script)
{
- perl_plugin->printf_server (perl_plugin,
- "Perl error: unable to remove handler, "
- "script not initialized");
+ perl_plugin->print_server (perl_plugin,
+ "Perl error: unable to remove handler, "
+ "script not initialized");
XSRETURN_NO;
}
if (items < 2)
{
- perl_plugin->printf_server (perl_plugin,
- "Perl error: wrong parameters for "
- "\"remove_handler\" function");
+ perl_plugin->print_server (perl_plugin,
+ "Perl error: wrong parameters for "
+ "\"remove_handler\" function");
XSRETURN_NO;
}
@@ -574,17 +574,17 @@ static XS (XS_weechat_get_info)
if (!perl_current_script)
{
- perl_plugin->printf_server (perl_plugin,
- "Perl error: unable to get info, "
- "script not initialized");
+ perl_plugin->print_server (perl_plugin,
+ "Perl error: unable to get info, "
+ "script not initialized");
XSRETURN_NO;
}
if (items < 1)
{
- perl_plugin->printf_server (perl_plugin,
- "Perl error: wrong parameters for "
- "\"get_info\" function");
+ perl_plugin->print_server (perl_plugin,
+ "Perl error: wrong parameters for "
+ "\"get_info\" function");
XSRETURN_NO;
}
@@ -627,9 +627,9 @@ static XS (XS_weechat_get_dcc_info)
if (!perl_current_script)
{
- perl_plugin->printf_server (perl_plugin,
- "Perl error: unable to get DCC info, "
- "script not initialized");
+ perl_plugin->print_server (perl_plugin,
+ "Perl error: unable to get DCC info, "
+ "script not initialized");
XSRETURN_EMPTY;
}
@@ -688,17 +688,17 @@ static XS (XS_weechat_get_config)
if (!perl_current_script)
{
- perl_plugin->printf_server (perl_plugin,
- "Perl error: unable to get config option, "
- "script not initialized");
+ perl_plugin->print_server (perl_plugin,
+ "Perl error: unable to get config option, "
+ "script not initialized");
XSRETURN_NO;
}
if (items < 1)
{
- perl_plugin->printf_server (perl_plugin,
- "Perl error: wrong parameters for "
- "\"get_config\" function");
+ perl_plugin->print_server (perl_plugin,
+ "Perl error: wrong parameters for "
+ "\"get_config\" function");
XSRETURN_NO;
}
@@ -735,17 +735,17 @@ static XS (XS_weechat_set_config)
if (!perl_current_script)
{
- perl_plugin->printf_server (perl_plugin,
- "Perl error: unable to set config option, "
- "script not initialized");
+ perl_plugin->print_server (perl_plugin,
+ "Perl error: unable to set config option, "
+ "script not initialized");
XSRETURN_NO;
}
if (items < 2)
{
- perl_plugin->printf_server (perl_plugin,
- "Perl error: wrong parameters for "
- "\"set_config\" function");
+ perl_plugin->print_server (perl_plugin,
+ "Perl error: wrong parameters for "
+ "\"set_config\" function");
XSRETURN_NO;
}
@@ -776,17 +776,17 @@ static XS (XS_weechat_get_plugin_config)
if (!perl_current_script)
{
- perl_plugin->printf_server (perl_plugin,
- "Perl error: unable to get plugin config option, "
- "script not initialized");
+ perl_plugin->print_server (perl_plugin,
+ "Perl error: unable to get plugin config option, "
+ "script not initialized");
XSRETURN_NO;
}
if (items < 1)
{
- perl_plugin->printf_server (perl_plugin,
- "Perl error: wrong parameters for "
- "\"get_plugin_config\" function");
+ perl_plugin->print_server (perl_plugin,
+ "Perl error: wrong parameters for "
+ "\"get_plugin_config\" function");
XSRETURN_NO;
}
@@ -825,17 +825,17 @@ static XS (XS_weechat_set_plugin_config)
if (!perl_current_script)
{
- perl_plugin->printf_server (perl_plugin,
- "Perl error: unable to set plugin config option, "
- "script not initialized");
+ perl_plugin->print_server (perl_plugin,
+ "Perl error: unable to set plugin config option, "
+ "script not initialized");
XSRETURN_NO;
}
if (items < 2)
{
- perl_plugin->printf_server (perl_plugin,
- "Perl error: wrong parameters for "
- "\"set_plugin_config\" function");
+ perl_plugin->print_server (perl_plugin,
+ "Perl error: wrong parameters for "
+ "\"set_plugin_config\" function");
XSRETURN_NO;
}
@@ -870,9 +870,9 @@ static XS (XS_weechat_get_server_info)
if (!perl_current_script)
{
- perl_plugin->printf_server (perl_plugin,
- "Perl error: unable to get server info, "
- "script not initialized");
+ perl_plugin->print_server (perl_plugin,
+ "Perl error: unable to get server info, "
+ "script not initialized");
XSRETURN_EMPTY;
}
@@ -950,17 +950,17 @@ static XS (XS_weechat_get_channel_info)
if (!perl_current_script)
{
- perl_plugin->printf_server (perl_plugin,
- "Perl error: unable to get channel info, "
- "script not initialized");
+ perl_plugin->print_server (perl_plugin,
+ "Perl error: unable to get channel info, "
+ "script not initialized");
XSRETURN_EMPTY;
}
if (items != 1)
{
- perl_plugin->printf_server (perl_plugin,
- "Perl error: wrong parameters for "
- "\"get_channel_info\" function");
+ perl_plugin->print_server (perl_plugin,
+ "Perl error: wrong parameters for "
+ "\"get_channel_info\" function");
XSRETURN_EMPTY;
}
@@ -1018,17 +1018,17 @@ static XS (XS_weechat_get_nick_info)
if (!perl_current_script)
{
- perl_plugin->printf_server (perl_plugin,
- "Perl error: unable to get nick info, "
- "script not initialized");
+ perl_plugin->print_server (perl_plugin,
+ "Perl error: unable to get nick info, "
+ "script not initialized");
XSRETURN_EMPTY;
}
if (items != 2)
{
- perl_plugin->printf_server (perl_plugin,
- "Perl error: wrong parameters for "
- "\"get_nick_info\" function");
+ perl_plugin->print_server (perl_plugin,
+ "Perl error: wrong parameters for "
+ "\"get_nick_info\" function");
XSRETURN_EMPTY;
}
@@ -1122,7 +1122,7 @@ weechat_perl_load (t_weechat_plugin *plugin, char *filename)
char *perl_args[] = { "", "-e", "0" };
#endif
- plugin->printf_server (plugin, "Loading Perl script \"%s\"", filename);
+ plugin->print_server (plugin, "Loading Perl script \"%s\"", filename);
perl_current_script = NULL;
#ifndef MULTIPLICITY
@@ -1135,8 +1135,8 @@ weechat_perl_load (t_weechat_plugin *plugin, char *filename)
if (perl_current_interpreter == NULL)
{
- plugin->printf_server (plugin,
- "Perl error: unable to create new sub-interpreter");
+ plugin->print_server (plugin,
+ "Perl error: unable to create new sub-interpreter");
return 0;
}
@@ -1158,27 +1158,27 @@ weechat_perl_load (t_weechat_plugin *plugin, char *filename)
{
if (eval == 2)
{
- plugin->printf_server (plugin,
- "Perl error: unable to parse file \"%s\"",
- filename);
- plugin->printf_server (plugin,
- "Perl error: %s",
+ plugin->print_server (plugin,
+ "Perl error: unable to parse file \"%s\"",
+ filename);
+ plugin->print_server (plugin,
+ "Perl error: %s",
#ifndef MULTIPLICITY
- SvPV(perl_get_sv("WeechatPerlScriptLoader::weechat_perl_load_eval_file_error", FALSE), len));
+ SvPV(perl_get_sv("WeechatPerlScriptLoader::weechat_perl_load_eval_file_error", FALSE), len));
#else
- SvPV(perl_get_sv("weechat_perl_load_eval_file_error", FALSE), len));
+ SvPV(perl_get_sv("weechat_perl_load_eval_file_error", FALSE), len));
#endif
}
else if ( eval == 1)
{
- plugin->printf_server (plugin,
- "Perl error: unable to run file \"%s\"",
- filename);
+ plugin->print_server (plugin,
+ "Perl error: unable to run file \"%s\"",
+ filename);
}
else {
- plugin->printf_server (plugin,
- "Perl error: unknown error while loading file \"%s\"",
- filename);
+ plugin->print_server (plugin,
+ "Perl error: unknown error while loading file \"%s\"",
+ filename);
}
#ifdef MULTIPLICITY
perl_destruct (perl_current_interpreter);
@@ -1190,11 +1190,12 @@ weechat_perl_load (t_weechat_plugin *plugin, char *filename)
return 0;
}
- if (perl_current_script == NULL) {
- plugin->printf_server (plugin,
- "Perl error: function \"register\" not found "
- "in file \"%s\"",
- filename);
+ if (perl_current_script == NULL)
+ {
+ plugin->print_server (plugin,
+ "Perl error: function \"register\" not found "
+ "in file \"%s\"",
+ filename);
#ifdef MULTIPLICITY
perl_destruct (perl_current_interpreter);
perl_free (perl_current_interpreter);
@@ -1218,9 +1219,9 @@ weechat_perl_load (t_weechat_plugin *plugin, char *filename)
void
weechat_perl_unload (t_weechat_plugin *plugin, t_plugin_script *script)
{
- plugin->printf_server (plugin,
- "Unloading Perl script \"%s\"",
- script->name);
+ plugin->print_server (plugin,
+ "Unloading Perl script \"%s\"",
+ script->name);
#ifndef MULTIPLICITY
eval_pv(script->interpreter, TRUE);
@@ -1255,15 +1256,15 @@ weechat_perl_unload_name (t_weechat_plugin *plugin, char *name)
if (ptr_script)
{
weechat_perl_unload (plugin, ptr_script);
- plugin->printf_server (plugin,
- "Perl script \"%s\" unloaded",
- name);
+ plugin->print_server (plugin,
+ "Perl script \"%s\" unloaded",
+ name);
}
else
{
- plugin->printf_server (plugin,
- "Perl error: script \"%s\" not loaded",
- name);
+ plugin->print_server (plugin,
+ "Perl error: script \"%s\" not loaded",
+ name);
}
}
@@ -1274,13 +1275,13 @@ weechat_perl_unload_name (t_weechat_plugin *plugin, char *name)
void
weechat_perl_unload_all (t_weechat_plugin *plugin)
{
- plugin->printf_server (plugin,
- "Unloading all Perl scripts");
+ plugin->print_server (plugin,
+ "Unloading all Perl scripts");
while (perl_scripts)
weechat_perl_unload (plugin, perl_scripts);
- plugin->printf_server (plugin,
- "Perl scripts unloaded");
+ plugin->print_server (plugin,
+ "Perl scripts unloaded");
}
/*
@@ -1315,26 +1316,26 @@ weechat_perl_cmd (t_weechat_plugin *plugin,
{
case 0:
/* list registered Perl scripts */
- plugin->printf_server (plugin, "");
- plugin->printf_server (plugin, "Registered Perl scripts:");
+ plugin->print_server (plugin, "");
+ plugin->print_server (plugin, "Registered Perl scripts:");
if (perl_scripts)
{
for (ptr_script = perl_scripts;
ptr_script; ptr_script = ptr_script->next_script)
{
- plugin->printf_server (plugin, " %s v%s%s%s",
- ptr_script->name,
- ptr_script->version,
- (ptr_script->description[0]) ? " - " : "",
- ptr_script->description);
+ plugin->print_server (plugin, " %s v%s%s%s",
+ ptr_script->name,
+ ptr_script->version,
+ (ptr_script->description[0]) ? " - " : "",
+ ptr_script->description);
}
}
else
- plugin->printf_server (plugin, " (none)");
+ plugin->print_server (plugin, " (none)");
/* list Perl message handlers */
- plugin->printf_server (plugin, "");
- plugin->printf_server (plugin, "Perl message handlers:");
+ plugin->print_server (plugin, "");
+ plugin->print_server (plugin, "Perl message handlers:");
handler_found = 0;
for (ptr_handler = plugin->handlers;
ptr_handler; ptr_handler = ptr_handler->next_handler)
@@ -1343,17 +1344,17 @@ weechat_perl_cmd (t_weechat_plugin *plugin,
&& (ptr_handler->handler_args))
{
handler_found = 1;
- plugin->printf_server (plugin, " IRC(%s) => Perl(%s)",
- ptr_handler->irc_command,
- ptr_handler->handler_args);
+ plugin->print_server (plugin, " IRC(%s) => Perl(%s)",
+ ptr_handler->irc_command,
+ ptr_handler->handler_args);
}
}
if (!handler_found)
- plugin->printf_server (plugin, " (none)");
+ plugin->print_server (plugin, " (none)");
/* list Perl command handlers */
- plugin->printf_server (plugin, "");
- plugin->printf_server (plugin, "Perl command handlers:");
+ plugin->print_server (plugin, "");
+ plugin->print_server (plugin, "Perl command handlers:");
handler_found = 0;
for (ptr_handler = plugin->handlers;
ptr_handler; ptr_handler = ptr_handler->next_handler)
@@ -1362,13 +1363,13 @@ weechat_perl_cmd (t_weechat_plugin *plugin,
&& (ptr_handler->handler_args))
{
handler_found = 1;
- plugin->printf_server (plugin, " /%s => Perl(%s)",
- ptr_handler->command,
- ptr_handler->handler_args);
+ plugin->print_server (plugin, " /%s => Perl(%s)",
+ ptr_handler->command,
+ ptr_handler->handler_args);
}
}
if (!handler_found)
- plugin->printf_server (plugin, " (none)");
+ plugin->print_server (plugin, " (none)");
break;
case 1:
if (plugin->ascii_strcasecmp (plugin, argv[0], "autoload") == 0)
@@ -1415,14 +1416,14 @@ weechat_perl_cmd (t_weechat_plugin *plugin,
}
else
{
- plugin->printf_server (plugin,
- "Perl error: unknown option for "
- "\"perl\" command");
+ plugin->print_server (plugin,
+ "Perl error: unknown option for "
+ "\"perl\" command");
}
break;
default:
- plugin->printf_server (plugin,
- "Perl error: wrong argument count for \"perl\" command");
+ plugin->print_server (plugin,
+ "Perl error: wrong argument count for \"perl\" command");
}
if (argv)
@@ -1441,18 +1442,18 @@ weechat_plugin_init (t_weechat_plugin *plugin)
perl_plugin = plugin;
#ifdef MULTIPLICITY
- plugin->printf_server (plugin, "Loading Perl module \"weechat\"");
+ plugin->print_server (plugin, "Loading Perl module \"weechat\"");
#else
char *perl_args[] = { "", "-e", "0" };
- plugin->printf_server (plugin, "Loading Perl module \"weechat\" (without multiplicity)");
+ plugin->print_server (plugin, "Loading Perl module \"weechat\" (without multiplicity)");
main_perl = perl_alloc ();
if (!main_perl)
{
- plugin->printf_server (plugin,
- "Perl error: unable to initialize Perl");
+ plugin->print_server (plugin,
+ "Perl error: unable to initialize Perl");
return PLUGIN_RC_KO;
}
@@ -1498,6 +1499,6 @@ weechat_plugin_end (t_weechat_plugin *plugin)
}
#endif
- perl_plugin->printf_server (perl_plugin,
- "Perl plugin ended");
+ perl_plugin->print_server (perl_plugin,
+ "Perl plugin ended");
}
diff --git a/src/plugins/scripts/python/weechat-python.c b/src/plugins/scripts/python/weechat-python.c
index 007ed3edc..69169dab0 100644
--- a/src/plugins/scripts/python/weechat-python.c
+++ b/src/plugins/scripts/python/weechat-python.c
@@ -66,9 +66,9 @@ weechat_python_exec (t_weechat_plugin *plugin,
if ( !(evFunc && PyCallable_Check (evFunc)) )
{
- plugin->printf_server (plugin,
- "Python error: unable to run function \"%s\"",
- function);
+ plugin->print_server (plugin,
+ "Python error: unable to run function \"%s\"",
+ function);
return PLUGIN_RC_KO;
}
@@ -128,20 +128,20 @@ weechat_python_register (PyObject *self, PyObject *args)
if (!PyArg_ParseTuple (args, "ssss", &name, &version, &shutdown_func, &description))
{
- python_plugin->printf_server (python_plugin,
- "Python error: wrong parameters for "
- "\"register\" function");
+ python_plugin->print_server (python_plugin,
+ "Python error: wrong parameters for "
+ "\"register\" function");
return Py_BuildValue ("i", 0);
}
if (weechat_script_search (python_plugin, &python_scripts, name))
{
/* error: another scripts already exists with this name! */
- python_plugin->printf_server (python_plugin,
- "Python error: unable to register "
- "\"%s\" script (another script "
- "already exists with this name)",
- name);
+ python_plugin->print_server (python_plugin,
+ "Python error: unable to register "
+ "\"%s\" script (another script "
+ "already exists with this name)",
+ name);
return Py_BuildValue ("i", 0);
}
@@ -154,17 +154,17 @@ weechat_python_register (PyObject *self, PyObject *args)
description);
if (python_current_script)
{
- python_plugin->printf_server (python_plugin,
- "Python: registered script \"%s\", "
- "version %s (%s)",
- name, version, description);
+ python_plugin->print_server (python_plugin,
+ "Python: registered script \"%s\", "
+ "version %s (%s)",
+ name, version, description);
}
else
{
- python_plugin->printf_server (python_plugin,
- "Python error: unable to load script "
- "\"%s\" (not enough memory)",
- name);
+ python_plugin->print_server (python_plugin,
+ "Python error: unable to load script "
+ "\"%s\" (not enough memory)",
+ name);
return Py_BuildValue ("i", 0);
}
@@ -185,9 +185,9 @@ weechat_python_print (PyObject *self, PyObject *args)
if (!python_current_script)
{
- python_plugin->printf_server (python_plugin,
- "Python error: unable to print message, "
- "script not initialized");
+ python_plugin->print_server (python_plugin,
+ "Python error: unable to print message, "
+ "script not initialized");
return Py_BuildValue ("i", 0);
}
@@ -197,15 +197,15 @@ weechat_python_print (PyObject *self, PyObject *args)
if (!PyArg_ParseTuple (args, "s|ss", &message, &channel_name, &server_name))
{
- python_plugin->printf_server (python_plugin,
- "Python error: wrong parameters for "
- "\"print\" function");
+ python_plugin->print_server (python_plugin,
+ "Python error: wrong parameters for "
+ "\"print\" function");
return Py_BuildValue ("i", 0);
}
- python_plugin->printf (python_plugin,
- server_name, channel_name,
- "%s", message);
+ python_plugin->print (python_plugin,
+ server_name, channel_name,
+ "%s", message);
return Py_BuildValue ("i", 1);
}
@@ -225,9 +225,9 @@ weechat_python_print_infobar (PyObject *self, PyObject *args)
if (!python_current_script)
{
- python_plugin->printf_server (python_plugin,
- "Python error: unable to print infobar message, "
- "script not initialized");
+ python_plugin->print_server (python_plugin,
+ "Python error: unable to print infobar message, "
+ "script not initialized");
return Py_BuildValue ("i", 0);
}
@@ -236,13 +236,13 @@ weechat_python_print_infobar (PyObject *self, PyObject *args)
if (!PyArg_ParseTuple (args, "is", &delay, &message))
{
- python_plugin->printf_server (python_plugin,
- "Python error: wrong parameters for "
- "\"print_infobar\" function");
+ python_plugin->print_server (python_plugin,
+ "Python error: wrong parameters for "
+ "\"print_infobar\" function");
return Py_BuildValue ("i", 0);
}
- python_plugin->infobar_printf (python_plugin, delay, "%s", message);
+ python_plugin->print_infobar (python_plugin, delay, "%s", message);
return Py_BuildValue ("i", 1);
}
@@ -261,9 +261,9 @@ weechat_python_log (PyObject *self, PyObject *args)
if (!python_current_script)
{
- python_plugin->printf_server (python_plugin,
- "Python error: unable to log message, "
- "script not initialized");
+ python_plugin->print_server (python_plugin,
+ "Python error: unable to log message, "
+ "script not initialized");
return Py_BuildValue ("i", 0);
}
@@ -273,9 +273,9 @@ weechat_python_log (PyObject *self, PyObject *args)
if (!PyArg_ParseTuple (args, "s|ss", &message, &channel_name, &server_name))
{
- python_plugin->printf_server (python_plugin,
- "Python error: wrong parameters for "
- "\"log\" function");
+ python_plugin->print_server (python_plugin,
+ "Python error: wrong parameters for "
+ "\"log\" function");
return Py_BuildValue ("i", 0);
}
@@ -300,9 +300,9 @@ weechat_python_command (PyObject *self, PyObject *args)
if (!python_current_script)
{
- python_plugin->printf_server (python_plugin,
- "Python error: unable to run command, "
- "script not initialized");
+ python_plugin->print_server (python_plugin,
+ "Python error: unable to run command, "
+ "script not initialized");
return Py_BuildValue ("i", 0);
}
@@ -312,9 +312,9 @@ weechat_python_command (PyObject *self, PyObject *args)
if (!PyArg_ParseTuple (args, "s|ss", &command, &channel_name, &server_name))
{
- python_plugin->printf_server (python_plugin,
- "Python error: wrong parameters for "
- "\"command\" function");
+ python_plugin->print_server (python_plugin,
+ "Python error: wrong parameters for "
+ "\"command\" function");
return Py_BuildValue ("i", 0);
}
@@ -339,9 +339,9 @@ weechat_python_add_message_handler (PyObject *self, PyObject *args)
if (!python_current_script)
{
- python_plugin->printf_server (python_plugin,
- "Python error: unable to add message handler, "
- "script not initialized");
+ python_plugin->print_server (python_plugin,
+ "Python error: unable to add message handler, "
+ "script not initialized");
return Py_BuildValue ("i", 0);
}
@@ -350,9 +350,9 @@ weechat_python_add_message_handler (PyObject *self, PyObject *args)
if (!PyArg_ParseTuple (args, "ss", &irc_command, &function))
{
- python_plugin->printf_server (python_plugin,
- "Python error: wrong parameters for "
- "\"add_message_handler\" function");
+ python_plugin->print_server (python_plugin,
+ "Python error: wrong parameters for "
+ "\"add_message_handler\" function");
return Py_BuildValue ("i", 0);
}
@@ -379,9 +379,9 @@ weechat_python_add_command_handler (PyObject *self, PyObject *args)
if (!python_current_script)
{
- python_plugin->printf_server (python_plugin,
- "Python error: unable to add command handler, "
- "script not initialized");
+ python_plugin->print_server (python_plugin,
+ "Python error: unable to add command handler, "
+ "script not initialized");
return Py_BuildValue ("i", 0);
}
@@ -396,9 +396,9 @@ weechat_python_add_command_handler (PyObject *self, PyObject *args)
&description, &arguments, &arguments_description,
completion_template))
{
- python_plugin->printf_server (python_plugin,
- "Python error: wrong parameters for "
- "\"add_command_handler\" function");
+ python_plugin->print_server (python_plugin,
+ "Python error: wrong parameters for "
+ "\"add_command_handler\" function");
return Py_BuildValue ("i", 0);
}
@@ -430,9 +430,9 @@ weechat_python_remove_handler (PyObject *self, PyObject *args)
if (!python_current_script)
{
- python_plugin->printf_server (python_plugin,
- "Python error: unable to remove handler, "
- "script not initialized");
+ python_plugin->print_server (python_plugin,
+ "Python error: unable to remove handler, "
+ "script not initialized");
return Py_BuildValue ("i", 0);
}
@@ -441,9 +441,9 @@ weechat_python_remove_handler (PyObject *self, PyObject *args)
if (!PyArg_ParseTuple (args, "ss", &command, &function))
{
- python_plugin->printf_server (python_plugin,
- "Python error: wrong parameters for "
- "\"remove_handler\" function");
+ python_plugin->print_server (python_plugin,
+ "Python error: wrong parameters for "
+ "\"remove_handler\" function");
return Py_BuildValue ("i", 0);
}
@@ -468,9 +468,9 @@ weechat_python_get_info (PyObject *self, PyObject *args)
if (!python_current_script)
{
- python_plugin->printf_server (python_plugin,
- "Python error: unable to get info, "
- "script not initialized");
+ python_plugin->print_server (python_plugin,
+ "Python error: unable to get info, "
+ "script not initialized");
return Py_BuildValue ("i", 0);
}
@@ -479,9 +479,9 @@ weechat_python_get_info (PyObject *self, PyObject *args)
if (!PyArg_ParseTuple (args, "s|s", &arg, &server_name))
{
- python_plugin->printf_server (python_plugin,
- "Python error: wrong parameters for "
- "\"get_info\" function");
+ python_plugin->print_server (python_plugin,
+ "Python error: wrong parameters for "
+ "\"get_info\" function");
return Py_BuildValue ("i", 0);
}
@@ -519,9 +519,9 @@ weechat_python_get_dcc_info (PyObject *self, PyObject *args)
if (!python_current_script)
{
- python_plugin->printf_server (python_plugin,
- "Python error: unable to get DCC info, "
- "script not initialized");
+ python_plugin->print_server (python_plugin,
+ "Python error: unable to get DCC info, "
+ "script not initialized");
return Py_None;
}
@@ -616,9 +616,9 @@ weechat_python_get_config (PyObject *self, PyObject *args)
if (!python_current_script)
{
- python_plugin->printf_server (python_plugin,
- "Python error: unable to get config option, "
- "script not initialized");
+ python_plugin->print_server (python_plugin,
+ "Python error: unable to get config option, "
+ "script not initialized");
return Py_BuildValue ("i", 0);
}
@@ -626,9 +626,9 @@ weechat_python_get_config (PyObject *self, PyObject *args)
if (!PyArg_ParseTuple (args, "s", &option))
{
- python_plugin->printf_server (python_plugin,
- "Python error: wrong parameters for "
- "\"get_config\" function");
+ python_plugin->print_server (python_plugin,
+ "Python error: wrong parameters for "
+ "\"get_config\" function");
return Py_BuildValue ("i", 0);
}
@@ -661,9 +661,9 @@ weechat_python_set_config (PyObject *self, PyObject *args)
if (!python_current_script)
{
- python_plugin->printf_server (python_plugin,
- "Python error: unable to set config option, "
- "script not initialized");
+ python_plugin->print_server (python_plugin,
+ "Python error: unable to set config option, "
+ "script not initialized");
return Py_BuildValue ("i", 0);
}
@@ -672,9 +672,9 @@ weechat_python_set_config (PyObject *self, PyObject *args)
if (!PyArg_ParseTuple (args, "ss", &option, &value))
{
- python_plugin->printf_server (python_plugin,
- "Python error: wrong parameters for "
- "\"set_config\" function");
+ python_plugin->print_server (python_plugin,
+ "Python error: wrong parameters for "
+ "\"set_config\" function");
return Py_BuildValue ("i", 0);
}
@@ -702,9 +702,9 @@ weechat_python_get_plugin_config (PyObject *self, PyObject *args)
if (!python_current_script)
{
- python_plugin->printf_server (python_plugin,
- "Python error: unable to get plugin config option, "
- "script not initialized");
+ python_plugin->print_server (python_plugin,
+ "Python error: unable to get plugin config option, "
+ "script not initialized");
return Py_BuildValue ("i", 0);
}
@@ -712,9 +712,9 @@ weechat_python_get_plugin_config (PyObject *self, PyObject *args)
if (!PyArg_ParseTuple (args, "s", &option))
{
- python_plugin->printf_server (python_plugin,
- "Python error: wrong parameters for "
- "\"get_plugin_config\" function");
+ python_plugin->print_server (python_plugin,
+ "Python error: wrong parameters for "
+ "\"get_plugin_config\" function");
return Py_BuildValue ("i", 0);
}
@@ -749,9 +749,9 @@ weechat_python_set_plugin_config (PyObject *self, PyObject *args)
if (!python_current_script)
{
- python_plugin->printf_server (python_plugin,
- "Python error: unable to set plugin config option, "
- "script not initialized");
+ python_plugin->print_server (python_plugin,
+ "Python error: unable to set plugin config option, "
+ "script not initialized");
return Py_BuildValue ("i", 0);
}
@@ -760,9 +760,9 @@ weechat_python_set_plugin_config (PyObject *self, PyObject *args)
if (!PyArg_ParseTuple (args, "ss", &option, &value))
{
- python_plugin->printf_server (python_plugin,
- "Python error: wrong parameters for "
- "\"set_plugin_config\" function");
+ python_plugin->print_server (python_plugin,
+ "Python error: wrong parameters for "
+ "\"set_plugin_config\" function");
return Py_BuildValue ("i", 0);
}
@@ -794,9 +794,9 @@ weechat_python_get_server_info (PyObject *self, PyObject *args)
if (!python_current_script)
{
- python_plugin->printf_server (python_plugin,
- "Python error: unable to get server infos, "
- "script not initialized");
+ python_plugin->print_server (python_plugin,
+ "Python error: unable to get server infos, "
+ "script not initialized");
return Py_BuildValue ("i", 0);
}
@@ -897,18 +897,18 @@ weechat_python_get_channel_info (PyObject *self, PyObject *args)
if (!python_current_script)
{
- python_plugin->printf_server (python_plugin,
- "Python error: unable to get channel infos, "
- "script not initialized");
+ python_plugin->print_server (python_plugin,
+ "Python error: unable to get channel infos, "
+ "script not initialized");
return Py_BuildValue ("i", 0);
}
server = NULL;
if (!PyArg_ParseTuple (args, "s", &server))
{
- python_plugin->printf_server (python_plugin,
- "Python error: wrong parameters for "
- "\"get_channel_info\" function");
+ python_plugin->print_server (python_plugin,
+ "Python error: wrong parameters for "
+ "\"get_channel_info\" function");
return Py_BuildValue ("i", 0);
}
@@ -964,9 +964,9 @@ weechat_python_get_nick_info (PyObject *self, PyObject *args)
if (!python_current_script)
{
- python_plugin->printf_server (python_plugin,
- "Python error: unable to get nick infos, "
- "script not initialized");
+ python_plugin->print_server (python_plugin,
+ "Python error: unable to get nick infos, "
+ "script not initialized");
return Py_BuildValue ("i", 0);
}
@@ -974,9 +974,9 @@ weechat_python_get_nick_info (PyObject *self, PyObject *args)
channel = NULL;
if (!PyArg_ParseTuple (args, "ss", &server, &channel))
{
- python_plugin->printf_server (python_plugin,
- "Python error: wrong parameters for "
- "\"get_nick_info\" function");
+ python_plugin->print_server (python_plugin,
+ "Python error: wrong parameters for "
+ "\"get_nick_info\" function");
return Py_BuildValue ("i", 0);
}
@@ -1047,9 +1047,9 @@ weechat_python_output (PyObject *self, PyObject *args)
if (!PyArg_ParseTuple (args, "s", &msg))
{
- python_plugin->printf_server (python_plugin,
- "Python error: unable to get "
- "stdout/stderr message(s)");
+ python_plugin->print_server (python_plugin,
+ "Python error: unable to get "
+ "stdout/stderr message(s)");
return NULL;
}
@@ -1057,8 +1057,8 @@ weechat_python_output (PyObject *self, PyObject *args)
*p = '\0';
if (strlen(msg) > 0)
- python_plugin->printf_server (python_plugin,
- "Python stdin/stdout: %s", msg);
+ python_plugin->print_server (python_plugin,
+ "Python stdin/stdout: %s", msg);
return Py_BuildValue ("i", 1);
}
@@ -1084,13 +1084,13 @@ weechat_python_load (t_weechat_plugin *plugin, char *filename)
PyThreadState *python_current_interpreter;
PyObject *weechat_module, *weechat_outputs, *weechat_dict;
- plugin->printf_server (plugin, "Loading Python script \"%s\"", filename);
+ plugin->print_server (plugin, "Loading Python script \"%s\"", filename);
if ((fp = fopen (filename, "r")) == NULL)
{
- plugin->printf_server (plugin,
- "Python error: unable to open file \"%s\"",
- filename);
+ plugin->print_server (plugin,
+ "Python error: unable to open file \"%s\"",
+ filename);
return 0;
}
@@ -1101,8 +1101,8 @@ weechat_python_load (t_weechat_plugin *plugin, char *filename)
if (python_current_interpreter == NULL)
{
- plugin->printf_server (plugin,
- "Python error: unable to create new sub-interpreter");
+ plugin->print_server (plugin,
+ "Python error: unable to create new sub-interpreter");
fclose (fp);
return 0;
}
@@ -1113,8 +1113,8 @@ weechat_python_load (t_weechat_plugin *plugin, char *filename)
if ( weechat_module == NULL)
{
- plugin->printf_server (plugin,
- "Python error: unable to initialize WeeChat module");
+ plugin->print_server (plugin,
+ "Python error: unable to initialize WeeChat module");
Py_EndInterpreter (python_current_interpreter);
fclose (fp);
return 0;
@@ -1131,26 +1131,26 @@ weechat_python_load (t_weechat_plugin *plugin, char *filename)
weechat_outputs = Py_InitModule("weechatOutputs", weechat_python_output_funcs);
if (weechat_outputs == NULL)
{
- plugin->printf_server (plugin,
- "Python warning: unable to redirect stdout and stderr");
+ plugin->print_server (plugin,
+ "Python warning: unable to redirect stdout and stderr");
}
else
{
if (PySys_SetObject("stdout", weechat_outputs) == -1)
- plugin->printf_server (plugin,
- "Python warning: unable to redirect stdout");
+ plugin->print_server (plugin,
+ "Python warning: unable to redirect stdout");
if (PySys_SetObject("stderr", weechat_outputs) == -1)
- plugin->printf_server (plugin,
- "Python warning: unable to redirect stderr");
+ plugin->print_server (plugin,
+ "Python warning: unable to redirect stderr");
}
python_current_script_filename = strdup (filename);
if (PyRun_SimpleFile (fp, filename) != 0)
{
- plugin->printf_server (plugin,
- "Python error: unable to parse file \"%s\"",
- filename);
+ plugin->print_server (plugin,
+ "Python error: unable to parse file \"%s\"",
+ filename);
free (python_current_script_filename);
Py_EndInterpreter (python_current_interpreter);
fclose (fp);
@@ -1168,10 +1168,10 @@ weechat_python_load (t_weechat_plugin *plugin, char *filename)
if (python_current_script == NULL)
{
- plugin->printf_server (plugin,
- "Python error: function \"register\" not found "
- "in file \"%s\"",
- filename);
+ plugin->print_server (plugin,
+ "Python error: function \"register\" not found "
+ "in file \"%s\"",
+ filename);
Py_EndInterpreter (python_current_interpreter);
return 0;
}
@@ -1188,9 +1188,9 @@ weechat_python_load (t_weechat_plugin *plugin, char *filename)
void
weechat_python_unload (t_weechat_plugin *plugin, t_plugin_script *script)
{
- plugin->printf_server (plugin,
- "Unloading Python script \"%s\"",
- script->name);
+ plugin->print_server (plugin,
+ "Unloading Python script \"%s\"",
+ script->name);
if (script->shutdown_func[0])
weechat_python_exec (plugin, script, script->shutdown_func, "", "");
@@ -1214,15 +1214,15 @@ weechat_python_unload_name (t_weechat_plugin *plugin, char *name)
if (ptr_script)
{
weechat_python_unload (plugin, ptr_script);
- plugin->printf_server (plugin,
- "Python script \"%s\" unloaded",
- name);
+ plugin->print_server (plugin,
+ "Python script \"%s\" unloaded",
+ name);
}
else
{
- plugin->printf_server (plugin,
- "Python error: script \"%s\" not loaded",
- name);
+ plugin->print_server (plugin,
+ "Python error: script \"%s\" not loaded",
+ name);
}
}
@@ -1233,13 +1233,13 @@ weechat_python_unload_name (t_weechat_plugin *plugin, char *name)
void
weechat_python_unload_all (t_weechat_plugin *plugin)
{
- plugin->printf_server (plugin,
- "Unloading all Python scripts");
+ plugin->print_server (plugin,
+ "Unloading all Python scripts");
while (python_scripts)
weechat_python_unload (plugin, python_scripts);
- plugin->printf_server (plugin,
- "Python scripts unloaded");
+ plugin->print_server (plugin,
+ "Python scripts unloaded");
}
/*
@@ -1274,26 +1274,26 @@ weechat_python_cmd (t_weechat_plugin *plugin,
{
case 0:
/* list registered Python scripts */
- plugin->printf_server (plugin, "");
- plugin->printf_server (plugin, "Registered Python scripts:");
+ plugin->print_server (plugin, "");
+ plugin->print_server (plugin, "Registered Python scripts:");
if (python_scripts)
{
for (ptr_script = python_scripts;
ptr_script; ptr_script = ptr_script->next_script)
{
- plugin->printf_server (plugin, " %s v%s%s%s",
- ptr_script->name,
- ptr_script->version,
- (ptr_script->description[0]) ? " - " : "",
- ptr_script->description);
+ plugin->print_server (plugin, " %s v%s%s%s",
+ ptr_script->name,
+ ptr_script->version,
+ (ptr_script->description[0]) ? " - " : "",
+ ptr_script->description);
}
}
else
- plugin->printf_server (plugin, " (none)");
+ plugin->print_server (plugin, " (none)");
/* list Python message handlers */
- plugin->printf_server (plugin, "");
- plugin->printf_server (plugin, "Python message handlers:");
+ plugin->print_server (plugin, "");
+ plugin->print_server (plugin, "Python message handlers:");
handler_found = 0;
for (ptr_handler = plugin->handlers;
ptr_handler; ptr_handler = ptr_handler->next_handler)
@@ -1302,17 +1302,17 @@ weechat_python_cmd (t_weechat_plugin *plugin,
&& (ptr_handler->handler_args))
{
handler_found = 1;
- plugin->printf_server (plugin, " IRC(%s) => Python(%s)",
- ptr_handler->irc_command,
- ptr_handler->handler_args);
+ plugin->print_server (plugin, " IRC(%s) => Python(%s)",
+ ptr_handler->irc_command,
+ ptr_handler->handler_args);
}
}
if (!handler_found)
- plugin->printf_server (plugin, " (none)");
+ plugin->print_server (plugin, " (none)");
/* list Python command handlers */
- plugin->printf_server (plugin, "");
- plugin->printf_server (plugin, "Python command handlers:");
+ plugin->print_server (plugin, "");
+ plugin->print_server (plugin, "Python command handlers:");
handler_found = 0;
for (ptr_handler = plugin->handlers;
ptr_handler; ptr_handler = ptr_handler->next_handler)
@@ -1321,13 +1321,13 @@ weechat_python_cmd (t_weechat_plugin *plugin,
&& (ptr_handler->handler_args))
{
handler_found = 1;
- plugin->printf_server (plugin, " /%s => Python(%s)",
- ptr_handler->command,
- ptr_handler->handler_args);
+ plugin->print_server (plugin, " /%s => Python(%s)",
+ ptr_handler->command,
+ ptr_handler->handler_args);
}
}
if (!handler_found)
- plugin->printf_server (plugin, " (none)");
+ plugin->print_server (plugin, " (none)");
break;
case 1:
if (plugin->ascii_strcasecmp (plugin, argv[0], "autoload") == 0)
@@ -1374,14 +1374,14 @@ weechat_python_cmd (t_weechat_plugin *plugin,
}
else
{
- plugin->printf_server (plugin,
- "Python error: unknown option for "
- "\"python\" command");
+ plugin->print_server (plugin,
+ "Python error: unknown option for "
+ "\"python\" command");
}
break;
default:
- plugin->printf_server (plugin,
- "Python error: wrong argument count for \"python\" command");
+ plugin->print_server (plugin,
+ "Python error: wrong argument count for \"python\" command");
}
if (argv)
@@ -1400,13 +1400,13 @@ weechat_plugin_init (t_weechat_plugin *plugin)
python_plugin = plugin;
- plugin->printf_server (plugin, "Loading Python module \"weechat\"");
+ plugin->print_server (plugin, "Loading Python module \"weechat\"");
Py_Initialize ();
if (Py_IsInitialized () == 0)
{
- plugin->printf_server (plugin,
- "Python error: unable to launch global interpreter");
+ plugin->print_server (plugin,
+ "Python error: unable to launch global interpreter");
return PLUGIN_RC_KO;
}
@@ -1416,8 +1416,8 @@ weechat_plugin_init (t_weechat_plugin *plugin)
if (python_mainThreadState == NULL)
{
- plugin->printf_server (plugin,
- "Python error: unable to get current interpreter state");
+ plugin->print_server (plugin,
+ "Python error: unable to get current interpreter state");
return PLUGIN_RC_KO;
}
@@ -1457,9 +1457,9 @@ weechat_plugin_end (t_weechat_plugin *plugin)
Py_Finalize ();
if (Py_IsInitialized () != 0)
- python_plugin->printf_server (python_plugin,
- "Python error: unable to free interpreter");
+ python_plugin->print_server (python_plugin,
+ "Python error: unable to free interpreter");
- python_plugin->printf_server (python_plugin,
- "Python plugin ended");
+ python_plugin->print_server (python_plugin,
+ "Python plugin ended");
}
diff --git a/src/plugins/scripts/ruby/weechat-ruby.c b/src/plugins/scripts/ruby/weechat-ruby.c
index 72b60a564..8ccee76fd 100644
--- a/src/plugins/scripts/ruby/weechat-ruby.c
+++ b/src/plugins/scripts/ruby/weechat-ruby.c
@@ -119,9 +119,9 @@ weechat_ruby_exec (t_weechat_plugin *plugin,
rb_str_new2((arguments == NULL) ? "" : arguments));
if (ruby_error)
{
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby error: unable to run function \"%s\"",
- function);
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby error: unable to run function \"%s\"",
+ function);
rb_eval_string_protect("Weechat.print(\"Ruby error: \" + $@.to_s)", NULL);
rb_eval_string_protect("Weechat.print(\"Ruby error: \" + $!.to_s)", NULL);
@@ -163,9 +163,9 @@ weechat_ruby_register (VALUE class, VALUE name, VALUE version,
if (NIL_P (name) || NIL_P (version) || NIL_P (shutdown_func) || NIL_P (description))
{
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby error: wrong parameters for "
- "\"register\" function");
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby error: wrong parameters for "
+ "\"register\" function");
return INT2FIX (0);
}
@@ -182,11 +182,11 @@ weechat_ruby_register (VALUE class, VALUE name, VALUE version,
if (weechat_script_search (ruby_plugin, &ruby_scripts, c_name))
{
/* error: another scripts already exists with this name! */
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby error: unable to register "
- "\"%s\" script (another script "
- "already exists with this name)",
- c_name);
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby error: unable to register "
+ "\"%s\" script (another script "
+ "already exists with this name)",
+ c_name);
return INT2FIX (0);
}
@@ -199,17 +199,17 @@ weechat_ruby_register (VALUE class, VALUE name, VALUE version,
c_description);
if (ruby_current_script)
{
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby: registered script \"%s\", "
- "version %s (%s)",
- c_name, c_version, c_description);
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby: registered script \"%s\", "
+ "version %s (%s)",
+ c_name, c_version, c_description);
}
else
{
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby error: unable to load script "
- "\"%s\" (not enough memory)",
- c_name);
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby error: unable to load script "
+ "\"%s\" (not enough memory)",
+ c_name);
return INT2FIX (0);
}
@@ -231,9 +231,9 @@ weechat_ruby_print (int argc, VALUE *argv, VALUE class)
if (!ruby_current_script)
{
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby error: unable to print message, "
- "script not initialized");
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby error: unable to print message, "
+ "script not initialized");
return INT2FIX (0);
}
@@ -248,9 +248,9 @@ weechat_ruby_print (int argc, VALUE *argv, VALUE class)
if (NIL_P (message))
{
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby error: wrong parameters for "
- "\"print\" function");
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby error: wrong parameters for "
+ "\"print\" function");
return INT2FIX (0);
}
@@ -269,9 +269,9 @@ weechat_ruby_print (int argc, VALUE *argv, VALUE class)
c_server_name = STR2CSTR (server_name);
}
- ruby_plugin->printf (ruby_plugin,
- c_server_name, c_channel_name,
- "%s", c_message);
+ ruby_plugin->print (ruby_plugin,
+ c_server_name, c_channel_name,
+ "%s", c_message);
return INT2FIX (1);
}
@@ -291,9 +291,9 @@ weechat_ruby_print_infobar (VALUE class, VALUE delay, VALUE message)
if (!ruby_current_script)
{
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby error: unable to print infobar message, "
- "script not initialized");
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby error: unable to print infobar message, "
+ "script not initialized");
return INT2FIX (0);
}
@@ -302,9 +302,9 @@ weechat_ruby_print_infobar (VALUE class, VALUE delay, VALUE message)
if (NIL_P (delay) || NIL_P (message))
{
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby error: wrong parameters for "
- "\"print_infobar\" function");
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby error: wrong parameters for "
+ "\"print_infobar\" function");
return INT2FIX (0);
}
@@ -314,7 +314,7 @@ weechat_ruby_print_infobar (VALUE class, VALUE delay, VALUE message)
c_delay = FIX2INT (delay);
c_message = STR2CSTR (message);
- ruby_plugin->infobar_printf (ruby_plugin, c_delay, "%s", c_message);
+ ruby_plugin->print_infobar (ruby_plugin, c_delay, "%s", c_message);
return INT2FIX (1);
}
@@ -334,9 +334,9 @@ weechat_ruby_log (int argc, VALUE *argv, VALUE class)
if (!ruby_current_script)
{
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby error: unable to log message, "
- "script not initialized");
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby error: unable to log message, "
+ "script not initialized");
return INT2FIX (0);
}
@@ -351,9 +351,9 @@ weechat_ruby_log (int argc, VALUE *argv, VALUE class)
if (NIL_P (message))
{
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby error: wrong parameters for "
- "\"log\" function");
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby error: wrong parameters for "
+ "\"log\" function");
return INT2FIX (0);
}
@@ -394,9 +394,9 @@ weechat_ruby_command (int argc, VALUE *argv, VALUE class)
if (!ruby_current_script)
{
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby error: unable to run command, "
- "script not initialized");
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby error: unable to run command, "
+ "script not initialized");
return INT2FIX (0);
}
@@ -411,9 +411,9 @@ weechat_ruby_command (int argc, VALUE *argv, VALUE class)
if (NIL_P (command))
{
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby error: wrong parameters for "
- "\"command\" function");
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby error: wrong parameters for "
+ "\"command\" function");
return INT2FIX (0);
}
@@ -453,9 +453,9 @@ weechat_ruby_add_message_handler (VALUE class, VALUE message, VALUE function)
if (!ruby_current_script)
{
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby error: unable to add message handler, "
- "script not initialized");
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby error: unable to add message handler, "
+ "script not initialized");
return INT2FIX (0);
}
@@ -464,9 +464,9 @@ weechat_ruby_add_message_handler (VALUE class, VALUE message, VALUE function)
if (NIL_P (message) || NIL_P (function))
{
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby error: wrong parameters for "
- "\"add_message_handler\" function");
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby error: wrong parameters for "
+ "\"add_message_handler\" function");
return INT2FIX (0);
}
@@ -501,9 +501,9 @@ weechat_ruby_add_command_handler (int argc, VALUE *argv, VALUE class)
if (!ruby_current_script)
{
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby error: unable to add command handler, "
- "script not initialized");
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby error: unable to add command handler, "
+ "script not initialized");
return INT2FIX (0);
}
@@ -525,7 +525,7 @@ weechat_ruby_add_command_handler (int argc, VALUE *argv, VALUE class)
if (NIL_P (command) || NIL_P (function))
{
- ruby_plugin->printf_server (ruby_plugin,
+ ruby_plugin->print_server (ruby_plugin,
"Ruby error: wrong parameters for "
"\"add_command_handler\" function");
return INT2FIX (0);
@@ -588,9 +588,9 @@ weechat_ruby_remove_handler (VALUE class, VALUE command, VALUE function)
if (!ruby_current_script)
{
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby error: unable to remove handler, "
- "script not initialized");
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby error: unable to remove handler, "
+ "script not initialized");
return INT2FIX (0);
}
@@ -599,9 +599,9 @@ weechat_ruby_remove_handler (VALUE class, VALUE command, VALUE function)
if (NIL_P (command) || NIL_P (function))
{
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby error: wrong parameters for "
- "\"remove_handler\" function");
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby error: wrong parameters for "
+ "\"remove_handler\" function");
return INT2FIX (0);
}
@@ -632,9 +632,9 @@ weechat_ruby_get_info (int argc, VALUE *argv, VALUE class)
if (!ruby_current_script)
{
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby error: unable to get info, "
- "script not initialized");
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby error: unable to get info, "
+ "script not initialized");
return INT2FIX (0);
}
@@ -647,9 +647,9 @@ weechat_ruby_get_info (int argc, VALUE *argv, VALUE class)
if (NIL_P (arg))
{
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby error: wrong parameters for "
- "\"get_info\" function");
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby error: wrong parameters for "
+ "\"get_info\" function");
return INT2FIX (0);
}
@@ -695,9 +695,9 @@ weechat_ruby_get_dcc_info (VALUE class)
if (!ruby_current_script)
{
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby error: unable to get DCC info, "
- "script not initialized");
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby error: unable to get DCC info, "
+ "script not initialized");
return INT2FIX (0);
}
@@ -791,9 +791,9 @@ weechat_ruby_get_config (VALUE class, VALUE option)
if (!ruby_current_script)
{
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby error: unable to get config option, "
- "script not initialized");
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby error: unable to get config option, "
+ "script not initialized");
return INT2FIX (0);
}
@@ -801,9 +801,9 @@ weechat_ruby_get_config (VALUE class, VALUE option)
if (NIL_P (option))
{
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby error: wrong parameters for "
- "\"get_config\" function");
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby error: wrong parameters for "
+ "\"get_config\" function");
return INT2FIX (0);
}
@@ -839,9 +839,9 @@ weechat_ruby_set_config (VALUE class, VALUE option, VALUE value)
if (!ruby_current_script)
{
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby error: unable to set config option, "
- "script not initialized");
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby error: unable to set config option, "
+ "script not initialized");
return INT2FIX (0);
}
@@ -850,9 +850,9 @@ weechat_ruby_set_config (VALUE class, VALUE option, VALUE value)
if (NIL_P (option))
{
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby error: wrong parameters for "
- "\"set_config\" function");
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby error: wrong parameters for "
+ "\"set_config\" function");
return INT2FIX (0);
}
@@ -886,9 +886,9 @@ weechat_ruby_get_plugin_config (VALUE class, VALUE option)
if (!ruby_current_script)
{
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby error: unable to get plugin config option, "
- "script not initialized");
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby error: unable to get plugin config option, "
+ "script not initialized");
return INT2FIX (0);
}
@@ -896,9 +896,9 @@ weechat_ruby_get_plugin_config (VALUE class, VALUE option)
if (NIL_P (option))
{
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby error: wrong parameters for "
- "\"get_plugin_config\" function");
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby error: wrong parameters for "
+ "\"get_plugin_config\" function");
return INT2FIX (0);
}
@@ -936,9 +936,9 @@ weechat_ruby_set_plugin_config (VALUE class, VALUE option, VALUE value)
if (!ruby_current_script)
{
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby error: unable to set plugin config option, "
- "script not initialized");
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby error: unable to set plugin config option, "
+ "script not initialized");
return INT2FIX (0);
}
@@ -947,9 +947,9 @@ weechat_ruby_set_plugin_config (VALUE class, VALUE option, VALUE value)
if (NIL_P (option))
{
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby error: wrong parameters for "
- "\"set_plugin_config\" function");
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby error: wrong parameters for "
+ "\"set_plugin_config\" function");
return INT2FIX (0);
}
@@ -986,9 +986,9 @@ weechat_ruby_get_server_info (VALUE class)
if (!ruby_current_script)
{
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby error: unable to get server infos, "
- "script not initialized");
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby error: unable to get server infos, "
+ "script not initialized");
return INT2FIX (0);
}
@@ -1089,18 +1089,18 @@ weechat_ruby_get_channel_info (VALUE class, VALUE server)
if (!ruby_current_script)
{
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby error: unable to get channel infos, "
- "script not initialized");
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby error: unable to get channel infos, "
+ "script not initialized");
return INT2FIX (0);
}
c_server = NULL;
if (NIL_P (server))
{
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby error: wrong parameters for "
- "\"get_channel_info\" function");
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby error: wrong parameters for "
+ "\"get_channel_info\" function");
return INT2FIX (0);
}
@@ -1162,9 +1162,9 @@ weechat_ruby_get_nick_info (VALUE class, VALUE server, VALUE channel)
if (!ruby_current_script)
{
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby error: unable to get channel infos, "
- "script not initialized");
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby error: unable to get channel infos, "
+ "script not initialized");
return INT2FIX (0);
}
@@ -1172,9 +1172,9 @@ weechat_ruby_get_nick_info (VALUE class, VALUE server, VALUE channel)
c_channel = NULL;
if (NIL_P (server) || NIL_P (channel))
{
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby error: wrong parameters for "
- "\"get_nick_info\" function");
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby error: wrong parameters for "
+ "\"get_nick_info\" function");
return INT2FIX (0);
}
@@ -1230,8 +1230,8 @@ weechat_ruby_output(VALUE self, VALUE str)
*p = '\0';
if (strlen(msg) > 0)
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby stdout/stderr: %s", msg);
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby stdout/stderr: %s", msg);
if (msg)
free (msg);
@@ -1250,7 +1250,7 @@ weechat_ruby_load (t_weechat_plugin *plugin, char *filename)
VALUE curModule, ruby_retcode;
int ruby_error;
- plugin->printf_server (plugin, "Loading Ruby script \"%s\"", filename);
+ plugin->print_server (plugin, "Loading Ruby script \"%s\"", filename);
ruby_current_script = NULL;
snprintf(modname, sizeof(modname), "%s%d", MOD_NAME_PREFIX, modnum);
@@ -1272,21 +1272,21 @@ weechat_ruby_load (t_weechat_plugin *plugin, char *filename)
switch (NUM2INT(ruby_retcode))
{
case 1:
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby error: unable to read file \"%s\"",
- filename);
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby error: unable to read file \"%s\"",
+ filename);
break;
case 2:
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby error: error while loading file \"%s\"",
- filename);
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby error: error while loading file \"%s\"",
+ filename);
break;
case 3:
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby error: unable to find \"weechat_init\" function in file \"%s\"",
- filename);
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby error: unable to find \"weechat_init\" function in file \"%s\"",
+ filename);
break;
}
@@ -1294,8 +1294,8 @@ weechat_ruby_load (t_weechat_plugin *plugin, char *filename)
{
ruby_eval_error = rb_iv_get(curModule, "@load_eval_file_error");
if (ruby_eval_error)
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby error: %s", STR2CSTR(ruby_eval_error));
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby error: %s", STR2CSTR(ruby_eval_error));
}
return 0;
@@ -1305,9 +1305,9 @@ weechat_ruby_load (t_weechat_plugin *plugin, char *filename)
if (ruby_error)
{
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby error: unable to eval weechat_init in file \"%s\"",
- filename);
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby error: unable to eval weechat_init in file \"%s\"",
+ filename);
rb_eval_string_protect("Weechat.print(\"Ruby error: \" + $@.to_s)", NULL);
rb_eval_string_protect("Weechat.print(\"Ruby error: \" + $!.to_s)", NULL);
@@ -1317,10 +1317,10 @@ weechat_ruby_load (t_weechat_plugin *plugin, char *filename)
}
if (ruby_current_script == NULL) {
- plugin->printf_server (plugin,
- "Ruby error: function \"register\" not found "
- "in file \"%s\"",
- filename);
+ plugin->print_server (plugin,
+ "Ruby error: function \"register\" not found "
+ "in file \"%s\"",
+ filename);
return 0;
}
@@ -1337,9 +1337,9 @@ weechat_ruby_load (t_weechat_plugin *plugin, char *filename)
void
weechat_ruby_unload (t_weechat_plugin *plugin, t_plugin_script *script)
{
- plugin->printf_server (plugin,
- "Unloading Ruby script \"%s\"",
- script->name);
+ plugin->print_server (plugin,
+ "Unloading Ruby script \"%s\"",
+ script->name);
if (script->shutdown_func[0])
weechat_ruby_exec (plugin, script, script->shutdown_func, "", "");
@@ -1363,15 +1363,15 @@ weechat_ruby_unload_name (t_weechat_plugin *plugin, char *name)
if (ptr_script)
{
weechat_ruby_unload (plugin, ptr_script);
- plugin->printf_server (plugin,
- "Ruby script \"%s\" unloaded",
- name);
+ plugin->print_server (plugin,
+ "Ruby script \"%s\" unloaded",
+ name);
}
else
{
- plugin->printf_server (plugin,
- "Ruby error: script \"%s\" not loaded",
- name);
+ plugin->print_server (plugin,
+ "Ruby error: script \"%s\" not loaded",
+ name);
}
}
@@ -1383,13 +1383,13 @@ void
weechat_ruby_unload_all (t_weechat_plugin *plugin)
{
- plugin->printf_server (plugin,
- "Unloading all Ruby scripts");
+ plugin->print_server (plugin,
+ "Unloading all Ruby scripts");
while (ruby_scripts)
weechat_ruby_unload (plugin, ruby_scripts);
- plugin->printf_server (plugin,
- "Ruby scripts unloaded");
+ plugin->print_server (plugin,
+ "Ruby scripts unloaded");
}
/*
@@ -1424,26 +1424,26 @@ weechat_ruby_cmd (t_weechat_plugin *plugin,
{
case 0:
/* list registered Ruby scripts */
- plugin->printf_server (plugin, "");
- plugin->printf_server (plugin, "Registered Ruby scripts:");
+ plugin->print_server (plugin, "");
+ plugin->print_server (plugin, "Registered Ruby scripts:");
if (ruby_scripts)
{
for (ptr_script = ruby_scripts;
ptr_script; ptr_script = ptr_script->next_script)
{
- plugin->printf_server (plugin, " %s v%s%s%s",
- ptr_script->name,
- ptr_script->version,
- (ptr_script->description[0]) ? " - " : "",
- ptr_script->description);
+ plugin->print_server (plugin, " %s v%s%s%s",
+ ptr_script->name,
+ ptr_script->version,
+ (ptr_script->description[0]) ? " - " : "",
+ ptr_script->description);
}
}
else
- plugin->printf_server (plugin, " (none)");
+ plugin->print_server (plugin, " (none)");
/* list Ruby message handlers */
- plugin->printf_server (plugin, "");
- plugin->printf_server (plugin, "Ruby message handlers:");
+ plugin->print_server (plugin, "");
+ plugin->print_server (plugin, "Ruby message handlers:");
handler_found = 0;
for (ptr_handler = plugin->handlers;
ptr_handler; ptr_handler = ptr_handler->next_handler)
@@ -1452,17 +1452,17 @@ weechat_ruby_cmd (t_weechat_plugin *plugin,
&& (ptr_handler->handler_args))
{
handler_found = 1;
- plugin->printf_server (plugin, " IRC(%s) => Ruby(%s)",
- ptr_handler->irc_command,
- ptr_handler->handler_args);
+ plugin->print_server (plugin, " IRC(%s) => Ruby(%s)",
+ ptr_handler->irc_command,
+ ptr_handler->handler_args);
}
}
if (!handler_found)
- plugin->printf_server (plugin, " (none)");
+ plugin->print_server (plugin, " (none)");
/* list Ruby command handlers */
- plugin->printf_server (plugin, "");
- plugin->printf_server (plugin, "Ruby command handlers:");
+ plugin->print_server (plugin, "");
+ plugin->print_server (plugin, "Ruby command handlers:");
handler_found = 0;
for (ptr_handler = plugin->handlers;
ptr_handler; ptr_handler = ptr_handler->next_handler)
@@ -1471,13 +1471,13 @@ weechat_ruby_cmd (t_weechat_plugin *plugin,
&& (ptr_handler->handler_args))
{
handler_found = 1;
- plugin->printf_server (plugin, " /%s => Ruby(%s)",
- ptr_handler->command,
- ptr_handler->handler_args);
+ plugin->print_server (plugin, " /%s => Ruby(%s)",
+ ptr_handler->command,
+ ptr_handler->handler_args);
}
}
if (!handler_found)
- plugin->printf_server (plugin, " (none)");
+ plugin->print_server (plugin, " (none)");
break;
case 1:
if (plugin->ascii_strcasecmp (plugin, argv[0], "autoload") == 0)
@@ -1524,14 +1524,14 @@ weechat_ruby_cmd (t_weechat_plugin *plugin,
}
else
{
- plugin->printf_server (plugin,
- "Ruby error: unknown option for "
- "\"ruby\" command");
+ plugin->print_server (plugin,
+ "Ruby error: unknown option for "
+ "\"ruby\" command");
}
break;
default:
- plugin->printf_server (plugin,
- "Ruby error: wrong argument count for \"ruby\" command");
+ plugin->print_server (plugin,
+ "Ruby error: wrong argument count for \"ruby\" command");
}
if (argv)
@@ -1593,7 +1593,7 @@ weechat_plugin_init (t_weechat_plugin *plugin)
ruby_plugin = plugin;
ruby_error = 0;
- plugin->printf_server (plugin, "Loading Ruby module \"weechat\"");
+ plugin->print_server (plugin, "Loading Ruby module \"weechat\"");
ruby_init ();
ruby_init_loadpath ();
@@ -1643,10 +1643,10 @@ weechat_plugin_init (t_weechat_plugin *plugin)
rb_eval_string_protect(weechat_ruby_code, &ruby_error);
if (ruby_error) {
VALUE ruby_error_info = rb_inspect(ruby_errinfo);
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby error: unable to eval weechat ruby internal code");
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby error: %s", STR2CSTR(ruby_error_info));
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby error: unable to eval weechat ruby internal code");
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby error: %s", STR2CSTR(ruby_error_info));
return PLUGIN_RC_KO;
}
@@ -1668,6 +1668,6 @@ weechat_plugin_end (t_weechat_plugin *plugin)
ruby_finalize();
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby plugin ended");
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby plugin ended");
}
diff --git a/src/plugins/weechat-plugin.h b/src/plugins/weechat-plugin.h
index b4523f5d1..727d57215 100644
--- a/src/plugins/weechat-plugin.h
+++ b/src/plugins/weechat-plugin.h
@@ -198,11 +198,9 @@ struct t_weechat_plugin
void (*exec_on_files) (t_weechat_plugin *, char *,
int (*)(t_weechat_plugin *, char *));
- void (*printf) (t_weechat_plugin *, char *, char *, char *, ...);
- void (*printf_server) (t_weechat_plugin *, char *, ...);
- void (*infobar_printf) (t_weechat_plugin *, int, char *, ...);
-
- void (*log) (t_weechat_plugin *, char *, char *, char *, ...);
+ void (*print) (t_weechat_plugin *, char *, char *, char *, ...);
+ void (*print_server) (t_weechat_plugin *, char *, ...);
+ void (*print_infobar) (t_weechat_plugin *, int, char *, ...);
t_plugin_handler *(*msg_handler_add) (t_weechat_plugin *, char *,
t_plugin_handler_func *,
@@ -230,6 +228,8 @@ struct t_weechat_plugin
t_plugin_nick_info *(*get_nick_info) (t_weechat_plugin *, char*, char*);
void (*free_nick_info) (t_weechat_plugin *, t_plugin_nick_info *);
+ void (*log) (t_weechat_plugin *, char *, char *, char *, ...);
+
/* WeeChat developers: ALWAYS add new functions at the end */
};
@@ -243,9 +243,9 @@ extern void weechat_plugin_exec_on_files (t_weechat_plugin *, char *,
int (*)(t_weechat_plugin *, char *));
/* display functions */
-extern void weechat_plugin_printf (t_weechat_plugin *, char *, char *, char *, ...);
-extern void weechat_plugin_printf_server (t_weechat_plugin *, char *, ...);
-extern void weechat_plugin_infobar_printf (t_weechat_plugin *, int, char *, ...);
+extern void weechat_plugin_print (t_weechat_plugin *, char *, char *, char *, ...);
+extern void weechat_plugin_print_server (t_weechat_plugin *, char *, ...);
+extern void weechat_plugin_print_infobar (t_weechat_plugin *, int, char *, ...);
/* log functions */
extern void weechat_plugin_log (t_weechat_plugin *, char *, char *, char *, ...);
diff --git a/weechat/ChangeLog b/weechat/ChangeLog
index b5594ff2a..f5b956b03 100644
--- a/weechat/ChangeLog
+++ b/weechat/ChangeLog
@@ -1,10 +1,11 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
-ChangeLog - 2006-02-12
+ChangeLog - 2006-02-16
Version 0.1.8 (under dev!):
+ * many commands allowed for aliases
* many commands allowed when connecting to server
* added Lua script plugin
* added functions in plugins API: get_server_info, free_server_info,
diff --git a/weechat/doc/en/weechat.en.xml b/weechat/doc/en/weechat.en.xml
index 65988b542..f809b2226 100644
--- a/weechat/doc/en/weechat.en.xml
+++ b/weechat/doc/en/weechat.en.xml
@@ -1490,7 +1490,7 @@ if (argv != NULL)
<screen>
int callback (t_weechat_plugin *plugin, char *file)
{
- plugin->printf_server (plugin, "file: %s", file);
+ plugin->print_server (plugin, "file: %s", file);
return 1;
}
...
@@ -1499,13 +1499,13 @@ plugin->exec_on_files (plugin, "/tmp", &amp;callback);
</para>
</section>
- <section id="secAPI_printf">
- <title>printf</title>
+ <section id="secAPI_print">
+ <title>print</title>
<para>
Prototype:
<command>
- void printf (t_weechat_plugin *plugin,
+ void print (t_weechat_plugin *plugin,
char *server, char *channel, char *message, ...)
</command>
</para>
@@ -1546,20 +1546,20 @@ plugin->exec_on_files (plugin, "/tmp", &amp;callback);
<para>
Examples:
<screen>
-plugin->printf (plugin, NULL, NULL, "hello");
-plugin->printf (plugin, NULL, "#weechat", "hello");
-plugin->printf (plugin, "freenode", "#weechat", "hello");
+plugin->print (plugin, NULL, NULL, "hello");
+plugin->print (plugin, NULL, "#weechat", "hello");
+plugin->print (plugin, "freenode", "#weechat", "hello");
</screen>
</para>
</section>
- <section id="secAPI_printf_server">
- <title>printf_server</title>
+ <section id="secAPI_print_server">
+ <title>print_server</title>
<para>
Prototype:
<command>
- void printf_server (t_weechat_plugin *plugin,
+ void print_server (t_weechat_plugin *plugin,
char *message, ...)
</command>
</para>
@@ -1585,17 +1585,17 @@ plugin->printf (plugin, "freenode", "#weechat", "hello");
Return value: none.
</para>
<para>
- Example: <screen>plugin->printf_server (plugin, "hello");</screen>
+ Example: <screen>plugin->print_server (plugin, "hello");</screen>
</para>
</section>
- <section id="secAPI_printf_infobar">
- <title>printf_infobar</title>
+ <section id="secAPI_print_infobar">
+ <title>print_infobar</title>
<para>
Prototype:
<command>
- void printf_infobar (t_weechat_plugin *plugin,
+ void print_infobar (t_weechat_plugin *plugin,
int time, char *message, ...)
</command>
</para>
@@ -1624,7 +1624,58 @@ plugin->printf (plugin, "freenode", "#weechat", "hello");
<para>
Example:
<screen>
-plugin->printf_infobar (plugin, 5, "hello");
+plugin->print_infobar (plugin, 5, "hello");
+</screen>
+ </para>
+ </section>
+
+ <section id="secAPI_log">
+ <title>log</title>
+
+ <para>
+ Prototype:
+ <command>
+ void log (t_weechat_plugin *plugin,
+ char *server, char *channel, char *message, ...)
+ </command>
+ </para>
+ <para>
+ Write a message in log file for a server or a channel.
+ </para>
+ <para>
+ Arguments:
+ <itemizedlist>
+ <listitem>
+ <para>
+ <option>plugin</option>: pointer to plugin structure
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <option>server</option>: internal name of server to find
+ buffer for log (may be NULL)
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <option>channel</option>: name of channel to find buffer
+ for log (may be NULL)
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <option>message</option>: message
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ Return value: none.
+ </para>
+ <para>
+ Example:
+<screen>
+plugin->log (plugin, "freenode", "#weechat", "test");
</screen>
</para>
</section>
@@ -1725,7 +1776,7 @@ plugin->printf_infobar (plugin, 5, "hello");
int msg_kick (t_weechat_plugin *plugin, char *server, char *command,
char *arguments, char *handler_args, void *handler_pointer)
{
- plugin->printf (plugin, server, NULL, "KICK received");
+ plugin->print (plugin, server, NULL, "KICK received");
return PLUGIN_RC_OK;
}
...
@@ -1935,9 +1986,9 @@ int cmd_test (t_weechat_plugin *plugin, char *server,
char *command, char *arguments, char *handler_args,
void *handler_pointer)
{
- plugin->printf (plugin, server, NULL,
- "test command, nick: %s",
- (arguments) ? arguments : "none");
+ plugin->print (plugin, server, NULL,
+ "test command, nick: %s",
+ (arguments) ? arguments : "none");
return PLUGIN_RC_OK;
}
...
@@ -2326,8 +2377,8 @@ char *nick = plugin->get_info (plugin, "nick", "freenode");
t_plugin_dcc_info *dcc_info = plugin->get_dcc_info (plugin);
for (ptr_dcc = dcc_info; ptr_dcc; ptr_dcc = ptr_dcc->next_dcc)
{
- plugin->printf_server (plugin, "DCC type=%d, with: %s",
- ptr_dcc->type, ptr_dcc->nick);
+ plugin->print_server (plugin, "DCC type=%d, with: %s",
+ ptr_dcc->type, ptr_dcc->nick);
}
if (dcc_info)
plugin->free_dcc_info (plugin, dcc_info);
@@ -2589,12 +2640,12 @@ if (server_info)
for (ptr_server_info = server_info; ptr_server_info;
ptr_server_info = ptr_server_info->next_server)
{
- plugin->printf (plugin, NULL, NULL,
- "server: %s, address: %s, port: %d %s",
- ptr_server_info->name,
- ptr_server_info->address,
- ptr_server_info->port,
- (ptr_server_info->is_connected) ? "(connected)" : "");
+ plugin->print (plugin, NULL, NULL,
+ "server: %s, address: %s, port: %d %s",
+ ptr_server_info->name,
+ ptr_server_info->address,
+ ptr_server_info->port,
+ (ptr_server_info->is_connected) ? "(connected)" : "");
}
plugin->free_server_info (plugin, server_info);
}
@@ -2743,10 +2794,10 @@ if (channel_info)
for (ptr_chan_info = channel_info; ptr_chan_info;
ptr_chan_info = ptr_chan_info->next_channel)
{
- plugin->printf (plugin, NULL, NULL,
- " %s (type %d)",
- ptr_chan_info->name,
- ptr_chan_info->type);
+ plugin->print (plugin, NULL, NULL,
+ " %s (type %d)",
+ ptr_chan_info->name,
+ ptr_chan_info->type);
}
plugin->free_channel_info (plugin, channel_info);
}
@@ -2879,10 +2930,10 @@ if (nick_info)
for (ptr_nick_info = nick_info; ptr_nick_info;
ptr_nick_info = ptr_nick_info->next_nick)
{
- plugin->printf (plugin, NULL, NULL,
- " %s (flags: %d)",
- ptr_nick_info->nick,
- ptr_nick_info->flags);
+ plugin->print (plugin, NULL, NULL,
+ " %s (flags: %d)",
+ ptr_nick_info->nick,
+ ptr_nick_info->flags);
}
plugin->free_nick_info (plugin, nick_info);
}
@@ -3506,6 +3557,79 @@ weechat.print_infobar (5, "message")
</section>
<section>
+ <title>log</title>
+
+ <para>
+ Perl prototype:
+ <command>
+ weechat::log ( message, [channel, [server]] )
+ </command>
+ </para>
+ <para>
+ Python prototype:
+ <command>
+ weechat.log ( message, [channel, [server]] )
+ </command>
+ </para>
+ <para>
+ Ruby prototype:
+ <command>
+ Weechat.log ( message, [channel, [server]] )
+ </command>
+ </para>
+ <para>
+ Lua prototype:
+ <command>
+ weechat.log ( message, [channel, [server]] )
+ </command>
+ </para>
+ <para>
+ Write a message in log file for a server or a channel.
+ </para>
+ <para>
+ Arguments:
+ <itemizedlist>
+ <listitem>
+ <para>
+ <option>message</option>: message
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <option>channel</option>: name of channel to find buffer
+ for log
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <option>server</option>: internal name of server to find
+ buffer for log
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ Return value: 1 if success, 0 if an error occurred.
+ </para>
+ <para>
+ Examples:
+<screen>
+# perl
+weechat::log ("message", "#weechat", "freenode");
+
+# python
+weechat.log ("message", "#weechat", "freenode")
+
+# ruby
+Weechat.log ("message", "#weechat", "freenode")
+
+-- lua
+weechat.log ("message", "#weechat", "freenode")
+</screen>
+ </para>
+ </section>
+
+ <section>
<title>add_message_handler</title>
<para>
diff --git a/weechat/doc/fr/weechat.fr.xml b/weechat/doc/fr/weechat.fr.xml
index 77a8e6b17..fd9dad93f 100644
--- a/weechat/doc/fr/weechat.fr.xml
+++ b/weechat/doc/fr/weechat.fr.xml
@@ -1518,7 +1518,7 @@ if (argv != NULL)
<screen>
int callback (t_weechat_plugin *plugin, char *fichier)
{
- plugin->printf_server (plugin, "fichier: %s", fichier);
+ plugin->print_server (plugin, "fichier: %s", fichier);
return 1;
}
...
@@ -1527,13 +1527,13 @@ plugin->exec_on_files (plugin, "/tmp", &amp;callback);
</para>
</section>
- <section id="secAPI_printf">
- <title>printf</title>
+ <section id="secAPI_print">
+ <title>print</title>
<para>
Prototype :
<command>
- void printf (t_weechat_plugin *plugin,
+ void print (t_weechat_plugin *plugin,
char *serveur, char *canal, char *message, ...)
</command>
</para>
@@ -1575,20 +1575,20 @@ plugin->exec_on_files (plugin, "/tmp", &amp;callback);
<para>
Exemples :
<screen>
-plugin->printf (plugin, NULL, NULL, "hello");
-plugin->printf (plugin, NULL, "#weechat", "hello");
-plugin->printf (plugin, "freenode", "#weechat", "hello");
+plugin->print (plugin, NULL, NULL, "hello");
+plugin->print (plugin, NULL, "#weechat", "hello");
+plugin->print (plugin, "freenode", "#weechat", "hello");
</screen>
</para>
</section>
- <section id="secAPI_printf_server">
- <title>printf_server</title>
+ <section id="secAPI_print_server">
+ <title>print_server</title>
<para>
Prototype :
<command>
- void printf_server (t_weechat_plugin *plugin,
+ void print_server (t_weechat_plugin *plugin,
char *message, ...)
</command>
</para>
@@ -1615,17 +1615,17 @@ plugin->printf (plugin, "freenode", "#weechat", "hello");
Valeur renvoyée : aucune.
</para>
<para>
- Exemple : <screen>plugin->printf_server (plugin, "hello");</screen>
+ Exemple : <screen>plugin->print_server (plugin, "hello");</screen>
</para>
</section>
- <section id="secAPI_printf_infobar">
- <title>printf_infobar</title>
+ <section id="secAPI_print_infobar">
+ <title>print_infobar</title>
<para>
Prototype :
<command>
- void printf_infobar (t_weechat_plugin *plugin,
+ void print_infobar (t_weechat_plugin *plugin,
int temps, char *message, ...)
</command>
</para>
@@ -1653,7 +1653,60 @@ plugin->printf (plugin, "freenode", "#weechat", "hello");
Valeur renvoyée : aucune.
</para>
<para>
- Exemple : <screen>plugin->printf_infobar (plugin, 5, "hello");</screen>
+ Exemple : <screen>plugin->print_infobar (plugin, 5, "hello");</screen>
+ </para>
+ </section>
+
+ <section id="secAPI_log">
+ <title>log</title>
+
+ <para>
+ Prototype :
+ <command>
+ void log (t_weechat_plugin *plugin,
+ char *serveur, char *canal, char *message, ...)
+ </command>
+ </para>
+ <para>
+ Ecrit un message dans le fichier de log pour un serveur ou un
+ canal.
+ </para>
+ <para>
+ Paramètres :
+ <itemizedlist>
+ <listitem>
+ <para>
+ <option>plugin</option> : pointeur vers la structure
+ de l'extension
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <option>serveur</option> : nom interne du serveur pour
+ trouver le log du tampon (peut être NULL)
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <option>canal</option> : nom du canal pour trouver le
+ tampon le log du tampon (peut être NULL)
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <option>message</option> : message
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ Valeur renvoyée : aucune.
+ </para>
+ <para>
+ Exemple :
+<screen>
+plugin->log (plugin, "freenode", "#weechat", "test");
+</screen>
</para>
</section>
@@ -1755,7 +1808,7 @@ plugin->printf (plugin, "freenode", "#weechat", "hello");
int msg_kick (t_weechat_plugin *plugin, char *serveur, char *commande,
char *arguments, char *handler_args, void *handler_pointer)
{
- plugin->printf (plugin, serveur, NULL, "KICK reçu");
+ plugin->print (plugin, serveur, NULL, "KICK reçu");
return PLUGIN_RC_OK;
}
...
@@ -1968,9 +2021,9 @@ int cmd_test (t_weechat_plugin *plugin, char *serveur,
char *commande, char *arguments, char *handler_args,
void *handler_pointer)
{
- plugin->printf (plugin, serveur, NULL,
- "commande test, pseudo: %s",
- (arguments) ? arguments : "aucun");
+ plugin->print (plugin, serveur, NULL,
+ "commande test, pseudo: %s",
+ (arguments) ? arguments : "aucun");
return PLUGIN_RC_OK;
}
...
@@ -2365,8 +2418,8 @@ char *nick = plugin->get_info (plugin, "nick", "freenode");
t_plugin_dcc_info *dcc_info = plugin->get_dcc_info (plugin);
for (ptr_dcc = dcc_info; ptr_dcc; ptr_dcc = ptr_dcc->next_dcc)
{
- plugin->printf_server (plugin, "DCC type=%d, avec: %s",
- ptr_dcc->type, ptr_dcc->nick);
+ plugin->print_server (plugin, "DCC type=%d, avec: %s",
+ ptr_dcc->type, ptr_dcc->nick);
}
if (dcc_info)
plugin->free_dcc_info (plugin, dcc_info);
@@ -2638,12 +2691,12 @@ if (server_info)
for (ptr_server_info = server_info; ptr_server_info;
ptr_server_info = ptr_server_info->next_server)
{
- plugin->printf (plugin, NULL, NULL,
- "serveur: %s, addresse: %s, port: %d %s",
- ptr_server_info->name,
- ptr_server_info->address,
- ptr_server_info->port,
- (ptr_server_info->is_connected) ? "(connecté)" : "");
+ plugin->print (plugin, NULL, NULL,
+ "serveur: %s, addresse: %s, port: %d %s",
+ ptr_server_info->name,
+ ptr_server_info->address,
+ ptr_server_info->port,
+ (ptr_server_info->is_connected) ? "(connecté)" : "");
}
plugin->free_server_info (plugin, server_info);
}
@@ -2794,10 +2847,10 @@ if (channel_info)
for (ptr_chan_info = channel_info; ptr_chan_info;
ptr_chan_info = ptr_chan_info->next_channel)
{
- plugin->printf (plugin, NULL, NULL,
- " %s (type %d)",
- ptr_chan_info->name,
- ptr_chan_info->type);
+ plugin->print (plugin, NULL, NULL,
+ " %s (type %d)",
+ ptr_chan_info->name,
+ ptr_chan_info->type);
}
plugin->free_channel_info (plugin, channel_info);
}
@@ -2933,10 +2986,10 @@ if (nick_info)
for (ptr_nick_info = nick_info; ptr_nick_info;
ptr_nick_info = ptr_nick_info->next_nick)
{
- plugin->printf (plugin, NULL, NULL,
- " %s (flags: %d)",
- ptr_nick_info->nick,
- ptr_nick_info->flags);
+ plugin->print (plugin, NULL, NULL,
+ " %s (flags: %d)",
+ ptr_nick_info->nick,
+ ptr_nick_info->flags);
}
plugin->free_nick_info (plugin, nick_info);
}
@@ -3571,6 +3624,80 @@ weechat.print_infobar (5, "message")
</section>
<section>
+ <title>log</title>
+
+ <para>
+ Prototype Perl :
+ <command>
+ weechat::log ( message, [canal, [serveur]] )
+ </command>
+ </para>
+ <para>
+ Prototype Python :
+ <command>
+ weechat.log ( message, [canal, [serveur]] )
+ </command>
+ </para>
+ <para>
+ Prototype Ruby :
+ <command>
+ Weechat.log ( message, [canal, [serveur]] )
+ </command>
+ </para>
+ <para>
+ Prototype Lua :
+ <command>
+ weechat.log ( message, [canal, [serveur]] )
+ </command>
+ </para>
+ <para>
+ Ecrit un message dans le fichier de log pour un serveur ou un
+ canal.
+ </para>
+ <para>
+ Paramètres :
+ <itemizedlist>
+ <listitem>
+ <para>
+ <option>message</option> : message
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <option>canal</option> : nom du canal pour trouver le
+ log du tampon
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <option>serveur</option> : nom interne du serveur pour
+ trouver le log du tampon
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ Valeur renvoyée : 1 si succès, 0 si une erreur s'est produite.
+ </para>
+ <para>
+ Exemples :
+<screen>
+# perl
+weechat::log ("message", "#weechat", "freenode");
+
+# python
+weechat.log ("message", "#weechat", "freenode")
+
+# ruby
+Weechat.log ("message", "#weechat", "freenode")
+
+-- lua
+weechat.log ("message", "#weechat", "freenode")
+</screen>
+ </para>
+ </section>
+
+ <section>
<title>add_message_handler</title>
<para>
diff --git a/weechat/po/cs.po b/weechat/po/cs.po
index 710d3cd21..cfb719df8 100644
--- a/weechat/po/cs.po
+++ b/weechat/po/cs.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.1.8-cvs\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2006-02-16 10:59+0100\n"
+"POT-Creation-Date: 2006-02-16 21:24+0100\n"
"PO-Revision-Date: 2006-01-24 19:25+0100\n"
"Last-Translator: Jiri Golembiovsky <golemj@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -2190,32 +2190,32 @@ msgstr ""
"%s funkce \"weechat_plugin_init\" nebyla v pluginu \"%s\" nalezena, naÄtení "
"selhalo\n"
-#: src/plugins/plugins.c:658
+#: src/plugins/plugins.c:659
#, c-format
msgid "Initializing plugin \"%s\" %s\n"
msgstr "Inicializuji plugin \"%s\" %s\n"
-#: src/plugins/plugins.c:666
+#: src/plugins/plugins.c:667
#, c-format
msgid "%s unable to initialize plugin \"%s\"\n"
msgstr "%s nemohu naÄíst plugin \"%s\"\n"
-#: src/plugins/plugins.c:677
+#: src/plugins/plugins.c:678
#, c-format
msgid "%s unable to load plugin \"%s\" (not enough memory)\n"
msgstr "%s nemohu naÄíst plugin \"%s\" (nedostatek pamÄ›ti)\n"
-#: src/plugins/plugins.c:685
+#: src/plugins/plugins.c:686
#, c-format
msgid "Plugin \"%s\" (%s) loaded.\n"
msgstr "Plugin \"%s\" (%s) naÄten.\n"
-#: src/plugins/plugins.c:852
+#: src/plugins/plugins.c:853
#, c-format
msgid "Plugin \"%s\" unloaded.\n"
msgstr "Plugin \"%s\" odebrán.\n"
-#: src/plugins/plugins.c:858
+#: src/plugins/plugins.c:859
#, c-format
msgid "%s plugin \"%s\" not found\n"
msgstr "%s plugin \"%s\" nenalezen\n"
@@ -2251,12 +2251,12 @@ msgstr ""
"tento soubor při aktualizaci nastavení.\n"
"#\n"
-#: src/plugins/plugins-interface.c:295
+#: src/plugins/plugins-interface.c:321
#, c-format
msgid "%s server/channel (%s/%s) not found for plugin exec command\n"
msgstr "%s server/kanál (%s/%s) nenaleyen pro exec příkaz pluginu\n"
-#: src/plugins/plugins-interface.c:309
+#: src/plugins/plugins-interface.c:335
#, c-format
msgid "%s server not found for plugin exec command\n"
msgstr "%s server nenalezen pro exec příkaz pluginu\n"
diff --git a/weechat/po/es.po b/weechat/po/es.po
index dac26c0c0..1ef166146 100644
--- a/weechat/po/es.po
+++ b/weechat/po/es.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.1.8-cvs\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2006-02-16 10:59+0100\n"
+"POT-Creation-Date: 2006-02-16 21:24+0100\n"
"PO-Revision-Date: 2006-01-24 19:24+0100\n"
"Last-Translator: Roberto González Cardenete <robert.glez@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -2211,33 +2211,33 @@ msgstr ""
"%s función \"weechat_plugin_init\" no encontrada en el plugin \"%s\", falló "
"al cargar\n"
-#: src/plugins/plugins.c:658
+#: src/plugins/plugins.c:659
#, c-format
msgid "Initializing plugin \"%s\" %s\n"
msgstr "Inicializando plugin \"%s\" %s\n"
-#: src/plugins/plugins.c:666
+#: src/plugins/plugins.c:667
#, c-format
msgid "%s unable to initialize plugin \"%s\"\n"
msgstr "%s no ha sido posible inicializar el plugin \"%s\"\n"
-#: src/plugins/plugins.c:677
+#: src/plugins/plugins.c:678
#, c-format
msgid "%s unable to load plugin \"%s\" (not enough memory)\n"
msgstr ""
"%s no ha sido posible cargar el plugin \"%s\" (no hay suficiente memoria)\n"
-#: src/plugins/plugins.c:685
+#: src/plugins/plugins.c:686
#, c-format
msgid "Plugin \"%s\" (%s) loaded.\n"
msgstr "Plugin \"%s\" (%s) cargado.\n"
-#: src/plugins/plugins.c:852
+#: src/plugins/plugins.c:853
#, c-format
msgid "Plugin \"%s\" unloaded.\n"
msgstr "Plugin \"%s\" descargado.\n"
-#: src/plugins/plugins.c:858
+#: src/plugins/plugins.c:859
#, c-format
msgid "%s plugin \"%s\" not found\n"
msgstr "%s plugin \"%s\" no encontrado\n"
@@ -2273,12 +2273,12 @@ msgstr ""
"archivo cuando se actualizan las opciones.\n"
"#\n"
-#: src/plugins/plugins-interface.c:295
+#: src/plugins/plugins-interface.c:321
#, c-format
msgid "%s server/channel (%s/%s) not found for plugin exec command\n"
msgstr ""
-#: src/plugins/plugins-interface.c:309
+#: src/plugins/plugins-interface.c:335
#, c-format
msgid "%s server not found for plugin exec command\n"
msgstr ""
diff --git a/weechat/po/fr.po b/weechat/po/fr.po
index 3c4281235..fe1ddade7 100644
--- a/weechat/po/fr.po
+++ b/weechat/po/fr.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.1.8-cvs\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2006-02-16 10:59+0100\n"
+"POT-Creation-Date: 2006-02-16 21:24+0100\n"
"PO-Revision-Date: 2006-02-16 11:00+0100\n"
"Last-Translator: FlashCode <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -2208,32 +2208,32 @@ msgstr ""
"%s la fonction \"weechat_plugin_init\" est introuvable dans l'extension \"%s"
"\", échec de chargement\n"
-#: src/plugins/plugins.c:658
+#: src/plugins/plugins.c:659
#, c-format
msgid "Initializing plugin \"%s\" %s\n"
msgstr "Initialisation de l'extension \"%s\" %s\n"
-#: src/plugins/plugins.c:666
+#: src/plugins/plugins.c:667
#, c-format
msgid "%s unable to initialize plugin \"%s\"\n"
msgstr "%s impossible d'initialiser l'extension \"%s\"\n"
-#: src/plugins/plugins.c:677
+#: src/plugins/plugins.c:678
#, c-format
msgid "%s unable to load plugin \"%s\" (not enough memory)\n"
msgstr "%s impossible de charger l'extension \"%s\" (mémoire insuffisante)\n"
-#: src/plugins/plugins.c:685
+#: src/plugins/plugins.c:686
#, c-format
msgid "Plugin \"%s\" (%s) loaded.\n"
msgstr "Extension \"%s\" (%s) chargée.\n"
-#: src/plugins/plugins.c:852
+#: src/plugins/plugins.c:853
#, c-format
msgid "Plugin \"%s\" unloaded.\n"
msgstr "Extension \"%s\" déchargée.\n"
-#: src/plugins/plugins.c:858
+#: src/plugins/plugins.c:859
#, c-format
msgid "%s plugin \"%s\" not found\n"
msgstr "%s extension \"%s\" non trouvée\n"
@@ -2269,14 +2269,14 @@ msgstr ""
"des options sont modifiées.\n"
"#\n"
-#: src/plugins/plugins-interface.c:295
+#: src/plugins/plugins-interface.c:321
#, c-format
msgid "%s server/channel (%s/%s) not found for plugin exec command\n"
msgstr ""
"%s serveur/canal (%s/%s) non trouvé pour l'exécution de commande de "
"l'extension\n"
-#: src/plugins/plugins-interface.c:309
+#: src/plugins/plugins-interface.c:335
#, c-format
msgid "%s server not found for plugin exec command\n"
msgstr "%s serveur non trouvé pour l'exécution de commande de l'extension\n"
diff --git a/weechat/po/hu.po b/weechat/po/hu.po
index 839c41680..0aeddc4a4 100644
--- a/weechat/po/hu.po
+++ b/weechat/po/hu.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.1.8-cvs\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2006-02-16 10:59+0100\n"
+"POT-Creation-Date: 2006-02-16 21:24+0100\n"
"PO-Revision-Date: 2006-02-07 18:34+0100\n"
"Last-Translator: voroskoi <voroskoi@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -2180,32 +2180,32 @@ msgstr ""
"%s a \"weechat_plugin_init\" függvény nem található a \"%s\" modulban, "
"betöltés sikertelen\n"
-#: src/plugins/plugins.c:658
+#: src/plugins/plugins.c:659
#, c-format
msgid "Initializing plugin \"%s\" %s\n"
msgstr "Modul betöltése: \"%s\" %s\n"
-#: src/plugins/plugins.c:666
+#: src/plugins/plugins.c:667
#, c-format
msgid "%s unable to initialize plugin \"%s\"\n"
msgstr "%s nem sikerült a modult betölteni \"%s\"\n"
-#: src/plugins/plugins.c:677
+#: src/plugins/plugins.c:678
#, c-format
msgid "%s unable to load plugin \"%s\" (not enough memory)\n"
msgstr "%s nem sikerült a modult betölteni \"%s\" (nincs elég memória)\n"
-#: src/plugins/plugins.c:685
+#: src/plugins/plugins.c:686
#, c-format
msgid "Plugin \"%s\" (%s) loaded.\n"
msgstr "A \"%s\" (%s) modul betöltve.\n"
-#: src/plugins/plugins.c:852
+#: src/plugins/plugins.c:853
#, c-format
msgid "Plugin \"%s\" unloaded.\n"
msgstr "A \"%s\" modul eltávolítva.\n"
-#: src/plugins/plugins.c:858
+#: src/plugins/plugins.c:859
#, c-format
msgid "%s plugin \"%s\" not found\n"
msgstr "%s a \"%s\" modul nem található\n"
@@ -2240,12 +2240,12 @@ msgstr ""
"# FIGYELEM! A WeeChat felülírja ezt a fájlt, ha a beállítások megváltoznak.\n"
"#\n"
-#: src/plugins/plugins-interface.c:295
+#: src/plugins/plugins-interface.c:321
#, c-format
msgid "%s server/channel (%s/%s) not found for plugin exec command\n"
msgstr "%s (%s/%s) szerver/szoba nem található a modul futtatása parancshoz\n"
-#: src/plugins/plugins-interface.c:309
+#: src/plugins/plugins-interface.c:335
#, c-format
msgid "%s server not found for plugin exec command\n"
msgstr "%s szerver nem található a modul futtatása parancshoz\n"
diff --git a/weechat/po/weechat.pot b/weechat/po/weechat.pot
index 2ed13b2b1..15d9493eb 100644
--- a/weechat/po/weechat.pot
+++ b/weechat/po/weechat.pot
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2006-02-16 10:59+0100\n"
+"POT-Creation-Date: 2006-02-16 21:24+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"
@@ -2053,32 +2053,32 @@ msgid ""
"load\n"
msgstr ""
-#: src/plugins/plugins.c:658
+#: src/plugins/plugins.c:659
#, c-format
msgid "Initializing plugin \"%s\" %s\n"
msgstr ""
-#: src/plugins/plugins.c:666
+#: src/plugins/plugins.c:667
#, c-format
msgid "%s unable to initialize plugin \"%s\"\n"
msgstr ""
-#: src/plugins/plugins.c:677
+#: src/plugins/plugins.c:678
#, c-format
msgid "%s unable to load plugin \"%s\" (not enough memory)\n"
msgstr ""
-#: src/plugins/plugins.c:685
+#: src/plugins/plugins.c:686
#, c-format
msgid "Plugin \"%s\" (%s) loaded.\n"
msgstr ""
-#: src/plugins/plugins.c:852
+#: src/plugins/plugins.c:853
#, c-format
msgid "Plugin \"%s\" unloaded.\n"
msgstr ""
-#: src/plugins/plugins.c:858
+#: src/plugins/plugins.c:859
#, c-format
msgid "%s plugin \"%s\" not found\n"
msgstr ""
@@ -2109,12 +2109,12 @@ msgid ""
"#\n"
msgstr ""
-#: src/plugins/plugins-interface.c:295
+#: src/plugins/plugins-interface.c:321
#, c-format
msgid "%s server/channel (%s/%s) not found for plugin exec command\n"
msgstr ""
-#: src/plugins/plugins-interface.c:309
+#: src/plugins/plugins-interface.c:335
#, c-format
msgid "%s server not found for plugin exec command\n"
msgstr ""
diff --git a/weechat/src/plugins/plugins-interface.c b/weechat/src/plugins/plugins-interface.c
index 9c682324d..bd8cdd087 100644
--- a/weechat/src/plugins/plugins-interface.c
+++ b/weechat/src/plugins/plugins-interface.c
@@ -153,12 +153,12 @@ weechat_plugin_exec_on_files (t_weechat_plugin *plugin, char *directory,
}
/*
- * weechat_plugin_printf: print a message on a server or channel buffer
+ * weechat_plugin_print: print a message on a server or channel buffer
*/
void
-weechat_plugin_printf (t_weechat_plugin *plugin,
- char *server, char *channel, char *message, ...)
+weechat_plugin_print (t_weechat_plugin *plugin,
+ char *server, char *channel, char *message, ...)
{
t_gui_buffer *ptr_buffer;
va_list argptr;
@@ -176,11 +176,11 @@ weechat_plugin_printf (t_weechat_plugin *plugin,
}
/*
- * weechat_plugin_printf_server: print a message on server buffer
+ * weechat_plugin_print_server: print a message on server buffer
*/
void
-weechat_plugin_printf_server (t_weechat_plugin *plugin, char *message, ...)
+weechat_plugin_print_server (t_weechat_plugin *plugin, char *message, ...)
{
va_list argptr;
static char buf[8192];
@@ -196,11 +196,11 @@ weechat_plugin_printf_server (t_weechat_plugin *plugin, char *message, ...)
}
/*
- * weechat_plugin_infobar_printf: print a message in infobar
+ * weechat_plugin_print_infobar: print a message in infobar
*/
void
-weechat_plugin_infobar_printf (t_weechat_plugin *plugin, int time_displayed, char *message, ...)
+weechat_plugin_print_infobar (t_weechat_plugin *plugin, int time_displayed, char *message, ...)
{
va_list argptr;
static char buf[1024];
diff --git a/weechat/src/plugins/plugins.c b/weechat/src/plugins/plugins.c
index db60c69e5..77ed56b55 100644
--- a/weechat/src/plugins/plugins.c
+++ b/weechat/src/plugins/plugins.c
@@ -622,9 +622,9 @@ plugin_load (char *filename)
new_plugin->cmd_handler_add = &weechat_plugin_cmd_handler_add;
new_plugin->handler_remove = &weechat_plugin_handler_remove;
new_plugin->handler_remove_all = &weechat_plugin_handler_remove_all;
- new_plugin->printf = &weechat_plugin_printf;
- new_plugin->printf_server = &weechat_plugin_printf_server;
- new_plugin->infobar_printf = &weechat_plugin_infobar_printf;
+ new_plugin->print = &weechat_plugin_print;
+ new_plugin->print_server = &weechat_plugin_print_server;
+ new_plugin->print_infobar = &weechat_plugin_print_infobar;
new_plugin->log = &weechat_plugin_log;
new_plugin->exec_command = &weechat_plugin_exec_command;
new_plugin->get_info = &weechat_plugin_get_info;
diff --git a/weechat/src/plugins/scripts/lua/weechat-lua.c b/weechat/src/plugins/scripts/lua/weechat-lua.c
index 422908cb3..f4e2751df 100644
--- a/weechat/src/plugins/scripts/lua/weechat-lua.c
+++ b/weechat/src/plugins/scripts/lua/weechat-lua.c
@@ -67,12 +67,12 @@ weechat_lua_exec (t_weechat_plugin *plugin,
if ( lua_pcall(lua_current_interpreter, 2, 1, 0) != 0)
{
- plugin->printf_server (plugin,
- "Lua error: unable to run function \"%s\"",
- function);
- plugin->printf_server (plugin,
- "Lua error: %s",
- lua_tostring (lua_current_interpreter, -1));
+ plugin->print_server (plugin,
+ "Lua error: unable to run function \"%s\"",
+ function);
+ plugin->print_server (plugin,
+ "Lua error: %s",
+ lua_tostring (lua_current_interpreter, -1));
return PLUGIN_RC_KO;
}
@@ -116,9 +116,9 @@ weechat_lua_register (lua_State *L)
if (n != 4)
{
- lua_plugin->printf_server (lua_plugin,
- "Lua error: wrong parameters for "
- "\"register\" function");
+ lua_plugin->print_server (lua_plugin,
+ "Lua error: wrong parameters for "
+ "\"register\" function");
lua_pushnumber (lua_current_interpreter, 0);
return 1;
}
@@ -131,11 +131,11 @@ weechat_lua_register (lua_State *L)
if (weechat_script_search (lua_plugin, &lua_scripts, (char *) name))
{
/* error: another scripts already exists with this name! */
- lua_plugin->printf_server (lua_plugin,
- "Lua error: unable to register "
- "\"%s\" script (another script "
- "already exists with this name)",
- name);
+ lua_plugin->print_server (lua_plugin,
+ "Lua error: unable to register "
+ "\"%s\" script (another script "
+ "already exists with this name)",
+ name);
lua_pushnumber (lua_current_interpreter, 0);
return 1;
}
@@ -151,17 +151,17 @@ weechat_lua_register (lua_State *L)
(char *) description);
if (lua_current_script)
{
- lua_plugin->printf_server (lua_plugin,
- "Lua: registered script \"%s\", "
- "version %s (%s)",
- name, version, description);
+ lua_plugin->print_server (lua_plugin,
+ "Lua: registered script \"%s\", "
+ "version %s (%s)",
+ name, version, description);
}
else
{
- lua_plugin->printf_server (lua_plugin,
- "Lua error: unable to load script "
- "\"%s\" (not enough memory)",
- name);
+ lua_plugin->print_server (lua_plugin,
+ "Lua error: unable to load script "
+ "\"%s\" (not enough memory)",
+ name);
lua_pushnumber (lua_current_interpreter, 0);
return 1;
}
@@ -184,9 +184,9 @@ weechat_lua_print (lua_State *L)
if (!lua_current_script)
{
- lua_plugin->printf_server (lua_plugin,
- "Lua error: unable to print message, "
- "script not initialized");
+ lua_plugin->print_server (lua_plugin,
+ "Lua error: unable to print message, "
+ "script not initialized");
lua_pushnumber (lua_current_interpreter, 0);
return 1;
}
@@ -212,17 +212,17 @@ weechat_lua_print (lua_State *L)
message = lua_tostring (lua_current_interpreter, -1);
break;
default:
- lua_plugin->printf_server (lua_plugin,
- "Lua error: wrong parameters for "
- "\"print\" function");
+ lua_plugin->print_server (lua_plugin,
+ "Lua error: wrong parameters for "
+ "\"print\" function");
lua_pushnumber (lua_current_interpreter, 0);
return 1;
}
- lua_plugin->printf (lua_plugin,
- (char *) server_name,
- (char *) channel_name,
- "%s", (char *) message);
+ lua_plugin->print (lua_plugin,
+ (char *) server_name,
+ (char *) channel_name,
+ "%s", (char *) message);
lua_pushnumber (lua_current_interpreter, 1);
return 1;
@@ -242,9 +242,9 @@ weechat_lua_print_infobar (lua_State *L)
if (!lua_current_script)
{
- lua_plugin->printf_server (lua_plugin,
- "Lua error: unable to print infobar message, "
- "script not initialized");
+ lua_plugin->print_server (lua_plugin,
+ "Lua error: unable to print infobar message, "
+ "script not initialized");
lua_pushnumber (lua_current_interpreter, 0);
return 1;
}
@@ -256,9 +256,9 @@ weechat_lua_print_infobar (lua_State *L)
if (n != 2)
{
- lua_plugin->printf_server (lua_plugin,
- "Lua error: wrong parameters for "
- "\"print_infobar\" function");
+ lua_plugin->print_server (lua_plugin,
+ "Lua error: wrong parameters for "
+ "\"print_infobar\" function");
lua_pushnumber (lua_current_interpreter, 0);
return 1;
}
@@ -266,7 +266,7 @@ weechat_lua_print_infobar (lua_State *L)
delay = lua_tonumber (lua_current_interpreter, -2);
message = lua_tostring (lua_current_interpreter, -1);
- lua_plugin->infobar_printf (lua_plugin, delay, "%s", (char *) message);
+ lua_plugin->print_infobar (lua_plugin, delay, "%s", (char *) message);
lua_pushnumber (lua_current_interpreter, 1);
return 1;
@@ -286,9 +286,9 @@ weechat_lua_log (lua_State *L)
if (!lua_current_script)
{
- lua_plugin->printf_server (lua_plugin,
- "Lua error: unable to print message, "
- "script not initialized");
+ lua_plugin->print_server (lua_plugin,
+ "Lua error: unable to print message, "
+ "script not initialized");
lua_pushnumber (lua_current_interpreter, 0);
return 1;
}
@@ -314,9 +314,9 @@ weechat_lua_log (lua_State *L)
message = lua_tostring (lua_current_interpreter, -1);
break;
default:
- lua_plugin->printf_server (lua_plugin,
- "Lua error: wrong parameters for "
- "\"log\" function");
+ lua_plugin->print_server (lua_plugin,
+ "Lua error: wrong parameters for "
+ "\"log\" function");
lua_pushnumber (lua_current_interpreter, 0);
return 1;
}
@@ -344,9 +344,9 @@ weechat_lua_command (lua_State *L)
if (!lua_current_script)
{
- lua_plugin->printf_server (lua_plugin,
- "Lua error: unable to run command, "
- "script not initialized");
+ lua_plugin->print_server (lua_plugin,
+ "Lua error: unable to run command, "
+ "script not initialized");
lua_pushnumber (lua_current_interpreter, 0);
return 1;
}
@@ -372,9 +372,9 @@ weechat_lua_command (lua_State *L)
command = lua_tostring (lua_current_interpreter, -1);
break;
default:
- lua_plugin->printf_server (lua_plugin,
- "Lua error: wrong parameters for "
- "\"command\" function");
+ lua_plugin->print_server (lua_plugin,
+ "Lua error: wrong parameters for "
+ "\"command\" function");
lua_pushnumber (lua_current_interpreter, 0);
return 1;
}
@@ -402,9 +402,9 @@ weechat_lua_add_message_handler (lua_State *L)
if (!lua_current_script)
{
- lua_plugin->printf_server (lua_plugin,
- "Lua error: unable to add message handler, "
- "script not initialized");
+ lua_plugin->print_server (lua_plugin,
+ "Lua error: unable to add message handler, "
+ "script not initialized");
lua_pushnumber (lua_current_interpreter, 0);
return 1;
}
@@ -416,9 +416,9 @@ weechat_lua_add_message_handler (lua_State *L)
if (n != 2)
{
- lua_plugin->printf_server (lua_plugin,
- "Lua error: wrong parameters for "
- "\"add_message_handler\" function");
+ lua_plugin->print_server (lua_plugin,
+ "Lua error: wrong parameters for "
+ "\"add_message_handler\" function");
lua_pushnumber (lua_current_interpreter, 0);
return 1;
}
@@ -453,9 +453,9 @@ weechat_lua_add_command_handler (lua_State *L)
if (!lua_current_script)
{
- lua_plugin->printf_server (lua_plugin,
- "Lua error: unable to add command handler, "
- "script not initialized");
+ lua_plugin->print_server (lua_plugin,
+ "Lua error: unable to add command handler, "
+ "script not initialized");
lua_pushnumber (lua_current_interpreter, 0);
return 1;
}
@@ -484,9 +484,9 @@ weechat_lua_add_command_handler (lua_State *L)
completion_template = lua_tostring (lua_current_interpreter, -1);
break;
default:
- lua_plugin->printf_server (lua_plugin,
- "Lua error: wrong parameters for "
- "\"add_command_handler\" function");
+ lua_plugin->print_server (lua_plugin,
+ "Lua error: wrong parameters for "
+ "\"add_command_handler\" function");
lua_pushnumber (lua_current_interpreter, 0);
return 1;
}
@@ -523,9 +523,9 @@ weechat_lua_remove_handler (lua_State *L)
if (!lua_current_script)
{
- lua_plugin->printf_server (lua_plugin,
- "Lua error: unable to remove handler, "
- "script not initialized");
+ lua_plugin->print_server (lua_plugin,
+ "Lua error: unable to remove handler, "
+ "script not initialized");
lua_pushnumber (lua_current_interpreter, 0);
return 1;
}
@@ -537,9 +537,9 @@ weechat_lua_remove_handler (lua_State *L)
if (n != 2)
{
- lua_plugin->printf_server (lua_plugin,
- "Lua error: wrong parameters for "
- "\"remove_handler\" function");
+ lua_plugin->print_server (lua_plugin,
+ "Lua error: wrong parameters for "
+ "\"remove_handler\" function");
lua_pushnumber (lua_current_interpreter, 0);
return 1;
}
@@ -569,9 +569,9 @@ weechat_lua_get_info (lua_State *L)
if (!lua_current_script)
{
- lua_plugin->printf_server (lua_plugin,
- "Lua error: unable to get info, "
- "script not initialized");
+ lua_plugin->print_server (lua_plugin,
+ "Lua error: unable to get info, "
+ "script not initialized");
lua_pushnumber (lua_current_interpreter, 0);
return 1;
}
@@ -591,9 +591,9 @@ weechat_lua_get_info (lua_State *L)
server_name = lua_tostring (lua_current_interpreter, -1);
break;
default:
- lua_plugin->printf_server (lua_plugin,
- "Lua error: wrong parameters for "
- "\"get_info\" function");
+ lua_plugin->print_server (lua_plugin,
+ "Lua error: wrong parameters for "
+ "\"get_info\" function");
lua_pushnumber (lua_current_interpreter, 0);
return 1;
}
@@ -624,9 +624,9 @@ weechat_lua_get_dcc_info (lua_State *L)
if (!lua_current_script)
{
- lua_plugin->printf_server (lua_plugin,
- "Lua error: unable to get DCC info, "
- "script not initialized");
+ lua_plugin->print_server (lua_plugin,
+ "Lua error: unable to get DCC info, "
+ "script not initialized");
lua_pushnil (lua_current_interpreter);
return 1;
}
@@ -738,9 +738,9 @@ weechat_lua_get_config (lua_State *L)
if (!lua_current_script)
{
- lua_plugin->printf_server (lua_plugin,
- "Lua error: unable to get config option, "
- "script not initialized");
+ lua_plugin->print_server (lua_plugin,
+ "Lua error: unable to get config option, "
+ "script not initialized");
lua_pushnumber (lua_current_interpreter, 0);
return 1;
}
@@ -751,9 +751,9 @@ weechat_lua_get_config (lua_State *L)
if (n != 1)
{
- lua_plugin->printf_server (lua_plugin,
- "Lua error: wrong parameters for "
- "\"get_config\" function");
+ lua_plugin->print_server (lua_plugin,
+ "Lua error: wrong parameters for "
+ "\"get_config\" function");
lua_pushnumber (lua_current_interpreter, 0);
return 1;
}
@@ -783,9 +783,9 @@ weechat_lua_set_config (lua_State *L)
if (!lua_current_script)
{
- lua_plugin->printf_server (lua_plugin,
- "Lua error: unable to set config option, "
- "script not initialized");
+ lua_plugin->print_server (lua_plugin,
+ "Lua error: unable to set config option, "
+ "script not initialized");
lua_pushnumber (lua_current_interpreter, 0);
return 1;
}
@@ -797,9 +797,9 @@ weechat_lua_set_config (lua_State *L)
if (n != 2)
{
- lua_plugin->printf_server (lua_plugin,
- "Lua error: wrong parameters for "
- "\"set_config\" function");
+ lua_plugin->print_server (lua_plugin,
+ "Lua error: wrong parameters for "
+ "\"set_config\" function");
lua_pushnumber (lua_current_interpreter, 0);
return 1;
}
@@ -830,9 +830,9 @@ weechat_lua_get_plugin_config (lua_State *L)
if (!lua_current_script)
{
- lua_plugin->printf_server (lua_plugin,
- "Lua error: unable to get plugin config option, "
- "script not initialized");
+ lua_plugin->print_server (lua_plugin,
+ "Lua error: unable to get plugin config option, "
+ "script not initialized");
lua_pushnumber (lua_current_interpreter, 0);
return 1;
}
@@ -843,9 +843,9 @@ weechat_lua_get_plugin_config (lua_State *L)
if (n != 1)
{
- lua_plugin->printf_server (lua_plugin,
- "Lua error: wrong parameters for "
- "\"get_plugin_config\" function");
+ lua_plugin->print_server (lua_plugin,
+ "Lua error: wrong parameters for "
+ "\"get_plugin_config\" function");
lua_pushnumber (lua_current_interpreter, 0);
return 1;
}
@@ -877,9 +877,9 @@ weechat_lua_set_plugin_config (lua_State *L)
if (!lua_current_script)
{
- lua_plugin->printf_server (lua_plugin,
- "Lua error: unable to set plugin config option, "
- "script not initialized");
+ lua_plugin->print_server (lua_plugin,
+ "Lua error: unable to set plugin config option, "
+ "script not initialized");
lua_pushnumber (lua_current_interpreter, 0);
return 1;
}
@@ -891,9 +891,9 @@ weechat_lua_set_plugin_config (lua_State *L)
if (n != 2)
{
- lua_plugin->printf_server (lua_plugin,
- "Lua error: wrong parameters for "
- "\"set_plugin_config\" function");
+ lua_plugin->print_server (lua_plugin,
+ "Lua error: wrong parameters for "
+ "\"set_plugin_config\" function");
lua_pushnumber (lua_current_interpreter, 0);
return 1;
}
@@ -925,9 +925,9 @@ weechat_lua_get_server_info (lua_State *L)
if (!lua_current_script)
{
- lua_plugin->printf_server (lua_plugin,
- "Lua error: unable to get server infos, "
- "script not initialized");
+ lua_plugin->print_server (lua_plugin,
+ "Lua error: unable to get server infos, "
+ "script not initialized");
lua_pushnil (lua_current_interpreter);
return 1;
}
@@ -1079,9 +1079,9 @@ weechat_lua_get_channel_info (lua_State *L)
if (!lua_current_script)
{
- lua_plugin->printf_server (lua_plugin,
- "Lua error: unable to get channel infos, "
- "script not initialized");
+ lua_plugin->print_server (lua_plugin,
+ "Lua error: unable to get channel infos, "
+ "script not initialized");
lua_pushnil (lua_current_interpreter);
return 1;
}
@@ -1092,9 +1092,9 @@ weechat_lua_get_channel_info (lua_State *L)
if (n != 1)
{
- lua_plugin->printf_server (lua_plugin,
- "Lua error: wrong parameters for "
- "\"get_channel_info\" function");
+ lua_plugin->print_server (lua_plugin,
+ "Lua error: wrong parameters for "
+ "\"get_channel_info\" function");
lua_pushnil (lua_current_interpreter);
return 1;
}
@@ -1162,9 +1162,9 @@ weechat_lua_get_nick_info (lua_State *L)
if (!lua_current_script)
{
- lua_plugin->printf_server (lua_plugin,
- "Lua error: unable to get nick infos, "
- "script not initialized");
+ lua_plugin->print_server (lua_plugin,
+ "Lua error: unable to get nick infos, "
+ "script not initialized");
lua_pushnil (lua_current_interpreter);
return 1;
}
@@ -1176,9 +1176,9 @@ weechat_lua_get_nick_info (lua_State *L)
if (n != 2)
{
- lua_plugin->printf_server (lua_plugin,
- "Lua error: wrong parameters for "
- "\"get_nick_info\" function");
+ lua_plugin->print_server (lua_plugin,
+ "Lua error: wrong parameters for "
+ "\"get_nick_info\" function");
lua_pushnil (lua_current_interpreter);
return 1;
}
@@ -1308,13 +1308,13 @@ weechat_lua_load (t_weechat_plugin *plugin, char *filename)
"io.stderr = weechat_outputs\n"
};
- plugin->printf_server (plugin, "Loading Lua script \"%s\"", filename);
+ plugin->print_server (plugin, "Loading Lua script \"%s\"", filename);
if ((fp = fopen (filename, "r")) == NULL)
{
- plugin->printf_server (plugin,
- "Lua error: unable to open file \"%s\"",
- filename);
+ plugin->print_server (plugin,
+ "Lua error: unable to open file \"%s\"",
+ filename);
return 0;
}
@@ -1324,8 +1324,8 @@ weechat_lua_load (t_weechat_plugin *plugin, char *filename)
if (lua_current_interpreter == NULL)
{
- plugin->printf_server (plugin,
- "Lua error: unable to create new sub-interpreter");
+ plugin->print_server (plugin,
+ "Lua error: unable to create new sub-interpreter");
fclose (fp);
return 0;
}
@@ -1340,19 +1340,19 @@ weechat_lua_load (t_weechat_plugin *plugin, char *filename)
luaL_openlib (lua_current_interpreter, "weechat", weechat_lua_funcs, 0);
if (lua_dostring (lua_current_interpreter, weechat_lua_code) != 0)
- plugin->printf_server (plugin,
- "Lua warning: unable to redirect stdout and stderr");
+ plugin->print_server (plugin,
+ "Lua warning: unable to redirect stdout and stderr");
lua_current_script_filename = strdup (filename);
if (luaL_loadfile (lua_current_interpreter, filename) != 0)
{
- plugin->printf_server (plugin,
- "Lua error: unable to load file \"%s\"",
- filename);
- plugin->printf_server (plugin,
- "Lua error: %s",
- lua_tostring (lua_current_interpreter, -1));
+ plugin->print_server (plugin,
+ "Lua error: unable to load file \"%s\"",
+ filename);
+ plugin->print_server (plugin,
+ "Lua error: %s",
+ lua_tostring (lua_current_interpreter, -1));
free (lua_current_script_filename);
lua_close (lua_current_interpreter);
fclose (fp);
@@ -1361,12 +1361,12 @@ weechat_lua_load (t_weechat_plugin *plugin, char *filename)
if (lua_pcall (lua_current_interpreter, 0, 0, 0) != 0)
{
- plugin->printf_server (plugin,
- "Lua error: unable to execute file \"%s\"",
- filename);
- plugin->printf_server (plugin,
- "Lua error: %s",
- lua_tostring (lua_current_interpreter, -1));
+ plugin->print_server (plugin,
+ "Lua error: unable to execute file \"%s\"",
+ filename);
+ plugin->print_server (plugin,
+ "Lua error: %s",
+ lua_tostring (lua_current_interpreter, -1));
free (lua_current_script_filename);
lua_close (lua_current_interpreter);
fclose (fp);
@@ -1381,10 +1381,10 @@ weechat_lua_load (t_weechat_plugin *plugin, char *filename)
if (lua_current_script == NULL)
{
- plugin->printf_server (plugin,
- "Lua error: function \"register\" not found "
- "in file \"%s\"",
- filename);
+ plugin->print_server (plugin,
+ "Lua error: function \"register\" not found "
+ "in file \"%s\"",
+ filename);
lua_close (lua_current_interpreter);
return 0;
}
@@ -1401,9 +1401,9 @@ weechat_lua_load (t_weechat_plugin *plugin, char *filename)
void
weechat_lua_unload (t_weechat_plugin *plugin, t_plugin_script *script)
{
- plugin->printf_server (plugin,
- "Unloading Lua script \"%s\"",
- script->name);
+ plugin->print_server (plugin,
+ "Unloading Lua script \"%s\"",
+ script->name);
if (script->shutdown_func[0])
weechat_lua_exec (plugin, script, script->shutdown_func, "", "");
@@ -1426,15 +1426,15 @@ weechat_lua_unload_name (t_weechat_plugin *plugin, char *name)
if (ptr_script)
{
weechat_lua_unload (plugin, ptr_script);
- plugin->printf_server (plugin,
- "Lua script \"%s\" unloaded",
- name);
+ plugin->print_server (plugin,
+ "Lua script \"%s\" unloaded",
+ name);
}
else
{
- plugin->printf_server (plugin,
- "Lua error: script \"%s\" not loaded",
- name);
+ plugin->print_server (plugin,
+ "Lua error: script \"%s\" not loaded",
+ name);
}
}
@@ -1445,13 +1445,13 @@ weechat_lua_unload_name (t_weechat_plugin *plugin, char *name)
void
weechat_lua_unload_all (t_weechat_plugin *plugin)
{
- plugin->printf_server (plugin,
- "Unloading all Lua scripts");
+ plugin->print_server (plugin,
+ "Unloading all Lua scripts");
while (lua_scripts)
weechat_lua_unload (plugin, lua_scripts);
- plugin->printf_server (plugin,
- "Lua scripts unloaded");
+ plugin->print_server (plugin,
+ "Lua scripts unloaded");
}
/*
@@ -1486,26 +1486,26 @@ weechat_lua_cmd (t_weechat_plugin *plugin,
{
case 0:
/* list registered Lua scripts */
- plugin->printf_server (plugin, "");
- plugin->printf_server (plugin, "Registered Lua scripts:");
+ plugin->print_server (plugin, "");
+ plugin->print_server (plugin, "Registered Lua scripts:");
if (lua_scripts)
{
for (ptr_script = lua_scripts;
ptr_script; ptr_script = ptr_script->next_script)
{
- plugin->printf_server (plugin, " %s v%s%s%s",
- ptr_script->name,
- ptr_script->version,
- (ptr_script->description[0]) ? " - " : "",
- ptr_script->description);
+ plugin->print_server (plugin, " %s v%s%s%s",
+ ptr_script->name,
+ ptr_script->version,
+ (ptr_script->description[0]) ? " - " : "",
+ ptr_script->description);
}
}
else
- plugin->printf_server (plugin, " (none)");
+ plugin->print_server (plugin, " (none)");
/* list Lua message handlers */
- plugin->printf_server (plugin, "");
- plugin->printf_server (plugin, "Lua message handlers:");
+ plugin->print_server (plugin, "");
+ plugin->print_server (plugin, "Lua message handlers:");
handler_found = 0;
for (ptr_handler = plugin->handlers;
ptr_handler; ptr_handler = ptr_handler->next_handler)
@@ -1514,17 +1514,17 @@ weechat_lua_cmd (t_weechat_plugin *plugin,
&& (ptr_handler->handler_args))
{
handler_found = 1;
- plugin->printf_server (plugin, " IRC(%s) => Lua(%s)",
- ptr_handler->irc_command,
- ptr_handler->handler_args);
+ plugin->print_server (plugin, " IRC(%s) => Lua(%s)",
+ ptr_handler->irc_command,
+ ptr_handler->handler_args);
}
}
if (!handler_found)
- plugin->printf_server (plugin, " (none)");
+ plugin->print_server (plugin, " (none)");
/* list Lua command handlers */
- plugin->printf_server (plugin, "");
- plugin->printf_server (plugin, "Lua command handlers:");
+ plugin->print_server (plugin, "");
+ plugin->print_server (plugin, "Lua command handlers:");
handler_found = 0;
for (ptr_handler = plugin->handlers;
ptr_handler; ptr_handler = ptr_handler->next_handler)
@@ -1533,13 +1533,13 @@ weechat_lua_cmd (t_weechat_plugin *plugin,
&& (ptr_handler->handler_args))
{
handler_found = 1;
- plugin->printf_server (plugin, " /%s => Lua(%s)",
- ptr_handler->command,
- ptr_handler->handler_args);
+ plugin->print_server (plugin, " /%s => Lua(%s)",
+ ptr_handler->command,
+ ptr_handler->handler_args);
}
}
if (!handler_found)
- plugin->printf_server (plugin, " (none)");
+ plugin->print_server (plugin, " (none)");
break;
case 1:
if (plugin->ascii_strcasecmp (plugin, argv[0], "autoload") == 0)
@@ -1586,14 +1586,14 @@ weechat_lua_cmd (t_weechat_plugin *plugin,
}
else
{
- plugin->printf_server (plugin,
- "Lua error: unknown option for "
- "\"lua\" command");
+ plugin->print_server (plugin,
+ "Lua error: unknown option for "
+ "\"lua\" command");
}
break;
default:
- plugin->printf_server (plugin,
- "Lua error: wrong argument count for \"lua\" command");
+ plugin->print_server (plugin,
+ "Lua error: wrong argument count for \"lua\" command");
}
if (argv)
@@ -1612,7 +1612,7 @@ weechat_plugin_init (t_weechat_plugin *plugin)
lua_plugin = plugin;
- plugin->printf_server (plugin, "Loading Lua module \"weechat\"");
+ plugin->print_server (plugin, "Loading Lua module \"weechat\"");
plugin->cmd_handler_add (plugin, "lua",
"list/load/unload Lua scripts",
@@ -1641,6 +1641,6 @@ weechat_plugin_end (t_weechat_plugin *plugin)
/* unload all scripts */
weechat_lua_unload_all (plugin);
- lua_plugin->printf_server (lua_plugin,
- "Lua plugin ended");
+ lua_plugin->print_server (lua_plugin,
+ "Lua plugin ended");
}
diff --git a/weechat/src/plugins/scripts/perl/weechat-perl.c b/weechat/src/plugins/scripts/perl/weechat-perl.c
index d50bf1d8f..5b329a506 100644
--- a/weechat/src/plugins/scripts/perl/weechat-perl.c
+++ b/weechat/src/plugins/scripts/perl/weechat-perl.c
@@ -146,16 +146,16 @@ weechat_perl_exec (t_weechat_plugin *plugin,
return_code = PLUGIN_RC_KO;
if (SvTRUE (sv))
{
- plugin->printf_server (plugin, "Perl error: %s", SvPV (sv, count));
+ plugin->print_server (plugin, "Perl error: %s", SvPV (sv, count));
POPs;
}
else
{
if (count != 1)
{
- plugin->printf_server (plugin,
- "Perl error: too much values from \"%s\" (%d). Expected: 1.",
- function, count);
+ plugin->print_server (plugin,
+ "Perl error: too much values from \"%s\" (%d). Expected: 1.",
+ function, count);
}
else
return_code = POPi;
@@ -204,9 +204,9 @@ static XS (XS_weechat_register)
if (items != 4)
{
- perl_plugin->printf_server (perl_plugin,
- "Perl error: wrong parameters for "
- "\"register\" function");
+ perl_plugin->print_server (perl_plugin,
+ "Perl error: wrong parameters for "
+ "\"register\" function");
XSRETURN_NO;
}
@@ -218,11 +218,11 @@ static XS (XS_weechat_register)
if (weechat_script_search (perl_plugin, &perl_scripts, name))
{
/* error: another script already exists with this name! */
- perl_plugin->printf_server (perl_plugin,
- "Perl error: unable to register "
- "\"%s\" script (another script "
- "already exists with this name)",
- name);
+ perl_plugin->print_server (perl_plugin,
+ "Perl error: unable to register "
+ "\"%s\" script (another script "
+ "already exists with this name)",
+ name);
XSRETURN_NO;
}
@@ -235,17 +235,17 @@ static XS (XS_weechat_register)
description);
if (perl_current_script)
{
- perl_plugin->printf_server (perl_plugin,
- "Perl: registered script \"%s\", "
- "version %s (%s)",
- name, version, description);
+ perl_plugin->print_server (perl_plugin,
+ "Perl: registered script \"%s\", "
+ "version %s (%s)",
+ name, version, description);
}
else
{
- perl_plugin->printf_server (perl_plugin,
- "Perl error: unable to load script "
- "\"%s\" (not enough memory)",
- name);
+ perl_plugin->print_server (perl_plugin,
+ "Perl error: unable to load script "
+ "\"%s\" (not enough memory)",
+ name);
XSRETURN_NO;
}
@@ -267,17 +267,17 @@ static XS (XS_weechat_print)
if (!perl_current_script)
{
- perl_plugin->printf_server (perl_plugin,
- "Perl error: unable to print message, "
- "script not initialized");
+ perl_plugin->print_server (perl_plugin,
+ "Perl error: unable to print message, "
+ "script not initialized");
XSRETURN_NO;
}
if (items < 1)
{
- perl_plugin->printf_server (perl_plugin,
- "Perl error: wrong parameters for "
- "\"print\" function");
+ perl_plugin->print_server (perl_plugin,
+ "Perl error: wrong parameters for "
+ "\"print\" function");
XSRETURN_NO;
}
@@ -293,9 +293,9 @@ static XS (XS_weechat_print)
server_name = SvPV (ST (2), integer);
}
- perl_plugin->printf (perl_plugin,
- server_name, channel_name,
- "%s", message);
+ perl_plugin->print (perl_plugin,
+ server_name, channel_name,
+ "%s", message);
XSRETURN_YES;
}
@@ -314,24 +314,24 @@ static XS (XS_weechat_print_infobar)
if (!perl_current_script)
{
- perl_plugin->printf_server (perl_plugin,
- "Perl error: unable to print infobar message, "
- "script not initialized");
+ perl_plugin->print_server (perl_plugin,
+ "Perl error: unable to print infobar message, "
+ "script not initialized");
XSRETURN_NO;
}
if (items < 2)
{
- perl_plugin->printf_server (perl_plugin,
- "Perl error: wrong parameters for "
- "\"print_infobar\" function");
+ perl_plugin->print_server (perl_plugin,
+ "Perl error: wrong parameters for "
+ "\"print_infobar\" function");
XSRETURN_NO;
}
- perl_plugin->infobar_printf (perl_plugin,
- SvIV (ST (0)),
- "%s",
- SvPV (ST (1), integer));
+ perl_plugin->print_infobar (perl_plugin,
+ SvIV (ST (0)),
+ "%s",
+ SvPV (ST (1), integer));
XSRETURN_YES;
}
@@ -351,17 +351,17 @@ static XS (XS_weechat_log)
if (!perl_current_script)
{
- perl_plugin->printf_server (perl_plugin,
- "Perl error: unable to print message, "
- "script not initialized");
+ perl_plugin->print_server (perl_plugin,
+ "Perl error: unable to print message, "
+ "script not initialized");
XSRETURN_NO;
}
if (items < 1)
{
- perl_plugin->printf_server (perl_plugin,
- "Perl error: wrong parameters for "
- "\"log\" function");
+ perl_plugin->print_server (perl_plugin,
+ "Perl error: wrong parameters for "
+ "\"log\" function");
XSRETURN_NO;
}
@@ -399,17 +399,17 @@ static XS (XS_weechat_command)
if (!perl_current_script)
{
- perl_plugin->printf_server (perl_plugin,
- "Perl error: unable to run command, "
- "script not initialized");
+ perl_plugin->print_server (perl_plugin,
+ "Perl error: unable to run command, "
+ "script not initialized");
XSRETURN_NO;
}
if (items < 1)
{
- perl_plugin->printf_server (perl_plugin,
- "Perl error: wrong parameters for "
- "\"command\" function");
+ perl_plugin->print_server (perl_plugin,
+ "Perl error: wrong parameters for "
+ "\"command\" function");
XSRETURN_NO;
}
@@ -445,17 +445,17 @@ static XS (XS_weechat_add_message_handler)
if (!perl_current_script)
{
- perl_plugin->printf_server (perl_plugin,
- "Perl error: unable to add message handler, "
- "script not initialized");
+ perl_plugin->print_server (perl_plugin,
+ "Perl error: unable to add message handler, "
+ "script not initialized");
XSRETURN_NO;
}
if (items < 2)
{
- perl_plugin->printf_server (perl_plugin,
- "Perl error: wrong parameters for "
- "\"add_message_handler\" function");
+ perl_plugin->print_server (perl_plugin,
+ "Perl error: wrong parameters for "
+ "\"add_message_handler\" function");
XSRETURN_NO;
}
@@ -486,17 +486,17 @@ static XS (XS_weechat_add_command_handler)
if (!perl_current_script)
{
- perl_plugin->printf_server (perl_plugin,
- "Perl error: unable to add command handler, "
- "script not initialized");
+ perl_plugin->print_server (perl_plugin,
+ "Perl error: unable to add command handler, "
+ "script not initialized");
XSRETURN_NO;
}
if (items < 2)
{
- perl_plugin->printf_server (perl_plugin,
- "Perl error: wrong parameters for "
- "\"add_command_handler\" function");
+ perl_plugin->print_server (perl_plugin,
+ "Perl error: wrong parameters for "
+ "\"add_command_handler\" function");
XSRETURN_NO;
}
@@ -536,17 +536,17 @@ static XS (XS_weechat_remove_handler)
if (!perl_current_script)
{
- perl_plugin->printf_server (perl_plugin,
- "Perl error: unable to remove handler, "
- "script not initialized");
+ perl_plugin->print_server (perl_plugin,
+ "Perl error: unable to remove handler, "
+ "script not initialized");
XSRETURN_NO;
}
if (items < 2)
{
- perl_plugin->printf_server (perl_plugin,
- "Perl error: wrong parameters for "
- "\"remove_handler\" function");
+ perl_plugin->print_server (perl_plugin,
+ "Perl error: wrong parameters for "
+ "\"remove_handler\" function");
XSRETURN_NO;
}
@@ -574,17 +574,17 @@ static XS (XS_weechat_get_info)
if (!perl_current_script)
{
- perl_plugin->printf_server (perl_plugin,
- "Perl error: unable to get info, "
- "script not initialized");
+ perl_plugin->print_server (perl_plugin,
+ "Perl error: unable to get info, "
+ "script not initialized");
XSRETURN_NO;
}
if (items < 1)
{
- perl_plugin->printf_server (perl_plugin,
- "Perl error: wrong parameters for "
- "\"get_info\" function");
+ perl_plugin->print_server (perl_plugin,
+ "Perl error: wrong parameters for "
+ "\"get_info\" function");
XSRETURN_NO;
}
@@ -627,9 +627,9 @@ static XS (XS_weechat_get_dcc_info)
if (!perl_current_script)
{
- perl_plugin->printf_server (perl_plugin,
- "Perl error: unable to get DCC info, "
- "script not initialized");
+ perl_plugin->print_server (perl_plugin,
+ "Perl error: unable to get DCC info, "
+ "script not initialized");
XSRETURN_EMPTY;
}
@@ -688,17 +688,17 @@ static XS (XS_weechat_get_config)
if (!perl_current_script)
{
- perl_plugin->printf_server (perl_plugin,
- "Perl error: unable to get config option, "
- "script not initialized");
+ perl_plugin->print_server (perl_plugin,
+ "Perl error: unable to get config option, "
+ "script not initialized");
XSRETURN_NO;
}
if (items < 1)
{
- perl_plugin->printf_server (perl_plugin,
- "Perl error: wrong parameters for "
- "\"get_config\" function");
+ perl_plugin->print_server (perl_plugin,
+ "Perl error: wrong parameters for "
+ "\"get_config\" function");
XSRETURN_NO;
}
@@ -735,17 +735,17 @@ static XS (XS_weechat_set_config)
if (!perl_current_script)
{
- perl_plugin->printf_server (perl_plugin,
- "Perl error: unable to set config option, "
- "script not initialized");
+ perl_plugin->print_server (perl_plugin,
+ "Perl error: unable to set config option, "
+ "script not initialized");
XSRETURN_NO;
}
if (items < 2)
{
- perl_plugin->printf_server (perl_plugin,
- "Perl error: wrong parameters for "
- "\"set_config\" function");
+ perl_plugin->print_server (perl_plugin,
+ "Perl error: wrong parameters for "
+ "\"set_config\" function");
XSRETURN_NO;
}
@@ -776,17 +776,17 @@ static XS (XS_weechat_get_plugin_config)
if (!perl_current_script)
{
- perl_plugin->printf_server (perl_plugin,
- "Perl error: unable to get plugin config option, "
- "script not initialized");
+ perl_plugin->print_server (perl_plugin,
+ "Perl error: unable to get plugin config option, "
+ "script not initialized");
XSRETURN_NO;
}
if (items < 1)
{
- perl_plugin->printf_server (perl_plugin,
- "Perl error: wrong parameters for "
- "\"get_plugin_config\" function");
+ perl_plugin->print_server (perl_plugin,
+ "Perl error: wrong parameters for "
+ "\"get_plugin_config\" function");
XSRETURN_NO;
}
@@ -825,17 +825,17 @@ static XS (XS_weechat_set_plugin_config)
if (!perl_current_script)
{
- perl_plugin->printf_server (perl_plugin,
- "Perl error: unable to set plugin config option, "
- "script not initialized");
+ perl_plugin->print_server (perl_plugin,
+ "Perl error: unable to set plugin config option, "
+ "script not initialized");
XSRETURN_NO;
}
if (items < 2)
{
- perl_plugin->printf_server (perl_plugin,
- "Perl error: wrong parameters for "
- "\"set_plugin_config\" function");
+ perl_plugin->print_server (perl_plugin,
+ "Perl error: wrong parameters for "
+ "\"set_plugin_config\" function");
XSRETURN_NO;
}
@@ -870,9 +870,9 @@ static XS (XS_weechat_get_server_info)
if (!perl_current_script)
{
- perl_plugin->printf_server (perl_plugin,
- "Perl error: unable to get server info, "
- "script not initialized");
+ perl_plugin->print_server (perl_plugin,
+ "Perl error: unable to get server info, "
+ "script not initialized");
XSRETURN_EMPTY;
}
@@ -950,17 +950,17 @@ static XS (XS_weechat_get_channel_info)
if (!perl_current_script)
{
- perl_plugin->printf_server (perl_plugin,
- "Perl error: unable to get channel info, "
- "script not initialized");
+ perl_plugin->print_server (perl_plugin,
+ "Perl error: unable to get channel info, "
+ "script not initialized");
XSRETURN_EMPTY;
}
if (items != 1)
{
- perl_plugin->printf_server (perl_plugin,
- "Perl error: wrong parameters for "
- "\"get_channel_info\" function");
+ perl_plugin->print_server (perl_plugin,
+ "Perl error: wrong parameters for "
+ "\"get_channel_info\" function");
XSRETURN_EMPTY;
}
@@ -1018,17 +1018,17 @@ static XS (XS_weechat_get_nick_info)
if (!perl_current_script)
{
- perl_plugin->printf_server (perl_plugin,
- "Perl error: unable to get nick info, "
- "script not initialized");
+ perl_plugin->print_server (perl_plugin,
+ "Perl error: unable to get nick info, "
+ "script not initialized");
XSRETURN_EMPTY;
}
if (items != 2)
{
- perl_plugin->printf_server (perl_plugin,
- "Perl error: wrong parameters for "
- "\"get_nick_info\" function");
+ perl_plugin->print_server (perl_plugin,
+ "Perl error: wrong parameters for "
+ "\"get_nick_info\" function");
XSRETURN_EMPTY;
}
@@ -1122,7 +1122,7 @@ weechat_perl_load (t_weechat_plugin *plugin, char *filename)
char *perl_args[] = { "", "-e", "0" };
#endif
- plugin->printf_server (plugin, "Loading Perl script \"%s\"", filename);
+ plugin->print_server (plugin, "Loading Perl script \"%s\"", filename);
perl_current_script = NULL;
#ifndef MULTIPLICITY
@@ -1135,8 +1135,8 @@ weechat_perl_load (t_weechat_plugin *plugin, char *filename)
if (perl_current_interpreter == NULL)
{
- plugin->printf_server (plugin,
- "Perl error: unable to create new sub-interpreter");
+ plugin->print_server (plugin,
+ "Perl error: unable to create new sub-interpreter");
return 0;
}
@@ -1158,27 +1158,27 @@ weechat_perl_load (t_weechat_plugin *plugin, char *filename)
{
if (eval == 2)
{
- plugin->printf_server (plugin,
- "Perl error: unable to parse file \"%s\"",
- filename);
- plugin->printf_server (plugin,
- "Perl error: %s",
+ plugin->print_server (plugin,
+ "Perl error: unable to parse file \"%s\"",
+ filename);
+ plugin->print_server (plugin,
+ "Perl error: %s",
#ifndef MULTIPLICITY
- SvPV(perl_get_sv("WeechatPerlScriptLoader::weechat_perl_load_eval_file_error", FALSE), len));
+ SvPV(perl_get_sv("WeechatPerlScriptLoader::weechat_perl_load_eval_file_error", FALSE), len));
#else
- SvPV(perl_get_sv("weechat_perl_load_eval_file_error", FALSE), len));
+ SvPV(perl_get_sv("weechat_perl_load_eval_file_error", FALSE), len));
#endif
}
else if ( eval == 1)
{
- plugin->printf_server (plugin,
- "Perl error: unable to run file \"%s\"",
- filename);
+ plugin->print_server (plugin,
+ "Perl error: unable to run file \"%s\"",
+ filename);
}
else {
- plugin->printf_server (plugin,
- "Perl error: unknown error while loading file \"%s\"",
- filename);
+ plugin->print_server (plugin,
+ "Perl error: unknown error while loading file \"%s\"",
+ filename);
}
#ifdef MULTIPLICITY
perl_destruct (perl_current_interpreter);
@@ -1190,11 +1190,12 @@ weechat_perl_load (t_weechat_plugin *plugin, char *filename)
return 0;
}
- if (perl_current_script == NULL) {
- plugin->printf_server (plugin,
- "Perl error: function \"register\" not found "
- "in file \"%s\"",
- filename);
+ if (perl_current_script == NULL)
+ {
+ plugin->print_server (plugin,
+ "Perl error: function \"register\" not found "
+ "in file \"%s\"",
+ filename);
#ifdef MULTIPLICITY
perl_destruct (perl_current_interpreter);
perl_free (perl_current_interpreter);
@@ -1218,9 +1219,9 @@ weechat_perl_load (t_weechat_plugin *plugin, char *filename)
void
weechat_perl_unload (t_weechat_plugin *plugin, t_plugin_script *script)
{
- plugin->printf_server (plugin,
- "Unloading Perl script \"%s\"",
- script->name);
+ plugin->print_server (plugin,
+ "Unloading Perl script \"%s\"",
+ script->name);
#ifndef MULTIPLICITY
eval_pv(script->interpreter, TRUE);
@@ -1255,15 +1256,15 @@ weechat_perl_unload_name (t_weechat_plugin *plugin, char *name)
if (ptr_script)
{
weechat_perl_unload (plugin, ptr_script);
- plugin->printf_server (plugin,
- "Perl script \"%s\" unloaded",
- name);
+ plugin->print_server (plugin,
+ "Perl script \"%s\" unloaded",
+ name);
}
else
{
- plugin->printf_server (plugin,
- "Perl error: script \"%s\" not loaded",
- name);
+ plugin->print_server (plugin,
+ "Perl error: script \"%s\" not loaded",
+ name);
}
}
@@ -1274,13 +1275,13 @@ weechat_perl_unload_name (t_weechat_plugin *plugin, char *name)
void
weechat_perl_unload_all (t_weechat_plugin *plugin)
{
- plugin->printf_server (plugin,
- "Unloading all Perl scripts");
+ plugin->print_server (plugin,
+ "Unloading all Perl scripts");
while (perl_scripts)
weechat_perl_unload (plugin, perl_scripts);
- plugin->printf_server (plugin,
- "Perl scripts unloaded");
+ plugin->print_server (plugin,
+ "Perl scripts unloaded");
}
/*
@@ -1315,26 +1316,26 @@ weechat_perl_cmd (t_weechat_plugin *plugin,
{
case 0:
/* list registered Perl scripts */
- plugin->printf_server (plugin, "");
- plugin->printf_server (plugin, "Registered Perl scripts:");
+ plugin->print_server (plugin, "");
+ plugin->print_server (plugin, "Registered Perl scripts:");
if (perl_scripts)
{
for (ptr_script = perl_scripts;
ptr_script; ptr_script = ptr_script->next_script)
{
- plugin->printf_server (plugin, " %s v%s%s%s",
- ptr_script->name,
- ptr_script->version,
- (ptr_script->description[0]) ? " - " : "",
- ptr_script->description);
+ plugin->print_server (plugin, " %s v%s%s%s",
+ ptr_script->name,
+ ptr_script->version,
+ (ptr_script->description[0]) ? " - " : "",
+ ptr_script->description);
}
}
else
- plugin->printf_server (plugin, " (none)");
+ plugin->print_server (plugin, " (none)");
/* list Perl message handlers */
- plugin->printf_server (plugin, "");
- plugin->printf_server (plugin, "Perl message handlers:");
+ plugin->print_server (plugin, "");
+ plugin->print_server (plugin, "Perl message handlers:");
handler_found = 0;
for (ptr_handler = plugin->handlers;
ptr_handler; ptr_handler = ptr_handler->next_handler)
@@ -1343,17 +1344,17 @@ weechat_perl_cmd (t_weechat_plugin *plugin,
&& (ptr_handler->handler_args))
{
handler_found = 1;
- plugin->printf_server (plugin, " IRC(%s) => Perl(%s)",
- ptr_handler->irc_command,
- ptr_handler->handler_args);
+ plugin->print_server (plugin, " IRC(%s) => Perl(%s)",
+ ptr_handler->irc_command,
+ ptr_handler->handler_args);
}
}
if (!handler_found)
- plugin->printf_server (plugin, " (none)");
+ plugin->print_server (plugin, " (none)");
/* list Perl command handlers */
- plugin->printf_server (plugin, "");
- plugin->printf_server (plugin, "Perl command handlers:");
+ plugin->print_server (plugin, "");
+ plugin->print_server (plugin, "Perl command handlers:");
handler_found = 0;
for (ptr_handler = plugin->handlers;
ptr_handler; ptr_handler = ptr_handler->next_handler)
@@ -1362,13 +1363,13 @@ weechat_perl_cmd (t_weechat_plugin *plugin,
&& (ptr_handler->handler_args))
{
handler_found = 1;
- plugin->printf_server (plugin, " /%s => Perl(%s)",
- ptr_handler->command,
- ptr_handler->handler_args);
+ plugin->print_server (plugin, " /%s => Perl(%s)",
+ ptr_handler->command,
+ ptr_handler->handler_args);
}
}
if (!handler_found)
- plugin->printf_server (plugin, " (none)");
+ plugin->print_server (plugin, " (none)");
break;
case 1:
if (plugin->ascii_strcasecmp (plugin, argv[0], "autoload") == 0)
@@ -1415,14 +1416,14 @@ weechat_perl_cmd (t_weechat_plugin *plugin,
}
else
{
- plugin->printf_server (plugin,
- "Perl error: unknown option for "
- "\"perl\" command");
+ plugin->print_server (plugin,
+ "Perl error: unknown option for "
+ "\"perl\" command");
}
break;
default:
- plugin->printf_server (plugin,
- "Perl error: wrong argument count for \"perl\" command");
+ plugin->print_server (plugin,
+ "Perl error: wrong argument count for \"perl\" command");
}
if (argv)
@@ -1441,18 +1442,18 @@ weechat_plugin_init (t_weechat_plugin *plugin)
perl_plugin = plugin;
#ifdef MULTIPLICITY
- plugin->printf_server (plugin, "Loading Perl module \"weechat\"");
+ plugin->print_server (plugin, "Loading Perl module \"weechat\"");
#else
char *perl_args[] = { "", "-e", "0" };
- plugin->printf_server (plugin, "Loading Perl module \"weechat\" (without multiplicity)");
+ plugin->print_server (plugin, "Loading Perl module \"weechat\" (without multiplicity)");
main_perl = perl_alloc ();
if (!main_perl)
{
- plugin->printf_server (plugin,
- "Perl error: unable to initialize Perl");
+ plugin->print_server (plugin,
+ "Perl error: unable to initialize Perl");
return PLUGIN_RC_KO;
}
@@ -1498,6 +1499,6 @@ weechat_plugin_end (t_weechat_plugin *plugin)
}
#endif
- perl_plugin->printf_server (perl_plugin,
- "Perl plugin ended");
+ perl_plugin->print_server (perl_plugin,
+ "Perl plugin ended");
}
diff --git a/weechat/src/plugins/scripts/python/weechat-python.c b/weechat/src/plugins/scripts/python/weechat-python.c
index 007ed3edc..69169dab0 100644
--- a/weechat/src/plugins/scripts/python/weechat-python.c
+++ b/weechat/src/plugins/scripts/python/weechat-python.c
@@ -66,9 +66,9 @@ weechat_python_exec (t_weechat_plugin *plugin,
if ( !(evFunc && PyCallable_Check (evFunc)) )
{
- plugin->printf_server (plugin,
- "Python error: unable to run function \"%s\"",
- function);
+ plugin->print_server (plugin,
+ "Python error: unable to run function \"%s\"",
+ function);
return PLUGIN_RC_KO;
}
@@ -128,20 +128,20 @@ weechat_python_register (PyObject *self, PyObject *args)
if (!PyArg_ParseTuple (args, "ssss", &name, &version, &shutdown_func, &description))
{
- python_plugin->printf_server (python_plugin,
- "Python error: wrong parameters for "
- "\"register\" function");
+ python_plugin->print_server (python_plugin,
+ "Python error: wrong parameters for "
+ "\"register\" function");
return Py_BuildValue ("i", 0);
}
if (weechat_script_search (python_plugin, &python_scripts, name))
{
/* error: another scripts already exists with this name! */
- python_plugin->printf_server (python_plugin,
- "Python error: unable to register "
- "\"%s\" script (another script "
- "already exists with this name)",
- name);
+ python_plugin->print_server (python_plugin,
+ "Python error: unable to register "
+ "\"%s\" script (another script "
+ "already exists with this name)",
+ name);
return Py_BuildValue ("i", 0);
}
@@ -154,17 +154,17 @@ weechat_python_register (PyObject *self, PyObject *args)
description);
if (python_current_script)
{
- python_plugin->printf_server (python_plugin,
- "Python: registered script \"%s\", "
- "version %s (%s)",
- name, version, description);
+ python_plugin->print_server (python_plugin,
+ "Python: registered script \"%s\", "
+ "version %s (%s)",
+ name, version, description);
}
else
{
- python_plugin->printf_server (python_plugin,
- "Python error: unable to load script "
- "\"%s\" (not enough memory)",
- name);
+ python_plugin->print_server (python_plugin,
+ "Python error: unable to load script "
+ "\"%s\" (not enough memory)",
+ name);
return Py_BuildValue ("i", 0);
}
@@ -185,9 +185,9 @@ weechat_python_print (PyObject *self, PyObject *args)
if (!python_current_script)
{
- python_plugin->printf_server (python_plugin,
- "Python error: unable to print message, "
- "script not initialized");
+ python_plugin->print_server (python_plugin,
+ "Python error: unable to print message, "
+ "script not initialized");
return Py_BuildValue ("i", 0);
}
@@ -197,15 +197,15 @@ weechat_python_print (PyObject *self, PyObject *args)
if (!PyArg_ParseTuple (args, "s|ss", &message, &channel_name, &server_name))
{
- python_plugin->printf_server (python_plugin,
- "Python error: wrong parameters for "
- "\"print\" function");
+ python_plugin->print_server (python_plugin,
+ "Python error: wrong parameters for "
+ "\"print\" function");
return Py_BuildValue ("i", 0);
}
- python_plugin->printf (python_plugin,
- server_name, channel_name,
- "%s", message);
+ python_plugin->print (python_plugin,
+ server_name, channel_name,
+ "%s", message);
return Py_BuildValue ("i", 1);
}
@@ -225,9 +225,9 @@ weechat_python_print_infobar (PyObject *self, PyObject *args)
if (!python_current_script)
{
- python_plugin->printf_server (python_plugin,
- "Python error: unable to print infobar message, "
- "script not initialized");
+ python_plugin->print_server (python_plugin,
+ "Python error: unable to print infobar message, "
+ "script not initialized");
return Py_BuildValue ("i", 0);
}
@@ -236,13 +236,13 @@ weechat_python_print_infobar (PyObject *self, PyObject *args)
if (!PyArg_ParseTuple (args, "is", &delay, &message))
{
- python_plugin->printf_server (python_plugin,
- "Python error: wrong parameters for "
- "\"print_infobar\" function");
+ python_plugin->print_server (python_plugin,
+ "Python error: wrong parameters for "
+ "\"print_infobar\" function");
return Py_BuildValue ("i", 0);
}
- python_plugin->infobar_printf (python_plugin, delay, "%s", message);
+ python_plugin->print_infobar (python_plugin, delay, "%s", message);
return Py_BuildValue ("i", 1);
}
@@ -261,9 +261,9 @@ weechat_python_log (PyObject *self, PyObject *args)
if (!python_current_script)
{
- python_plugin->printf_server (python_plugin,
- "Python error: unable to log message, "
- "script not initialized");
+ python_plugin->print_server (python_plugin,
+ "Python error: unable to log message, "
+ "script not initialized");
return Py_BuildValue ("i", 0);
}
@@ -273,9 +273,9 @@ weechat_python_log (PyObject *self, PyObject *args)
if (!PyArg_ParseTuple (args, "s|ss", &message, &channel_name, &server_name))
{
- python_plugin->printf_server (python_plugin,
- "Python error: wrong parameters for "
- "\"log\" function");
+ python_plugin->print_server (python_plugin,
+ "Python error: wrong parameters for "
+ "\"log\" function");
return Py_BuildValue ("i", 0);
}
@@ -300,9 +300,9 @@ weechat_python_command (PyObject *self, PyObject *args)
if (!python_current_script)
{
- python_plugin->printf_server (python_plugin,
- "Python error: unable to run command, "
- "script not initialized");
+ python_plugin->print_server (python_plugin,
+ "Python error: unable to run command, "
+ "script not initialized");
return Py_BuildValue ("i", 0);
}
@@ -312,9 +312,9 @@ weechat_python_command (PyObject *self, PyObject *args)
if (!PyArg_ParseTuple (args, "s|ss", &command, &channel_name, &server_name))
{
- python_plugin->printf_server (python_plugin,
- "Python error: wrong parameters for "
- "\"command\" function");
+ python_plugin->print_server (python_plugin,
+ "Python error: wrong parameters for "
+ "\"command\" function");
return Py_BuildValue ("i", 0);
}
@@ -339,9 +339,9 @@ weechat_python_add_message_handler (PyObject *self, PyObject *args)
if (!python_current_script)
{
- python_plugin->printf_server (python_plugin,
- "Python error: unable to add message handler, "
- "script not initialized");
+ python_plugin->print_server (python_plugin,
+ "Python error: unable to add message handler, "
+ "script not initialized");
return Py_BuildValue ("i", 0);
}
@@ -350,9 +350,9 @@ weechat_python_add_message_handler (PyObject *self, PyObject *args)
if (!PyArg_ParseTuple (args, "ss", &irc_command, &function))
{
- python_plugin->printf_server (python_plugin,
- "Python error: wrong parameters for "
- "\"add_message_handler\" function");
+ python_plugin->print_server (python_plugin,
+ "Python error: wrong parameters for "
+ "\"add_message_handler\" function");
return Py_BuildValue ("i", 0);
}
@@ -379,9 +379,9 @@ weechat_python_add_command_handler (PyObject *self, PyObject *args)
if (!python_current_script)
{
- python_plugin->printf_server (python_plugin,
- "Python error: unable to add command handler, "
- "script not initialized");
+ python_plugin->print_server (python_plugin,
+ "Python error: unable to add command handler, "
+ "script not initialized");
return Py_BuildValue ("i", 0);
}
@@ -396,9 +396,9 @@ weechat_python_add_command_handler (PyObject *self, PyObject *args)
&description, &arguments, &arguments_description,
completion_template))
{
- python_plugin->printf_server (python_plugin,
- "Python error: wrong parameters for "
- "\"add_command_handler\" function");
+ python_plugin->print_server (python_plugin,
+ "Python error: wrong parameters for "
+ "\"add_command_handler\" function");
return Py_BuildValue ("i", 0);
}
@@ -430,9 +430,9 @@ weechat_python_remove_handler (PyObject *self, PyObject *args)
if (!python_current_script)
{
- python_plugin->printf_server (python_plugin,
- "Python error: unable to remove handler, "
- "script not initialized");
+ python_plugin->print_server (python_plugin,
+ "Python error: unable to remove handler, "
+ "script not initialized");
return Py_BuildValue ("i", 0);
}
@@ -441,9 +441,9 @@ weechat_python_remove_handler (PyObject *self, PyObject *args)
if (!PyArg_ParseTuple (args, "ss", &command, &function))
{
- python_plugin->printf_server (python_plugin,
- "Python error: wrong parameters for "
- "\"remove_handler\" function");
+ python_plugin->print_server (python_plugin,
+ "Python error: wrong parameters for "
+ "\"remove_handler\" function");
return Py_BuildValue ("i", 0);
}
@@ -468,9 +468,9 @@ weechat_python_get_info (PyObject *self, PyObject *args)
if (!python_current_script)
{
- python_plugin->printf_server (python_plugin,
- "Python error: unable to get info, "
- "script not initialized");
+ python_plugin->print_server (python_plugin,
+ "Python error: unable to get info, "
+ "script not initialized");
return Py_BuildValue ("i", 0);
}
@@ -479,9 +479,9 @@ weechat_python_get_info (PyObject *self, PyObject *args)
if (!PyArg_ParseTuple (args, "s|s", &arg, &server_name))
{
- python_plugin->printf_server (python_plugin,
- "Python error: wrong parameters for "
- "\"get_info\" function");
+ python_plugin->print_server (python_plugin,
+ "Python error: wrong parameters for "
+ "\"get_info\" function");
return Py_BuildValue ("i", 0);
}
@@ -519,9 +519,9 @@ weechat_python_get_dcc_info (PyObject *self, PyObject *args)
if (!python_current_script)
{
- python_plugin->printf_server (python_plugin,
- "Python error: unable to get DCC info, "
- "script not initialized");
+ python_plugin->print_server (python_plugin,
+ "Python error: unable to get DCC info, "
+ "script not initialized");
return Py_None;
}
@@ -616,9 +616,9 @@ weechat_python_get_config (PyObject *self, PyObject *args)
if (!python_current_script)
{
- python_plugin->printf_server (python_plugin,
- "Python error: unable to get config option, "
- "script not initialized");
+ python_plugin->print_server (python_plugin,
+ "Python error: unable to get config option, "
+ "script not initialized");
return Py_BuildValue ("i", 0);
}
@@ -626,9 +626,9 @@ weechat_python_get_config (PyObject *self, PyObject *args)
if (!PyArg_ParseTuple (args, "s", &option))
{
- python_plugin->printf_server (python_plugin,
- "Python error: wrong parameters for "
- "\"get_config\" function");
+ python_plugin->print_server (python_plugin,
+ "Python error: wrong parameters for "
+ "\"get_config\" function");
return Py_BuildValue ("i", 0);
}
@@ -661,9 +661,9 @@ weechat_python_set_config (PyObject *self, PyObject *args)
if (!python_current_script)
{
- python_plugin->printf_server (python_plugin,
- "Python error: unable to set config option, "
- "script not initialized");
+ python_plugin->print_server (python_plugin,
+ "Python error: unable to set config option, "
+ "script not initialized");
return Py_BuildValue ("i", 0);
}
@@ -672,9 +672,9 @@ weechat_python_set_config (PyObject *self, PyObject *args)
if (!PyArg_ParseTuple (args, "ss", &option, &value))
{
- python_plugin->printf_server (python_plugin,
- "Python error: wrong parameters for "
- "\"set_config\" function");
+ python_plugin->print_server (python_plugin,
+ "Python error: wrong parameters for "
+ "\"set_config\" function");
return Py_BuildValue ("i", 0);
}
@@ -702,9 +702,9 @@ weechat_python_get_plugin_config (PyObject *self, PyObject *args)
if (!python_current_script)
{
- python_plugin->printf_server (python_plugin,
- "Python error: unable to get plugin config option, "
- "script not initialized");
+ python_plugin->print_server (python_plugin,
+ "Python error: unable to get plugin config option, "
+ "script not initialized");
return Py_BuildValue ("i", 0);
}
@@ -712,9 +712,9 @@ weechat_python_get_plugin_config (PyObject *self, PyObject *args)
if (!PyArg_ParseTuple (args, "s", &option))
{
- python_plugin->printf_server (python_plugin,
- "Python error: wrong parameters for "
- "\"get_plugin_config\" function");
+ python_plugin->print_server (python_plugin,
+ "Python error: wrong parameters for "
+ "\"get_plugin_config\" function");
return Py_BuildValue ("i", 0);
}
@@ -749,9 +749,9 @@ weechat_python_set_plugin_config (PyObject *self, PyObject *args)
if (!python_current_script)
{
- python_plugin->printf_server (python_plugin,
- "Python error: unable to set plugin config option, "
- "script not initialized");
+ python_plugin->print_server (python_plugin,
+ "Python error: unable to set plugin config option, "
+ "script not initialized");
return Py_BuildValue ("i", 0);
}
@@ -760,9 +760,9 @@ weechat_python_set_plugin_config (PyObject *self, PyObject *args)
if (!PyArg_ParseTuple (args, "ss", &option, &value))
{
- python_plugin->printf_server (python_plugin,
- "Python error: wrong parameters for "
- "\"set_plugin_config\" function");
+ python_plugin->print_server (python_plugin,
+ "Python error: wrong parameters for "
+ "\"set_plugin_config\" function");
return Py_BuildValue ("i", 0);
}
@@ -794,9 +794,9 @@ weechat_python_get_server_info (PyObject *self, PyObject *args)
if (!python_current_script)
{
- python_plugin->printf_server (python_plugin,
- "Python error: unable to get server infos, "
- "script not initialized");
+ python_plugin->print_server (python_plugin,
+ "Python error: unable to get server infos, "
+ "script not initialized");
return Py_BuildValue ("i", 0);
}
@@ -897,18 +897,18 @@ weechat_python_get_channel_info (PyObject *self, PyObject *args)
if (!python_current_script)
{
- python_plugin->printf_server (python_plugin,
- "Python error: unable to get channel infos, "
- "script not initialized");
+ python_plugin->print_server (python_plugin,
+ "Python error: unable to get channel infos, "
+ "script not initialized");
return Py_BuildValue ("i", 0);
}
server = NULL;
if (!PyArg_ParseTuple (args, "s", &server))
{
- python_plugin->printf_server (python_plugin,
- "Python error: wrong parameters for "
- "\"get_channel_info\" function");
+ python_plugin->print_server (python_plugin,
+ "Python error: wrong parameters for "
+ "\"get_channel_info\" function");
return Py_BuildValue ("i", 0);
}
@@ -964,9 +964,9 @@ weechat_python_get_nick_info (PyObject *self, PyObject *args)
if (!python_current_script)
{
- python_plugin->printf_server (python_plugin,
- "Python error: unable to get nick infos, "
- "script not initialized");
+ python_plugin->print_server (python_plugin,
+ "Python error: unable to get nick infos, "
+ "script not initialized");
return Py_BuildValue ("i", 0);
}
@@ -974,9 +974,9 @@ weechat_python_get_nick_info (PyObject *self, PyObject *args)
channel = NULL;
if (!PyArg_ParseTuple (args, "ss", &server, &channel))
{
- python_plugin->printf_server (python_plugin,
- "Python error: wrong parameters for "
- "\"get_nick_info\" function");
+ python_plugin->print_server (python_plugin,
+ "Python error: wrong parameters for "
+ "\"get_nick_info\" function");
return Py_BuildValue ("i", 0);
}
@@ -1047,9 +1047,9 @@ weechat_python_output (PyObject *self, PyObject *args)
if (!PyArg_ParseTuple (args, "s", &msg))
{
- python_plugin->printf_server (python_plugin,
- "Python error: unable to get "
- "stdout/stderr message(s)");
+ python_plugin->print_server (python_plugin,
+ "Python error: unable to get "
+ "stdout/stderr message(s)");
return NULL;
}
@@ -1057,8 +1057,8 @@ weechat_python_output (PyObject *self, PyObject *args)
*p = '\0';
if (strlen(msg) > 0)
- python_plugin->printf_server (python_plugin,
- "Python stdin/stdout: %s", msg);
+ python_plugin->print_server (python_plugin,
+ "Python stdin/stdout: %s", msg);
return Py_BuildValue ("i", 1);
}
@@ -1084,13 +1084,13 @@ weechat_python_load (t_weechat_plugin *plugin, char *filename)
PyThreadState *python_current_interpreter;
PyObject *weechat_module, *weechat_outputs, *weechat_dict;
- plugin->printf_server (plugin, "Loading Python script \"%s\"", filename);
+ plugin->print_server (plugin, "Loading Python script \"%s\"", filename);
if ((fp = fopen (filename, "r")) == NULL)
{
- plugin->printf_server (plugin,
- "Python error: unable to open file \"%s\"",
- filename);
+ plugin->print_server (plugin,
+ "Python error: unable to open file \"%s\"",
+ filename);
return 0;
}
@@ -1101,8 +1101,8 @@ weechat_python_load (t_weechat_plugin *plugin, char *filename)
if (python_current_interpreter == NULL)
{
- plugin->printf_server (plugin,
- "Python error: unable to create new sub-interpreter");
+ plugin->print_server (plugin,
+ "Python error: unable to create new sub-interpreter");
fclose (fp);
return 0;
}
@@ -1113,8 +1113,8 @@ weechat_python_load (t_weechat_plugin *plugin, char *filename)
if ( weechat_module == NULL)
{
- plugin->printf_server (plugin,
- "Python error: unable to initialize WeeChat module");
+ plugin->print_server (plugin,
+ "Python error: unable to initialize WeeChat module");
Py_EndInterpreter (python_current_interpreter);
fclose (fp);
return 0;
@@ -1131,26 +1131,26 @@ weechat_python_load (t_weechat_plugin *plugin, char *filename)
weechat_outputs = Py_InitModule("weechatOutputs", weechat_python_output_funcs);
if (weechat_outputs == NULL)
{
- plugin->printf_server (plugin,
- "Python warning: unable to redirect stdout and stderr");
+ plugin->print_server (plugin,
+ "Python warning: unable to redirect stdout and stderr");
}
else
{
if (PySys_SetObject("stdout", weechat_outputs) == -1)
- plugin->printf_server (plugin,
- "Python warning: unable to redirect stdout");
+ plugin->print_server (plugin,
+ "Python warning: unable to redirect stdout");
if (PySys_SetObject("stderr", weechat_outputs) == -1)
- plugin->printf_server (plugin,
- "Python warning: unable to redirect stderr");
+ plugin->print_server (plugin,
+ "Python warning: unable to redirect stderr");
}
python_current_script_filename = strdup (filename);
if (PyRun_SimpleFile (fp, filename) != 0)
{
- plugin->printf_server (plugin,
- "Python error: unable to parse file \"%s\"",
- filename);
+ plugin->print_server (plugin,
+ "Python error: unable to parse file \"%s\"",
+ filename);
free (python_current_script_filename);
Py_EndInterpreter (python_current_interpreter);
fclose (fp);
@@ -1168,10 +1168,10 @@ weechat_python_load (t_weechat_plugin *plugin, char *filename)
if (python_current_script == NULL)
{
- plugin->printf_server (plugin,
- "Python error: function \"register\" not found "
- "in file \"%s\"",
- filename);
+ plugin->print_server (plugin,
+ "Python error: function \"register\" not found "
+ "in file \"%s\"",
+ filename);
Py_EndInterpreter (python_current_interpreter);
return 0;
}
@@ -1188,9 +1188,9 @@ weechat_python_load (t_weechat_plugin *plugin, char *filename)
void
weechat_python_unload (t_weechat_plugin *plugin, t_plugin_script *script)
{
- plugin->printf_server (plugin,
- "Unloading Python script \"%s\"",
- script->name);
+ plugin->print_server (plugin,
+ "Unloading Python script \"%s\"",
+ script->name);
if (script->shutdown_func[0])
weechat_python_exec (plugin, script, script->shutdown_func, "", "");
@@ -1214,15 +1214,15 @@ weechat_python_unload_name (t_weechat_plugin *plugin, char *name)
if (ptr_script)
{
weechat_python_unload (plugin, ptr_script);
- plugin->printf_server (plugin,
- "Python script \"%s\" unloaded",
- name);
+ plugin->print_server (plugin,
+ "Python script \"%s\" unloaded",
+ name);
}
else
{
- plugin->printf_server (plugin,
- "Python error: script \"%s\" not loaded",
- name);
+ plugin->print_server (plugin,
+ "Python error: script \"%s\" not loaded",
+ name);
}
}
@@ -1233,13 +1233,13 @@ weechat_python_unload_name (t_weechat_plugin *plugin, char *name)
void
weechat_python_unload_all (t_weechat_plugin *plugin)
{
- plugin->printf_server (plugin,
- "Unloading all Python scripts");
+ plugin->print_server (plugin,
+ "Unloading all Python scripts");
while (python_scripts)
weechat_python_unload (plugin, python_scripts);
- plugin->printf_server (plugin,
- "Python scripts unloaded");
+ plugin->print_server (plugin,
+ "Python scripts unloaded");
}
/*
@@ -1274,26 +1274,26 @@ weechat_python_cmd (t_weechat_plugin *plugin,
{
case 0:
/* list registered Python scripts */
- plugin->printf_server (plugin, "");
- plugin->printf_server (plugin, "Registered Python scripts:");
+ plugin->print_server (plugin, "");
+ plugin->print_server (plugin, "Registered Python scripts:");
if (python_scripts)
{
for (ptr_script = python_scripts;
ptr_script; ptr_script = ptr_script->next_script)
{
- plugin->printf_server (plugin, " %s v%s%s%s",
- ptr_script->name,
- ptr_script->version,
- (ptr_script->description[0]) ? " - " : "",
- ptr_script->description);
+ plugin->print_server (plugin, " %s v%s%s%s",
+ ptr_script->name,
+ ptr_script->version,
+ (ptr_script->description[0]) ? " - " : "",
+ ptr_script->description);
}
}
else
- plugin->printf_server (plugin, " (none)");
+ plugin->print_server (plugin, " (none)");
/* list Python message handlers */
- plugin->printf_server (plugin, "");
- plugin->printf_server (plugin, "Python message handlers:");
+ plugin->print_server (plugin, "");
+ plugin->print_server (plugin, "Python message handlers:");
handler_found = 0;
for (ptr_handler = plugin->handlers;
ptr_handler; ptr_handler = ptr_handler->next_handler)
@@ -1302,17 +1302,17 @@ weechat_python_cmd (t_weechat_plugin *plugin,
&& (ptr_handler->handler_args))
{
handler_found = 1;
- plugin->printf_server (plugin, " IRC(%s) => Python(%s)",
- ptr_handler->irc_command,
- ptr_handler->handler_args);
+ plugin->print_server (plugin, " IRC(%s) => Python(%s)",
+ ptr_handler->irc_command,
+ ptr_handler->handler_args);
}
}
if (!handler_found)
- plugin->printf_server (plugin, " (none)");
+ plugin->print_server (plugin, " (none)");
/* list Python command handlers */
- plugin->printf_server (plugin, "");
- plugin->printf_server (plugin, "Python command handlers:");
+ plugin->print_server (plugin, "");
+ plugin->print_server (plugin, "Python command handlers:");
handler_found = 0;
for (ptr_handler = plugin->handlers;
ptr_handler; ptr_handler = ptr_handler->next_handler)
@@ -1321,13 +1321,13 @@ weechat_python_cmd (t_weechat_plugin *plugin,
&& (ptr_handler->handler_args))
{
handler_found = 1;
- plugin->printf_server (plugin, " /%s => Python(%s)",
- ptr_handler->command,
- ptr_handler->handler_args);
+ plugin->print_server (plugin, " /%s => Python(%s)",
+ ptr_handler->command,
+ ptr_handler->handler_args);
}
}
if (!handler_found)
- plugin->printf_server (plugin, " (none)");
+ plugin->print_server (plugin, " (none)");
break;
case 1:
if (plugin->ascii_strcasecmp (plugin, argv[0], "autoload") == 0)
@@ -1374,14 +1374,14 @@ weechat_python_cmd (t_weechat_plugin *plugin,
}
else
{
- plugin->printf_server (plugin,
- "Python error: unknown option for "
- "\"python\" command");
+ plugin->print_server (plugin,
+ "Python error: unknown option for "
+ "\"python\" command");
}
break;
default:
- plugin->printf_server (plugin,
- "Python error: wrong argument count for \"python\" command");
+ plugin->print_server (plugin,
+ "Python error: wrong argument count for \"python\" command");
}
if (argv)
@@ -1400,13 +1400,13 @@ weechat_plugin_init (t_weechat_plugin *plugin)
python_plugin = plugin;
- plugin->printf_server (plugin, "Loading Python module \"weechat\"");
+ plugin->print_server (plugin, "Loading Python module \"weechat\"");
Py_Initialize ();
if (Py_IsInitialized () == 0)
{
- plugin->printf_server (plugin,
- "Python error: unable to launch global interpreter");
+ plugin->print_server (plugin,
+ "Python error: unable to launch global interpreter");
return PLUGIN_RC_KO;
}
@@ -1416,8 +1416,8 @@ weechat_plugin_init (t_weechat_plugin *plugin)
if (python_mainThreadState == NULL)
{
- plugin->printf_server (plugin,
- "Python error: unable to get current interpreter state");
+ plugin->print_server (plugin,
+ "Python error: unable to get current interpreter state");
return PLUGIN_RC_KO;
}
@@ -1457,9 +1457,9 @@ weechat_plugin_end (t_weechat_plugin *plugin)
Py_Finalize ();
if (Py_IsInitialized () != 0)
- python_plugin->printf_server (python_plugin,
- "Python error: unable to free interpreter");
+ python_plugin->print_server (python_plugin,
+ "Python error: unable to free interpreter");
- python_plugin->printf_server (python_plugin,
- "Python plugin ended");
+ python_plugin->print_server (python_plugin,
+ "Python plugin ended");
}
diff --git a/weechat/src/plugins/scripts/ruby/weechat-ruby.c b/weechat/src/plugins/scripts/ruby/weechat-ruby.c
index 72b60a564..8ccee76fd 100644
--- a/weechat/src/plugins/scripts/ruby/weechat-ruby.c
+++ b/weechat/src/plugins/scripts/ruby/weechat-ruby.c
@@ -119,9 +119,9 @@ weechat_ruby_exec (t_weechat_plugin *plugin,
rb_str_new2((arguments == NULL) ? "" : arguments));
if (ruby_error)
{
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby error: unable to run function \"%s\"",
- function);
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby error: unable to run function \"%s\"",
+ function);
rb_eval_string_protect("Weechat.print(\"Ruby error: \" + $@.to_s)", NULL);
rb_eval_string_protect("Weechat.print(\"Ruby error: \" + $!.to_s)", NULL);
@@ -163,9 +163,9 @@ weechat_ruby_register (VALUE class, VALUE name, VALUE version,
if (NIL_P (name) || NIL_P (version) || NIL_P (shutdown_func) || NIL_P (description))
{
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby error: wrong parameters for "
- "\"register\" function");
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby error: wrong parameters for "
+ "\"register\" function");
return INT2FIX (0);
}
@@ -182,11 +182,11 @@ weechat_ruby_register (VALUE class, VALUE name, VALUE version,
if (weechat_script_search (ruby_plugin, &ruby_scripts, c_name))
{
/* error: another scripts already exists with this name! */
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby error: unable to register "
- "\"%s\" script (another script "
- "already exists with this name)",
- c_name);
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby error: unable to register "
+ "\"%s\" script (another script "
+ "already exists with this name)",
+ c_name);
return INT2FIX (0);
}
@@ -199,17 +199,17 @@ weechat_ruby_register (VALUE class, VALUE name, VALUE version,
c_description);
if (ruby_current_script)
{
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby: registered script \"%s\", "
- "version %s (%s)",
- c_name, c_version, c_description);
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby: registered script \"%s\", "
+ "version %s (%s)",
+ c_name, c_version, c_description);
}
else
{
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby error: unable to load script "
- "\"%s\" (not enough memory)",
- c_name);
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby error: unable to load script "
+ "\"%s\" (not enough memory)",
+ c_name);
return INT2FIX (0);
}
@@ -231,9 +231,9 @@ weechat_ruby_print (int argc, VALUE *argv, VALUE class)
if (!ruby_current_script)
{
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby error: unable to print message, "
- "script not initialized");
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby error: unable to print message, "
+ "script not initialized");
return INT2FIX (0);
}
@@ -248,9 +248,9 @@ weechat_ruby_print (int argc, VALUE *argv, VALUE class)
if (NIL_P (message))
{
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby error: wrong parameters for "
- "\"print\" function");
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby error: wrong parameters for "
+ "\"print\" function");
return INT2FIX (0);
}
@@ -269,9 +269,9 @@ weechat_ruby_print (int argc, VALUE *argv, VALUE class)
c_server_name = STR2CSTR (server_name);
}
- ruby_plugin->printf (ruby_plugin,
- c_server_name, c_channel_name,
- "%s", c_message);
+ ruby_plugin->print (ruby_plugin,
+ c_server_name, c_channel_name,
+ "%s", c_message);
return INT2FIX (1);
}
@@ -291,9 +291,9 @@ weechat_ruby_print_infobar (VALUE class, VALUE delay, VALUE message)
if (!ruby_current_script)
{
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby error: unable to print infobar message, "
- "script not initialized");
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby error: unable to print infobar message, "
+ "script not initialized");
return INT2FIX (0);
}
@@ -302,9 +302,9 @@ weechat_ruby_print_infobar (VALUE class, VALUE delay, VALUE message)
if (NIL_P (delay) || NIL_P (message))
{
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby error: wrong parameters for "
- "\"print_infobar\" function");
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby error: wrong parameters for "
+ "\"print_infobar\" function");
return INT2FIX (0);
}
@@ -314,7 +314,7 @@ weechat_ruby_print_infobar (VALUE class, VALUE delay, VALUE message)
c_delay = FIX2INT (delay);
c_message = STR2CSTR (message);
- ruby_plugin->infobar_printf (ruby_plugin, c_delay, "%s", c_message);
+ ruby_plugin->print_infobar (ruby_plugin, c_delay, "%s", c_message);
return INT2FIX (1);
}
@@ -334,9 +334,9 @@ weechat_ruby_log (int argc, VALUE *argv, VALUE class)
if (!ruby_current_script)
{
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby error: unable to log message, "
- "script not initialized");
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby error: unable to log message, "
+ "script not initialized");
return INT2FIX (0);
}
@@ -351,9 +351,9 @@ weechat_ruby_log (int argc, VALUE *argv, VALUE class)
if (NIL_P (message))
{
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby error: wrong parameters for "
- "\"log\" function");
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby error: wrong parameters for "
+ "\"log\" function");
return INT2FIX (0);
}
@@ -394,9 +394,9 @@ weechat_ruby_command (int argc, VALUE *argv, VALUE class)
if (!ruby_current_script)
{
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby error: unable to run command, "
- "script not initialized");
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby error: unable to run command, "
+ "script not initialized");
return INT2FIX (0);
}
@@ -411,9 +411,9 @@ weechat_ruby_command (int argc, VALUE *argv, VALUE class)
if (NIL_P (command))
{
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby error: wrong parameters for "
- "\"command\" function");
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby error: wrong parameters for "
+ "\"command\" function");
return INT2FIX (0);
}
@@ -453,9 +453,9 @@ weechat_ruby_add_message_handler (VALUE class, VALUE message, VALUE function)
if (!ruby_current_script)
{
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby error: unable to add message handler, "
- "script not initialized");
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby error: unable to add message handler, "
+ "script not initialized");
return INT2FIX (0);
}
@@ -464,9 +464,9 @@ weechat_ruby_add_message_handler (VALUE class, VALUE message, VALUE function)
if (NIL_P (message) || NIL_P (function))
{
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby error: wrong parameters for "
- "\"add_message_handler\" function");
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby error: wrong parameters for "
+ "\"add_message_handler\" function");
return INT2FIX (0);
}
@@ -501,9 +501,9 @@ weechat_ruby_add_command_handler (int argc, VALUE *argv, VALUE class)
if (!ruby_current_script)
{
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby error: unable to add command handler, "
- "script not initialized");
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby error: unable to add command handler, "
+ "script not initialized");
return INT2FIX (0);
}
@@ -525,7 +525,7 @@ weechat_ruby_add_command_handler (int argc, VALUE *argv, VALUE class)
if (NIL_P (command) || NIL_P (function))
{
- ruby_plugin->printf_server (ruby_plugin,
+ ruby_plugin->print_server (ruby_plugin,
"Ruby error: wrong parameters for "
"\"add_command_handler\" function");
return INT2FIX (0);
@@ -588,9 +588,9 @@ weechat_ruby_remove_handler (VALUE class, VALUE command, VALUE function)
if (!ruby_current_script)
{
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby error: unable to remove handler, "
- "script not initialized");
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby error: unable to remove handler, "
+ "script not initialized");
return INT2FIX (0);
}
@@ -599,9 +599,9 @@ weechat_ruby_remove_handler (VALUE class, VALUE command, VALUE function)
if (NIL_P (command) || NIL_P (function))
{
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby error: wrong parameters for "
- "\"remove_handler\" function");
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby error: wrong parameters for "
+ "\"remove_handler\" function");
return INT2FIX (0);
}
@@ -632,9 +632,9 @@ weechat_ruby_get_info (int argc, VALUE *argv, VALUE class)
if (!ruby_current_script)
{
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby error: unable to get info, "
- "script not initialized");
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby error: unable to get info, "
+ "script not initialized");
return INT2FIX (0);
}
@@ -647,9 +647,9 @@ weechat_ruby_get_info (int argc, VALUE *argv, VALUE class)
if (NIL_P (arg))
{
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby error: wrong parameters for "
- "\"get_info\" function");
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby error: wrong parameters for "
+ "\"get_info\" function");
return INT2FIX (0);
}
@@ -695,9 +695,9 @@ weechat_ruby_get_dcc_info (VALUE class)
if (!ruby_current_script)
{
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby error: unable to get DCC info, "
- "script not initialized");
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby error: unable to get DCC info, "
+ "script not initialized");
return INT2FIX (0);
}
@@ -791,9 +791,9 @@ weechat_ruby_get_config (VALUE class, VALUE option)
if (!ruby_current_script)
{
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby error: unable to get config option, "
- "script not initialized");
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby error: unable to get config option, "
+ "script not initialized");
return INT2FIX (0);
}
@@ -801,9 +801,9 @@ weechat_ruby_get_config (VALUE class, VALUE option)
if (NIL_P (option))
{
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby error: wrong parameters for "
- "\"get_config\" function");
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby error: wrong parameters for "
+ "\"get_config\" function");
return INT2FIX (0);
}
@@ -839,9 +839,9 @@ weechat_ruby_set_config (VALUE class, VALUE option, VALUE value)
if (!ruby_current_script)
{
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby error: unable to set config option, "
- "script not initialized");
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby error: unable to set config option, "
+ "script not initialized");
return INT2FIX (0);
}
@@ -850,9 +850,9 @@ weechat_ruby_set_config (VALUE class, VALUE option, VALUE value)
if (NIL_P (option))
{
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby error: wrong parameters for "
- "\"set_config\" function");
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby error: wrong parameters for "
+ "\"set_config\" function");
return INT2FIX (0);
}
@@ -886,9 +886,9 @@ weechat_ruby_get_plugin_config (VALUE class, VALUE option)
if (!ruby_current_script)
{
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby error: unable to get plugin config option, "
- "script not initialized");
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby error: unable to get plugin config option, "
+ "script not initialized");
return INT2FIX (0);
}
@@ -896,9 +896,9 @@ weechat_ruby_get_plugin_config (VALUE class, VALUE option)
if (NIL_P (option))
{
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby error: wrong parameters for "
- "\"get_plugin_config\" function");
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby error: wrong parameters for "
+ "\"get_plugin_config\" function");
return INT2FIX (0);
}
@@ -936,9 +936,9 @@ weechat_ruby_set_plugin_config (VALUE class, VALUE option, VALUE value)
if (!ruby_current_script)
{
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby error: unable to set plugin config option, "
- "script not initialized");
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby error: unable to set plugin config option, "
+ "script not initialized");
return INT2FIX (0);
}
@@ -947,9 +947,9 @@ weechat_ruby_set_plugin_config (VALUE class, VALUE option, VALUE value)
if (NIL_P (option))
{
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby error: wrong parameters for "
- "\"set_plugin_config\" function");
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby error: wrong parameters for "
+ "\"set_plugin_config\" function");
return INT2FIX (0);
}
@@ -986,9 +986,9 @@ weechat_ruby_get_server_info (VALUE class)
if (!ruby_current_script)
{
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby error: unable to get server infos, "
- "script not initialized");
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby error: unable to get server infos, "
+ "script not initialized");
return INT2FIX (0);
}
@@ -1089,18 +1089,18 @@ weechat_ruby_get_channel_info (VALUE class, VALUE server)
if (!ruby_current_script)
{
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby error: unable to get channel infos, "
- "script not initialized");
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby error: unable to get channel infos, "
+ "script not initialized");
return INT2FIX (0);
}
c_server = NULL;
if (NIL_P (server))
{
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby error: wrong parameters for "
- "\"get_channel_info\" function");
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby error: wrong parameters for "
+ "\"get_channel_info\" function");
return INT2FIX (0);
}
@@ -1162,9 +1162,9 @@ weechat_ruby_get_nick_info (VALUE class, VALUE server, VALUE channel)
if (!ruby_current_script)
{
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby error: unable to get channel infos, "
- "script not initialized");
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby error: unable to get channel infos, "
+ "script not initialized");
return INT2FIX (0);
}
@@ -1172,9 +1172,9 @@ weechat_ruby_get_nick_info (VALUE class, VALUE server, VALUE channel)
c_channel = NULL;
if (NIL_P (server) || NIL_P (channel))
{
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby error: wrong parameters for "
- "\"get_nick_info\" function");
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby error: wrong parameters for "
+ "\"get_nick_info\" function");
return INT2FIX (0);
}
@@ -1230,8 +1230,8 @@ weechat_ruby_output(VALUE self, VALUE str)
*p = '\0';
if (strlen(msg) > 0)
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby stdout/stderr: %s", msg);
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby stdout/stderr: %s", msg);
if (msg)
free (msg);
@@ -1250,7 +1250,7 @@ weechat_ruby_load (t_weechat_plugin *plugin, char *filename)
VALUE curModule, ruby_retcode;
int ruby_error;
- plugin->printf_server (plugin, "Loading Ruby script \"%s\"", filename);
+ plugin->print_server (plugin, "Loading Ruby script \"%s\"", filename);
ruby_current_script = NULL;
snprintf(modname, sizeof(modname), "%s%d", MOD_NAME_PREFIX, modnum);
@@ -1272,21 +1272,21 @@ weechat_ruby_load (t_weechat_plugin *plugin, char *filename)
switch (NUM2INT(ruby_retcode))
{
case 1:
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby error: unable to read file \"%s\"",
- filename);
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby error: unable to read file \"%s\"",
+ filename);
break;
case 2:
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby error: error while loading file \"%s\"",
- filename);
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby error: error while loading file \"%s\"",
+ filename);
break;
case 3:
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby error: unable to find \"weechat_init\" function in file \"%s\"",
- filename);
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby error: unable to find \"weechat_init\" function in file \"%s\"",
+ filename);
break;
}
@@ -1294,8 +1294,8 @@ weechat_ruby_load (t_weechat_plugin *plugin, char *filename)
{
ruby_eval_error = rb_iv_get(curModule, "@load_eval_file_error");
if (ruby_eval_error)
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby error: %s", STR2CSTR(ruby_eval_error));
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby error: %s", STR2CSTR(ruby_eval_error));
}
return 0;
@@ -1305,9 +1305,9 @@ weechat_ruby_load (t_weechat_plugin *plugin, char *filename)
if (ruby_error)
{
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby error: unable to eval weechat_init in file \"%s\"",
- filename);
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby error: unable to eval weechat_init in file \"%s\"",
+ filename);
rb_eval_string_protect("Weechat.print(\"Ruby error: \" + $@.to_s)", NULL);
rb_eval_string_protect("Weechat.print(\"Ruby error: \" + $!.to_s)", NULL);
@@ -1317,10 +1317,10 @@ weechat_ruby_load (t_weechat_plugin *plugin, char *filename)
}
if (ruby_current_script == NULL) {
- plugin->printf_server (plugin,
- "Ruby error: function \"register\" not found "
- "in file \"%s\"",
- filename);
+ plugin->print_server (plugin,
+ "Ruby error: function \"register\" not found "
+ "in file \"%s\"",
+ filename);
return 0;
}
@@ -1337,9 +1337,9 @@ weechat_ruby_load (t_weechat_plugin *plugin, char *filename)
void
weechat_ruby_unload (t_weechat_plugin *plugin, t_plugin_script *script)
{
- plugin->printf_server (plugin,
- "Unloading Ruby script \"%s\"",
- script->name);
+ plugin->print_server (plugin,
+ "Unloading Ruby script \"%s\"",
+ script->name);
if (script->shutdown_func[0])
weechat_ruby_exec (plugin, script, script->shutdown_func, "", "");
@@ -1363,15 +1363,15 @@ weechat_ruby_unload_name (t_weechat_plugin *plugin, char *name)
if (ptr_script)
{
weechat_ruby_unload (plugin, ptr_script);
- plugin->printf_server (plugin,
- "Ruby script \"%s\" unloaded",
- name);
+ plugin->print_server (plugin,
+ "Ruby script \"%s\" unloaded",
+ name);
}
else
{
- plugin->printf_server (plugin,
- "Ruby error: script \"%s\" not loaded",
- name);
+ plugin->print_server (plugin,
+ "Ruby error: script \"%s\" not loaded",
+ name);
}
}
@@ -1383,13 +1383,13 @@ void
weechat_ruby_unload_all (t_weechat_plugin *plugin)
{
- plugin->printf_server (plugin,
- "Unloading all Ruby scripts");
+ plugin->print_server (plugin,
+ "Unloading all Ruby scripts");
while (ruby_scripts)
weechat_ruby_unload (plugin, ruby_scripts);
- plugin->printf_server (plugin,
- "Ruby scripts unloaded");
+ plugin->print_server (plugin,
+ "Ruby scripts unloaded");
}
/*
@@ -1424,26 +1424,26 @@ weechat_ruby_cmd (t_weechat_plugin *plugin,
{
case 0:
/* list registered Ruby scripts */
- plugin->printf_server (plugin, "");
- plugin->printf_server (plugin, "Registered Ruby scripts:");
+ plugin->print_server (plugin, "");
+ plugin->print_server (plugin, "Registered Ruby scripts:");
if (ruby_scripts)
{
for (ptr_script = ruby_scripts;
ptr_script; ptr_script = ptr_script->next_script)
{
- plugin->printf_server (plugin, " %s v%s%s%s",
- ptr_script->name,
- ptr_script->version,
- (ptr_script->description[0]) ? " - " : "",
- ptr_script->description);
+ plugin->print_server (plugin, " %s v%s%s%s",
+ ptr_script->name,
+ ptr_script->version,
+ (ptr_script->description[0]) ? " - " : "",
+ ptr_script->description);
}
}
else
- plugin->printf_server (plugin, " (none)");
+ plugin->print_server (plugin, " (none)");
/* list Ruby message handlers */
- plugin->printf_server (plugin, "");
- plugin->printf_server (plugin, "Ruby message handlers:");
+ plugin->print_server (plugin, "");
+ plugin->print_server (plugin, "Ruby message handlers:");
handler_found = 0;
for (ptr_handler = plugin->handlers;
ptr_handler; ptr_handler = ptr_handler->next_handler)
@@ -1452,17 +1452,17 @@ weechat_ruby_cmd (t_weechat_plugin *plugin,
&& (ptr_handler->handler_args))
{
handler_found = 1;
- plugin->printf_server (plugin, " IRC(%s) => Ruby(%s)",
- ptr_handler->irc_command,
- ptr_handler->handler_args);
+ plugin->print_server (plugin, " IRC(%s) => Ruby(%s)",
+ ptr_handler->irc_command,
+ ptr_handler->handler_args);
}
}
if (!handler_found)
- plugin->printf_server (plugin, " (none)");
+ plugin->print_server (plugin, " (none)");
/* list Ruby command handlers */
- plugin->printf_server (plugin, "");
- plugin->printf_server (plugin, "Ruby command handlers:");
+ plugin->print_server (plugin, "");
+ plugin->print_server (plugin, "Ruby command handlers:");
handler_found = 0;
for (ptr_handler = plugin->handlers;
ptr_handler; ptr_handler = ptr_handler->next_handler)
@@ -1471,13 +1471,13 @@ weechat_ruby_cmd (t_weechat_plugin *plugin,
&& (ptr_handler->handler_args))
{
handler_found = 1;
- plugin->printf_server (plugin, " /%s => Ruby(%s)",
- ptr_handler->command,
- ptr_handler->handler_args);
+ plugin->print_server (plugin, " /%s => Ruby(%s)",
+ ptr_handler->command,
+ ptr_handler->handler_args);
}
}
if (!handler_found)
- plugin->printf_server (plugin, " (none)");
+ plugin->print_server (plugin, " (none)");
break;
case 1:
if (plugin->ascii_strcasecmp (plugin, argv[0], "autoload") == 0)
@@ -1524,14 +1524,14 @@ weechat_ruby_cmd (t_weechat_plugin *plugin,
}
else
{
- plugin->printf_server (plugin,
- "Ruby error: unknown option for "
- "\"ruby\" command");
+ plugin->print_server (plugin,
+ "Ruby error: unknown option for "
+ "\"ruby\" command");
}
break;
default:
- plugin->printf_server (plugin,
- "Ruby error: wrong argument count for \"ruby\" command");
+ plugin->print_server (plugin,
+ "Ruby error: wrong argument count for \"ruby\" command");
}
if (argv)
@@ -1593,7 +1593,7 @@ weechat_plugin_init (t_weechat_plugin *plugin)
ruby_plugin = plugin;
ruby_error = 0;
- plugin->printf_server (plugin, "Loading Ruby module \"weechat\"");
+ plugin->print_server (plugin, "Loading Ruby module \"weechat\"");
ruby_init ();
ruby_init_loadpath ();
@@ -1643,10 +1643,10 @@ weechat_plugin_init (t_weechat_plugin *plugin)
rb_eval_string_protect(weechat_ruby_code, &ruby_error);
if (ruby_error) {
VALUE ruby_error_info = rb_inspect(ruby_errinfo);
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby error: unable to eval weechat ruby internal code");
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby error: %s", STR2CSTR(ruby_error_info));
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby error: unable to eval weechat ruby internal code");
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby error: %s", STR2CSTR(ruby_error_info));
return PLUGIN_RC_KO;
}
@@ -1668,6 +1668,6 @@ weechat_plugin_end (t_weechat_plugin *plugin)
ruby_finalize();
- ruby_plugin->printf_server (ruby_plugin,
- "Ruby plugin ended");
+ ruby_plugin->print_server (ruby_plugin,
+ "Ruby plugin ended");
}
diff --git a/weechat/src/plugins/weechat-plugin.h b/weechat/src/plugins/weechat-plugin.h
index b4523f5d1..727d57215 100644
--- a/weechat/src/plugins/weechat-plugin.h
+++ b/weechat/src/plugins/weechat-plugin.h
@@ -198,11 +198,9 @@ struct t_weechat_plugin
void (*exec_on_files) (t_weechat_plugin *, char *,
int (*)(t_weechat_plugin *, char *));
- void (*printf) (t_weechat_plugin *, char *, char *, char *, ...);
- void (*printf_server) (t_weechat_plugin *, char *, ...);
- void (*infobar_printf) (t_weechat_plugin *, int, char *, ...);
-
- void (*log) (t_weechat_plugin *, char *, char *, char *, ...);
+ void (*print) (t_weechat_plugin *, char *, char *, char *, ...);
+ void (*print_server) (t_weechat_plugin *, char *, ...);
+ void (*print_infobar) (t_weechat_plugin *, int, char *, ...);
t_plugin_handler *(*msg_handler_add) (t_weechat_plugin *, char *,
t_plugin_handler_func *,
@@ -230,6 +228,8 @@ struct t_weechat_plugin
t_plugin_nick_info *(*get_nick_info) (t_weechat_plugin *, char*, char*);
void (*free_nick_info) (t_weechat_plugin *, t_plugin_nick_info *);
+ void (*log) (t_weechat_plugin *, char *, char *, char *, ...);
+
/* WeeChat developers: ALWAYS add new functions at the end */
};
@@ -243,9 +243,9 @@ extern void weechat_plugin_exec_on_files (t_weechat_plugin *, char *,
int (*)(t_weechat_plugin *, char *));
/* display functions */
-extern void weechat_plugin_printf (t_weechat_plugin *, char *, char *, char *, ...);
-extern void weechat_plugin_printf_server (t_weechat_plugin *, char *, ...);
-extern void weechat_plugin_infobar_printf (t_weechat_plugin *, int, char *, ...);
+extern void weechat_plugin_print (t_weechat_plugin *, char *, char *, char *, ...);
+extern void weechat_plugin_print_server (t_weechat_plugin *, char *, ...);
+extern void weechat_plugin_print_infobar (t_weechat_plugin *, int, char *, ...);
/* log functions */
extern void weechat_plugin_log (t_weechat_plugin *, char *, char *, char *, ...);