diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2017-08-13 10:40:01 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2017-08-13 10:40:01 +0200 |
commit | bfef8da84c685dea678c8aa2fcb6d5a570d7a7b2 (patch) | |
tree | 8c5064f94120fc7c5d700168c18bf00154c0b7ed /src/plugins | |
parent | bf0df282a2a33ccc4179f5819b7936f37a0ebc37 (diff) | |
download | weechat-bfef8da84c685dea678c8aa2fcb6d5a570d7a7b2.zip |
api: change type of arguments status/gnutls_rc/sock in hook_connect() callback from string to integer (in scripts)
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/guile/weechat-guile-api.c | 13 | ||||
-rw-r--r-- | src/plugins/javascript/weechat-js-api.cpp | 13 | ||||
-rw-r--r-- | src/plugins/lua/weechat-lua-api.c | 13 | ||||
-rw-r--r-- | src/plugins/perl/weechat-perl-api.c | 13 | ||||
-rw-r--r-- | src/plugins/python/weechat-python-api.c | 14 | ||||
-rw-r--r-- | src/plugins/ruby/weechat-ruby-api.c | 13 | ||||
-rw-r--r-- | src/plugins/tcl/weechat-tcl-api.c | 13 |
7 files changed, 29 insertions, 63 deletions
diff --git a/src/plugins/guile/weechat-guile-api.c b/src/plugins/guile/weechat-guile-api.c index 3f1182856..b9f2c9e9b 100644 --- a/src/plugins/guile/weechat-guile-api.c +++ b/src/plugins/guile/weechat-guile-api.c @@ -2388,7 +2388,6 @@ weechat_guile_api_hook_connect_cb (const void *pointer, void *data, { struct t_plugin_script *script; void *func_argv[6]; - char str_status[32], str_gnutls_rc[32], str_sock[32]; char empty_arg[1] = { '\0' }; const char *ptr_function, *ptr_data; int *rc, ret; @@ -2398,21 +2397,17 @@ weechat_guile_api_hook_connect_cb (const void *pointer, void *data, if (ptr_function && ptr_function[0]) { - snprintf (str_status, sizeof (str_status), "%d", status); - snprintf (str_gnutls_rc, sizeof (str_gnutls_rc), "%d", gnutls_rc); - snprintf (str_sock, sizeof (str_sock), "%d", sock); - func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg; - func_argv[1] = str_status; - func_argv[2] = str_gnutls_rc; - func_argv[3] = str_sock; + func_argv[1] = &status; + func_argv[2] = &gnutls_rc; + func_argv[3] = &sock; func_argv[4] = (ip_address) ? (char *)ip_address : empty_arg; func_argv[5] = (error) ? (char *)error : empty_arg; rc = (int *) weechat_guile_exec (script, WEECHAT_SCRIPT_EXEC_INT, ptr_function, - "ssssss", func_argv); + "siiiss", func_argv); if (!rc) ret = WEECHAT_RC_ERROR; diff --git a/src/plugins/javascript/weechat-js-api.cpp b/src/plugins/javascript/weechat-js-api.cpp index c41c613f9..ab3b9a2ee 100644 --- a/src/plugins/javascript/weechat-js-api.cpp +++ b/src/plugins/javascript/weechat-js-api.cpp @@ -2309,7 +2309,6 @@ weechat_js_api_hook_connect_cb (const void *pointer, void *data, { struct t_plugin_script *script; void *func_argv[6]; - char str_status[32], str_gnutls_rc[32], str_sock[32]; char empty_arg[1] = { '\0' }; const char *ptr_function, *ptr_data; int *rc, ret; @@ -2319,21 +2318,17 @@ weechat_js_api_hook_connect_cb (const void *pointer, void *data, if (ptr_function && ptr_function[0]) { - snprintf (str_status, sizeof (str_status), "%d", status); - snprintf (str_gnutls_rc, sizeof (str_gnutls_rc), "%d", gnutls_rc); - snprintf (str_sock, sizeof (str_sock), "%d", sock); - func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg; - func_argv[1] = str_status; - func_argv[2] = str_gnutls_rc; - func_argv[3] = str_sock; + func_argv[1] = &status; + func_argv[2] = &gnutls_rc; + func_argv[3] = &sock; func_argv[4] = (ip_address) ? (char *)ip_address : empty_arg; func_argv[5] = (error) ? (char *)error : empty_arg; rc = (int *)weechat_js_exec (script, WEECHAT_SCRIPT_EXEC_INT, ptr_function, - "ssssss", func_argv); + "siiiss", func_argv); if (!rc) ret = WEECHAT_RC_ERROR; diff --git a/src/plugins/lua/weechat-lua-api.c b/src/plugins/lua/weechat-lua-api.c index 9148bfb2c..144c8f7b4 100644 --- a/src/plugins/lua/weechat-lua-api.c +++ b/src/plugins/lua/weechat-lua-api.c @@ -2506,7 +2506,6 @@ weechat_lua_api_hook_connect_cb (const void *pointer, void *data, { struct t_plugin_script *script; void *func_argv[6]; - char str_status[32], str_gnutls_rc[32], str_sock[32]; char empty_arg[1] = { '\0' }; const char *ptr_function, *ptr_data; int *rc, ret; @@ -2516,21 +2515,17 @@ weechat_lua_api_hook_connect_cb (const void *pointer, void *data, if (ptr_function && ptr_function[0]) { - snprintf (str_status, sizeof (str_status), "%d", status); - snprintf (str_gnutls_rc, sizeof (str_gnutls_rc), "%d", gnutls_rc); - snprintf (str_sock, sizeof (str_sock), "%d", sock); - func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg; - func_argv[1] = str_status; - func_argv[2] = str_gnutls_rc; - func_argv[3] = str_sock; + func_argv[1] = &status; + func_argv[2] = &gnutls_rc; + func_argv[3] = &sock; func_argv[4] = (ip_address) ? (char *)ip_address : empty_arg; func_argv[5] = (error) ? (char *)error : empty_arg; rc = (int *) weechat_lua_exec (script, WEECHAT_SCRIPT_EXEC_INT, ptr_function, - "ssssss", func_argv); + "siiiss", func_argv); if (!rc) ret = WEECHAT_RC_ERROR; diff --git a/src/plugins/perl/weechat-perl-api.c b/src/plugins/perl/weechat-perl-api.c index 982aeaba2..e6960c73a 100644 --- a/src/plugins/perl/weechat-perl-api.c +++ b/src/plugins/perl/weechat-perl-api.c @@ -2424,7 +2424,6 @@ weechat_perl_api_hook_connect_cb (const void *pointer, void *data, { struct t_plugin_script *script; void *func_argv[6]; - char str_status[32], str_gnutls_rc[32], str_sock[32]; char empty_arg[1] = { '\0' }; const char *ptr_function, *ptr_data; int *rc, ret; @@ -2434,21 +2433,17 @@ weechat_perl_api_hook_connect_cb (const void *pointer, void *data, if (ptr_function && ptr_function[0]) { - snprintf (str_status, sizeof (str_status), "%d", status); - snprintf (str_gnutls_rc, sizeof (str_gnutls_rc), "%d", gnutls_rc); - snprintf (str_sock, sizeof (str_sock), "%d", sock); - func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg; - func_argv[1] = str_status; - func_argv[2] = str_gnutls_rc; - func_argv[3] = str_sock; + func_argv[1] = &status; + func_argv[2] = &gnutls_rc; + func_argv[3] = &sock; func_argv[4] = (ip_address) ? (char *)ip_address : empty_arg; func_argv[5] = (error) ? (char *)error : empty_arg; rc = (int *) weechat_perl_exec (script, WEECHAT_SCRIPT_EXEC_INT, ptr_function, - "ssssss", func_argv); + "siiiss", func_argv); if (!rc) ret = WEECHAT_RC_ERROR; diff --git a/src/plugins/python/weechat-python-api.c b/src/plugins/python/weechat-python-api.c index f3384bd4e..e3b4d93e5 100644 --- a/src/plugins/python/weechat-python-api.c +++ b/src/plugins/python/weechat-python-api.c @@ -2442,7 +2442,7 @@ weechat_python_api_hook_connect_cb (const void *pointer, void *data, { struct t_plugin_script *script; void *func_argv[6]; - char str_status[32], str_gnutls_rc[32], str_sock[32], empty_arg[1] = { '\0' }; + char empty_arg[1] = { '\0' }; const char *ptr_function, *ptr_data; int *rc, ret; @@ -2451,21 +2451,17 @@ weechat_python_api_hook_connect_cb (const void *pointer, void *data, if (ptr_function && ptr_function[0]) { - snprintf (str_status, sizeof (str_status), "%d", status); - snprintf (str_gnutls_rc, sizeof (str_gnutls_rc), "%d", gnutls_rc); - snprintf (str_sock, sizeof (str_sock), "%d", sock); - func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg; - func_argv[1] = str_status; - func_argv[2] = str_gnutls_rc; - func_argv[3] = str_sock; + func_argv[1] = &status; + func_argv[2] = &gnutls_rc; + func_argv[3] = &sock; func_argv[4] = (ip_address) ? (char *)ip_address : empty_arg; func_argv[5] = (error) ? (char *)error : empty_arg; rc = (int *) weechat_python_exec (script, WEECHAT_SCRIPT_EXEC_INT, ptr_function, - "ssssss", func_argv); + "siiiss", func_argv); if (!rc) ret = WEECHAT_RC_ERROR; diff --git a/src/plugins/ruby/weechat-ruby-api.c b/src/plugins/ruby/weechat-ruby-api.c index 488ec9193..361901b01 100644 --- a/src/plugins/ruby/weechat-ruby-api.c +++ b/src/plugins/ruby/weechat-ruby-api.c @@ -2952,7 +2952,6 @@ weechat_ruby_api_hook_connect_cb (const void *pointer, void *data, { struct t_plugin_script *script; void *func_argv[6]; - char str_status[32], str_gnutls_rc[32], str_sock[32]; char empty_arg[1] = { '\0' }; const char *ptr_function, *ptr_data; int *rc, ret; @@ -2962,21 +2961,17 @@ weechat_ruby_api_hook_connect_cb (const void *pointer, void *data, if (ptr_function && ptr_function[0]) { - snprintf (str_status, sizeof (str_status), "%d", status); - snprintf (str_gnutls_rc, sizeof (str_gnutls_rc), "%d", gnutls_rc); - snprintf (str_sock, sizeof (str_sock), "%d", sock); - func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg; - func_argv[1] = str_status; - func_argv[2] = str_gnutls_rc; - func_argv[3] = str_sock; + func_argv[1] = &status; + func_argv[2] = &gnutls_rc; + func_argv[3] = &sock; func_argv[4] = (ip_address) ? (char *)ip_address : empty_arg; func_argv[5] = (error) ? (char *)error : empty_arg; rc = (int *) weechat_ruby_exec (script, WEECHAT_SCRIPT_EXEC_INT, ptr_function, - "ssssss", func_argv); + "siiiss", func_argv); if (!rc) ret = WEECHAT_RC_ERROR; diff --git a/src/plugins/tcl/weechat-tcl-api.c b/src/plugins/tcl/weechat-tcl-api.c index 90a21566d..28675b21e 100644 --- a/src/plugins/tcl/weechat-tcl-api.c +++ b/src/plugins/tcl/weechat-tcl-api.c @@ -2690,7 +2690,6 @@ weechat_tcl_api_hook_connect_cb (const void *pointer, void *data, { struct t_plugin_script *script; void *func_argv[6]; - char str_status[32], str_gnutls_rc[32], str_sock[32]; char empty_arg[1] = { '\0' }; const char *ptr_function, *ptr_data; int *rc, ret; @@ -2700,21 +2699,17 @@ weechat_tcl_api_hook_connect_cb (const void *pointer, void *data, if (ptr_function && ptr_function[0]) { - snprintf (str_status, sizeof (str_status), "%d", status); - snprintf (str_gnutls_rc, sizeof (str_gnutls_rc), "%d", gnutls_rc); - snprintf (str_sock, sizeof (str_sock), "%d", sock); - func_argv[0] = (ptr_data) ? (char *)ptr_data : empty_arg; - func_argv[1] = str_status; - func_argv[2] = str_gnutls_rc; - func_argv[3] = str_sock; + func_argv[1] = &status; + func_argv[2] = &gnutls_rc; + func_argv[3] = &sock; func_argv[4] = (ip_address) ? (char *)ip_address : empty_arg; func_argv[5] = (error) ? (char *)error : empty_arg; rc = (int *) weechat_tcl_exec (script, WEECHAT_SCRIPT_EXEC_INT, ptr_function, - "ssssss", func_argv); + "siiiss", func_argv); if (!rc) ret = WEECHAT_RC_ERROR; |