mirror of
https://github.com/weechat/weechat.git
synced 2026-06-25 04:16:38 +02:00
Compare commits
17 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7e988871ab | |||
| 8a1650b26f | |||
| 51c3e0b9ec | |||
| ae89d28462 | |||
| 54151a3480 | |||
| 66ec959001 | |||
| c7bd1bca8b | |||
| ca80d4fae7 | |||
| 8c78abe2c0 | |||
| 729bdbf5e3 | |||
| 6b2e9847a9 | |||
| 4e74ad3107 | |||
| 80621129f7 | |||
| 4806d7f20f | |||
| 89084850a5 | |||
| 06e2a1bb25 | |||
| 906c6ebb61 |
@@ -11,7 +11,7 @@ Sébastien Helleu <flashcode@flashtux.org> <flashcode>
|
||||
Sébastien Helleu <flashcode@flashtux.org> <uid67137>
|
||||
Nils Görs <weechatter@arcor.de>
|
||||
Ryuunosuke Ayanokouzi <i38w7i3@yahoo.co.jp>
|
||||
Krzysztof Korościk <soltys@szluug.org>
|
||||
Krzysztof Korościk <soltys1@gmail.com>
|
||||
Marco Paolone <marcopaolone@gmail.com>
|
||||
<marcopaolone@gmail.com> <marco@DrB4tch.sitecomwl601>
|
||||
<mikaela.suomalainen@outlook.com> <mkaysi@outlook.com>
|
||||
|
||||
@@ -94,6 +94,7 @@ Alphabetically:
|
||||
* Tom Alsberg
|
||||
* Tor Hveem (xt)
|
||||
* Valentin Lorentz (progval)
|
||||
* Vasco Almeida
|
||||
* Voroskoi
|
||||
* Yannick Palanque
|
||||
|
||||
|
||||
+8
-4
@@ -21,6 +21,7 @@ https://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes]
|
||||
[[1.5_features]]
|
||||
=== New features
|
||||
|
||||
* core: add Portuguese translations
|
||||
* core: change default value of option weechat.look.nick_color_hash to "djb2"
|
||||
* core: fix nick coloring when stop chars and a forced color are used: first
|
||||
remove chars then look for forced color
|
||||
@@ -31,10 +32,13 @@ https://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes]
|
||||
(issue #262)
|
||||
* core: move irc bar item "away" to core, move options
|
||||
"irc.look.item_away_message" and "irc.color.item_away" to core (issue #692)
|
||||
* api: add support of functions in hook_process
|
||||
* api: add pointer in callbacks used in scripting API (issue #406)
|
||||
* irc: add option irc.network.sasl_fail_unavailable (issue #600, issue #697)
|
||||
* irc: add multiple targets and support of "-server" in command /ctcp
|
||||
(issue #204, issue #493)
|
||||
* lua: fix crash when a lua function doesn't return a value and a string was
|
||||
expected (issue #718)
|
||||
* ruby: add detection of Ruby 2.3 (issue #698)
|
||||
* trigger: add "recover" in default triggers cmd_pass/msg_auth, and "regain"
|
||||
in default trigger "msg_auth" (issue #511)
|
||||
@@ -45,7 +49,7 @@ https://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes]
|
||||
* core: check that pointers received in arguments are not NULL in buffers and
|
||||
windows functions
|
||||
* core: fix truncation of buffer names in hotlist (issue #668)
|
||||
* core: fix update of window title under tmux (issue #685)
|
||||
* core: fix update of window title under Tmux (issue #685)
|
||||
* core: fix detection of Python shared libraries (issue #676)
|
||||
* api: fix number of arguments returned by function string_split() when
|
||||
keep_eol is 2 and the string ends with separators
|
||||
@@ -112,7 +116,7 @@ https://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes]
|
||||
* core: fix memory leak when using multiple "-d" or "-r" in command line
|
||||
arguments
|
||||
* core: don't complain any more about "tmux" and "tmux-256color" $TERM values
|
||||
when WeeChat is running under tmux (issue #519)
|
||||
when WeeChat is running under Tmux (issue #519)
|
||||
* core: fix truncated messages after a word with a length of zero on screen
|
||||
(for example a zero width space: U+200B) (bug #40985, issue #502)
|
||||
* api: fix handle of invalid escape in function string_convert_escaped_chars()
|
||||
@@ -454,7 +458,7 @@ https://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes]
|
||||
|
||||
* core: add terabyte unit for size displayed
|
||||
* core: display a warning on startup if $TERM does not start with "screen"
|
||||
under screen/tmux
|
||||
under Screen/Tmux
|
||||
* core: add option weechat.color.status_nicklist_count (issue #109,
|
||||
issue #110)
|
||||
* core: add option "env" in command /set (manage environment variables)
|
||||
@@ -2615,7 +2619,7 @@ https://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes]
|
||||
* fix refresh bug (too many refresh) when terminal is resized
|
||||
* fix nicklist display bugs when on top or bottom of chat window
|
||||
* fix --disable-plugins option in configure script
|
||||
* fix high CPU usage when running under a screen that has been killed
|
||||
* fix high CPU usage when running under a Screen that has been killed
|
||||
|
||||
[[0.1.8]]
|
||||
== Version 0.1.8 (2006-03-18)
|
||||
|
||||
+1
-1
@@ -58,7 +58,7 @@ solaris*)
|
||||
esac
|
||||
|
||||
# Gettext
|
||||
ALL_LINGUAS="cs de es fr hu it ja pl pt_BR ru tr"
|
||||
ALL_LINGUAS="cs de es fr hu it ja pl pt pt_BR ru tr"
|
||||
AM_GNU_GETTEXT
|
||||
AM_GNU_GETTEXT_VERSION([0.18])
|
||||
|
||||
|
||||
@@ -83,7 +83,8 @@ $ git clone https://github.com/weechat/weechat.git
|
||||
$ cd weechat
|
||||
----
|
||||
|
||||
NOTE: Um auf den aktuellen Stand zu kommen verwendest Du z.B. "`git pull`" in
|
||||
[NOTE]
|
||||
Um auf den aktuellen Stand zu kommen verwendest Du z.B. "`git pull`" in
|
||||
diesem Ordner.
|
||||
|
||||
Ansonsten kannst Du das 'Entwickler-Paket' herunterladen und entpacken:
|
||||
|
||||
@@ -2282,7 +2282,9 @@ WeeChat unterstützt eine SASL Authentifikation, mittels verschiedener Mechanism
|
||||
* 'ecdsa-nist256p-challenge': Abgleich von öffentlichem/privatem Schlüssel
|
||||
* 'external': SSL Zertifikat welches auf Client Seite vorliegt
|
||||
* 'dh-blowfish': Passwort wird mittels blowfish verschlüsselt
|
||||
(*unsicher*, wird nicht empfohlen)
|
||||
* 'dh-aes': Passwort wird mittels AES verschlüsselt
|
||||
(*unsicher*, wird nicht empfohlen)
|
||||
|
||||
[NOTE]
|
||||
Die "gcrypt" Bibliothek wird beim kompilieren von WeeChat benötigt um
|
||||
|
||||
@@ -7517,8 +7517,8 @@ struct t_hook *weechat_hook_process (const char *command,
|
||||
|
||||
Arguments:
|
||||
|
||||
* 'command': command to launch in child process or URL _(WeeChat ≥ 0.3.7)_
|
||||
(see below)
|
||||
* 'command': command to launch in child process, URL _(WeeChat ≥ 0.3.7)_ or
|
||||
function _(WeeChat ≥ 1.5)_ (see below)
|
||||
* 'timeout': timeout for command (in milliseconds): after this timeout, child
|
||||
process is killed (0 means no timeout)
|
||||
* 'callback': function called when data from child is available, or when child
|
||||
@@ -7533,13 +7533,16 @@ Arguments:
|
||||
**** '2': transfer error
|
||||
**** '3': not enough memory
|
||||
**** '4': error with a file
|
||||
*** '< 0': 'WEECHAT_HOOK_PROCESS_RUNNING' (data available, but child still
|
||||
running) or 'WEECHAT_HOOK_PROCESS_ERROR' (error when launching command)
|
||||
*** '< 0':
|
||||
**** 'WEECHAT_HOOK_PROCESS_RUNNING': data available, but child still running)
|
||||
**** 'WEECHAT_HOOK_PROCESS_ERROR': error when launching command
|
||||
**** 'WEECHAT_HOOK_PROCESS_CHILD': callback is called in the child process
|
||||
** 'out': standard output of command (stdout)
|
||||
** 'err': error output of command (stderr)
|
||||
** return value:
|
||||
*** 'WEECHAT_RC_OK'
|
||||
*** 'WEECHAT_RC_ERROR'
|
||||
*** child process return code (in case of function with "func:" in command)
|
||||
* 'callback_pointer': pointer given to callback when it is called by WeeChat
|
||||
* 'callback_data': pointer given to callback when it is called by WeeChat;
|
||||
if not NULL, it must have been allocated with malloc (or similar function)
|
||||
@@ -7552,9 +7555,18 @@ Return value:
|
||||
When command has ended, or if timeout is reached, WeeChat will automatically
|
||||
unhook (and kill process if it is still running).
|
||||
|
||||
The command can be an URL with format: "url:http://www.example.com", to download
|
||||
content of URL _(WeeChat ≥ 0.3.7)_. Options are possible for URL with
|
||||
function <<_hook_process_hashtable,weechat_hook_process_hashtable>>.
|
||||
The command can be an URL with format: "url:http://www.example.com",
|
||||
to download content of URL _(WeeChat ≥ 0.3.7)_. Options are possible for URL
|
||||
with function <<_hook_process_hashtable,weechat_hook_process_hashtable>>.
|
||||
|
||||
The command can also be a function name with format: "func:name", to execute
|
||||
the function "name" _(WeeChat ≥ 1.5)_. This function receives a single argument
|
||||
('data') and must return a string, which is sent to the callback. +
|
||||
In C API, the callback is called with the return code set to
|
||||
'WEECHAT_HOOK_PROCESS_CHILD', which means the callback is running in the child
|
||||
process (after fork). +
|
||||
In scripting API, the function 'name' is called directly and its result
|
||||
(string) is sent to the callback (like the output of an external command).
|
||||
|
||||
[TIP]
|
||||
If you want to retrieve infos about WeeChat (like current stable version,
|
||||
@@ -7575,6 +7587,7 @@ C example:
|
||||
|
||||
[source,C]
|
||||
----
|
||||
/* example with an external command */
|
||||
int
|
||||
my_process_cb (const void *pointer, void *data, const char *command,
|
||||
int return_code, const char *out, const char *err)
|
||||
@@ -7605,6 +7618,52 @@ my_process_cb (const void *pointer, void *data, const char *command,
|
||||
|
||||
struct t_hook *my_process_hook = weechat_hook_process ("ls", 5000,
|
||||
&my_process_cb, NULL, NULL);
|
||||
|
||||
/* example with the callback called in the child process */
|
||||
int
|
||||
my_process_cb (const void *pointer, void *data, const char *command,
|
||||
int return_code, const char *out, const char *err)
|
||||
{
|
||||
if (return_code == WEECHAT_HOOK_PROCESS_CHILD)
|
||||
{
|
||||
/* do something blocking... */
|
||||
/* ... */
|
||||
|
||||
/* the stdout will be sent as "out" in the parent callback */
|
||||
printf ("this is the result");
|
||||
|
||||
/* return code of the process */
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (return_code == WEECHAT_HOOK_PROCESS_ERROR)
|
||||
{
|
||||
weechat_printf (NULL, "Error with command '%s'", command);
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
if (return_code >= 0)
|
||||
{
|
||||
weechat_printf (NULL, "return_code = %d", return_code);
|
||||
}
|
||||
|
||||
if (out)
|
||||
{
|
||||
weechat_printf (NULL, "stdout: %s", out);
|
||||
}
|
||||
|
||||
if (err)
|
||||
{
|
||||
weechat_printf (NULL, "stderr: %s", err);
|
||||
}
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
}
|
||||
|
||||
struct t_hook *my_process_hook = weechat_hook_process ("func:get_status", 5000,
|
||||
&my_process_cb, NULL, NULL);
|
||||
----
|
||||
|
||||
Script (Python):
|
||||
@@ -7614,7 +7673,7 @@ Script (Python):
|
||||
# prototype
|
||||
hook = weechat.hook_process(command, timeout, callback, callback_data)
|
||||
|
||||
# example
|
||||
# example with an external command
|
||||
def my_process_cb(data, command, return_code, out, err):
|
||||
if return_code == weechat.WEECHAT_HOOK_PROCESS_ERROR:
|
||||
weechat.prnt("", "Error with command '%s'" % command)
|
||||
@@ -7628,6 +7687,26 @@ def my_process_cb(data, command, return_code, out, err):
|
||||
return weechat.WEECHAT_RC_OK
|
||||
|
||||
hook = weechat.hook_process("ls", 5000, "my_process_cb", "")
|
||||
|
||||
# example with a script function
|
||||
def get_status(data):
|
||||
# do something blocking...
|
||||
# ...
|
||||
return "this is the result"
|
||||
|
||||
def my_process_cb(data, command, return_code, out, err):
|
||||
if return_code == weechat.WEECHAT_HOOK_PROCESS_ERROR:
|
||||
weechat.prnt("", "Error with command '%s'" % command)
|
||||
return weechat.WEECHAT_RC_OK
|
||||
if return_code >= 0:
|
||||
weechat.prnt("", "return_code = %d" % return_code)
|
||||
if out != "":
|
||||
weechat.prnt("", "stdout: %s" % out)
|
||||
if err != "":
|
||||
weechat.prnt("", "stderr: %s" % err)
|
||||
return weechat.WEECHAT_RC_OK
|
||||
|
||||
hook = weechat.hook_process("func:get_status", 5000, "my_process_cb", "")
|
||||
----
|
||||
|
||||
==== hook_process_hashtable
|
||||
|
||||
@@ -71,7 +71,8 @@ $ git clone https://github.com/weechat/weechat.git
|
||||
$ cd weechat
|
||||
----
|
||||
|
||||
NOTE: Later, you can run "`git pull`" in this directory, to get deltas with
|
||||
[NOTE]
|
||||
Later, you can run "`git pull`" in this directory, to get deltas with
|
||||
the latest updates.
|
||||
|
||||
Otherwise you can download and unpack 'devel' package:
|
||||
|
||||
@@ -2229,8 +2229,8 @@ WeeChat supports SASL authentication, using different mechanisms:
|
||||
* 'plain': plain text password (default)
|
||||
* 'ecdsa-nist256p-challenge': challenge with public/private key
|
||||
* 'external': client side SSL cert
|
||||
* 'dh-blowfish': blowfish encrypted password
|
||||
* 'dh-aes': AES encrypted password
|
||||
* 'dh-blowfish': blowfish encrypted password (*insecure*, not recommended)
|
||||
* 'dh-aes': AES encrypted password (*insecure*, not recommended)
|
||||
|
||||
[NOTE]
|
||||
The "gcrypt" library is required when compiling WeeChat in order to use
|
||||
|
||||
@@ -7654,8 +7654,8 @@ struct t_hook *weechat_hook_process (const char *command,
|
||||
|
||||
Paramètres :
|
||||
|
||||
* 'command' : commande à lancer dans le processus fils ou URL
|
||||
_(WeeChat ≥ 0.3.7)_ (voir ci-dessous)
|
||||
* 'command' : commande à lancer dans le processus fils, URL _(WeeChat ≥ 0.3.7)_
|
||||
ou fonction _(WeeChat ≥ 1.5)_ (voir ci-dessous)
|
||||
* 'timeout' : timeout pour la commande (en millisecondes) : après ce délai, le
|
||||
processus fils est tué (0 signifie pas de limite)
|
||||
* 'callback' : fonction appelée quand des données du fils sont disponibles, or
|
||||
@@ -7671,14 +7671,19 @@ Paramètres :
|
||||
**** '2' : erreur de transfert
|
||||
**** '3' : pas assez de mémoire
|
||||
**** '4' : erreur avec un fichier
|
||||
*** '< 0' : 'WEECHAT_HOOK_PROCESS_RUNNING' (données disponibles, mais le
|
||||
fils tourne toujours) ou 'WEECHAT_HOOK_PROCESS_ERROR' (erreur en lançant
|
||||
la commande)
|
||||
*** '< 0' :
|
||||
**** 'WEECHAT_HOOK_PROCESS_RUNNING' : données disponibles, mais le fils tourne
|
||||
toujours
|
||||
**** 'WEECHAT_HOOK_PROCESS_ERROR' : erreur en lançant la commande
|
||||
**** 'WEECHAT_HOOK_PROCESS_CHILD': le "callback" est appelé dans le processus
|
||||
fils
|
||||
** 'out' : sortie standard de la commande (stdout)
|
||||
** 'err' : erreurs de la commande (stderr)
|
||||
** valeur de retour :
|
||||
*** 'WEECHAT_RC_OK'
|
||||
*** 'WEECHAT_RC_ERROR'
|
||||
*** code retour du processus fils (dans le cas d'une fonction avec "func:" dans
|
||||
la commande)
|
||||
* 'callback_pointer' : pointeur donné au "callback" lorsqu'il est appelé par
|
||||
WeeChat
|
||||
* 'callback_data' : pointeur donné au "callback" lorsqu'il est appelé par
|
||||
@@ -7699,6 +7704,17 @@ pour télécharger le contenu de l'URL _(WeeChat ≥ 0.3.7)_.
|
||||
Des options pour l'URL sont possibles avec la fonction
|
||||
<<_hook_process_hashtable,weechat_hook_process_hashtable>>.
|
||||
|
||||
La commande peut aussi être le nom d'une fonction avec le format : "func:nom",
|
||||
pour exécuter la fonction "nom" _(WeeChat ≥ 1.5)_. Cette fonction reçoit un
|
||||
paramètre ('data') et doit retourner une chaîne de caractères, qui sera envoyée
|
||||
au "callback". +
|
||||
Dans l'API C, le "callback" est appelé avec le code retour qui vaut
|
||||
'WEECHAT_HOOK_PROCESS_CHILD', cela signifie que le "callback" tourne dans le
|
||||
processus fils (après le fork). +
|
||||
Dans l'API script, la fonction 'nom' est appelée directement et le résultat
|
||||
(chaîne de caractères) est envoyé au "callback" (comme la sortie d'une commande
|
||||
externe).
|
||||
|
||||
[TIP]
|
||||
Si vous souhaitez récupérer des infos à propos de WeeChat (comme la version
|
||||
stable actuelle, le dernier commit git, etc...), vous pouvez utiliser les URLs
|
||||
@@ -7720,6 +7736,7 @@ Exemple en C :
|
||||
|
||||
[source,C]
|
||||
----
|
||||
/* exemple avec une commande externe */
|
||||
int
|
||||
my_process_cb (const void *pointer, void *data, const char *command,
|
||||
int return_code, const char *out, const char *err)
|
||||
@@ -7750,6 +7767,52 @@ my_process_cb (const void *pointer, void *data, const char *command,
|
||||
|
||||
struct t_hook *my_process_hook = weechat_hook_process ("ls", 5000,
|
||||
&my_process_cb, NULL, NULL);
|
||||
|
||||
/* exemple avec le "callback" appelé dans le processus fils */
|
||||
int
|
||||
my_process_cb (const void *pointer, void *data, const char *command,
|
||||
int return_code, const char *out, const char *err)
|
||||
{
|
||||
if (return_code == WEECHAT_HOOK_PROCESS_CHILD)
|
||||
{
|
||||
/* faire quelque chose de bloquant... */
|
||||
/* ... */
|
||||
|
||||
/* la sortie "stdout" sera envoyée comme "out" au "callback" parent */
|
||||
printf ("ceci est le résultat");
|
||||
|
||||
/* code retour du processus */
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (return_code == WEECHAT_HOOK_PROCESS_ERROR)
|
||||
{
|
||||
weechat_printf (NULL, "Erreur avec la commande '%s'", command);
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
if (return_code >= 0)
|
||||
{
|
||||
weechat_printf (NULL, "return_code = %d", return_code);
|
||||
}
|
||||
|
||||
if (out)
|
||||
{
|
||||
weechat_printf (NULL, "stdout : %s", out);
|
||||
}
|
||||
|
||||
if (err)
|
||||
{
|
||||
weechat_printf (NULL, "stderr : %s", err);
|
||||
}
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
}
|
||||
|
||||
struct t_hook *my_process_hook = weechat_hook_process ("func:get_status", 5000,
|
||||
&my_process_cb, NULL, NULL);
|
||||
----
|
||||
|
||||
Script (Python) :
|
||||
@@ -7759,7 +7822,7 @@ Script (Python) :
|
||||
# prototype
|
||||
hook = weechat.hook_process(command, timeout, callback, callback_data)
|
||||
|
||||
# exemple
|
||||
# exemple avec une commande externe
|
||||
def my_process_cb(data, command, return_code, out, err):
|
||||
if return_code == weechat.WEECHAT_HOOK_PROCESS_ERROR:
|
||||
weechat.prnt("", "Erreur avec la commande '%s'" % command)
|
||||
@@ -7773,6 +7836,26 @@ def my_process_cb(data, command, return_code, out, err):
|
||||
return weechat.WEECHAT_RC_OK
|
||||
|
||||
hook = weechat.hook_process("ls", 5000, "my_process_cb", "")
|
||||
|
||||
# exemple avec une fonction du script
|
||||
def get_status(data):
|
||||
# faire quelque chose de bloquant...
|
||||
# ...
|
||||
return "ceci est le résultat"
|
||||
|
||||
def my_process_cb(data, command, return_code, out, err):
|
||||
if return_code == weechat.WEECHAT_HOOK_PROCESS_ERROR:
|
||||
weechat.prnt("", "Erreur avec la commande '%s'" % command)
|
||||
return weechat.WEECHAT_RC_OK
|
||||
if return_code >= 0:
|
||||
weechat.prnt("", "return_code = %d" % return_code)
|
||||
if out != "":
|
||||
weechat.prnt("", "stdout : %s" % out)
|
||||
if err != "":
|
||||
weechat.prnt("", "stderr : %s" % err)
|
||||
return weechat.WEECHAT_RC_OK
|
||||
|
||||
hook = weechat.hook_process("func:get_status", 5000, "my_process_cb", "")
|
||||
----
|
||||
|
||||
==== hook_process_hashtable
|
||||
|
||||
@@ -75,8 +75,9 @@ $ git clone https://github.com/weechat/weechat.git
|
||||
$ cd weechat
|
||||
----
|
||||
|
||||
NOTE : Plus tard, vous pourrez utiliser la commande "`git pull`" dans ce
|
||||
répertoire pour obtenir juste les deltas avec la version d'aujourd'hui.
|
||||
[NOTE]
|
||||
Plus tard, vous pourrez utiliser la commande "`git pull`" dans ce répertoire
|
||||
pour obtenir juste les deltas avec la version d'aujourd'hui.
|
||||
|
||||
Sinon vous pouvez installer le paquet 'devel' :
|
||||
|
||||
|
||||
@@ -2306,8 +2306,8 @@ mécanismes :
|
||||
* 'plain' : mot de passe en clair (par défaut)
|
||||
* 'ecdsa-nist256p-challenge' : challenge avec clé publique/privée
|
||||
* 'external' : certificat SSL côté client
|
||||
* 'dh-blowfish' : mot de passe chiffré avec blowfish
|
||||
* 'dh-aes' : mot de passe chiffré avec AES
|
||||
* 'dh-blowfish' : mot de passe chiffré avec blowfish (*non sûr*, non recommandé)
|
||||
* 'dh-aes' : mot de passe chiffré avec AES (*non sûr*, non recommandé)
|
||||
|
||||
[NOTE]
|
||||
La librairie "gcrypt" est requise lors de la compilation de WeeChat pour
|
||||
|
||||
@@ -7718,8 +7718,9 @@ struct t_hook *weechat_hook_process (const char *command,
|
||||
|
||||
Argomenti:
|
||||
|
||||
* 'command': comando da avviare nel processo figlio o URL
|
||||
_(WeeChat ≥ 0.3.7)_, segue:
|
||||
// TRANSLATION MISSING
|
||||
* 'command': command to launch in child process, URL _(WeeChat ≥ 0.3.7)_ or
|
||||
function _(WeeChat ≥ 1.5)_ (see below)
|
||||
* 'timeout': timeout per il comando (in millisecondi): dopo questo timeout,
|
||||
il processo figlio viene terminato (0 indica nessun timeout)
|
||||
* 'callback': funzione chiamata quando i dati dal processo figlio sono disponibili,
|
||||
@@ -7735,14 +7736,19 @@ Argomenti:
|
||||
**** '2': errore di trasferimento
|
||||
**** '3': memoria non sufficiente
|
||||
**** '4': errore con un file
|
||||
*** '< 0': 'WEECHAT_HOOK_PROCESS_RUNNING' (dati disponibili, ma figlio
|
||||
ancora in esecuzione) o 'WEECHAT_HOOK_PROCESS_ERROR' (errore nella
|
||||
esecuzione del comando)
|
||||
*** '< 0':
|
||||
**** 'WEECHAT_HOOK_PROCESS_RUNNING': dati disponibili, ma figlio ancora in
|
||||
esecuzione)
|
||||
**** 'WEECHAT_HOOK_PROCESS_ERROR': errore nella esecuzione del comando
|
||||
// TRANSLATION MISSING
|
||||
**** 'WEECHAT_HOOK_PROCESS_CHILD': callback is called in the child process
|
||||
** 'out': output standard del comando (stdout)
|
||||
** 'err': output di errore del comando (stderr)
|
||||
** valore restituito:
|
||||
*** 'WEECHAT_RC_OK'
|
||||
*** 'WEECHAT_RC_ERROR'
|
||||
// TRANSLATION MISSING
|
||||
*** child process return code (in case of function with "func:" in command)
|
||||
* 'callback_pointer': puntatore fornito alla callback quando chiamata da WeeChat
|
||||
// TRANSLATION MISSING
|
||||
* 'callback_data': puntatore fornito alla callback quando chiamata da WeeChat;
|
||||
@@ -7761,6 +7767,16 @@ scaricare il contenuto dell'URL _(WeeChat ≥ 0.3.7)_. Le opzioni per
|
||||
un URL sono disponibili con la funzione
|
||||
<<_hook_process_hashtable,weechat_hook_process_hashtable>>.
|
||||
|
||||
// TRANSLATION MISSING
|
||||
The command can also be a function name with format: "func:name", to execute
|
||||
the function "name" _(WeeChat ≥ 1.5)_. This function receives a single argument
|
||||
('data') and must return a string, which is sent to the callback. +
|
||||
In C API, the callback is called with the return code set to
|
||||
'WEECHAT_HOOK_PROCESS_CHILD', which means the callback is running in the child
|
||||
process (after fork). +
|
||||
In scripting API, the function 'name' is called directly and its result
|
||||
(string) is sent to the callback (like the output of an external command).
|
||||
|
||||
// TRANSLATION MISSING
|
||||
[TIP]
|
||||
If you want to retrieve infos about WeeChat (like current stable version,
|
||||
@@ -7782,6 +7798,7 @@ Esempio in C:
|
||||
|
||||
[source,C]
|
||||
----
|
||||
/* example with an external command */
|
||||
int
|
||||
my_process_cb (const void *pointer, void *data, const char *command,
|
||||
int return_code, const char *out, const char *err)
|
||||
@@ -7812,6 +7829,52 @@ my_process_cb (const void *pointer, void *data, const char *command,
|
||||
|
||||
struct t_hook *my_process_hook = weechat_hook_process ("ls", 5000,
|
||||
&my_process_cb, NULL, NULL);
|
||||
|
||||
/* example with the callback called in the child process */
|
||||
int
|
||||
my_process_cb (const void *pointer, void *data, const char *command,
|
||||
int return_code, const char *out, const char *err)
|
||||
{
|
||||
if (return_code == WEECHAT_HOOK_PROCESS_CHILD)
|
||||
{
|
||||
/* do something blocking... */
|
||||
/* ... */
|
||||
|
||||
/* the stdout will be sent as "out" in the parent callback */
|
||||
printf ("this is the result");
|
||||
|
||||
/* return code of the process */
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (return_code == WEECHAT_HOOK_PROCESS_ERROR)
|
||||
{
|
||||
weechat_printf (NULL, "Error with command '%s'", command);
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
if (return_code >= 0)
|
||||
{
|
||||
weechat_printf (NULL, "return_code = %d", return_code);
|
||||
}
|
||||
|
||||
if (out)
|
||||
{
|
||||
weechat_printf (NULL, "stdout: %s", out);
|
||||
}
|
||||
|
||||
if (err)
|
||||
{
|
||||
weechat_printf (NULL, "stderr: %s", err);
|
||||
}
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
}
|
||||
|
||||
struct t_hook *my_process_hook = weechat_hook_process ("func:get_status", 5000,
|
||||
&my_process_cb, NULL, NULL);
|
||||
----
|
||||
|
||||
Script (Python):
|
||||
@@ -7821,7 +7884,7 @@ Script (Python):
|
||||
# prototipo
|
||||
hook = weechat.hook_process(command, timeout, callback, callback_data)
|
||||
|
||||
# esempio
|
||||
# example with an external command
|
||||
def my_process_cb(data, command, return_code, out, err):
|
||||
if return_code == weechat.WEECHAT_HOOK_PROCESS_ERROR:
|
||||
weechat.prnt("", "Error with command '%s'" % command)
|
||||
@@ -7835,6 +7898,26 @@ def my_process_cb(data, command, return_code, out, err):
|
||||
return weechat.WEECHAT_RC_OK
|
||||
|
||||
hook = weechat.hook_process("ls", 5000, "my_process_cb", "")
|
||||
|
||||
# example with a script function
|
||||
def get_status(data):
|
||||
# do something blocking...
|
||||
# ...
|
||||
return "this is the result"
|
||||
|
||||
def my_process_cb(data, command, return_code, out, err):
|
||||
if return_code == weechat.WEECHAT_HOOK_PROCESS_ERROR:
|
||||
weechat.prnt("", "Error with command '%s'" % command)
|
||||
return weechat.WEECHAT_RC_OK
|
||||
if return_code >= 0:
|
||||
weechat.prnt("", "return_code = %d" % return_code)
|
||||
if out != "":
|
||||
weechat.prnt("", "stdout: %s" % out)
|
||||
if err != "":
|
||||
weechat.prnt("", "stderr: %s" % err)
|
||||
return weechat.WEECHAT_RC_OK
|
||||
|
||||
hook = weechat.hook_process("func:get_status", 5000, "my_process_cb", "")
|
||||
----
|
||||
|
||||
==== hook_process_hashtable
|
||||
|
||||
@@ -80,8 +80,9 @@ $ git clone https://github.com/weechat/weechat.git
|
||||
$ cd weechat
|
||||
----
|
||||
|
||||
NOTA: In seguito, si può eseguire "`git pull`" in questa directory per
|
||||
ricevere gli ultimi aggiornamenti.
|
||||
[NOTE]
|
||||
In seguito, si può eseguire "`git pull`" in questa directory per ricevere gli
|
||||
ultimi aggiornamenti.
|
||||
|
||||
Altrimenti si può scaricare ed estrarre il pacchetto 'devel':
|
||||
|
||||
|
||||
@@ -2350,9 +2350,9 @@ WeeChat supports SASL authentication, using different mechanisms:
|
||||
* 'ecdsa-nist256p-challenge': challenge with public/private key
|
||||
* 'external': certificato SSL da lato client
|
||||
// TRANSLATION MISSING
|
||||
* 'dh-blowfish': blowfish encrypted password
|
||||
* 'dh-blowfish': blowfish encrypted password (*insecure*, not recommended)
|
||||
// TRANSLATION MISSING
|
||||
* 'dh-aes': AES encrypted password
|
||||
* 'dh-aes': AES encrypted password (*insecure*, not recommended)
|
||||
|
||||
[NOTE]
|
||||
La libreria "gcrypt" è richiesta per compilare WeeChat al fine di usare il
|
||||
|
||||
@@ -7515,8 +7515,9 @@ struct t_hook *weechat_hook_process (const char *command,
|
||||
|
||||
引数:
|
||||
|
||||
* 'command': 子プロセスで実行するコマンドまたは
|
||||
URL _(WeeChat バージョン 0.3.7 以上で利用可)_ (以下を参照)
|
||||
// TRANSLATION MISSING
|
||||
* 'command': command to launch in child process, URL _(WeeChat ≥ 0.3.7)_ or
|
||||
function _(WeeChat ≥ 1.5)_ (see below)
|
||||
* 'timeout': コマンドのタイムアウト (ミリ秒):
|
||||
このタイムアウトを過ぎたら、子プロセスを kill します (タイムアウトさせない場合は 0)
|
||||
* 'callback':
|
||||
@@ -7531,13 +7532,20 @@ struct t_hook *weechat_hook_process (const char *command,
|
||||
**** '2': 転送エラー
|
||||
**** '3': メモリ不足
|
||||
**** '4': ファイルに関するエラー
|
||||
*** '< 0': 'WEECHAT_HOOK_PROCESS_RUNNING' (データは利用可能だが子プロセスは終了していない)
|
||||
または 'WEECHAT_HOOK_PROCESS_ERROR' (コマンドの実行中にエラー)
|
||||
*** '< 0':
|
||||
// TRANSLATION MISSING
|
||||
**** 'WEECHAT_HOOK_PROCESS_RUNNING': data available, but child still running)
|
||||
// TRANSLATION MISSING
|
||||
**** 'WEECHAT_HOOK_PROCESS_ERROR': error when launching command
|
||||
// TRANSLATION MISSING
|
||||
**** 'WEECHAT_HOOK_PROCESS_CHILD': callback is called in the child process
|
||||
** 'out': コマンドの標準出力 (stdout)
|
||||
** 'err': コマンドの標準エラー出力 (stderr)
|
||||
** 戻り値:
|
||||
*** 'WEECHAT_RC_OK'
|
||||
*** 'WEECHAT_RC_ERROR'
|
||||
// TRANSLATION MISSING
|
||||
*** child process return code (in case of function with "func:" in command)
|
||||
* 'callback_pointer': WeeChat が 'callback' コールバックを呼び出す際にコールバックに渡すポインタ
|
||||
* 'callback_data': WeeChat が 'callback' コールバックを呼び出す際にコールバックに渡すポインタ;
|
||||
このポインタが NULL でない場合、このポインタは malloc (または類似の関数)
|
||||
@@ -7554,6 +7562,16 @@ struct t_hook *weechat_hook_process (const char *command,
|
||||
の内容がダウンロードされます _(WeeChat バージョン 0.3.7 以上で利用可)_ 。<<_hook_process_hashtable,weechat_hook_process_hashtable>>
|
||||
関数を使えば URL に対してオプションを与えることもできます。
|
||||
|
||||
// TRANSLATION MISSING
|
||||
The command can also be a function name with format: "func:name", to execute
|
||||
the function "name" _(WeeChat ≥ 1.5)_. This function receives a single argument
|
||||
('data') and must return a string, which is sent to the callback. +
|
||||
In C API, the callback is called with the return code set to
|
||||
'WEECHAT_HOOK_PROCESS_CHILD', which means the callback is running in the child
|
||||
process (after fork). +
|
||||
In scripting API, the function 'name' is called directly and its result
|
||||
(string) is sent to the callback (like the output of an external command).
|
||||
|
||||
[TIP]
|
||||
WeeChat に関する情報 (例えば現在の安定版、最新の git コミット、...)
|
||||
が欲しい場合、https://weechat.org/dev/info に書かれている URL を使ってください
|
||||
@@ -7573,6 +7591,7 @@ C 言語での使用例:
|
||||
|
||||
[source,C]
|
||||
----
|
||||
/* example with an external command */
|
||||
int
|
||||
my_process_cb (const void *pointer, void *data, const char *command,
|
||||
int return_code, const char *out, const char *err)
|
||||
@@ -7603,6 +7622,52 @@ my_process_cb (const void *pointer, void *data, const char *command,
|
||||
|
||||
struct t_hook *my_process_hook = weechat_hook_process ("ls", 5000,
|
||||
&my_process_cb, NULL, NULL);
|
||||
|
||||
/* example with the callback called in the child process */
|
||||
int
|
||||
my_process_cb (const void *pointer, void *data, const char *command,
|
||||
int return_code, const char *out, const char *err)
|
||||
{
|
||||
if (return_code == WEECHAT_HOOK_PROCESS_CHILD)
|
||||
{
|
||||
/* do something blocking... */
|
||||
/* ... */
|
||||
|
||||
/* the stdout will be sent as "out" in the parent callback */
|
||||
printf ("this is the result");
|
||||
|
||||
/* return code of the process */
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (return_code == WEECHAT_HOOK_PROCESS_ERROR)
|
||||
{
|
||||
weechat_printf (NULL, "Error with command '%s'", command);
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
|
||||
if (return_code >= 0)
|
||||
{
|
||||
weechat_printf (NULL, "return_code = %d", return_code);
|
||||
}
|
||||
|
||||
if (out)
|
||||
{
|
||||
weechat_printf (NULL, "stdout: %s", out);
|
||||
}
|
||||
|
||||
if (err)
|
||||
{
|
||||
weechat_printf (NULL, "stderr: %s", err);
|
||||
}
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
}
|
||||
}
|
||||
|
||||
struct t_hook *my_process_hook = weechat_hook_process ("func:get_status", 5000,
|
||||
&my_process_cb, NULL, NULL);
|
||||
----
|
||||
|
||||
スクリプト (Python) での使用例:
|
||||
@@ -7612,7 +7677,7 @@ struct t_hook *my_process_hook = weechat_hook_process ("ls", 5000,
|
||||
# プロトタイプ
|
||||
hook = weechat.hook_process(command, timeout, callback, callback_data)
|
||||
|
||||
# 例
|
||||
# example with an external command
|
||||
def my_process_cb(data, command, return_code, out, err):
|
||||
if return_code == weechat.WEECHAT_HOOK_PROCESS_ERROR:
|
||||
weechat.prnt("", "Error with command '%s'" % command)
|
||||
@@ -7626,6 +7691,26 @@ def my_process_cb(data, command, return_code, out, err):
|
||||
return weechat.WEECHAT_RC_OK
|
||||
|
||||
hook = weechat.hook_process("ls", 5000, "my_process_cb", "")
|
||||
|
||||
# example with a script function
|
||||
def get_status(data):
|
||||
# do something blocking...
|
||||
# ...
|
||||
return "this is the result"
|
||||
|
||||
def my_process_cb(data, command, return_code, out, err):
|
||||
if return_code == weechat.WEECHAT_HOOK_PROCESS_ERROR:
|
||||
weechat.prnt("", "Error with command '%s'" % command)
|
||||
return weechat.WEECHAT_RC_OK
|
||||
if return_code >= 0:
|
||||
weechat.prnt("", "return_code = %d" % return_code)
|
||||
if out != "":
|
||||
weechat.prnt("", "stdout: %s" % out)
|
||||
if err != "":
|
||||
weechat.prnt("", "stderr: %s" % err)
|
||||
return weechat.WEECHAT_RC_OK
|
||||
|
||||
hook = weechat.hook_process("func:get_status", 5000, "my_process_cb", "")
|
||||
----
|
||||
|
||||
==== hook_process_hashtable
|
||||
|
||||
@@ -73,7 +73,8 @@ $ git clone https://github.com/weechat/weechat.git
|
||||
$ cd weechat
|
||||
----
|
||||
|
||||
注意: clone の後、このディレクトリ内で "`git pull`"
|
||||
[NOTE]
|
||||
clone の後、このディレクトリ内で "`git pull`"
|
||||
を実行すれば、最新のアップデートとの差分が更新されます。
|
||||
|
||||
他の方法として 'devel' パッケージをダウンロードして展開する方法があります:
|
||||
|
||||
@@ -2228,8 +2228,8 @@ WeeChat は SASL 認証をサポートします、以下の認証メカニズム
|
||||
* 'plain': 平文パスワード (デフォルト)
|
||||
* 'ecdsa-nist256p-challenge': 公開鍵/秘密鍵を使うチャレンジ認証
|
||||
* 'external': クライアント側 SSL 証明書
|
||||
* 'dh-blowfish': blowfish 暗号パスワード
|
||||
* 'dh-aes': AES 暗号パスワード
|
||||
* 'dh-blowfish': blowfish 暗号パスワード (*危険* 、非推奨)
|
||||
* 'dh-aes': AES 暗号パスワード (*危険* 、非推奨)
|
||||
|
||||
[NOTE]
|
||||
"dh-blowfish" メカニズムを利用する場合、"gcrypt" ライブラリが
|
||||
|
||||
@@ -91,7 +91,7 @@ $HOME/.weechat/weechat.log::
|
||||
|
||||
Autorem tej strony pomocy Sébastien Helleu <flashcode@flashtux.org>.
|
||||
|
||||
Tłumaczenie Krzysztof Korościk <soltys@szluug.org>.
|
||||
Tłumaczenie Krzysztof Korościk <soltys1@gmail.com>.
|
||||
|
||||
== PRAWA AUTORSKIE
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
Tłumaczenie:
|
||||
|
||||
* Krzysztof Korościk <soltys@szluug.org>, 2009-2016
|
||||
* Krzysztof Korościk <soltys1@gmail.com>, 2009-2016
|
||||
|
||||
[NOTE]
|
||||
Ten dokument jest napisany dla WeeChat w wersji ≥ 0.3.0, ale powinien być używany
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
Tłumaczenie:
|
||||
|
||||
* Krzysztof Korościk <soltys@szluug.org>, 2009-2016
|
||||
* Krzysztof Korościk <soltys1@gmail.com>, 2009-2016
|
||||
|
||||
|
||||
[[start]]
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
Tłumaczenie:
|
||||
|
||||
* Krzysztof Korościk <soltys@szluug.org>, 2009-2016
|
||||
* Krzysztof Korościk <soltys1@gmail.com>, 2009-2016
|
||||
|
||||
|
||||
Ten dokument opisuje klienta rozmów WeeChat, który jest częścią WeeChat.
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
Tłumaczenie:
|
||||
|
||||
* Krzysztof Korościk <soltys@szluug.org>, 2009-2016
|
||||
* Krzysztof Korościk <soltys1@gmail.com>, 2009-2016
|
||||
|
||||
|
||||
[[purpose]]
|
||||
@@ -76,7 +76,8 @@ $ git clone https://github.com/weechat/weechat.git
|
||||
$ cd weechat
|
||||
----
|
||||
|
||||
UWAGA: Później możesz wykonać w tym katalogu "`git pull`", aby pobrać najnowsze
|
||||
[NOTE]
|
||||
Później możesz wykonać w tym katalogu "`git pull`", aby pobrać najnowsze
|
||||
poprawki.
|
||||
|
||||
Oczywiście możesz pobrać paczkę oznaczoną jako 'devel':
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
Tłumaczenie:
|
||||
|
||||
* Krzysztof Korościk <soltys@szluug.org>, 2009-2016
|
||||
* Krzysztof Korościk <soltys1@gmail.com>, 2009-2016
|
||||
|
||||
|
||||
Ten dokument opisuje klienta rozmów WeeChat, będącego częścią WeeChat.
|
||||
@@ -2249,8 +2249,12 @@ WeeChat wspiera uwierzytelnianie SASL, używając różnych mechanizmów:
|
||||
* 'plain': hasło w czystym tekście (domyślne)
|
||||
* 'ecdsa-nist256p-challenge': klucz prywatny/publiczny
|
||||
* 'external': certyfikat SSL po stronie klienta
|
||||
// TRANSLATION MISSING
|
||||
* 'dh-blowfish': hasło zaszyfrowane algorytmem blowfish
|
||||
(*insecure*, not recommended)
|
||||
// TRANSLATION MISSING
|
||||
* 'dh-aes': hasło zaszyfrowane algorytmem AES
|
||||
(*insecure*, not recommended)
|
||||
|
||||
[NOTE]
|
||||
Biblioteka "gcrypt" jest wymagana podczas kompilacji WeeChat w celu dodania
|
||||
|
||||
@@ -26,6 +26,7 @@ set(PO_FILES
|
||||
it.po
|
||||
ja.po
|
||||
pl.po
|
||||
pt.po
|
||||
pt_BR.po
|
||||
ru.po
|
||||
tr.po
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (C) 2009-2016 Krzysztof Koroscik <soltys@szluug.org>
|
||||
# Copyright (C) 2009-2016 Krzysztof Koroscik <soltys1@gmail.com>
|
||||
# Copyright (C) 2010 B.J. Stobiecki <bartek@stobiecki.eu>
|
||||
#
|
||||
# This file is part of WeeChat, the extensible chat client.
|
||||
@@ -23,7 +23,7 @@ msgstr ""
|
||||
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
|
||||
"POT-Creation-Date: 2016-04-04 14:36+0200\n"
|
||||
"PO-Revision-Date: 2016-03-17 20:43+0100\n"
|
||||
"Last-Translator: Krzysztof Korościk <soltys@szluug.org>\n"
|
||||
"Last-Translator: Krzysztof Korościk <soltys1@gmail.com>\n"
|
||||
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
|
||||
"Language: pl\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
|
||||
+51
-1
@@ -76,6 +76,8 @@ int real_delete_pending = 0; /* 1 if some hooks must be deleted */
|
||||
|
||||
struct pollfd *hook_fd_pollfd = NULL; /* file descriptors for poll() */
|
||||
int hook_fd_pollfd_count = 0; /* number of file descriptors */
|
||||
int hook_process_pending = 0; /* 1 if there are some process to */
|
||||
/* run (via fork) */
|
||||
|
||||
|
||||
void hook_process_run (struct t_hook *hook_process);
|
||||
@@ -1405,6 +1407,8 @@ hook_fd_exec ()
|
||||
|
||||
/* perform the poll() */
|
||||
timeout = hook_timer_get_time_to_next ();
|
||||
if (hook_process_pending)
|
||||
timeout = 0;
|
||||
ready = poll (hook_fd_pollfd, num_fd, timeout);
|
||||
if (ready <= 0)
|
||||
return;
|
||||
@@ -1547,7 +1551,10 @@ hook_process_hashtable (struct t_weechat_plugin *plugin,
|
||||
new_hook_process->timeout);
|
||||
}
|
||||
|
||||
hook_process_run (new_hook);
|
||||
if (strncmp (new_hook_process->command, "func:", 5) == 0)
|
||||
hook_process_pending = 1;
|
||||
else
|
||||
hook_process_run (new_hook);
|
||||
|
||||
return new_hook;
|
||||
|
||||
@@ -1656,6 +1663,16 @@ hook_process_child (struct t_hook *hook_process)
|
||||
}
|
||||
rc = weeurl_download (ptr_url, HOOK_PROCESS(hook_process, options));
|
||||
}
|
||||
else if (strncmp (HOOK_PROCESS(hook_process, command), "func:", 5) == 0)
|
||||
{
|
||||
/* run a function (via the hook callback) */
|
||||
rc = (int) (HOOK_PROCESS(hook_process, callback))
|
||||
(hook_process->callback_pointer,
|
||||
hook_process->callback_data,
|
||||
HOOK_PROCESS(hook_process, command),
|
||||
WEECHAT_HOOK_PROCESS_CHILD,
|
||||
NULL, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* launch command */
|
||||
@@ -2142,6 +2159,39 @@ error:
|
||||
unhook (hook_process);
|
||||
}
|
||||
|
||||
/*
|
||||
* Executes all process commands pending.
|
||||
*/
|
||||
|
||||
void
|
||||
hook_process_exec ()
|
||||
{
|
||||
struct t_hook *ptr_hook, *next_hook;
|
||||
|
||||
hook_exec_start ();
|
||||
|
||||
ptr_hook = weechat_hooks[HOOK_TYPE_PROCESS];
|
||||
while (ptr_hook)
|
||||
{
|
||||
next_hook = ptr_hook->next_hook;
|
||||
|
||||
if (!ptr_hook->deleted
|
||||
&& !ptr_hook->running
|
||||
&& (HOOK_PROCESS(ptr_hook, child_pid) == 0))
|
||||
{
|
||||
ptr_hook->running = 1;
|
||||
hook_process_run (ptr_hook);
|
||||
ptr_hook->running = 0;
|
||||
}
|
||||
|
||||
ptr_hook = next_hook;
|
||||
}
|
||||
|
||||
hook_exec_end ();
|
||||
|
||||
hook_process_pending = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Hooks a connection to a peer (using fork).
|
||||
*
|
||||
|
||||
@@ -505,6 +505,7 @@ extern struct t_hook *hook_process_hashtable (struct t_weechat_plugin *plugin,
|
||||
t_hook_callback_process *callback,
|
||||
const void *callback_pointer,
|
||||
void *callback_data);
|
||||
extern void hook_process_exec ();
|
||||
extern struct t_hook *hook_connect (struct t_weechat_plugin *plugin,
|
||||
const char *proxy, const char *address,
|
||||
int port, int ipv6, int retry,
|
||||
|
||||
@@ -422,6 +422,9 @@ gui_main_loop ()
|
||||
|
||||
/* execute fd hooks */
|
||||
hook_fd_exec ();
|
||||
|
||||
/* run process (with fork) */
|
||||
hook_process_exec ();
|
||||
}
|
||||
|
||||
/* remove keyboard hook */
|
||||
|
||||
@@ -2171,14 +2171,33 @@ weechat_guile_api_hook_process_cb (const void *pointer, void *data,
|
||||
{
|
||||
struct t_plugin_script *script;
|
||||
void *func_argv[5];
|
||||
char empty_arg[1] = { '\0' };
|
||||
char empty_arg[1] = { '\0' }, *result;
|
||||
const char *ptr_function, *ptr_data;
|
||||
int *rc, ret;
|
||||
|
||||
script = (struct t_plugin_script *)pointer;
|
||||
plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
|
||||
|
||||
if (ptr_function && ptr_function[0])
|
||||
if (return_code == WEECHAT_HOOK_PROCESS_CHILD)
|
||||
{
|
||||
if (strncmp (command, "func:", 5) == 0)
|
||||
{
|
||||
func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
|
||||
|
||||
result = (char *) weechat_guile_exec (script,
|
||||
WEECHAT_SCRIPT_EXEC_STRING,
|
||||
command + 5,
|
||||
"s", func_argv);
|
||||
if (result)
|
||||
{
|
||||
printf ("%s", result);
|
||||
free (result);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
else if (ptr_function && ptr_function[0])
|
||||
{
|
||||
func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
|
||||
func_argv[1] = (command) ? (char *)command : empty_arg;
|
||||
|
||||
@@ -2085,14 +2085,33 @@ weechat_js_api_hook_process_cb (const void *pointer, void *data,
|
||||
{
|
||||
struct t_plugin_script *script;
|
||||
void *func_argv[5];
|
||||
char empty_arg[1] = { '\0' };
|
||||
char empty_arg[1] = { '\0' }, *result;
|
||||
const char *ptr_function, *ptr_data;
|
||||
int *rc, ret;
|
||||
|
||||
script = (struct t_plugin_script *)pointer;
|
||||
plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
|
||||
|
||||
if (ptr_function && ptr_function[0])
|
||||
if (return_code == WEECHAT_HOOK_PROCESS_CHILD)
|
||||
{
|
||||
if (strncmp (command, "func:", 5) == 0)
|
||||
{
|
||||
func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
|
||||
|
||||
result = (char *) weechat_js_exec (script,
|
||||
WEECHAT_SCRIPT_EXEC_STRING,
|
||||
command + 5,
|
||||
"s", func_argv);
|
||||
if (result)
|
||||
{
|
||||
printf ("%s", result);
|
||||
free (result);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
else if (ptr_function && ptr_function[0])
|
||||
{
|
||||
func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
|
||||
func_argv[1] = (command) ? (char *)command : empty_arg;
|
||||
|
||||
@@ -215,7 +215,7 @@ weechat_js_exec (struct t_plugin_script *script,
|
||||
if ((ret_type == WEECHAT_SCRIPT_EXEC_STRING) && (ret_js->IsString()))
|
||||
{
|
||||
v8::String::Utf8Value temp_str(ret_js);
|
||||
ret_value = *temp_str;
|
||||
ret_value = (*temp_str) ? strdup(*temp_str) : NULL;
|
||||
}
|
||||
else if ((ret_type == WEECHAT_SCRIPT_EXEC_INT) && (ret_js->IsInt32()))
|
||||
{
|
||||
|
||||
@@ -2268,14 +2268,33 @@ weechat_lua_api_hook_process_cb (const void *pointer, void *data,
|
||||
{
|
||||
struct t_plugin_script *script;
|
||||
void *func_argv[5];
|
||||
char empty_arg[1] = { '\0' };
|
||||
char empty_arg[1] = { '\0' }, *result;
|
||||
const char *ptr_function, *ptr_data;
|
||||
int *rc, ret;
|
||||
|
||||
script = (struct t_plugin_script *)pointer;
|
||||
plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
|
||||
|
||||
if (ptr_function && ptr_function[0])
|
||||
if (return_code == WEECHAT_HOOK_PROCESS_CHILD)
|
||||
{
|
||||
if (strncmp (command, "func:", 5) == 0)
|
||||
{
|
||||
func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
|
||||
|
||||
result = (char *) weechat_lua_exec (script,
|
||||
WEECHAT_SCRIPT_EXEC_STRING,
|
||||
command + 5,
|
||||
"s", func_argv);
|
||||
if (result)
|
||||
{
|
||||
printf ("%s", result);
|
||||
free (result);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
else if (ptr_function && ptr_function[0])
|
||||
{
|
||||
func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
|
||||
func_argv[1] = (command) ? (char *)command : empty_arg;
|
||||
|
||||
@@ -204,7 +204,19 @@ weechat_lua_exec (struct t_plugin_script *script, int ret_type,
|
||||
{
|
||||
if (ret_type == WEECHAT_SCRIPT_EXEC_STRING)
|
||||
{
|
||||
ret_value = strdup ((char *) lua_tostring (lua_current_interpreter, -1));
|
||||
ret_value = (char *) lua_tostring (lua_current_interpreter, -1);
|
||||
if (ret_value)
|
||||
{
|
||||
ret_value = strdup (ret_value);
|
||||
}
|
||||
else
|
||||
{
|
||||
weechat_printf (NULL,
|
||||
weechat_gettext ("%s%s: function \"%s\" must "
|
||||
"return a valid value"),
|
||||
weechat_prefix ("error"), LUA_PLUGIN_NAME,
|
||||
function);
|
||||
}
|
||||
}
|
||||
else if (ret_type == WEECHAT_SCRIPT_EXEC_INT)
|
||||
{
|
||||
|
||||
@@ -2198,14 +2198,33 @@ weechat_perl_api_hook_process_cb (const void *pointer, void *data,
|
||||
{
|
||||
struct t_plugin_script *script;
|
||||
void *func_argv[5];
|
||||
char empty_arg[1] = { '\0' };
|
||||
char empty_arg[1] = { '\0' }, *result;
|
||||
const char *ptr_function, *ptr_data;
|
||||
int *rc, ret;
|
||||
|
||||
script = (struct t_plugin_script *)pointer;
|
||||
plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
|
||||
|
||||
if (ptr_function && ptr_function[0])
|
||||
if (return_code == WEECHAT_HOOK_PROCESS_CHILD)
|
||||
{
|
||||
if (strncmp (command, "func:", 5) == 0)
|
||||
{
|
||||
func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
|
||||
|
||||
result = (char *) weechat_perl_exec (script,
|
||||
WEECHAT_SCRIPT_EXEC_STRING,
|
||||
command + 5,
|
||||
"s", func_argv);
|
||||
if (result)
|
||||
{
|
||||
printf ("%s", result);
|
||||
free (result);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
else if (ptr_function && ptr_function[0])
|
||||
{
|
||||
func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
|
||||
func_argv[1] = (command) ? (char *)command : empty_arg;
|
||||
|
||||
@@ -2208,14 +2208,33 @@ weechat_python_api_hook_process_cb (const void *pointer, void *data,
|
||||
{
|
||||
struct t_plugin_script *script;
|
||||
void *func_argv[5];
|
||||
char empty_arg[1] = { '\0' };
|
||||
char empty_arg[1] = { '\0' }, *result;
|
||||
const char *ptr_function, *ptr_data;
|
||||
int *rc, ret;
|
||||
|
||||
script = (struct t_plugin_script *)pointer;
|
||||
plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
|
||||
|
||||
if (ptr_function && ptr_function[0])
|
||||
if (return_code == WEECHAT_HOOK_PROCESS_CHILD)
|
||||
{
|
||||
if (strncmp (command, "func:", 5) == 0)
|
||||
{
|
||||
func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
|
||||
|
||||
result = (char *) weechat_python_exec (script,
|
||||
WEECHAT_SCRIPT_EXEC_STRING,
|
||||
command + 5,
|
||||
"s", func_argv);
|
||||
if (result)
|
||||
{
|
||||
printf ("%s", result);
|
||||
free (result);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
else if (ptr_function && ptr_function[0])
|
||||
{
|
||||
func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
|
||||
func_argv[1] = (command) ? (char *)command : empty_arg;
|
||||
|
||||
@@ -2682,14 +2682,33 @@ weechat_ruby_api_hook_process_cb (const void *pointer, void *data,
|
||||
{
|
||||
struct t_plugin_script *script;
|
||||
void *func_argv[5];
|
||||
char empty_arg[1] = { '\0' };
|
||||
char empty_arg[1] = { '\0' }, *result;
|
||||
const char *ptr_function, *ptr_data;
|
||||
int *rc, ret;
|
||||
|
||||
script = (struct t_plugin_script *)pointer;
|
||||
plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
|
||||
|
||||
if (ptr_function && ptr_function[0])
|
||||
if (return_code == WEECHAT_HOOK_PROCESS_CHILD)
|
||||
{
|
||||
if (strncmp (command, "func:", 5) == 0)
|
||||
{
|
||||
func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
|
||||
|
||||
result = (char *) weechat_ruby_exec (script,
|
||||
WEECHAT_SCRIPT_EXEC_STRING,
|
||||
command + 5,
|
||||
"s", func_argv);
|
||||
if (result)
|
||||
{
|
||||
printf ("%s", result);
|
||||
free (result);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
else if (ptr_function && ptr_function[0])
|
||||
{
|
||||
func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
|
||||
func_argv[1] = (command) ? (char *)command : empty_arg;
|
||||
|
||||
@@ -2450,14 +2450,33 @@ weechat_tcl_api_hook_process_cb (const void *pointer, void *data,
|
||||
{
|
||||
struct t_plugin_script *script;
|
||||
void *func_argv[5];
|
||||
char empty_arg[1] = { '\0' };
|
||||
char empty_arg[1] = { '\0' }, *result;
|
||||
const char *ptr_function, *ptr_data;
|
||||
int *rc, ret;
|
||||
|
||||
script = (struct t_plugin_script *)pointer;
|
||||
plugin_script_get_function_and_data (data, &ptr_function, &ptr_data);
|
||||
|
||||
if (ptr_function && ptr_function[0])
|
||||
if (return_code == WEECHAT_HOOK_PROCESS_CHILD)
|
||||
{
|
||||
if (strncmp (command, "func:", 5) == 0)
|
||||
{
|
||||
func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
|
||||
|
||||
result = (char *) weechat_tcl_exec (script,
|
||||
WEECHAT_SCRIPT_EXEC_STRING,
|
||||
command + 5,
|
||||
"s", func_argv);
|
||||
if (result)
|
||||
{
|
||||
printf ("%s", result);
|
||||
free (result);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
else if (ptr_function && ptr_function[0])
|
||||
{
|
||||
func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
|
||||
func_argv[1] = (command) ? (char *)command : empty_arg;
|
||||
|
||||
@@ -57,7 +57,7 @@ struct timeval;
|
||||
* please change the date with current one; for a second change at same
|
||||
* date, increment the 01, otherwise please keep 01.
|
||||
*/
|
||||
#define WEECHAT_PLUGIN_API_VERSION "20160324-01"
|
||||
#define WEECHAT_PLUGIN_API_VERSION "20160423-01"
|
||||
|
||||
/* macros for defining plugin infos */
|
||||
#define WEECHAT_PLUGIN_NAME(__name) \
|
||||
@@ -138,11 +138,16 @@ struct timeval;
|
||||
|
||||
/*
|
||||
* process return code (for callback):
|
||||
* if >= 0, then process ended and it's return code of command
|
||||
* if < 0, then it's running or error
|
||||
* if >= 0, the process ended and it's return code of command
|
||||
* if -1, the process is still running
|
||||
* if -2, the process ended with an error
|
||||
* if -3, the callback is called in the child process (exec of function)
|
||||
* (note: the return code -3 is NEVER sent to script plugins,
|
||||
* it can be used only in C API)
|
||||
*/
|
||||
#define WEECHAT_HOOK_PROCESS_RUNNING -1
|
||||
#define WEECHAT_HOOK_PROCESS_ERROR -2
|
||||
#define WEECHAT_HOOK_PROCESS_CHILD -3
|
||||
|
||||
/* connect status for connection hooked */
|
||||
#define WEECHAT_HOOK_CONNECT_OK 0
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@
|
||||
|
||||
WEECHAT_STABLE=1.4
|
||||
WEECHAT_DEVEL=1.5
|
||||
WEECHAT_DEVEL_FULL=1.5-rc1
|
||||
WEECHAT_DEVEL_FULL=1.5-rc2
|
||||
|
||||
if [ $# -lt 1 ]; then
|
||||
echo >&2 "Syntax: $0 stable|devel|devel-full|devel-major|devel-minor|devel-patch"
|
||||
|
||||
Reference in New Issue
Block a user