diff --git a/doc/en/weechat_plugin_api.en.txt b/doc/en/weechat_plugin_api.en.txt index 8705b0327..c135a1b59 100644 --- a/doc/en/weechat_plugin_api.en.txt +++ b/doc/en/weechat_plugin_api.en.txt @@ -4046,8 +4046,8 @@ struct t_hook *weechat_hook_process (const char *command, int (*callback)(void *data, const char *command, int return_code, - const char *stdout, - const char *stderr), + const char *out, + const char *err), void *callback_data); ---------------------------------------- @@ -4065,8 +4065,8 @@ Arguments: *** '>= 0': child command return code *** '< 0': 'WEECHAT_HOOK_PROCESS_OK_RUNNING' (data available, but child still running) or 'WEECHAT_HOOK_PROCESS_ERROR' (error when launching command) -** 'stdout': standard output of command -** 'stderr': error output of command +** 'out': standard output of command (stdout) +** 'err': error output of command (stderr) * 'callback_data': pointer given to callback when it is called by WeeChat Return value: @@ -4079,7 +4079,7 @@ Example: ---------------------------------------- int my_process_cb (void *data, const char *command, int return_code, - const char *stdout, const char *stderr) + const char *out, const char *err) { if (return_code == WEECHAT_HOOK_PROCESS_ERROR) { @@ -4092,14 +4092,14 @@ my_process_cb (void *data, const char *command, int return_code, weechat_printf (NULL, "return_code = %d", return_code); } - if (stdout) + if (out) { - weechat_printf (NULL, "stdout: %s", stdout); + weechat_printf (NULL, "stdout: %s", out); } - if (stderr) + if (err) { - weechat_printf (NULL, "stderr: %s", stderr); + weechat_printf (NULL, "stderr: %s", err); } return WEECHAT_RC_OK; diff --git a/doc/fr/weechat_plugin_api.fr.txt b/doc/fr/weechat_plugin_api.fr.txt index e0954adca..03042e787 100644 --- a/doc/fr/weechat_plugin_api.fr.txt +++ b/doc/fr/weechat_plugin_api.fr.txt @@ -4112,8 +4112,8 @@ struct t_hook *weechat_hook_process (const char *command, int (*callback)(void *data, const char *command, int return_code, - const char *stdout, - const char *stderr), + const char *out, + const char *err), void *callback_data); ---------------------------------------- @@ -4132,8 +4132,8 @@ Paramètres : *** '< 0' : 'WEECHAT_HOOK_PROCESS_OK_RUNNING' (données disponibles, mais le fils tourne toujours) ou 'WEECHAT_HOOK_PROCESS_ERROR' (erreur en lançant la commande) -** 'stdout' : sortie standard de la commande -** 'stderr' : erreurs de la commande +** 'out' : sortie standard de la commande (stdout) +** 'err' : erreurs de la commande (stderr) * 'callback_data' : pointeur donné au "callback" lorsqu'il est appelé par WeeChat @@ -4147,7 +4147,7 @@ Exemple : ---------------------------------------- int mon_processus_cb (void *data, const char *command, int return_code, - const char *stdout, const char *stderr) + const char *out, const char *err) { if (return_code == WEECHAT_HOOK_PROCESS_ERROR) { @@ -4160,14 +4160,14 @@ mon_processus_cb (void *data, const char *command, int return_code, weechat_printf (NULL, "return_code = %d", return_code); } - if (stdout) + if (out) { - weechat_printf (NULL, "stdout : %s", stdout); + weechat_printf (NULL, "stdout : %s", out); } - if (stderr) + if (err) { - weechat_printf (NULL, "stderr : %s", stderr); + weechat_printf (NULL, "stderr : %s", err); } return WEECHAT_RC_OK; diff --git a/src/core/wee-hook.c b/src/core/wee-hook.c index 6b0dc0a04..e57af00fc 100644 --- a/src/core/wee-hook.c +++ b/src/core/wee-hook.c @@ -1231,7 +1231,7 @@ hook_process_child (struct t_hook *hook_process) void hook_process_child_read (struct t_hook *hook_process, int fd, - int stdout, struct t_hook **hook_fd) + int out, struct t_hook **hook_fd) { char buffer[4096]; int num_read; @@ -1244,8 +1244,8 @@ hook_process_child_read (struct t_hook *hook_process, int fd, (hook_process->callback_data, HOOK_PROCESS(hook_process, command), WEECHAT_HOOK_PROCESS_RUNNING, - (stdout) ? buffer : NULL, - (stdout) ? NULL : buffer); + (out) ? buffer : NULL, + (out) ? NULL : buffer); } else if (num_read == 0) { diff --git a/src/core/wee-hook.h b/src/core/wee-hook.h index 2827d3c31..67b1cac11 100644 --- a/src/core/wee-hook.h +++ b/src/core/wee-hook.h @@ -160,8 +160,8 @@ struct t_hook_fd /* hook process */ typedef int (t_hook_callback_process)(void *data, const char *command, - int return_code, const char *stdout, - const char *stderr); + int return_code, const char *out, + const char *err); struct t_hook_process { diff --git a/src/plugins/scripts/lua/weechat-lua-api.c b/src/plugins/scripts/lua/weechat-lua-api.c index 6669427c8..c49c1fe22 100644 --- a/src/plugins/scripts/lua/weechat-lua-api.c +++ b/src/plugins/scripts/lua/weechat-lua-api.c @@ -3432,7 +3432,7 @@ weechat_lua_api_hook_fd (lua_State *L) int weechat_lua_api_hook_process_cb (void *data, const char *command, int return_code, - const char *stdout, const char *stderr) + const char *out, const char *err) { struct t_script_callback *script_callback; char *lua_argv[6], str_rc[32], empty_arg[1] = { '\0' }; @@ -3447,8 +3447,8 @@ weechat_lua_api_hook_process_cb (void *data, lua_argv[0] = (script_callback->data) ? script_callback->data : empty_arg; lua_argv[1] = (command) ? (char *)command : empty_arg; lua_argv[2] = str_rc; - lua_argv[3] = (stdout) ? (char *)stdout : empty_arg; - lua_argv[4] = (stderr) ? (char *)stderr : empty_arg; + lua_argv[3] = (out) ? (char *)out : empty_arg; + lua_argv[4] = (err) ? (char *)err : empty_arg; lua_argv[5] = NULL; rc = (int *) weechat_lua_exec (script_callback->script, diff --git a/src/plugins/scripts/perl/weechat-perl-api.c b/src/plugins/scripts/perl/weechat-perl-api.c index cfe30e4b5..ec150241b 100644 --- a/src/plugins/scripts/perl/weechat-perl-api.c +++ b/src/plugins/scripts/perl/weechat-perl-api.c @@ -2886,7 +2886,7 @@ static XS (XS_weechat_api_hook_fd) int weechat_perl_api_hook_process_cb (void *data, const char *command, int return_code, - const char *stdout, const char *stderr) + const char *out, const char *err) { struct t_script_callback *script_callback; char *perl_argv[6], str_rc[32], empty_arg[1] = { '\0' }; @@ -2901,8 +2901,8 @@ weechat_perl_api_hook_process_cb (void *data, perl_argv[0] = (script_callback->data) ? script_callback->data : empty_arg; perl_argv[1] = (command) ? (char *)command : empty_arg; perl_argv[2] = str_rc; - perl_argv[3] = (stdout) ? (char *)stdout : empty_arg; - perl_argv[4] = (stderr) ? (char *)stderr : empty_arg; + perl_argv[3] = (out) ? (char *)out : empty_arg; + perl_argv[4] = (err) ? (char *)err : empty_arg; perl_argv[5] = NULL; rc = (int *) weechat_perl_exec (script_callback->script, diff --git a/src/plugins/scripts/python/weechat-python-api.c b/src/plugins/scripts/python/weechat-python-api.c index 303411533..839d4c903 100644 --- a/src/plugins/scripts/python/weechat-python-api.c +++ b/src/plugins/scripts/python/weechat-python-api.c @@ -3050,7 +3050,7 @@ weechat_python_api_hook_fd (PyObject *self, PyObject *args) int weechat_python_api_hook_process_cb (void *data, const char *command, int return_code, - const char *stdout, const char *stderr) + const char *out, const char *err) { struct t_script_callback *script_callback; char *python_argv[6], str_rc[32], empty_arg[1] = { '\0' }; @@ -3065,8 +3065,8 @@ weechat_python_api_hook_process_cb (void *data, python_argv[0] = (script_callback->data) ? script_callback->data : empty_arg; python_argv[1] = (command) ? (char *)command : empty_arg; python_argv[2] = str_rc; - python_argv[3] = (stdout) ? (char *)stdout : empty_arg; - python_argv[4] = (stderr) ? (char *)stderr : empty_arg; + python_argv[3] = (out) ? (char *)out : empty_arg; + python_argv[4] = (err) ? (char *)err : empty_arg; python_argv[5] = NULL; rc = (int *) weechat_python_exec (script_callback->script, diff --git a/src/plugins/scripts/ruby/weechat-ruby-api.c b/src/plugins/scripts/ruby/weechat-ruby-api.c index 5eb325a1f..81e71274f 100644 --- a/src/plugins/scripts/ruby/weechat-ruby-api.c +++ b/src/plugins/scripts/ruby/weechat-ruby-api.c @@ -3524,7 +3524,7 @@ weechat_ruby_api_hook_fd (VALUE class, VALUE fd, VALUE read, VALUE write, int weechat_ruby_api_hook_process_cb (void *data, const char *command, int return_code, - const char *stdout, const char *stderr) + const char *out, const char *err) { struct t_script_callback *script_callback; char *ruby_argv[6], str_rc[32], empty_arg[1] = { '\0' }; @@ -3539,8 +3539,8 @@ weechat_ruby_api_hook_process_cb (void *data, ruby_argv[0] = (script_callback->data) ? script_callback->data : empty_arg; ruby_argv[1] = (command) ? (char *)command : empty_arg; ruby_argv[2] = str_rc; - ruby_argv[3] = (stdout) ? (char *)stdout : empty_arg; - ruby_argv[4] = (stderr) ? (char *)stderr : empty_arg; + ruby_argv[3] = (out) ? (char *)out : empty_arg; + ruby_argv[4] = (err) ? (char *)err : empty_arg; ruby_argv[5] = NULL; rc = (int *) weechat_ruby_exec (script_callback->script, diff --git a/src/plugins/scripts/script-api.c b/src/plugins/scripts/script-api.c index 2eee67105..d9b25f0f6 100644 --- a/src/plugins/scripts/script-api.c +++ b/src/plugins/scripts/script-api.c @@ -887,8 +887,8 @@ script_api_hook_process (struct t_weechat_plugin *weechat_plugin, int (*callback)(void *data, const char *command, int return_code, - const char *stdout, - const char *stderr), + const char *out, + const char *err), const char *function, const char *data) { diff --git a/src/plugins/scripts/script-api.h b/src/plugins/scripts/script-api.h index 8d4622c56..2e5445100 100644 --- a/src/plugins/scripts/script-api.h +++ b/src/plugins/scripts/script-api.h @@ -158,8 +158,8 @@ extern struct t_hook *script_api_hook_process (struct t_weechat_plugin *weechat_ int (*callback)(void *data, const char *command, int return_code, - const char *stdout, - const char *stderr), + const char *out, + const char *err), const char *function, const char *data); extern struct t_hook *script_api_hook_connect (struct t_weechat_plugin *weechat_plugin, diff --git a/src/plugins/scripts/tcl/weechat-tcl-api.c b/src/plugins/scripts/tcl/weechat-tcl-api.c index 6ec6742c2..f7acb8ae0 100644 --- a/src/plugins/scripts/tcl/weechat-tcl-api.c +++ b/src/plugins/scripts/tcl/weechat-tcl-api.c @@ -3284,7 +3284,7 @@ weechat_tcl_api_hook_fd (ClientData clientData, Tcl_Interp *interp, int weechat_tcl_api_hook_process_cb (void *data, const char *command, int return_code, - const char *stdout, const char *stderr) + const char *out, const char *err) { struct t_script_callback *script_callback; char *tcl_argv[6], str_rc[32], empty_arg[1] = { '\0' }; @@ -3299,8 +3299,8 @@ weechat_tcl_api_hook_process_cb (void *data, tcl_argv[0] = (script_callback->data) ? script_callback->data : empty_arg; tcl_argv[1] = (command) ? (char *)command : empty_arg; tcl_argv[2] = str_rc; - tcl_argv[3] = (stdout) ? (char *)stdout : empty_arg; - tcl_argv[4] = (stderr) ? (char *)stderr : empty_arg; + tcl_argv[3] = (out) ? (char *)out : empty_arg; + tcl_argv[4] = (err) ? (char *)err : empty_arg; tcl_argv[5] = NULL; rc = (int *) weechat_tcl_exec (script_callback->script, diff --git a/src/plugins/weechat-plugin.h b/src/plugins/weechat-plugin.h index 0dab3ac81..bcc8d9b9f 100644 --- a/src/plugins/weechat-plugin.h +++ b/src/plugins/weechat-plugin.h @@ -385,8 +385,8 @@ struct t_weechat_plugin int (*callback)(void *data, const char *command, int return_code, - const char *stdout, - const char *stderr), + const char *out, + const char *err), void *callback_data); struct t_hook *(*hook_connect) (struct t_weechat_plugin *plugin, const char *proxy,