1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-26 04:46:37 +02:00

Give file descriptor to callback of hook_fd

This commit is contained in:
Sebastien Helleu
2009-02-18 11:13:23 +01:00
parent e263a847da
commit 4d1fdfade0
23 changed files with 80 additions and 36 deletions
+6 -3
View File
@@ -2940,15 +2940,18 @@ weechat_lua_api_hook_timer (lua_State *L)
*/
int
weechat_lua_api_hook_fd_cb (void *data)
weechat_lua_api_hook_fd_cb (void *data, int fd)
{
struct t_script_callback *script_callback;
char *lua_argv[1];
char *lua_argv[2], str_fd[32];
int *rc, ret;
script_callback = (struct t_script_callback *)data;
lua_argv[0] = NULL;
snprintf (str_fd, sizeof (str_fd), "%d", fd);
lua_argv[0] = str_fd;
lua_argv[1] = NULL;
rc = (int *) weechat_lua_exec (script_callback->script,
WEECHAT_SCRIPT_EXEC_INT,