mirror of
https://github.com/weechat/weechat.git
synced 2026-07-08 18:53:12 +02:00
api: send file descriptor as integer instead of string to the callback of hook_fd
This commit is contained in:
@@ -2206,7 +2206,7 @@ weechat_guile_api_hook_fd_cb (const void *pointer, void *data, int fd)
|
||||
{
|
||||
struct t_plugin_script *script;
|
||||
void *func_argv[2];
|
||||
char str_fd[32], empty_arg[1] = { '\0' };
|
||||
char empty_arg[1] = { '\0' };
|
||||
const char *ptr_function, *ptr_data;
|
||||
int *rc, ret;
|
||||
|
||||
@@ -2215,15 +2215,13 @@ weechat_guile_api_hook_fd_cb (const void *pointer, void *data, int fd)
|
||||
|
||||
if (ptr_function && ptr_function[0])
|
||||
{
|
||||
snprintf (str_fd, sizeof (str_fd), "%d", fd);
|
||||
|
||||
func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
|
||||
func_argv[1] = str_fd;
|
||||
func_argv[1] = &fd;
|
||||
|
||||
rc = (int *) weechat_guile_exec (script,
|
||||
WEECHAT_SCRIPT_EXEC_INT,
|
||||
ptr_function,
|
||||
"ss", func_argv);
|
||||
"si", func_argv);
|
||||
|
||||
if (!rc)
|
||||
ret = WEECHAT_RC_ERROR;
|
||||
|
||||
@@ -2121,7 +2121,7 @@ weechat_js_api_hook_fd_cb (const void *pointer, void *data, int fd)
|
||||
{
|
||||
struct t_plugin_script *script;
|
||||
void *func_argv[2];
|
||||
char str_fd[32], empty_arg[1] = { '\0' };
|
||||
char empty_arg[1] = { '\0' };
|
||||
const char *ptr_function, *ptr_data;
|
||||
int *rc, ret;
|
||||
|
||||
@@ -2130,15 +2130,13 @@ weechat_js_api_hook_fd_cb (const void *pointer, void *data, int fd)
|
||||
|
||||
if (ptr_function && ptr_function[0])
|
||||
{
|
||||
snprintf (str_fd, sizeof (str_fd), "%d", fd);
|
||||
|
||||
func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
|
||||
func_argv[1] = str_fd;
|
||||
func_argv[1] = &fd;
|
||||
|
||||
rc = (int *)weechat_js_exec (script,
|
||||
WEECHAT_SCRIPT_EXEC_INT,
|
||||
ptr_function,
|
||||
"ss", func_argv);
|
||||
"si", func_argv);
|
||||
|
||||
if (!rc)
|
||||
ret = WEECHAT_RC_ERROR;
|
||||
|
||||
@@ -2316,7 +2316,7 @@ weechat_lua_api_hook_fd_cb (const void *pointer, void *data, int fd)
|
||||
{
|
||||
struct t_plugin_script *script;
|
||||
void *func_argv[2];
|
||||
char str_fd[32], empty_arg[1] = { '\0' };
|
||||
char empty_arg[1] = { '\0' };
|
||||
const char *ptr_function, *ptr_data;
|
||||
int *rc, ret;
|
||||
|
||||
@@ -2325,15 +2325,13 @@ weechat_lua_api_hook_fd_cb (const void *pointer, void *data, int fd)
|
||||
|
||||
if (ptr_function && ptr_function[0])
|
||||
{
|
||||
snprintf (str_fd, sizeof (str_fd), "%d", fd);
|
||||
|
||||
func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
|
||||
func_argv[1] = str_fd;
|
||||
func_argv[1] = &fd;
|
||||
|
||||
rc = (int *) weechat_lua_exec (script,
|
||||
WEECHAT_SCRIPT_EXEC_INT,
|
||||
ptr_function,
|
||||
"ss", func_argv);
|
||||
"si", func_argv);
|
||||
|
||||
if (!rc)
|
||||
ret = WEECHAT_RC_ERROR;
|
||||
|
||||
@@ -2246,7 +2246,7 @@ weechat_perl_api_hook_fd_cb (const void *pointer, void *data, int fd)
|
||||
{
|
||||
struct t_plugin_script *script;
|
||||
void *func_argv[2];
|
||||
char str_fd[32], empty_arg[1] = { '\0' };
|
||||
char empty_arg[1] = { '\0' };
|
||||
const char *ptr_function, *ptr_data;
|
||||
int *rc, ret;
|
||||
|
||||
@@ -2255,15 +2255,13 @@ weechat_perl_api_hook_fd_cb (const void *pointer, void *data, int fd)
|
||||
|
||||
if (ptr_function && ptr_function[0])
|
||||
{
|
||||
snprintf (str_fd, sizeof (str_fd), "%d", fd);
|
||||
|
||||
func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
|
||||
func_argv[1] = str_fd;
|
||||
func_argv[1] = &fd;
|
||||
|
||||
rc = (int *) weechat_perl_exec (script,
|
||||
WEECHAT_SCRIPT_EXEC_INT,
|
||||
ptr_function,
|
||||
"ss", func_argv);
|
||||
"si", func_argv);
|
||||
|
||||
if (!rc)
|
||||
ret = WEECHAT_RC_ERROR;
|
||||
|
||||
@@ -2247,7 +2247,7 @@ weechat_python_api_hook_fd_cb (const void *pointer, void *data, int fd)
|
||||
{
|
||||
struct t_plugin_script *script;
|
||||
void *func_argv[2];
|
||||
char str_fd[32], empty_arg[1] = { '\0' };
|
||||
char empty_arg[1] = { '\0' };
|
||||
const char *ptr_function, *ptr_data;
|
||||
int *rc, ret;
|
||||
|
||||
@@ -2256,15 +2256,13 @@ weechat_python_api_hook_fd_cb (const void *pointer, void *data, int fd)
|
||||
|
||||
if (ptr_function && ptr_function[0])
|
||||
{
|
||||
snprintf (str_fd, sizeof (str_fd), "%d", fd);
|
||||
|
||||
func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
|
||||
func_argv[1] = str_fd;
|
||||
func_argv[1] = &fd;
|
||||
|
||||
rc = (int *) weechat_python_exec (script,
|
||||
WEECHAT_SCRIPT_EXEC_INT,
|
||||
ptr_function,
|
||||
"ss", func_argv);
|
||||
"si", func_argv);
|
||||
|
||||
if (!rc)
|
||||
ret = WEECHAT_RC_ERROR;
|
||||
|
||||
@@ -2735,7 +2735,7 @@ weechat_ruby_api_hook_fd_cb (const void *pointer, void *data, int fd)
|
||||
{
|
||||
struct t_plugin_script *script;
|
||||
void *func_argv[2];
|
||||
char str_fd[32], empty_arg[1] = { '\0' };
|
||||
char empty_arg[1] = { '\0' };
|
||||
const char *ptr_function, *ptr_data;
|
||||
int *rc, ret;
|
||||
|
||||
@@ -2744,15 +2744,13 @@ weechat_ruby_api_hook_fd_cb (const void *pointer, void *data, int fd)
|
||||
|
||||
if (ptr_function && ptr_function[0])
|
||||
{
|
||||
snprintf (str_fd, sizeof (str_fd), "%d", fd);
|
||||
|
||||
func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
|
||||
func_argv[1] = str_fd;
|
||||
func_argv[1] = &fd;
|
||||
|
||||
rc = (int *) weechat_ruby_exec (script,
|
||||
WEECHAT_SCRIPT_EXEC_INT,
|
||||
ptr_function,
|
||||
"ss", func_argv);
|
||||
"si", func_argv);
|
||||
|
||||
if (!rc)
|
||||
ret = WEECHAT_RC_ERROR;
|
||||
|
||||
@@ -2497,7 +2497,7 @@ weechat_tcl_api_hook_fd_cb (const void *pointer, void *data, int fd)
|
||||
{
|
||||
struct t_plugin_script *script;
|
||||
void *func_argv[2];
|
||||
char str_fd[32], empty_arg[1] = { '\0' };
|
||||
char empty_arg[1] = { '\0' };
|
||||
const char *ptr_function, *ptr_data;
|
||||
int *rc, ret;
|
||||
|
||||
@@ -2506,15 +2506,13 @@ weechat_tcl_api_hook_fd_cb (const void *pointer, void *data, int fd)
|
||||
|
||||
if (ptr_function && ptr_function[0])
|
||||
{
|
||||
snprintf (str_fd, sizeof (str_fd), "%d", fd);
|
||||
|
||||
func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg;
|
||||
func_argv[1] = str_fd;
|
||||
func_argv[1] = &fd;
|
||||
|
||||
rc = (int *) weechat_tcl_exec (script,
|
||||
WEECHAT_SCRIPT_EXEC_INT,
|
||||
ptr_function,
|
||||
"ss", func_argv);
|
||||
"si", func_argv);
|
||||
|
||||
if (!rc)
|
||||
ret = WEECHAT_RC_ERROR;
|
||||
|
||||
Reference in New Issue
Block a user