diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2015-02-21 09:49:51 +0100 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2015-02-21 09:49:51 +0100 |
commit | c853d29e76f7d16b511dfec235c3f25a758085d5 (patch) | |
tree | 6f5bb19e998aa5961fe59f61f52ec2d5cbe698f0 /src/plugins | |
parent | c1a5a76d087d716e5f49afeb88352d3a126614af (diff) | |
download | weechat-c853d29e76f7d16b511dfec235c3f25a758085d5.zip |
scripts: rename macro API_FUNC to API_INIT_FUNC, add macro API_FUNC to declare API functions
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/guile/weechat-guile-api.c | 391 | ||||
-rw-r--r-- | src/plugins/lua/weechat-lua-api.c | 966 | ||||
-rw-r--r-- | src/plugins/perl/weechat-perl-api.c | 767 | ||||
-rw-r--r-- | src/plugins/python/weechat-python-api.c | 964 | ||||
-rw-r--r-- | src/plugins/ruby/weechat-ruby-api.c | 395 | ||||
-rw-r--r-- | src/plugins/tcl/weechat-tcl-api.c | 1163 |
6 files changed, 1943 insertions, 2703 deletions
diff --git a/src/plugins/guile/weechat-guile-api.c b/src/plugins/guile/weechat-guile-api.c index 828eee598..c2318aa46 100644 --- a/src/plugins/guile/weechat-guile-api.c +++ b/src/plugins/guile/weechat-guile-api.c @@ -35,7 +35,7 @@ /* max strings created by an API function */ #define GUILE_MAX_STRINGS 64 -#define API_FUNC(__init, __name, __ret) \ +#define API_INIT_FUNC(__init, __name, __ret) \ char *guile_function_name = __name; \ char *guile_strings[GUILE_MAX_STRINGS]; \ int guile_num_strings = 0; \ @@ -69,13 +69,13 @@ } #define API_RETURN_OK \ API_FREE_STRINGS; \ - return SCM_BOOL_T; + return SCM_BOOL_T #define API_RETURN_ERROR \ API_FREE_STRINGS \ - return SCM_BOOL_F; + return SCM_BOOL_F #define API_RETURN_EMPTY \ API_FREE_STRINGS; \ - return scm_from_locale_string(""); + return scm_from_locale_string("") #define API_RETURN_STRING(__string) \ API_FREE_STRINGS; \ if (__string) \ @@ -92,13 +92,14 @@ return scm_from_locale_string("") #define API_RETURN_INT(__int) \ API_FREE_STRINGS; \ - return scm_from_int (__int); + return scm_from_int (__int) #define API_RETURN_LONG(__long) \ API_FREE_STRINGS; \ - return scm_from_long (__long); + return scm_from_long (__long) #define API_RETURN_OTHER(__scm) \ API_FREE_STRINGS; \ - return __scm; + return __scm + #define API_DEF_FUNC(__name, __argc) \ scm_c_define_gsubr ("weechat:" #__name, __argc, 0, 0, \ &weechat_guile_api_##__name); \ @@ -156,7 +157,7 @@ SCM weechat_guile_api_register (SCM name, SCM author, SCM version, SCM license, SCM description, SCM shutdown_func, SCM charset) { - API_FUNC(0, "register", API_RETURN_ERROR); + API_INIT_FUNC(0, "register", API_RETURN_ERROR); if (guile_registered_script) { /* script already registered */ @@ -234,7 +235,7 @@ weechat_guile_api_plugin_get_name (SCM plugin) { const char *result; - API_FUNC(1, "plugin_get_name", API_RETURN_EMPTY); + API_INIT_FUNC(1, "plugin_get_name", API_RETURN_EMPTY); if (!scm_is_string (plugin)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -246,7 +247,7 @@ weechat_guile_api_plugin_get_name (SCM plugin) SCM weechat_guile_api_charset_set (SCM charset) { - API_FUNC(1, "charset_set", API_RETURN_ERROR); + API_INIT_FUNC(1, "charset_set", API_RETURN_ERROR); if (!scm_is_string (charset)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -261,7 +262,7 @@ weechat_guile_api_iconv_to_internal (SCM charset, SCM string) char *result; SCM return_value; - API_FUNC(1, "iconv_to_internal", API_RETURN_EMPTY); + API_INIT_FUNC(1, "iconv_to_internal", API_RETURN_EMPTY); if (!scm_is_string (charset) || !scm_is_string (string)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -277,7 +278,7 @@ weechat_guile_api_iconv_from_internal (SCM charset, SCM string) char *result; SCM return_value; - API_FUNC(1, "iconv_from_internal", API_RETURN_EMPTY); + API_INIT_FUNC(1, "iconv_from_internal", API_RETURN_EMPTY); if (!scm_is_string (charset) || !scm_is_string (string)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -292,7 +293,7 @@ weechat_guile_api_gettext (SCM string) { const char *result; - API_FUNC(1, "gettext", API_RETURN_EMPTY); + API_INIT_FUNC(1, "gettext", API_RETURN_EMPTY); if (!scm_is_string (string)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -306,7 +307,7 @@ weechat_guile_api_ngettext (SCM single, SCM plural, SCM count) { const char *result; - API_FUNC(1, "ngettext", API_RETURN_EMPTY); + API_INIT_FUNC(1, "ngettext", API_RETURN_EMPTY); if (!scm_is_string (single) || !scm_is_string (plural) || !scm_is_integer (count)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -323,7 +324,7 @@ weechat_guile_api_strlen_screen (SCM string) { int value; - API_FUNC(1, "strlen_screen", API_RETURN_INT(0)); + API_INIT_FUNC(1, "strlen_screen", API_RETURN_INT(0)); if (!scm_is_string (string)) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -337,7 +338,7 @@ weechat_guile_api_string_match (SCM string, SCM mask, SCM case_sensitive) { int value; - API_FUNC(1, "string_match", API_RETURN_INT(0)); + API_INIT_FUNC(1, "string_match", API_RETURN_INT(0)); if (!scm_is_string (string) || !scm_is_string (mask) || !scm_is_integer (case_sensitive)) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -354,7 +355,7 @@ weechat_guile_api_string_has_highlight (SCM string, SCM highlight_words) { int value; - API_FUNC(1, "string_has_highlight", API_RETURN_INT(0)); + API_INIT_FUNC(1, "string_has_highlight", API_RETURN_INT(0)); if (!scm_is_string (string) || !scm_is_string (highlight_words)) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -369,7 +370,7 @@ weechat_guile_api_string_has_highlight_regex (SCM string, SCM regex) { int value; - API_FUNC(1, "string_has_highlight_regex", API_RETURN_INT(0)); + API_INIT_FUNC(1, "string_has_highlight_regex", API_RETURN_INT(0)); if (!scm_is_string (string) || !scm_is_string (regex)) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -385,7 +386,7 @@ weechat_guile_api_string_mask_to_regex (SCM mask) char *result; SCM return_value; - API_FUNC(1, "string_mask_to_regex", API_RETURN_EMPTY); + API_INIT_FUNC(1, "string_mask_to_regex", API_RETURN_EMPTY); if (!scm_is_string (mask)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -400,7 +401,7 @@ weechat_guile_api_string_remove_color (SCM string, SCM replacement) char *result; SCM return_value; - API_FUNC(1, "string_remove_color", API_RETURN_EMPTY); + API_INIT_FUNC(1, "string_remove_color", API_RETURN_EMPTY); if (!scm_is_string (string) || !scm_is_string (replacement)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -415,7 +416,7 @@ weechat_guile_api_string_is_command_char (SCM string) { int value; - API_FUNC(1, "string_is_command_char", API_RETURN_INT(0)); + API_INIT_FUNC(1, "string_is_command_char", API_RETURN_INT(0)); if (!scm_is_string (string)) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -429,7 +430,7 @@ weechat_guile_api_string_input_for_buffer (SCM string) { const char *result; - API_FUNC(1, "string_input_for_buffer", API_RETURN_EMPTY); + API_INIT_FUNC(1, "string_input_for_buffer", API_RETURN_EMPTY); if (!scm_is_string (string)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -446,7 +447,7 @@ weechat_guile_api_string_eval_expression (SCM expr, SCM pointers, SCM return_value; struct t_hashtable *c_pointers, *c_extra_vars, *c_options; - API_FUNC(1, "string_eval_expression", API_RETURN_EMPTY); + API_INIT_FUNC(1, "string_eval_expression", API_RETURN_EMPTY); if (!scm_is_string (expr) || !scm_list_p (pointers) || !scm_list_p (extra_vars) || !scm_list_p (options)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -481,7 +482,7 @@ weechat_guile_api_string_eval_expression (SCM expr, SCM pointers, SCM weechat_guile_api_mkdir_home (SCM directory, SCM mode) { - API_FUNC(1, "mkdir_home", API_RETURN_ERROR); + API_INIT_FUNC(1, "mkdir_home", API_RETURN_ERROR); if (!scm_is_string (directory) || !scm_is_integer (mode)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -494,7 +495,7 @@ weechat_guile_api_mkdir_home (SCM directory, SCM mode) SCM weechat_guile_api_mkdir (SCM directory, SCM mode) { - API_FUNC(1, "mkdir", API_RETURN_ERROR); + API_INIT_FUNC(1, "mkdir", API_RETURN_ERROR); if (!scm_is_string (directory) || !scm_is_integer (mode)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -507,7 +508,7 @@ weechat_guile_api_mkdir (SCM directory, SCM mode) SCM weechat_guile_api_mkdir_parents (SCM directory, SCM mode) { - API_FUNC(1, "mkdir_parents", API_RETURN_ERROR); + API_INIT_FUNC(1, "mkdir_parents", API_RETURN_ERROR); if (!scm_is_string (directory) || !scm_is_integer (mode)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -522,7 +523,7 @@ weechat_guile_api_list_new () { char *result; - API_FUNC(1, "list_new", API_RETURN_EMPTY); + API_INIT_FUNC(1, "list_new", API_RETURN_EMPTY); result = API_PTR2STR(weechat_list_new ()); @@ -534,7 +535,7 @@ weechat_guile_api_list_add (SCM weelist, SCM data, SCM where, SCM user_data) { char *result; - API_FUNC(1, "list_add", API_RETURN_EMPTY); + API_INIT_FUNC(1, "list_add", API_RETURN_EMPTY); if (!scm_is_string (weelist) || !scm_is_string (data) || !scm_is_string (where) || !scm_is_string (user_data)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -552,7 +553,7 @@ weechat_guile_api_list_search (SCM weelist, SCM data) { char *result; - API_FUNC(1, "list_search", API_RETURN_EMPTY); + API_INIT_FUNC(1, "list_search", API_RETURN_EMPTY); if (!scm_is_string (weelist) || !scm_is_string (data)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -567,7 +568,7 @@ weechat_guile_api_list_search_pos (SCM weelist, SCM data) { int pos; - API_FUNC(1, "list_search_pos", API_RETURN_INT(-1)); + API_INIT_FUNC(1, "list_search_pos", API_RETURN_INT(-1)); if (!scm_is_string (weelist) || !scm_is_string (data)) API_WRONG_ARGS(API_RETURN_INT(-1)); @@ -582,7 +583,7 @@ weechat_guile_api_list_casesearch (SCM weelist, SCM data) { char *result; - API_FUNC(1, "list_casesearch", API_RETURN_EMPTY); + API_INIT_FUNC(1, "list_casesearch", API_RETURN_EMPTY); if (!scm_is_string (weelist) || !scm_is_string (data)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -597,7 +598,7 @@ weechat_guile_api_list_casesearch_pos (SCM weelist, SCM data) { int pos; - API_FUNC(1, "list_casesearch_pos", API_RETURN_INT(-1)); + API_INIT_FUNC(1, "list_casesearch_pos", API_RETURN_INT(-1)); if (!scm_is_string (weelist) || !scm_is_string (data)) API_WRONG_ARGS(API_RETURN_INT(-1)); @@ -612,7 +613,7 @@ weechat_guile_api_list_get (SCM weelist, SCM position) { char *result; - API_FUNC(1, "list_get", API_RETURN_EMPTY); + API_INIT_FUNC(1, "list_get", API_RETURN_EMPTY); if (!scm_is_string (weelist) || !scm_is_integer (position)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -625,7 +626,7 @@ weechat_guile_api_list_get (SCM weelist, SCM position) SCM weechat_guile_api_list_set (SCM item, SCM new_value) { - API_FUNC(1, "list_set", API_RETURN_ERROR); + API_INIT_FUNC(1, "list_set", API_RETURN_ERROR); if (!scm_is_string (item) || !scm_is_string (new_value)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -640,7 +641,7 @@ weechat_guile_api_list_next (SCM item) { char *result; - API_FUNC(1, "list_next", API_RETURN_EMPTY); + API_INIT_FUNC(1, "list_next", API_RETURN_EMPTY); if (!scm_is_string (item)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -654,7 +655,7 @@ weechat_guile_api_list_prev (SCM item) { char *result; - API_FUNC(1, "list_prev", API_RETURN_EMPTY); + API_INIT_FUNC(1, "list_prev", API_RETURN_EMPTY); if (!scm_is_string (item)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -668,7 +669,7 @@ weechat_guile_api_list_string (SCM item) { const char *result; - API_FUNC(1, "list_string", API_RETURN_EMPTY); + API_INIT_FUNC(1, "list_string", API_RETURN_EMPTY); if (!scm_is_string (item)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -682,7 +683,7 @@ weechat_guile_api_list_size (SCM weelist) { int size; - API_FUNC(1, "list_size", API_RETURN_INT(0)); + API_INIT_FUNC(1, "list_size", API_RETURN_INT(0)); if (!scm_is_string (weelist)) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -694,7 +695,7 @@ weechat_guile_api_list_size (SCM weelist) SCM weechat_guile_api_list_remove (SCM weelist, SCM item) { - API_FUNC(1, "list_remove", API_RETURN_ERROR); + API_INIT_FUNC(1, "list_remove", API_RETURN_ERROR); if (!scm_is_string (weelist) || !scm_is_string (item)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -707,7 +708,7 @@ weechat_guile_api_list_remove (SCM weelist, SCM item) SCM weechat_guile_api_list_remove_all (SCM weelist) { - API_FUNC(1, "list_remove_all", API_RETURN_ERROR); + API_INIT_FUNC(1, "list_remove_all", API_RETURN_ERROR); if (!scm_is_string (weelist)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -719,7 +720,7 @@ weechat_guile_api_list_remove_all (SCM weelist) SCM weechat_guile_api_list_free (SCM weelist) { - API_FUNC(1, "list_free", API_RETURN_ERROR); + API_INIT_FUNC(1, "list_free", API_RETURN_ERROR); if (!scm_is_string (weelist)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -771,7 +772,7 @@ weechat_guile_api_config_new (SCM name, SCM function, SCM data) char *result; SCM return_value; - API_FUNC(1, "config_new", API_RETURN_EMPTY); + API_INIT_FUNC(1, "config_new", API_RETURN_EMPTY); if (!scm_is_string (name) || !scm_is_string (function) || !scm_is_string (data)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -1008,7 +1009,7 @@ weechat_guile_api_config_new_section (SCM args) char *result; SCM return_value; - API_FUNC(1, "config_new_section", API_RETURN_EMPTY); + API_INIT_FUNC(1, "config_new_section", API_RETURN_EMPTY); if (!scm_list_p (args) || (scm_to_int (scm_length (args)) != 14)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -1067,7 +1068,7 @@ weechat_guile_api_config_search_section (SCM config_file, SCM section_name) char *result; SCM return_value; - API_FUNC(1, "config_search_section", API_RETURN_EMPTY); + API_INIT_FUNC(1, "config_search_section", API_RETURN_EMPTY); if (!scm_is_string (config_file) || !scm_is_string (section_name)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -1184,7 +1185,7 @@ weechat_guile_api_config_new_option (SCM args) char *result; SCM return_value; - API_FUNC(1, "config_new_option", API_RETURN_EMPTY); + API_INIT_FUNC(1, "config_new_option", API_RETURN_EMPTY); if (!scm_list_p (args) || (scm_to_int (scm_length (args)) != 17)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -1251,7 +1252,7 @@ weechat_guile_api_config_search_option (SCM config_file, SCM section, char *result; SCM return_value; - API_FUNC(1, "config_search_option", API_RETURN_EMPTY); + API_INIT_FUNC(1, "config_search_option", API_RETURN_EMPTY); if (!scm_is_string (config_file) || !scm_is_string (section) || !scm_is_string (option_name)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -1268,7 +1269,7 @@ weechat_guile_api_config_string_to_boolean (SCM text) { int value; - API_FUNC(1, "config_string_to_boolean", API_RETURN_INT(0)); + API_INIT_FUNC(1, "config_string_to_boolean", API_RETURN_INT(0)); if (!scm_is_string (text)) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -1282,7 +1283,7 @@ weechat_guile_api_config_option_reset (SCM option, SCM run_callback) { int rc; - API_FUNC(1, "config_option_reset", API_RETURN_INT(0)); + API_INIT_FUNC(1, "config_option_reset", API_RETURN_INT(0)); if (!scm_is_string (option) || !scm_is_integer (run_callback)) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -1298,7 +1299,7 @@ weechat_guile_api_config_option_set (SCM option, SCM new_value, { int rc; - API_FUNC(1, "config_option_set", API_RETURN_INT(WEECHAT_CONFIG_OPTION_SET_ERROR)); + API_INIT_FUNC(1, "config_option_set", API_RETURN_INT(WEECHAT_CONFIG_OPTION_SET_ERROR)); if (!scm_is_string (option) || !scm_is_string (new_value) || !scm_is_integer (run_callback)) API_WRONG_ARGS(API_RETURN_INT(WEECHAT_CONFIG_OPTION_SET_ERROR)); @@ -1315,7 +1316,7 @@ weechat_guile_api_config_option_set_null (SCM option, SCM run_callback) { int rc; - API_FUNC(1, "config_option_set_null", API_RETURN_INT(WEECHAT_CONFIG_OPTION_SET_ERROR)); + API_INIT_FUNC(1, "config_option_set_null", API_RETURN_INT(WEECHAT_CONFIG_OPTION_SET_ERROR)); if (!scm_is_string (option) || !scm_is_integer (run_callback)) API_WRONG_ARGS(API_RETURN_INT(WEECHAT_CONFIG_OPTION_SET_ERROR)); @@ -1330,7 +1331,7 @@ weechat_guile_api_config_option_unset (SCM option) { int rc; - API_FUNC(1, "config_option_unset", API_RETURN_INT(WEECHAT_CONFIG_OPTION_UNSET_ERROR)); + API_INIT_FUNC(1, "config_option_unset", API_RETURN_INT(WEECHAT_CONFIG_OPTION_UNSET_ERROR)); if (!scm_is_string (option)) API_WRONG_ARGS(API_RETURN_INT(WEECHAT_CONFIG_OPTION_UNSET_ERROR)); @@ -1342,7 +1343,7 @@ weechat_guile_api_config_option_unset (SCM option) SCM weechat_guile_api_config_option_rename (SCM option, SCM new_name) { - API_FUNC(1, "config_option_rename", API_RETURN_ERROR); + API_INIT_FUNC(1, "config_option_rename", API_RETURN_ERROR); if (!scm_is_string (option) || !scm_is_string (new_name)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -1357,7 +1358,7 @@ weechat_guile_api_config_option_is_null (SCM option) { int value; - API_FUNC(1, "config_option_is_null", API_RETURN_INT(1)); + API_INIT_FUNC(1, "config_option_is_null", API_RETURN_INT(1)); if (!scm_is_string (option)) API_WRONG_ARGS(API_RETURN_INT(1)); @@ -1371,7 +1372,7 @@ weechat_guile_api_config_option_default_is_null (SCM option) { int value; - API_FUNC(1, "config_option_default_is_null", API_RETURN_INT(1)); + API_INIT_FUNC(1, "config_option_default_is_null", API_RETURN_INT(1)); if (!scm_is_string (option)) API_WRONG_ARGS(API_RETURN_INT(1)); @@ -1385,7 +1386,7 @@ weechat_guile_api_config_boolean (SCM option) { int value; - API_FUNC(1, "config_boolean", API_RETURN_INT(0)); + API_INIT_FUNC(1, "config_boolean", API_RETURN_INT(0)); if (!scm_is_string (option)) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -1399,7 +1400,7 @@ weechat_guile_api_config_boolean_default (SCM option) { int value; - API_FUNC(1, "config_boolean_default", API_RETURN_INT(0)); + API_INIT_FUNC(1, "config_boolean_default", API_RETURN_INT(0)); if (!scm_is_string (option)) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -1413,7 +1414,7 @@ weechat_guile_api_config_integer (SCM option) { int value; - API_FUNC(1, "config_integer", API_RETURN_INT(0)); + API_INIT_FUNC(1, "config_integer", API_RETURN_INT(0)); if (!scm_is_string (option)) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -1427,7 +1428,7 @@ weechat_guile_api_config_integer_default (SCM option) { int value; - API_FUNC(1, "config_integer_default", API_RETURN_INT(0)); + API_INIT_FUNC(1, "config_integer_default", API_RETURN_INT(0)); if (!scm_is_string (option)) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -1441,7 +1442,7 @@ weechat_guile_api_config_string (SCM option) { const char *result; - API_FUNC(1, "config_string", API_RETURN_EMPTY); + API_INIT_FUNC(1, "config_string", API_RETURN_EMPTY); if (!scm_is_string (option)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -1455,7 +1456,7 @@ weechat_guile_api_config_string_default (SCM option) { const char *result; - API_FUNC(1, "config_string_default", API_RETURN_EMPTY); + API_INIT_FUNC(1, "config_string_default", API_RETURN_EMPTY); if (!scm_is_string (option)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -1469,7 +1470,7 @@ weechat_guile_api_config_color (SCM option) { const char *result; - API_FUNC(1, "config_color", API_RETURN_INT(0)); + API_INIT_FUNC(1, "config_color", API_RETURN_INT(0)); if (!scm_is_string (option)) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -1483,7 +1484,7 @@ weechat_guile_api_config_color_default (SCM option) { const char *result; - API_FUNC(1, "config_color_default", API_RETURN_INT(0)); + API_INIT_FUNC(1, "config_color_default", API_RETURN_INT(0)); if (!scm_is_string (option)) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -1495,7 +1496,7 @@ weechat_guile_api_config_color_default (SCM option) SCM weechat_guile_api_config_write_option (SCM config_file, SCM option) { - API_FUNC(1, "config_write_option", API_RETURN_ERROR); + API_INIT_FUNC(1, "config_write_option", API_RETURN_ERROR); if (!scm_is_string (config_file) || !scm_is_string (option)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -1509,7 +1510,7 @@ SCM weechat_guile_api_config_write_line (SCM config_file, SCM option_name, SCM value) { - API_FUNC(1, "config_write_line", API_RETURN_ERROR); + API_INIT_FUNC(1, "config_write_line", API_RETURN_ERROR); if (!scm_is_string (config_file) || !scm_is_string (option_name) || !scm_is_string (value)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -1526,7 +1527,7 @@ weechat_guile_api_config_write (SCM config_file) { int rc; - API_FUNC(1, "config_write", API_RETURN_INT(-1)); + API_INIT_FUNC(1, "config_write", API_RETURN_INT(-1)); if (!scm_is_string (config_file)) API_WRONG_ARGS(API_RETURN_INT(-1)); @@ -1540,7 +1541,7 @@ weechat_guile_api_config_read (SCM config_file) { int rc; - API_FUNC(1, "config_read", API_RETURN_INT(-1)); + API_INIT_FUNC(1, "config_read", API_RETURN_INT(-1)); if (!scm_is_string (config_file)) API_WRONG_ARGS(API_RETURN_INT(-1)); @@ -1554,7 +1555,7 @@ weechat_guile_api_config_reload (SCM config_file) { int rc; - API_FUNC(1, "config_reload", API_RETURN_INT(-1)); + API_INIT_FUNC(1, "config_reload", API_RETURN_INT(-1)); if (!scm_is_string (config_file)) API_WRONG_ARGS(API_RETURN_INT(-1)); @@ -1566,7 +1567,7 @@ weechat_guile_api_config_reload (SCM config_file) SCM weechat_guile_api_config_option_free (SCM option) { - API_FUNC(1, "config_option_free", API_RETURN_ERROR); + API_INIT_FUNC(1, "config_option_free", API_RETURN_ERROR); if (!scm_is_string (option)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -1580,7 +1581,7 @@ weechat_guile_api_config_option_free (SCM option) SCM weechat_guile_api_config_section_free_options (SCM section) { - API_FUNC(1, "config_section_free_options", API_RETURN_ERROR); + API_INIT_FUNC(1, "config_section_free_options", API_RETURN_ERROR); if (!scm_is_string (section)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -1594,7 +1595,7 @@ weechat_guile_api_config_section_free_options (SCM section) SCM weechat_guile_api_config_section_free (SCM section) { - API_FUNC(1, "config_section_free", API_RETURN_ERROR); + API_INIT_FUNC(1, "config_section_free", API_RETURN_ERROR); if (!scm_is_string (section)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -1608,7 +1609,7 @@ weechat_guile_api_config_section_free (SCM section) SCM weechat_guile_api_config_free (SCM config_file) { - API_FUNC(1, "config_free", API_RETURN_ERROR); + API_INIT_FUNC(1, "config_free", API_RETURN_ERROR); if (!scm_is_string (config_file)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -1625,7 +1626,7 @@ weechat_guile_api_config_get (SCM option) char *result; SCM return_value; - API_FUNC(1, "config_get", API_RETURN_EMPTY); + API_INIT_FUNC(1, "config_get", API_RETURN_EMPTY); if (!scm_is_string (option)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -1639,7 +1640,7 @@ weechat_guile_api_config_get_plugin (SCM option) { const char *result; - API_FUNC(1, "config_get_plugin", API_RETURN_EMPTY); + API_INIT_FUNC(1, "config_get_plugin", API_RETURN_EMPTY); if (!scm_is_string (option)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -1655,7 +1656,7 @@ weechat_guile_api_config_is_set_plugin (SCM option) { int rc; - API_FUNC(1, "config_is_set_plugin", API_RETURN_INT(0)); + API_INIT_FUNC(1, "config_is_set_plugin", API_RETURN_INT(0)); if (!scm_is_string (option)) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -1671,7 +1672,7 @@ weechat_guile_api_config_set_plugin (SCM option, SCM value) { int rc; - API_FUNC(1, "config_set_plugin", API_RETURN_INT(WEECHAT_CONFIG_OPTION_SET_ERROR)); + API_INIT_FUNC(1, "config_set_plugin", API_RETURN_INT(WEECHAT_CONFIG_OPTION_SET_ERROR)); if (!scm_is_string (option) || !scm_is_string (value)) API_WRONG_ARGS(API_RETURN_INT(WEECHAT_CONFIG_OPTION_SET_ERROR)); @@ -1686,7 +1687,7 @@ weechat_guile_api_config_set_plugin (SCM option, SCM value) SCM weechat_guile_api_config_set_desc_plugin (SCM option, SCM description) { - API_FUNC(1, "config_set_desc_plugin", API_RETURN_ERROR); + API_INIT_FUNC(1, "config_set_desc_plugin", API_RETURN_ERROR); if (!scm_is_string (option) || !scm_is_string (description)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -1703,7 +1704,7 @@ weechat_guile_api_config_unset_plugin (SCM option) { int rc; - API_FUNC(1, "config_unset_plugin", API_RETURN_INT(WEECHAT_CONFIG_OPTION_UNSET_ERROR)); + API_INIT_FUNC(1, "config_unset_plugin", API_RETURN_INT(WEECHAT_CONFIG_OPTION_UNSET_ERROR)); if (!scm_is_string (option)) API_WRONG_ARGS(API_RETURN_INT(WEECHAT_CONFIG_OPTION_UNSET_ERROR)); @@ -1720,7 +1721,7 @@ weechat_guile_api_key_bind (SCM context, SCM keys) struct t_hashtable *c_keys; int num_keys; - API_FUNC(1, "key_bind", API_RETURN_INT(0)); + API_INIT_FUNC(1, "key_bind", API_RETURN_INT(0)); if (!scm_is_string (context) || !scm_list_p (keys)) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -1742,7 +1743,7 @@ weechat_guile_api_key_unbind (SCM context, SCM key) { int num_keys; - API_FUNC(1, "key_unbind", API_RETURN_INT(0)); + API_INIT_FUNC(1, "key_unbind", API_RETURN_INT(0)); if (!scm_is_string (context) || !scm_is_string (key)) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -1757,7 +1758,7 @@ weechat_guile_api_prefix (SCM prefix) { const char *result; - API_FUNC(0, "prefix", API_RETURN_EMPTY); + API_INIT_FUNC(0, "prefix", API_RETURN_EMPTY); if (!scm_is_string (prefix)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -1771,7 +1772,7 @@ weechat_guile_api_color (SCM color) { const char *result; - API_FUNC(0, "color", API_RETURN_EMPTY); + API_INIT_FUNC(0, "color", API_RETURN_EMPTY); if (!scm_is_string (color)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -1783,7 +1784,7 @@ weechat_guile_api_color (SCM color) SCM weechat_guile_api_print (SCM buffer, SCM message) { - API_FUNC(0, "print", API_RETURN_ERROR); + API_INIT_FUNC(0, "print", API_RETURN_ERROR); if (!scm_is_string (buffer) || !scm_is_string (message)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -1798,7 +1799,7 @@ weechat_guile_api_print (SCM buffer, SCM message) SCM weechat_guile_api_print_date_tags (SCM buffer, SCM date, SCM tags, SCM message) { - API_FUNC(1, "print_date_tags", API_RETURN_ERROR); + API_INIT_FUNC(1, "print_date_tags", API_RETURN_ERROR); if (!scm_is_string (buffer) || !scm_is_integer (date) || !scm_is_string (tags) || !scm_is_string (message)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -1816,7 +1817,7 @@ weechat_guile_api_print_date_tags (SCM buffer, SCM date, SCM tags, SCM message) SCM weechat_guile_api_print_y (SCM buffer, SCM y, SCM message) { - API_FUNC(1, "print_y", API_RETURN_ERROR); + API_INIT_FUNC(1, "print_y", API_RETURN_ERROR); if (!scm_is_string (buffer) || !scm_is_integer (y) || !scm_is_string (message)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -1833,7 +1834,7 @@ weechat_guile_api_print_y (SCM buffer, SCM y, SCM message) SCM weechat_guile_api_log_print (SCM message) { - API_FUNC(1, "log_print", API_RETURN_ERROR); + API_INIT_FUNC(1, "log_print", API_RETURN_ERROR); if (!scm_is_string (message)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -1893,7 +1894,7 @@ weechat_guile_api_hook_command (SCM command, SCM description, SCM args, char *result; SCM return_value; - API_FUNC(1, "hook_command", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_command", API_RETURN_EMPTY); if (!scm_is_string (command) || !scm_is_string (description) || !scm_is_string (args) || !scm_is_string (args_description) || !scm_is_string (completion) || !scm_is_string (function) @@ -1958,7 +1959,7 @@ weechat_guile_api_hook_command_run (SCM command, SCM function, SCM data) char *result; SCM return_value; - API_FUNC(1, "hook_command_run", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_command_run", API_RETURN_EMPTY); if (!scm_is_string (command) || !scm_is_string (function) || !scm_is_string (data)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -2017,7 +2018,7 @@ weechat_guile_api_hook_timer (SCM interval, SCM align_second, SCM max_calls, char *result; SCM return_value; - API_FUNC(1, "hook_timer", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_timer", API_RETURN_EMPTY); if (!scm_is_integer (interval) || !scm_is_integer (align_second) || !scm_is_integer (max_calls) || !scm_is_string (function) || !scm_is_string (data)) @@ -2078,7 +2079,7 @@ weechat_guile_api_hook_fd (SCM fd, SCM read, SCM write, SCM exception, char *result; SCM return_value; - API_FUNC(1, "hook_fd", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_fd", API_RETURN_EMPTY); if (!scm_is_integer (fd) || !scm_is_integer (read) || !scm_is_integer (write) || !scm_is_integer (exception) || !scm_is_string (function) || !scm_is_string (data)) @@ -2143,7 +2144,7 @@ weechat_guile_api_hook_process (SCM command, SCM timeout, SCM function, char *result; SCM return_value; - API_FUNC(1, "hook_process", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_process", API_RETURN_EMPTY); if (!scm_is_string (command) || !scm_is_integer (timeout) || !scm_is_string (function) || !scm_is_string (data)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -2167,7 +2168,7 @@ weechat_guile_api_hook_process_hashtable (SCM command, SCM options, SCM timeout, SCM return_value; struct t_hashtable *c_options; - API_FUNC(1, "hook_process_hashtable", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_process_hashtable", API_RETURN_EMPTY); if (!scm_is_string (command) || !scm_list_p (options) || !scm_is_integer (timeout) || !scm_is_string (function) || !scm_is_string (data)) @@ -2246,7 +2247,7 @@ weechat_guile_api_hook_connect (SCM proxy, SCM address, SCM port, SCM ipv6, char *result; SCM return_value; - API_FUNC(1, "hook_connect", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_connect", API_RETURN_EMPTY); if (!scm_is_string (proxy) || !scm_is_string (address) || !scm_is_integer (port) || !scm_is_integer (ipv6) || !scm_is_integer (retry) || !scm_is_string (local_hostname) @@ -2335,7 +2336,7 @@ weechat_guile_api_hook_print (SCM buffer, SCM tags, SCM message, char *result; SCM return_value; - API_FUNC(1, "hook_print", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_print", API_RETURN_EMPTY); if (!scm_is_string (buffer) || !scm_is_string (tags) || !scm_is_string (message) || !scm_is_integer (strip_colors) || !scm_is_string (function) || !scm_is_string (data)) @@ -2420,7 +2421,7 @@ weechat_guile_api_hook_signal (SCM signal, SCM function, SCM data) char *result; SCM return_value; - API_FUNC(1, "hook_signal", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_signal", API_RETURN_EMPTY); if (!scm_is_string (signal) || !scm_is_string (function) || !scm_is_string (data)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -2440,7 +2441,7 @@ weechat_guile_api_hook_signal_send (SCM signal, SCM type_data, { int number, rc; - API_FUNC(1, "hook_signal_send", API_RETURN_INT(WEECHAT_RC_ERROR)); + API_INIT_FUNC(1, "hook_signal_send", API_RETURN_INT(WEECHAT_RC_ERROR)); if (!scm_is_string (signal) || !scm_is_string (type_data)) API_WRONG_ARGS(API_RETURN_INT(WEECHAT_RC_ERROR)); @@ -2518,7 +2519,7 @@ weechat_guile_api_hook_hsignal (SCM signal, SCM function, SCM data) char *result; SCM return_value; - API_FUNC(1, "hook_hsignal", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_hsignal", API_RETURN_EMPTY); if (!scm_is_string (signal) || !scm_is_string (function) || !scm_is_string (data)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -2539,7 +2540,7 @@ weechat_guile_api_hook_hsignal_send (SCM signal, SCM hashtable) struct t_hashtable *c_hashtable; int rc; - API_FUNC(1, "hook_hsignal_send", API_RETURN_INT(WEECHAT_RC_ERROR)); + API_INIT_FUNC(1, "hook_hsignal_send", API_RETURN_INT(WEECHAT_RC_ERROR)); if (!scm_is_string (signal) || !scm_list_p (hashtable)) API_WRONG_ARGS(API_RETURN_INT(WEECHAT_RC_ERROR)); @@ -2597,7 +2598,7 @@ weechat_guile_api_hook_config (SCM option, SCM function, SCM data) char *result; SCM return_value; - API_FUNC(1, "hook_config", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_config", API_RETURN_EMPTY); if (!scm_is_string (option) || !scm_is_string (function) || !scm_is_string (data)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -2661,7 +2662,7 @@ weechat_guile_api_hook_completion (SCM completion, SCM description, char *result; SCM return_value; - API_FUNC(1, "hook_completion", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_completion", API_RETURN_EMPTY); if (!scm_is_string (completion) || !scm_is_string (description) || !scm_is_string (function) || !scm_is_string (data)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -2681,7 +2682,7 @@ SCM weechat_guile_api_hook_completion_list_add (SCM completion, SCM word, SCM nick_completion, SCM where) { - API_FUNC(1, "hook_completion_list_add", API_RETURN_ERROR); + API_INIT_FUNC(1, "hook_completion_list_add", API_RETURN_ERROR); if (!scm_is_string (completion) || !scm_is_string (word) || !scm_is_integer (nick_completion) || !scm_is_string (where)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -2726,7 +2727,7 @@ weechat_guile_api_hook_modifier (SCM modifier, SCM function, SCM data) char *result; SCM return_value; - API_FUNC(1, "hook_modifier", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_modifier", API_RETURN_EMPTY); if (!scm_is_string (modifier) || !scm_is_string (function) || !scm_is_string (data)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -2748,7 +2749,7 @@ weechat_guile_api_hook_modifier_exec (SCM modifier, SCM modifier_data, char *result; SCM return_value; - API_FUNC(1, "hook_modifier_exec", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_modifier_exec", API_RETURN_EMPTY); if (!scm_is_string (modifier) || !scm_is_string (modifier_data) || !scm_is_string (string)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -2792,7 +2793,7 @@ weechat_guile_api_hook_info (SCM info_name, SCM description, char *result; SCM return_value; - API_FUNC(1, "hook_info", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_info", API_RETURN_EMPTY); if (!scm_is_string (info_name) || !scm_is_string (description) || !scm_is_string (args_description) || !scm_is_string (function) || !scm_is_string (data)) @@ -2844,7 +2845,7 @@ weechat_guile_api_hook_info_hashtable (SCM info_name, SCM description, char *result; SCM return_value; - API_FUNC(1, "hook_info_hashtable", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_info_hashtable", API_RETURN_EMPTY); if (!scm_is_string (info_name) || !scm_is_string (description) || !scm_is_string (args_description) || !scm_is_string (output_description) || !scm_is_string (function) || !scm_is_string (data)) @@ -2903,7 +2904,7 @@ weechat_guile_api_hook_infolist (SCM infolist_name, SCM description, char *result; SCM return_value; - API_FUNC(1, "hook_infolist", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_infolist", API_RETURN_EMPTY); if (!scm_is_string (infolist_name) || !scm_is_string (description) || !scm_is_string (pointer_description) || !scm_is_string (args_description) || !scm_is_string (function) || !scm_is_string (data)) @@ -2951,7 +2952,7 @@ weechat_guile_api_hook_focus (SCM area, SCM function, SCM data) char *result; SCM return_value; - API_FUNC(1, "hook_focus", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_focus", API_RETURN_EMPTY); if (!scm_is_string (area) || !scm_is_string (function) || !scm_is_string (data)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -2969,7 +2970,7 @@ weechat_guile_api_hook_focus (SCM area, SCM function, SCM data) SCM weechat_guile_api_hook_set (SCM hook, SCM property, SCM value) { - API_FUNC(1, "hook_set", API_RETURN_ERROR); + API_INIT_FUNC(1, "hook_set", API_RETURN_ERROR); if (!scm_is_string (hook) || !scm_is_string (property) || !scm_is_string (value)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -2984,7 +2985,7 @@ weechat_guile_api_hook_set (SCM hook, SCM property, SCM value) SCM weechat_guile_api_unhook (SCM hook) { - API_FUNC(1, "unhook", API_RETURN_ERROR); + API_INIT_FUNC(1, "unhook", API_RETURN_ERROR); if (!scm_is_string (hook)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -2998,7 +2999,7 @@ weechat_guile_api_unhook (SCM hook) SCM weechat_guile_api_unhook_all () { - API_FUNC(1, "unhook_all", API_RETURN_ERROR); + API_INIT_FUNC(1, "unhook_all", API_RETURN_ERROR); plugin_script_api_unhook_all (weechat_guile_plugin, guile_current_script); @@ -3086,7 +3087,7 @@ weechat_guile_api_buffer_new (SCM name, SCM function_input, SCM data_input, char *result; SCM return_value; - API_FUNC(1, "buffer_new", API_RETURN_EMPTY); + API_INIT_FUNC(1, "buffer_new", API_RETURN_EMPTY); if (!scm_is_string (name) || !scm_is_string (function_input) || !scm_is_string (data_input) || !scm_is_string (function_close) || !scm_is_string (data_close)) @@ -3111,7 +3112,7 @@ weechat_guile_api_buffer_search (SCM plugin, SCM name) char *result; SCM return_value; - API_FUNC(1, "buffer_search", API_RETURN_EMPTY); + API_INIT_FUNC(1, "buffer_search", API_RETURN_EMPTY); if (!scm_is_string (plugin) || !scm_is_string (name)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3127,7 +3128,7 @@ weechat_guile_api_buffer_search_main () char *result; SCM return_value; - API_FUNC(1, "buffer_search_main", API_RETURN_EMPTY); + API_INIT_FUNC(1, "buffer_search_main", API_RETURN_EMPTY); result = API_PTR2STR(weechat_buffer_search_main ()); @@ -3140,7 +3141,7 @@ weechat_guile_api_current_buffer () char *result; SCM return_value; - API_FUNC(1, "current_buffer", API_RETURN_EMPTY); + API_INIT_FUNC(1, "current_buffer", API_RETURN_EMPTY); result = API_PTR2STR(weechat_current_buffer ()); @@ -3150,7 +3151,7 @@ weechat_guile_api_current_buffer () SCM weechat_guile_api_buffer_clear (SCM buffer) { - API_FUNC(1, "buffer_clear", API_RETURN_ERROR); + API_INIT_FUNC(1, "buffer_clear", API_RETURN_ERROR); if (!scm_is_string (buffer)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -3162,7 +3163,7 @@ weechat_guile_api_buffer_clear (SCM buffer) SCM weechat_guile_api_buffer_close (SCM buffer) { - API_FUNC(1, "buffer_close", API_RETURN_ERROR); + API_INIT_FUNC(1, "buffer_close", API_RETURN_ERROR); if (!scm_is_string (buffer)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -3176,7 +3177,7 @@ weechat_guile_api_buffer_close (SCM buffer) SCM weechat_guile_api_buffer_merge (SCM buffer, SCM target_buffer) { - API_FUNC(1, "buffer_merge", API_RETURN_ERROR); + API_INIT_FUNC(1, "buffer_merge", API_RETURN_ERROR); if (!scm_is_string (buffer) || !scm_is_string (target_buffer)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -3189,7 +3190,7 @@ weechat_guile_api_buffer_merge (SCM buffer, SCM target_buffer) SCM weechat_guile_api_buffer_unmerge (SCM buffer, SCM number) { - API_FUNC(1, "buffer_unmerge", API_RETURN_ERROR); + API_INIT_FUNC(1, "buffer_unmerge", API_RETURN_ERROR); if (!scm_is_string (buffer) || !scm_is_integer (number)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -3204,7 +3205,7 @@ weechat_guile_api_buffer_get_integer (SCM buffer, SCM property) { int value; - API_FUNC(1, "buffer_get_integer", API_RETURN_INT(-1)); + API_INIT_FUNC(1, "buffer_get_integer", API_RETURN_INT(-1)); if (!scm_is_string (buffer) || !scm_is_string (property)) API_WRONG_ARGS(API_RETURN_INT(-1)); @@ -3219,7 +3220,7 @@ weechat_guile_api_buffer_get_string (SCM buffer, SCM property) { const char *result; - API_FUNC(1, "buffer_get_string", API_RETURN_EMPTY); + API_INIT_FUNC(1, "buffer_get_string", API_RETURN_EMPTY); if (!scm_is_string (buffer) || !scm_is_string (property)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3235,7 +3236,7 @@ weechat_guile_api_buffer_get_pointer (SCM buffer, SCM property) char *result; SCM return_value; - API_FUNC(1, "buffer_get_pointer", API_RETURN_EMPTY); + API_INIT_FUNC(1, "buffer_get_pointer", API_RETURN_EMPTY); if (!scm_is_string (buffer) || !scm_is_string (property)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3248,7 +3249,7 @@ weechat_guile_api_buffer_get_pointer (SCM buffer, SCM property) SCM weechat_guile_api_buffer_set (SCM buffer, SCM property, SCM value) { - API_FUNC(1, "buffer_set", API_RETURN_ERROR); + API_INIT_FUNC(1, "buffer_set", API_RETURN_ERROR); if (!scm_is_string (buffer) || !scm_is_string (property) || !scm_is_string (value)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -3266,7 +3267,7 @@ weechat_guile_api_buffer_string_replace_local_var (SCM buffer, SCM string) char *result; SCM return_value; - API_FUNC(1, "buffer_string_replace_local_var", API_RETURN_ERROR); + API_INIT_FUNC(1, "buffer_string_replace_local_var", API_RETURN_ERROR); if (!scm_is_string (buffer) || !scm_is_string (string)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -3281,7 +3282,7 @@ weechat_guile_api_buffer_match_list (SCM buffer, SCM string) { int value; - API_FUNC(1, "buffer_match_list", API_RETURN_INT(0)); + API_INIT_FUNC(1, "buffer_match_list", API_RETURN_INT(0)); if (!scm_is_string (buffer) || !scm_is_string (string)) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -3297,7 +3298,7 @@ weechat_guile_api_current_window () char *result; SCM return_value; - API_FUNC(1, "current_window", API_RETURN_EMPTY); + API_INIT_FUNC(1, "current_window", API_RETURN_EMPTY); result = API_PTR2STR(weechat_current_window ()); @@ -3310,7 +3311,7 @@ weechat_guile_api_window_search_with_buffer (SCM buffer) char *result; SCM return_value; - API_FUNC(1, "window_search_with_buffer", API_RETURN_EMPTY); + API_INIT_FUNC(1, "window_search_with_buffer", API_RETURN_EMPTY); if (!scm_is_string (buffer)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3324,7 +3325,7 @@ weechat_guile_api_window_get_integer (SCM window, SCM property) { int value; - API_FUNC(1, "window_get_integer", API_RETURN_INT(-1)); + API_INIT_FUNC(1, "window_get_integer", API_RETURN_INT(-1)); if (!scm_is_string (window) || !scm_is_string (property)) API_WRONG_ARGS(API_RETURN_INT(-1)); @@ -3339,7 +3340,7 @@ weechat_guile_api_window_get_string (SCM window, SCM property) { const char *result; - API_FUNC(1, "window_get_string", API_RETURN_EMPTY); + API_INIT_FUNC(1, "window_get_string", API_RETURN_EMPTY); if (!scm_is_string (window) || !scm_is_string (property)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3355,7 +3356,7 @@ weechat_guile_api_window_get_pointer (SCM window, SCM property) char *result; SCM return_value; - API_FUNC(1, "window_get_pointer", API_RETURN_EMPTY); + API_INIT_FUNC(1, "window_get_pointer", API_RETURN_EMPTY); if (!scm_is_string (window) || !scm_is_string (property)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3368,7 +3369,7 @@ weechat_guile_api_window_get_pointer (SCM window, SCM property) SCM weechat_guile_api_window_set_title (SCM title) { - API_FUNC(1, "window_set_title", API_RETURN_ERROR); + API_INIT_FUNC(1, "window_set_title", API_RETURN_ERROR); if (!scm_is_string (title)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -3384,7 +3385,7 @@ weechat_guile_api_nicklist_add_group (SCM buffer, SCM parent_group, SCM name, char *result; SCM return_value; - API_FUNC(1, "nicklist_add_group", API_RETURN_EMPTY); + API_INIT_FUNC(1, "nicklist_add_group", API_RETURN_EMPTY); if (!scm_is_string (buffer) || !scm_is_string (parent_group) || !scm_is_string (name) || !scm_is_string (color) || !scm_is_integer (visible)) @@ -3405,7 +3406,7 @@ weechat_guile_api_nicklist_search_group (SCM buffer, SCM from_group, SCM name) char *result; SCM return_value; - API_FUNC(1, "nicklist_search_group", API_RETURN_EMPTY); + API_INIT_FUNC(1, "nicklist_search_group", API_RETURN_EMPTY); if (!scm_is_string (buffer) || !scm_is_string (from_group) || !scm_is_string (name)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3425,7 +3426,7 @@ weechat_guile_api_nicklist_add_nick (SCM buffer, SCM group, SCM name, char *result; SCM return_value; - API_FUNC(1, "nicklist_add_nick", API_RETURN_EMPTY); + API_INIT_FUNC(1, "nicklist_add_nick", API_RETURN_EMPTY); if (!scm_is_string (buffer) || !scm_is_string (group) || !scm_is_string (name) || !scm_is_string (color) || !scm_is_string (prefix) || !scm_is_string (prefix_color) @@ -3449,7 +3450,7 @@ weechat_guile_api_nicklist_search_nick (SCM buffer, SCM from_group, SCM name) char *result; SCM return_value; - API_FUNC(1, "nicklist_search_nick", API_RETURN_EMPTY); + API_INIT_FUNC(1, "nicklist_search_nick", API_RETURN_EMPTY); if (!scm_is_string (buffer) || !scm_is_string (from_group) || !scm_is_string (name)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3464,7 +3465,7 @@ weechat_guile_api_nicklist_search_nick (SCM buffer, SCM from_group, SCM name) SCM weechat_guile_api_nicklist_remove_group (SCM buffer, SCM group) { - API_FUNC(1, "nicklist_remove_group", API_RETURN_ERROR); + API_INIT_FUNC(1, "nicklist_remove_group", API_RETURN_ERROR); if (!scm_is_string (buffer) || !scm_is_string (group)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -3477,7 +3478,7 @@ weechat_guile_api_nicklist_remove_group (SCM buffer, SCM group) SCM weechat_guile_api_nicklist_remove_nick (SCM buffer, SCM nick) { - API_FUNC(1, "nicklist_remove_nick", API_RETURN_ERROR); + API_INIT_FUNC(1, "nicklist_remove_nick", API_RETURN_ERROR); if (!scm_is_string (buffer) || !scm_is_string (nick)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -3490,7 +3491,7 @@ weechat_guile_api_nicklist_remove_nick (SCM buffer, SCM nick) SCM weechat_guile_api_nicklist_remove_all (SCM buffer) { - API_FUNC(1, "nicklist_remove_all", API_RETURN_ERROR); + API_INIT_FUNC(1, "nicklist_remove_all", API_RETURN_ERROR); if (!scm_is_string (buffer)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -3505,7 +3506,7 @@ weechat_guile_api_nicklist_group_get_integer (SCM buffer, SCM group, { int value; - API_FUNC(1, "nicklist_group_get_integer", API_RETURN_INT(-1)); + API_INIT_FUNC(1, "nicklist_group_get_integer", API_RETURN_INT(-1)); if (!scm_is_string (buffer) || !scm_is_string (group) || !scm_is_string (property)) API_WRONG_ARGS(API_RETURN_INT(-1)); @@ -3523,7 +3524,7 @@ weechat_guile_api_nicklist_group_get_string (SCM buffer, SCM group, { const char *result; - API_FUNC(1, "nicklist_group_get_string", API_RETURN_EMPTY); + API_INIT_FUNC(1, "nicklist_group_get_string", API_RETURN_EMPTY); if (!scm_is_string (buffer) || !scm_is_string (group) || !scm_is_string (property)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3542,7 +3543,7 @@ weechat_guile_api_nicklist_group_get_pointer (SCM buffer, SCM group, char *result; SCM return_value; - API_FUNC(1, "nicklist_group_get_pointer", API_RETURN_EMPTY); + API_INIT_FUNC(1, "nicklist_group_get_pointer", API_RETURN_EMPTY); if (!scm_is_string (buffer) || !scm_is_string (group) || !scm_is_string (property)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3558,7 +3559,7 @@ SCM weechat_guile_api_nicklist_group_set (SCM buffer, SCM group, SCM property, SCM value) { - API_FUNC(1, "nicklist_group_set", API_RETURN_ERROR); + API_INIT_FUNC(1, "nicklist_group_set", API_RETURN_ERROR); if (!scm_is_string (buffer) || !scm_is_string (group) || !scm_is_string (property) || !scm_is_string (value)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -3575,7 +3576,7 @@ weechat_guile_api_nicklist_nick_get_integer (SCM buffer, SCM nick, SCM property) { int value; - API_FUNC(1, "nicklist_nick_get_integer", API_RETURN_INT(-1)); + API_INIT_FUNC(1, "nicklist_nick_get_integer", API_RETURN_INT(-1)); if (!scm_is_string (buffer) || !scm_is_string (nick) || !scm_is_string (property)) API_WRONG_ARGS(API_RETURN_INT(-1)); @@ -3592,7 +3593,7 @@ weechat_guile_api_nicklist_nick_get_string (SCM buffer, SCM nick, SCM property) { const char *result; - API_FUNC(1, "nicklist_nick_get_string", API_RETURN_EMPTY); + API_INIT_FUNC(1, "nicklist_nick_get_string", API_RETURN_EMPTY); if (!scm_is_string (buffer) || !scm_is_string (nick) || !scm_is_string (property)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3610,7 +3611,7 @@ weechat_guile_api_nicklist_nick_get_pointer (SCM buffer, SCM nick, SCM property) char *result; SCM return_value; - API_FUNC(1, "nicklist_nick_get_pointer", API_RETURN_EMPTY); + API_INIT_FUNC(1, "nicklist_nick_get_pointer", API_RETURN_EMPTY); if (!scm_is_string (buffer) || !scm_is_string (nick) || !scm_is_string (property)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3626,7 +3627,7 @@ SCM weechat_guile_api_nicklist_nick_set (SCM buffer, SCM nick, SCM property, SCM value) { - API_FUNC(1, "nicklist_nick_set", API_RETURN_ERROR); + API_INIT_FUNC(1, "nicklist_nick_set", API_RETURN_ERROR); if (!scm_is_string (buffer) || !scm_is_string (nick) || !scm_is_string (property) || !scm_is_string (value)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -3645,7 +3646,7 @@ weechat_guile_api_bar_item_search (SCM name) char *result; SCM return_value; - API_FUNC(1, "bar_item_search", API_RETURN_EMPTY); + API_INIT_FUNC(1, "bar_item_search", API_RETURN_EMPTY); if (!scm_is_string (name)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3719,7 +3720,7 @@ weechat_guile_api_bar_item_new (SCM name, SCM function, SCM data) char *result; SCM return_value; - API_FUNC(1, "bar_item_new", API_RETURN_EMPTY); + API_INIT_FUNC(1, "bar_item_new", API_RETURN_EMPTY); if (!scm_is_string (name) || !scm_is_string (function) || !scm_is_string (data)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3737,7 +3738,7 @@ weechat_guile_api_bar_item_new (SCM name, SCM function, SCM data) SCM weechat_guile_api_bar_item_update (SCM name) { - API_FUNC(1, "bar_item_update", API_RETURN_ERROR); + API_INIT_FUNC(1, "bar_item_update", API_RETURN_ERROR); if (!scm_is_string (name)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -3749,7 +3750,7 @@ weechat_guile_api_bar_item_update (SCM name) SCM weechat_guile_api_bar_item_remove (SCM item) { - API_FUNC(1, "bar_item_remove", API_RETURN_ERROR); + API_INIT_FUNC(1, "bar_item_remove", API_RETURN_ERROR); if (!scm_is_string (item)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -3766,7 +3767,7 @@ weechat_guile_api_bar_search (SCM name) char *result; SCM return_value; - API_FUNC(1, "bar_search", API_RETURN_EMPTY); + API_INIT_FUNC(1, "bar_search", API_RETURN_EMPTY); if (!scm_is_string (name)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3784,7 +3785,7 @@ weechat_guile_api_bar_new (SCM args) char *result; SCM return_value; - API_FUNC(1, "bar_new", API_RETURN_EMPTY); + API_INIT_FUNC(1, "bar_new", API_RETURN_EMPTY); if (!scm_list_p (args) || (scm_to_int (scm_length (args)) != 15)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3836,7 +3837,7 @@ weechat_guile_api_bar_new (SCM args) SCM weechat_guile_api_bar_set (SCM bar, SCM property, SCM value) { - API_FUNC(1, "bar_set", API_RETURN_ERROR); + API_INIT_FUNC(1, "bar_set", API_RETURN_ERROR); if (!scm_is_string (bar) || !scm_is_string (property) || !scm_is_string (value)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -3851,7 +3852,7 @@ weechat_guile_api_bar_set (SCM bar, SCM property, SCM value) SCM weechat_guile_api_bar_update (SCM name) { - API_FUNC(1, "bar_update", API_RETURN_ERROR); + API_INIT_FUNC(1, "bar_update", API_RETURN_ERROR); if (!scm_is_string (name)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -3863,7 +3864,7 @@ weechat_guile_api_bar_update (SCM name) SCM weechat_guile_api_bar_remove (SCM bar) { - API_FUNC(1, "bar_remove", API_RETURN_ERROR); + API_INIT_FUNC(1, "bar_remove", API_RETURN_ERROR); if (!scm_is_string (bar)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -3877,7 +3878,7 @@ weechat_guile_api_command (SCM buffer, SCM command) { int rc; - API_FUNC(1, "command", API_RETURN_ERROR); + API_INIT_FUNC(1, "command", API_RETURN_ERROR); if (!scm_is_string (buffer) || !scm_is_string (command)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -3894,7 +3895,7 @@ weechat_guile_api_info_get (SCM info_name, SCM arguments) { const char *result; - API_FUNC(1, "info_get", API_RETURN_EMPTY); + API_INIT_FUNC(1, "info_get", API_RETURN_EMPTY); if (!scm_is_string (info_name) || !scm_is_string (arguments)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3910,7 +3911,7 @@ weechat_guile_api_info_get_hashtable (SCM info_name, SCM hash) struct t_hashtable *c_hashtable, *result_hashtable; SCM result_alist; - API_FUNC(1, "info_get_hashtable", API_RETURN_EMPTY); + API_INIT_FUNC(1, "info_get_hashtable", API_RETURN_EMPTY); if (!scm_is_string (info_name) || !scm_list_p (hash)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3937,7 +3938,7 @@ weechat_guile_api_infolist_new () char *result; SCM return_value; - API_FUNC(1, "infolist_new", API_RETURN_EMPTY); + API_INIT_FUNC(1, "infolist_new", API_RETURN_EMPTY); result = API_PTR2STR(weechat_infolist_new ()); @@ -3950,7 +3951,7 @@ weechat_guile_api_infolist_new_item (SCM infolist) char *result; SCM return_value; - API_FUNC(1, "infolist_new_item", API_RETURN_EMPTY); + API_INIT_FUNC(1, "infolist_new_item", API_RETURN_EMPTY); if (!scm_is_string (infolist)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3965,7 +3966,7 @@ weechat_guile_api_infolist_new_var_integer (SCM infolist, SCM name, SCM value) char *result; SCM return_value; - API_FUNC(1, "infolist_new_var_integer", API_RETURN_EMPTY); + API_INIT_FUNC(1, "infolist_new_var_integer", API_RETURN_EMPTY); if (!scm_is_string (infolist) || !scm_is_string (name) || !scm_is_integer (value)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3983,7 +3984,7 @@ weechat_guile_api_infolist_new_var_string (SCM infolist, SCM name, SCM value) char *result; SCM return_value; - API_FUNC(1, "infolist_new_var_string", API_RETURN_EMPTY); + API_INIT_FUNC(1, "infolist_new_var_string", API_RETURN_EMPTY); if (!scm_is_string (infolist) || !scm_is_string (name) || !scm_is_string (value)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4001,7 +4002,7 @@ weechat_guile_api_infolist_new_var_pointer (SCM infolist, SCM name, SCM value) char *result; SCM return_value; - API_FUNC(1, "infolist_new_var_pointer", API_RETURN_EMPTY); + API_INIT_FUNC(1, "infolist_new_var_pointer", API_RETURN_EMPTY); if (!scm_is_string (infolist) || !scm_is_string (name) || !scm_is_string (value)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4019,7 +4020,7 @@ weechat_guile_api_infolist_new_var_time (SCM infolist, SCM name, SCM value) char *result; SCM return_value; - API_FUNC(1, "infolist_new_var_time", API_RETURN_EMPTY); + API_INIT_FUNC(1, "infolist_new_var_time", API_RETURN_EMPTY); if (!scm_is_string (infolist) || !scm_is_string (name) || !scm_is_integer (value)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4037,7 +4038,7 @@ weechat_guile_api_infolist_get (SCM name, SCM pointer, SCM arguments) char *result; SCM return_value; - API_FUNC(1, "infolist_get", API_RETURN_EMPTY); + API_INIT_FUNC(1, "infolist_get", API_RETURN_EMPTY); if (!scm_is_string (name) || !scm_is_string (pointer) || !scm_is_string (arguments)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4054,7 +4055,7 @@ weechat_guile_api_infolist_next (SCM infolist) { int value; - API_FUNC(1, "infolist_next", API_RETURN_INT(0)); + API_INIT_FUNC(1, "infolist_next", API_RETURN_INT(0)); if (!scm_is_string (infolist)) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -4068,7 +4069,7 @@ weechat_guile_api_infolist_prev (SCM infolist) { int value; - API_FUNC(1, "infolist_prev", API_RETURN_INT(0)); + API_INIT_FUNC(1, "infolist_prev", API_RETURN_INT(0)); if (!scm_is_string (infolist)) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -4080,7 +4081,7 @@ weechat_guile_api_infolist_prev (SCM infolist) SCM weechat_guile_api_infolist_reset_item_cursor (SCM infolist) { - API_FUNC(1, "infolist_reset_item_cursor", API_RETURN_ERROR); + API_INIT_FUNC(1, "infolist_reset_item_cursor", API_RETURN_ERROR); if (!scm_is_string (infolist)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -4094,7 +4095,7 @@ weechat_guile_api_infolist_fields (SCM infolist) { const char *result; - API_FUNC(1, "infolist_fields", API_RETURN_EMPTY); + API_INIT_FUNC(1, "infolist_fields", API_RETURN_EMPTY); if (!scm_is_string (infolist)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4108,7 +4109,7 @@ weechat_guile_api_infolist_integer (SCM infolist, SCM variable) { int value; - API_FUNC(1, "infolist_integer", API_RETURN_INT(0)); + API_INIT_FUNC(1, "infolist_integer", API_RETURN_INT(0)); if (!scm_is_string (infolist) || !scm_is_string (variable)) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -4123,7 +4124,7 @@ weechat_guile_api_infolist_string (SCM infolist, SCM variable) { const char *result; - API_FUNC(1, "infolist_string", API_RETURN_EMPTY); + API_INIT_FUNC(1, "infolist_string", API_RETURN_EMPTY); if (!scm_is_string (infolist) || !scm_is_string (variable)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4139,7 +4140,7 @@ weechat_guile_api_infolist_pointer (SCM infolist, SCM variable) char *result; SCM return_value; - API_FUNC(1, "infolist_pointer", API_RETURN_EMPTY); + API_INIT_FUNC(1, "infolist_pointer", API_RETURN_EMPTY); if (!scm_is_string (infolist) || !scm_is_string (variable)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4157,7 +4158,7 @@ weechat_guile_api_infolist_time (SCM infolist, SCM variable) struct tm *date_tmp; SCM return_value; - API_FUNC(1, "infolist_time", API_RETURN_EMPTY); + API_INIT_FUNC(1, "infolist_time", API_RETURN_EMPTY); if (!scm_is_string (infolist) || !scm_is_string (variable)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4175,7 +4176,7 @@ weechat_guile_api_infolist_time (SCM infolist, SCM variable) SCM weechat_guile_api_infolist_free (SCM infolist) { - API_FUNC(1, "infolist_free", API_RETURN_ERROR); + API_INIT_FUNC(1, "infolist_free", API_RETURN_ERROR); if (!scm_is_string (infolist)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -4190,7 +4191,7 @@ weechat_guile_api_hdata_get (SCM name) char *result; SCM return_value; - API_FUNC(1, "hdata_get", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hdata_get", API_RETURN_EMPTY); if (!scm_is_string (name)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4204,7 +4205,7 @@ weechat_guile_api_hdata_get_var_offset (SCM hdata, SCM name) { int value; - API_FUNC(1, "hdata_get_var_offset", API_RETURN_INT(0)); + API_INIT_FUNC(1, "hdata_get_var_offset", API_RETURN_INT(0)); if (!scm_is_string (hdata) || !scm_is_string (name)) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -4219,7 +4220,7 @@ weechat_guile_api_hdata_get_var_type_string (SCM hdata, SCM name) { const char *result; - API_FUNC(1, "hdata_get_var_type_string", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hdata_get_var_type_string", API_RETURN_EMPTY); if (!scm_is_string (hdata) || !scm_is_string (name)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4234,7 +4235,7 @@ weechat_guile_api_hdata_get_var_array_size (SCM hdata, SCM pointer, SCM name) { int value; - API_FUNC(1, "hdata_get_var_array_size", API_RETURN_INT(-1)); + API_INIT_FUNC(1, "hdata_get_var_array_size", API_RETURN_INT(-1)); if (!scm_is_string (hdata) || !scm_is_string (pointer) || !scm_is_string (name)) API_WRONG_ARGS(API_RETURN_INT(-1)); @@ -4252,7 +4253,7 @@ weechat_guile_api_hdata_get_var_array_size_string (SCM hdata, SCM pointer, { const char *result; - API_FUNC(1, "hdata_get_var_array_size_string", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hdata_get_var_array_size_string", API_RETURN_EMPTY); if (!scm_is_string (hdata) || !scm_is_string (pointer) || !scm_is_string (name)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4269,7 +4270,7 @@ weechat_guile_api_hdata_get_var_hdata (SCM hdata, SCM name) { const char *result; - API_FUNC(1, "hdata_get_var_hdata", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hdata_get_var_hdata", API_RETURN_EMPTY); if (!scm_is_string (hdata) || !scm_is_string (name)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4285,7 +4286,7 @@ weechat_guile_api_hdata_get_list (SCM hdata, SCM name) char *result; SCM return_value; - API_FUNC(1, "hdata_get_list", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hdata_get_list", API_RETURN_EMPTY); if (!scm_is_string (hdata) || !scm_is_string (name)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4300,7 +4301,7 @@ weechat_guile_api_hdata_check_pointer (SCM hdata, SCM list, SCM pointer) { int value; - API_FUNC(1, "hdata_check_pointer", API_RETURN_INT(0)); + API_INIT_FUNC(1, "hdata_check_pointer", API_RETURN_INT(0)); if (!scm_is_string (hdata) || !scm_is_string (list) || !scm_is_string (pointer)) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -4318,7 +4319,7 @@ weechat_guile_api_hdata_move (SCM hdata, SCM pointer, SCM count) char *result; SCM return_value; - API_FUNC(1, "hdata_move", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hdata_move", API_RETURN_EMPTY); if (!scm_is_string (hdata) || !scm_is_string (pointer) || !scm_is_integer (count)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4336,7 +4337,7 @@ weechat_guile_api_hdata_search (SCM hdata, SCM pointer, SCM search, SCM move) char *result; SCM return_value; - API_FUNC(1, "hdata_search", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hdata_search", API_RETURN_EMPTY); if (!scm_is_string (hdata) || !scm_is_string (pointer) || !scm_is_string (search) || !scm_is_integer (move)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4354,7 +4355,7 @@ weechat_guile_api_hdata_char (SCM hdata, SCM pointer, SCM name) { int value; - API_FUNC(1, "hdata_char", API_RETURN_INT(0)); + API_INIT_FUNC(1, "hdata_char", API_RETURN_INT(0)); if (!scm_is_string (hdata) || !scm_is_string (pointer) || !scm_is_string (name)) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -4371,7 +4372,7 @@ weechat_guile_api_hdata_integer (SCM hdata, SCM pointer, SCM name) { int value; - API_FUNC(1, "hdata_integer", API_RETURN_INT(0)); + API_INIT_FUNC(1, "hdata_integer", API_RETURN_INT(0)); if (!scm_is_string (hdata) || !scm_is_string (pointer) || !scm_is_string (name)) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -4388,7 +4389,7 @@ weechat_guile_api_hdata_long (SCM hdata, SCM pointer, SCM name) { long value; - API_FUNC(1, "hdata_long", API_RETURN_LONG(0)); + API_INIT_FUNC(1, "hdata_long", API_RETURN_LONG(0)); if (!scm_is_string (hdata) || !scm_is_string (pointer) || !scm_is_string (name)) API_WRONG_ARGS(API_RETURN_LONG(0)); @@ -4405,7 +4406,7 @@ weechat_guile_api_hdata_string (SCM hdata, SCM pointer, SCM name) { const char *result; - API_FUNC(1, "hdata_string", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hdata_string", API_RETURN_EMPTY); if (!scm_is_string (hdata) || !scm_is_string (pointer) || !scm_is_string (name)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4423,7 +4424,7 @@ weechat_guile_api_hdata_pointer (SCM hdata, SCM pointer, SCM name) char *result; SCM return_value; - API_FUNC(1, "hdata_pointer", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hdata_pointer", API_RETURN_EMPTY); if (!scm_is_string (hdata) || !scm_is_string (pointer) || !scm_is_string (name)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4442,7 +4443,7 @@ weechat_guile_api_hdata_time (SCM hdata, SCM pointer, SCM name) time_t time; SCM return_value; - API_FUNC(1, "hdata_time", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hdata_time", API_RETURN_EMPTY); if (!scm_is_string (hdata) || !scm_is_string (pointer) || !scm_is_string (name)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4461,7 +4462,7 @@ weechat_guile_api_hdata_hashtable (SCM hdata, SCM pointer, SCM name) { SCM result_alist; - API_FUNC(1, "hdata_hashtable", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hdata_hashtable", API_RETURN_EMPTY); if (!scm_is_string (hdata) || !scm_is_string (pointer) || !scm_is_string (name)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4480,7 +4481,7 @@ weechat_guile_api_hdata_update (SCM hdata, SCM pointer, SCM hashtable) struct t_hashtable *c_hashtable; int value; - API_FUNC(1, "hdata_update", API_RETURN_INT(0)); + API_INIT_FUNC(1, "hdata_update", API_RETURN_INT(0)); if (!scm_is_string (hdata) || !scm_is_string (pointer) || !scm_list_p (hashtable)) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -4504,7 +4505,7 @@ weechat_guile_api_hdata_get_string (SCM hdata, SCM property) { const char *result; - API_FUNC(1, "hdata_get_string", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hdata_get_string", API_RETURN_EMPTY); if (!scm_is_string (hdata) || !scm_is_string (property)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4520,7 +4521,7 @@ weechat_guile_api_upgrade_new (SCM filename, SCM write) char *result; SCM return_value; - API_FUNC(1, "upgrade_new", API_RETURN_EMPTY); + API_INIT_FUNC(1, "upgrade_new", API_RETURN_EMPTY); if (!scm_is_string (filename) || !scm_is_integer (write)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4536,7 +4537,7 @@ weechat_guile_api_upgrade_write_object (SCM upgrade_file, SCM object_id, { int rc; - API_FUNC(1, "upgrade_write_object", API_RETURN_INT(0)); + API_INIT_FUNC(1, "upgrade_write_object", API_RETURN_INT(0)); if (!scm_is_string (upgrade_file) || !scm_is_integer (object_id) || !scm_is_string (infolist)) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -4598,7 +4599,7 @@ weechat_guile_api_upgrade_read (SCM upgrade_file, SCM function, SCM data) { int rc; - API_FUNC(1, "upgrade_read", API_RETURN_INT(0)); + API_INIT_FUNC(1, "upgrade_read", API_RETURN_INT(0)); if (!scm_is_string (upgrade_file) || !scm_is_string (function) || !scm_is_string (data)) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -4616,7 +4617,7 @@ weechat_guile_api_upgrade_read (SCM upgrade_file, SCM function, SCM data) SCM weechat_guile_api_upgrade_close (SCM upgrade_file) { - API_FUNC(1, "upgrade_close", API_RETURN_ERROR); + API_INIT_FUNC(1, "upgrade_close", API_RETURN_ERROR); if (!scm_is_string (upgrade_file)) API_WRONG_ARGS(API_RETURN_ERROR); diff --git a/src/plugins/lua/weechat-lua-api.c b/src/plugins/lua/weechat-lua-api.c index 94d1065b6..e2b3eba7f 100644 --- a/src/plugins/lua/weechat-lua-api.c +++ b/src/plugins/lua/weechat-lua-api.c @@ -37,7 +37,16 @@ #include "weechat-lua.h" -#define API_FUNC(__init, __name, __ret) \ +#define API_DEF_CONST_INT(__name) \ + { #__name, __name, NULL } +#define API_DEF_CONST_STR(__name) \ + { #__name, 0, __name } +#define API_DEF_FUNC(__name) \ + { #__name, &weechat_lua_api_##__name } +#define API_FUNC(__name) \ + static int \ + weechat_lua_api_##__name (lua_State *L) +#define API_INIT_FUNC(__init, __name, __ret) \ char *lua_function_name = __name; \ (void) L; \ if (__init \ @@ -67,39 +76,31 @@ #define API_RETURN_STRING(__string) \ lua_pushstring (L, \ (__string) ? __string : ""); \ - return 1; + return 1 #define API_RETURN_STRING_FREE(__string) \ lua_pushstring (L, \ (__string) ? __string : ""); \ if (__string) \ free (__string); \ - return 1; + return 1 #define API_RETURN_INT(__int) \ lua_pushnumber (L, __int); \ - return 1; + return 1 #define API_RETURN_LONG(__long) \ lua_pushnumber (L, __long); \ - return 1; - -#define API_DEF_FUNC(__name) \ - { #__name, &weechat_lua_api_##__name } -#define API_DEF_CONST_INT(__name) \ - { #__name, __name, NULL } -#define API_DEF_CONST_STR(__name) \ - { #__name, 0, __name } + return 1 /* * Registers a lua script. */ -static int -weechat_lua_api_register (lua_State *L) +API_FUNC(register) { const char *name, *author, *version, *license, *description; const char *shutdown_func, *charset; - API_FUNC(0, "register", API_RETURN_ERROR); + API_INIT_FUNC(0, "register", API_RETURN_ERROR); if (lua_registered_script) { /* script already registered */ @@ -173,12 +174,11 @@ weechat_lua_api_register (lua_State *L) * core. */ -static int -weechat_lua_api_plugin_get_name (lua_State *L) +API_FUNC(plugin_get_name) { const char *plugin, *result; - API_FUNC(1, "plugin_get_name", API_RETURN_EMPTY); + API_INIT_FUNC(1, "plugin_get_name", API_RETURN_EMPTY); if (lua_gettop (L) < 1) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -189,12 +189,11 @@ weechat_lua_api_plugin_get_name (lua_State *L) API_RETURN_STRING(result); } -static int -weechat_lua_api_charset_set (lua_State *L) +API_FUNC(charset_set) { const char *charset; - API_FUNC(1, "charset_set", API_RETURN_ERROR); + API_INIT_FUNC(1, "charset_set", API_RETURN_ERROR); if (lua_gettop (L) < 1) API_WRONG_ARGS(API_RETURN_ERROR); @@ -206,13 +205,12 @@ weechat_lua_api_charset_set (lua_State *L) API_RETURN_OK; } -static int -weechat_lua_api_iconv_to_internal (lua_State *L) +API_FUNC(iconv_to_internal) { const char *charset, *string; char *result; - API_FUNC(1, "iconv_to_internal", API_RETURN_EMPTY); + API_INIT_FUNC(1, "iconv_to_internal", API_RETURN_EMPTY); if (lua_gettop (L) < 2) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -224,13 +222,12 @@ weechat_lua_api_iconv_to_internal (lua_State *L) API_RETURN_STRING_FREE(result); } -static int -weechat_lua_api_iconv_from_internal (lua_State *L) +API_FUNC(iconv_from_internal) { const char *charset, *string; char *result; - API_FUNC(1, "iconv_from_internal", API_RETURN_EMPTY); + API_INIT_FUNC(1, "iconv_from_internal", API_RETURN_EMPTY); if (lua_gettop (L) < 2) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -242,12 +239,11 @@ weechat_lua_api_iconv_from_internal (lua_State *L) API_RETURN_STRING_FREE(result); } -static int -weechat_lua_api_gettext (lua_State *L) +API_FUNC(gettext) { const char *string, *result; - API_FUNC(1, "gettext", API_RETURN_EMPTY); + API_INIT_FUNC(1, "gettext", API_RETURN_EMPTY); if (lua_gettop (L) < 1) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -258,13 +254,12 @@ weechat_lua_api_gettext (lua_State *L) API_RETURN_STRING(result); } -static int -weechat_lua_api_ngettext (lua_State *L) +API_FUNC(ngettext) { const char *single, *plural, *result; int count; - API_FUNC(1, "ngettext", API_RETURN_EMPTY); + API_INIT_FUNC(1, "ngettext", API_RETURN_EMPTY); if (lua_gettop (L) < 3) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -277,13 +272,12 @@ weechat_lua_api_ngettext (lua_State *L) API_RETURN_STRING(result); } -static int -weechat_lua_api_strlen_screen (lua_State *L) +API_FUNC(strlen_screen) { const char *string; int value; - API_FUNC(1, "strlen_screen", API_RETURN_INT(0)); + API_INIT_FUNC(1, "strlen_screen", API_RETURN_INT(0)); if (lua_gettop (L) < 1) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -294,13 +288,12 @@ weechat_lua_api_strlen_screen (lua_State *L) API_RETURN_INT(value); } -static int -weechat_lua_api_string_match (lua_State *L) +API_FUNC(string_match) { const char *string, *mask; int case_sensitive, value; - API_FUNC(1, "string_match", API_RETURN_INT(0)); + API_INIT_FUNC(1, "string_match", API_RETURN_INT(0)); if (lua_gettop (L) < 3) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -313,13 +306,12 @@ weechat_lua_api_string_match (lua_State *L) API_RETURN_INT(value); } -static int -weechat_lua_api_string_has_highlight (lua_State *L) +API_FUNC(string_has_highlight) { const char *string, *highlight_words; int value; - API_FUNC(1, "string_has_highlight", API_RETURN_INT(0)); + API_INIT_FUNC(1, "string_has_highlight", API_RETURN_INT(0)); if (lua_gettop (L) < 2) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -331,13 +323,12 @@ weechat_lua_api_string_has_highlight (lua_State *L) API_RETURN_INT(value); } -static int -weechat_lua_api_string_has_highlight_regex (lua_State *L) +API_FUNC(string_has_highlight_regex) { const char *string, *regex; int value; - API_FUNC(1, "string_has_highlight_regex", API_RETURN_INT(0)); + API_INIT_FUNC(1, "string_has_highlight_regex", API_RETURN_INT(0)); if (lua_gettop (L) < 2) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -349,13 +340,12 @@ weechat_lua_api_string_has_highlight_regex (lua_State *L) API_RETURN_INT(value); } -static int -weechat_lua_api_string_mask_to_regex (lua_State *L) +API_FUNC(string_mask_to_regex) { const char *mask; char *result; - API_FUNC(1, "string_mask_to_regex", API_RETURN_EMPTY); + API_INIT_FUNC(1, "string_mask_to_regex", API_RETURN_EMPTY); if (lua_gettop (L) < 1) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -366,13 +356,12 @@ weechat_lua_api_string_mask_to_regex (lua_State *L) API_RETURN_STRING_FREE(result); } -static int -weechat_lua_api_string_remove_color (lua_State *L) +API_FUNC(string_remove_color) { const char *string, *replacement; char *result; - API_FUNC(1, "string_remove_color", API_RETURN_EMPTY); + API_INIT_FUNC(1, "string_remove_color", API_RETURN_EMPTY); if (lua_gettop (L) < 2) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -384,13 +373,12 @@ weechat_lua_api_string_remove_color (lua_State *L) API_RETURN_STRING_FREE(result); } -static int -weechat_lua_api_string_is_command_char (lua_State *L) +API_FUNC(string_is_command_char) { const char *string; int value; - API_FUNC(1, "string_is_command_char", API_RETURN_INT(0)); + API_INIT_FUNC(1, "string_is_command_char", API_RETURN_INT(0)); if (lua_gettop (L) < 1) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -401,12 +389,11 @@ weechat_lua_api_string_is_command_char (lua_State *L) API_RETURN_INT(value); } -static int -weechat_lua_api_string_input_for_buffer (lua_State *L) +API_FUNC(string_input_for_buffer) { const char *string, *result; - API_FUNC(1, "string_input_for_buffer", API_RETURN_EMPTY); + API_INIT_FUNC(1, "string_input_for_buffer", API_RETURN_EMPTY); if (lua_gettop (L) < 1) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -417,14 +404,13 @@ weechat_lua_api_string_input_for_buffer (lua_State *L) API_RETURN_STRING(result); } -static int -weechat_lua_api_string_eval_expression (lua_State *L) +API_FUNC(string_eval_expression) { const char *expr; struct t_hashtable *pointers, *extra_vars, *options; char *result; - API_FUNC(1, "string_eval_expression", API_RETURN_EMPTY); + API_INIT_FUNC(1, "string_eval_expression", API_RETURN_EMPTY); if (lua_gettop (L) < 4) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -455,13 +441,12 @@ weechat_lua_api_string_eval_expression (lua_State *L) API_RETURN_STRING_FREE(result); } -static int -weechat_lua_api_mkdir_home (lua_State *L) +API_FUNC(mkdir_home) { const char *directory; int mode; - API_FUNC(1, "mkdir_home", API_RETURN_ERROR); + API_INIT_FUNC(1, "mkdir_home", API_RETURN_ERROR); if (lua_gettop (L) < 2) API_WRONG_ARGS(API_RETURN_ERROR); @@ -474,13 +459,12 @@ weechat_lua_api_mkdir_home (lua_State *L) API_RETURN_OK; } -static int -weechat_lua_api_mkdir (lua_State *L) +API_FUNC(mkdir) { const char *directory; int mode; - API_FUNC(1, "mkdir", API_RETURN_ERROR); + API_INIT_FUNC(1, "mkdir", API_RETURN_ERROR); if (lua_gettop (L) < 2) API_WRONG_ARGS(API_RETURN_ERROR); @@ -493,13 +477,12 @@ weechat_lua_api_mkdir (lua_State *L) API_RETURN_OK; } -static int -weechat_lua_api_mkdir_parents (lua_State *L) +API_FUNC(mkdir_parents) { const char *directory; int mode; - API_FUNC(1, "mkdir_parents", API_RETURN_ERROR); + API_INIT_FUNC(1, "mkdir_parents", API_RETURN_ERROR); if (lua_gettop (L) < 2) API_WRONG_ARGS(API_RETURN_ERROR); @@ -512,25 +495,23 @@ weechat_lua_api_mkdir_parents (lua_State *L) API_RETURN_OK; } -static int -weechat_lua_api_list_new (lua_State *L) +API_FUNC(list_new) { char *result; - API_FUNC(1, "list_new", API_RETURN_EMPTY); + API_INIT_FUNC(1, "list_new", API_RETURN_EMPTY); result = API_PTR2STR(weechat_list_new ()); API_RETURN_STRING_FREE(result); } -static int -weechat_lua_api_list_add (lua_State *L) +API_FUNC(list_add) { const char *weelist, *data, *where, *user_data; char *result; - API_FUNC(1, "list_add", API_RETURN_EMPTY); + API_INIT_FUNC(1, "list_add", API_RETURN_EMPTY); if (lua_gettop (L) < 4) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -547,13 +528,12 @@ weechat_lua_api_list_add (lua_State *L) API_RETURN_STRING_FREE(result); } -static int -weechat_lua_api_list_search (lua_State *L) +API_FUNC(list_search) { const char *weelist, *data; char *result; - API_FUNC(1, "list_search", API_RETURN_EMPTY); + API_INIT_FUNC(1, "list_search", API_RETURN_EMPTY); if (lua_gettop (L) < 2) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -566,13 +546,12 @@ weechat_lua_api_list_search (lua_State *L) API_RETURN_STRING_FREE(result); } -static int -weechat_lua_api_list_search_pos (lua_State *L) +API_FUNC(list_search_pos) { const char *weelist, *data; int pos; - API_FUNC(1, "list_search_pos", API_RETURN_INT(-1)); + API_INIT_FUNC(1, "list_search_pos", API_RETURN_INT(-1)); if (lua_gettop (L) < 2) API_WRONG_ARGS(API_RETURN_INT(-1)); @@ -584,13 +563,12 @@ weechat_lua_api_list_search_pos (lua_State *L) API_RETURN_INT(pos); } -static int -weechat_lua_api_list_casesearch (lua_State *L) +API_FUNC(list_casesearch) { const char *weelist, *data; char *result; - API_FUNC(1, "list_casesearch", API_RETURN_EMPTY); + API_INIT_FUNC(1, "list_casesearch", API_RETURN_EMPTY); if (lua_gettop (L) < 2) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -603,13 +581,12 @@ weechat_lua_api_list_casesearch (lua_State *L) API_RETURN_STRING_FREE(result); } -static int -weechat_lua_api_list_casesearch_pos (lua_State *L) +API_FUNC(list_casesearch_pos) { const char *weelist, *data; int pos; - API_FUNC(1, "list_casesearch_pos", API_RETURN_INT(-1)); + API_INIT_FUNC(1, "list_casesearch_pos", API_RETURN_INT(-1)); if (lua_gettop (L) < 2) API_WRONG_ARGS(API_RETURN_INT(-1)); @@ -621,14 +598,13 @@ weechat_lua_api_list_casesearch_pos (lua_State *L) API_RETURN_INT(pos); } -static int -weechat_lua_api_list_get (lua_State *L) +API_FUNC(list_get) { const char *weelist; char *result; int position; - API_FUNC(1, "list_get", API_RETURN_EMPTY); + API_INIT_FUNC(1, "list_get", API_RETURN_EMPTY); if (lua_gettop (L) < 2) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -641,12 +617,11 @@ weechat_lua_api_list_get (lua_State *L) API_RETURN_STRING_FREE(result); } -static int -weechat_lua_api_list_set (lua_State *L) +API_FUNC(list_set) { const char *item, *new_value; - API_FUNC(1, "list_set", API_RETURN_ERROR); + API_INIT_FUNC(1, "list_set", API_RETURN_ERROR); if (lua_gettop (L) < 2) API_WRONG_ARGS(API_RETURN_ERROR); @@ -659,13 +634,12 @@ weechat_lua_api_list_set (lua_State *L) API_RETURN_OK; } -static int -weechat_lua_api_list_next (lua_State *L) +API_FUNC(list_next) { const char *item; char *result; - API_FUNC(1, "list_next", API_RETURN_EMPTY); + API_INIT_FUNC(1, "list_next", API_RETURN_EMPTY); if (lua_gettop (L) < 1) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -676,13 +650,12 @@ weechat_lua_api_list_next (lua_State *L) API_RETURN_STRING_FREE(result); } -static int -weechat_lua_api_list_prev (lua_State *L) +API_FUNC(list_prev) { const char *item; char *result; - API_FUNC(1, "list_prev", API_RETURN_EMPTY); + API_INIT_FUNC(1, "list_prev", API_RETURN_EMPTY); if (lua_gettop (L) < 1) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -693,12 +666,11 @@ weechat_lua_api_list_prev (lua_State *L) API_RETURN_STRING_FREE(result); } -static int -weechat_lua_api_list_string (lua_State *L) +API_FUNC(list_string) { const char *item, *result; - API_FUNC(1, "list_string", API_RETURN_EMPTY); + API_INIT_FUNC(1, "list_string", API_RETURN_EMPTY); if (lua_gettop (L) < 1) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -709,13 +681,12 @@ weechat_lua_api_list_string (lua_State *L) API_RETURN_STRING(result); } -static int -weechat_lua_api_list_size (lua_State *L) +API_FUNC(list_size) { const char *weelist; int size; - API_FUNC(1, "list_size", API_RETURN_INT(0)); + API_INIT_FUNC(1, "list_size", API_RETURN_INT(0)); if (lua_gettop (L) < 1) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -726,12 +697,11 @@ weechat_lua_api_list_size (lua_State *L) API_RETURN_INT(size); } -static int -weechat_lua_api_list_remove (lua_State *L) +API_FUNC(list_remove) { const char *weelist, *item; - API_FUNC(1, "list_remove", API_RETURN_ERROR); + API_INIT_FUNC(1, "list_remove", API_RETURN_ERROR); if (lua_gettop (L) < 2) API_WRONG_ARGS(API_RETURN_ERROR); @@ -744,12 +714,11 @@ weechat_lua_api_list_remove (lua_State *L) API_RETURN_OK; } -static int -weechat_lua_api_list_remove_all (lua_State *L) +API_FUNC(list_remove_all) { const char *weelist; - API_FUNC(1, "list_remove_all", API_RETURN_ERROR); + API_INIT_FUNC(1, "list_remove_all", API_RETURN_ERROR); if (lua_gettop (L) < 1) API_WRONG_ARGS(API_RETURN_ERROR); @@ -760,12 +729,11 @@ weechat_lua_api_list_remove_all (lua_State *L) API_RETURN_OK; } -static int -weechat_lua_api_list_free (lua_State *L) +API_FUNC(list_free) { const char *weelist; - API_FUNC(1, "list_free", API_RETURN_ERROR); + API_INIT_FUNC(1, "list_free", API_RETURN_ERROR); if (lua_gettop (L) < 1) API_WRONG_ARGS(API_RETURN_ERROR); @@ -813,13 +781,12 @@ weechat_lua_api_config_reload_cb (void *data, return WEECHAT_CONFIG_READ_FILE_NOT_FOUND; } -static int -weechat_lua_api_config_new (lua_State *L) +API_FUNC(config_new) { const char *name, *function, *data; char *result; - API_FUNC(1, "config_new", API_RETURN_EMPTY); + API_INIT_FUNC(1, "config_new", API_RETURN_EMPTY); if (lua_gettop (L) < 3) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -1049,8 +1016,7 @@ weechat_lua_api_config_section_delete_option_cb (void *data, return WEECHAT_CONFIG_OPTION_UNSET_ERROR; } -static int -weechat_lua_api_config_new_section (lua_State *L) +API_FUNC(config_new_section) { const char *config_file, *name, *function_read, *data_read; const char *function_write, *data_write, *function_write_default; @@ -1060,7 +1026,7 @@ weechat_lua_api_config_new_section (lua_State *L) char *result; int user_can_add_options, user_can_delete_options; - API_FUNC(1, "config_new_section", API_RETURN_EMPTY); + API_INIT_FUNC(1, "config_new_section", API_RETURN_EMPTY); if (lua_gettop (L) < 14) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -1104,13 +1070,12 @@ weechat_lua_api_config_new_section (lua_State *L) API_RETURN_STRING_FREE(result); } -static int -weechat_lua_api_config_search_section (lua_State *L) +API_FUNC(config_search_section) { const char *config_file, *section_name; char *result; - API_FUNC(1, "config_search_section", API_RETURN_EMPTY); + API_INIT_FUNC(1, "config_search_section", API_RETURN_EMPTY); if (lua_gettop (L) < 2) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -1220,8 +1185,7 @@ weechat_lua_api_config_option_delete_cb (void *data, } } -static int -weechat_lua_api_config_new_option (lua_State *L) +API_FUNC(config_new_option) { const char *config_file, *section, *name, *type, *description; const char *string_values, *default_value, *value; @@ -1230,7 +1194,7 @@ weechat_lua_api_config_new_option (lua_State *L) char *result; int min, max, null_value_allowed; - API_FUNC(1, "config_new_option", API_RETURN_EMPTY); + API_INIT_FUNC(1, "config_new_option", API_RETURN_EMPTY); if (lua_gettop (L) < 17) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -1278,13 +1242,12 @@ weechat_lua_api_config_new_option (lua_State *L) API_RETURN_STRING_FREE(result); } -static int -weechat_lua_api_config_search_option (lua_State *L) +API_FUNC(config_search_option) { const char *config_file, *section, *option_name; char *result; - API_FUNC(1, "config_search_option", API_RETURN_EMPTY); + API_INIT_FUNC(1, "config_search_option", API_RETURN_EMPTY); if (lua_gettop (L) < 3) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -1299,13 +1262,12 @@ weechat_lua_api_config_search_option (lua_State *L) API_RETURN_STRING_FREE(result); } -static int -weechat_lua_api_config_string_to_boolean (lua_State *L) +API_FUNC(config_string_to_boolean) { const char *text; int value; - API_FUNC(1, "config_string_to_boolean", API_RETURN_INT(0)); + API_INIT_FUNC(1, "config_string_to_boolean", API_RETURN_INT(0)); if (lua_gettop (L) < 1) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -1316,13 +1278,12 @@ weechat_lua_api_config_string_to_boolean (lua_State *L) API_RETURN_INT(value); } -static int -weechat_lua_api_config_option_reset (lua_State *L) +API_FUNC(config_option_reset) { const char *option; int run_callback, rc; - API_FUNC(1, "config_option_reset", API_RETURN_INT(0)); + API_INIT_FUNC(1, "config_option_reset", API_RETURN_INT(0)); if (lua_gettop (L) < 2) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -1335,13 +1296,12 @@ weechat_lua_api_config_option_reset (lua_State *L) API_RETURN_INT(rc); } -static int -weechat_lua_api_config_option_set (lua_State *L) +API_FUNC(config_option_set) { const char *option, *new_value; int run_callback, rc; - API_FUNC(1, "config_option_set", API_RETURN_INT(WEECHAT_CONFIG_OPTION_SET_ERROR)); + API_INIT_FUNC(1, "config_option_set", API_RETURN_INT(WEECHAT_CONFIG_OPTION_SET_ERROR)); if (lua_gettop (L) < 3) API_WRONG_ARGS(API_RETURN_INT(WEECHAT_CONFIG_OPTION_SET_ERROR)); @@ -1356,13 +1316,12 @@ weechat_lua_api_config_option_set (lua_State *L) API_RETURN_INT(rc); } -static int -weechat_lua_api_config_option_set_null (lua_State *L) +API_FUNC(config_option_set_null) { const char *option; int run_callback, rc; - API_FUNC(1, "config_option_set_null", API_RETURN_INT(WEECHAT_CONFIG_OPTION_SET_ERROR)); + API_INIT_FUNC(1, "config_option_set_null", API_RETURN_INT(WEECHAT_CONFIG_OPTION_SET_ERROR)); if (lua_gettop (L) < 2) API_WRONG_ARGS(API_RETURN_INT(WEECHAT_CONFIG_OPTION_SET_ERROR)); @@ -1375,13 +1334,12 @@ weechat_lua_api_config_option_set_null (lua_State *L) API_RETURN_INT(rc); } -static int -weechat_lua_api_config_option_unset (lua_State *L) +API_FUNC(config_option_unset) { const char *option; int rc; - API_FUNC(1, "config_option_unset", API_RETURN_INT(WEECHAT_CONFIG_OPTION_UNSET_ERROR)); + API_INIT_FUNC(1, "config_option_unset", API_RETURN_INT(WEECHAT_CONFIG_OPTION_UNSET_ERROR)); if (lua_gettop (L) < 1) API_WRONG_ARGS(API_RETURN_INT(WEECHAT_CONFIG_OPTION_UNSET_ERROR)); @@ -1392,12 +1350,11 @@ weechat_lua_api_config_option_unset (lua_State *L) API_RETURN_INT(rc); } -static int -weechat_lua_api_config_option_rename (lua_State *L) +API_FUNC(config_option_rename) { const char *option, *new_name; - API_FUNC(1, "config_option_rename", API_RETURN_ERROR); + API_INIT_FUNC(1, "config_option_rename", API_RETURN_ERROR); if (lua_gettop (L) < 2) API_WRONG_ARGS(API_RETURN_ERROR); @@ -1410,13 +1367,12 @@ weechat_lua_api_config_option_rename (lua_State *L) API_RETURN_OK; } -static int -weechat_lua_api_config_option_is_null (lua_State *L) +API_FUNC(config_option_is_null) { const char *option; int value; - API_FUNC(1, "config_option_is_null", API_RETURN_INT(1)); + API_INIT_FUNC(1, "config_option_is_null", API_RETURN_INT(1)); if (lua_gettop (L) < 1) API_WRONG_ARGS(API_RETURN_INT(1)); @@ -1427,13 +1383,12 @@ weechat_lua_api_config_option_is_null (lua_State *L) API_RETURN_INT(value); } -static int -weechat_lua_api_config_option_default_is_null (lua_State *L) +API_FUNC(config_option_default_is_null) { const char *option; int value; - API_FUNC(1, "config_option_default_is_null", API_RETURN_INT(1)); + API_INIT_FUNC(1, "config_option_default_is_null", API_RETURN_INT(1)); if (lua_gettop (L) < 1) API_WRONG_ARGS(API_RETURN_INT(1)); @@ -1444,13 +1399,12 @@ weechat_lua_api_config_option_default_is_null (lua_State *L) API_RETURN_INT(value); } -static int -weechat_lua_api_config_boolean (lua_State *L) +API_FUNC(config_boolean) { const char *option; int value; - API_FUNC(1, "config_boolean", API_RETURN_INT(0)); + API_INIT_FUNC(1, "config_boolean", API_RETURN_INT(0)); if (lua_gettop (L) < 1) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -1461,13 +1415,12 @@ weechat_lua_api_config_boolean (lua_State *L) API_RETURN_INT(value); } -static int -weechat_lua_api_config_boolean_default (lua_State *L) +API_FUNC(config_boolean_default) { const char *option; int value; - API_FUNC(1, "config_boolean_default", API_RETURN_INT(0)); + API_INIT_FUNC(1, "config_boolean_default", API_RETURN_INT(0)); if (lua_gettop (L) < 1) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -1478,13 +1431,12 @@ weechat_lua_api_config_boolean_default (lua_State *L) API_RETURN_INT(value); } -static int -weechat_lua_api_config_integer (lua_State *L) +API_FUNC(config_integer) { const char *option; int value; - API_FUNC(1, "config_integer", API_RETURN_INT(0)); + API_INIT_FUNC(1, "config_integer", API_RETURN_INT(0)); if (lua_gettop (L) < 1) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -1495,13 +1447,12 @@ weechat_lua_api_config_integer (lua_State *L) API_RETURN_INT(value); } -static int -weechat_lua_api_config_integer_default (lua_State *L) +API_FUNC(config_integer_default) { const char *option; int value; - API_FUNC(1, "config_integer_default", API_RETURN_INT(0)); + API_INIT_FUNC(1, "config_integer_default", API_RETURN_INT(0)); if (lua_gettop (L) < 1) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -1512,12 +1463,11 @@ weechat_lua_api_config_integer_default (lua_State *L) API_RETURN_INT(value); } -static int -weechat_lua_api_config_string (lua_State *L) +API_FUNC(config_string) { const char *option, *result; - API_FUNC(1, "config_string", API_RETURN_EMPTY); + API_INIT_FUNC(1, "config_string", API_RETURN_EMPTY); if (lua_gettop (L) < 1) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -1528,12 +1478,11 @@ weechat_lua_api_config_string (lua_State *L) API_RETURN_STRING(result); } -static int -weechat_lua_api_config_string_default (lua_State *L) +API_FUNC(config_string_default) { const char *option, *result; - API_FUNC(1, "config_string_default", API_RETURN_EMPTY); + API_INIT_FUNC(1, "config_string_default", API_RETURN_EMPTY); if (lua_gettop (L) < 1) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -1544,12 +1493,11 @@ weechat_lua_api_config_string_default (lua_State *L) API_RETURN_STRING(result); } -static int -weechat_lua_api_config_color (lua_State *L) +API_FUNC(config_color) { const char *option, *result; - API_FUNC(1, "config_color", API_RETURN_INT(0)); + API_INIT_FUNC(1, "config_color", API_RETURN_INT(0)); if (lua_gettop (L) < 1) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -1560,12 +1508,11 @@ weechat_lua_api_config_color (lua_State *L) API_RETURN_STRING(result); } -static int -weechat_lua_api_config_color_default (lua_State *L) +API_FUNC(config_color_default) { const char *option, *result; - API_FUNC(1, "config_color_default", API_RETURN_INT(0)); + API_INIT_FUNC(1, "config_color_default", API_RETURN_INT(0)); if (lua_gettop (L) < 1) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -1576,12 +1523,11 @@ weechat_lua_api_config_color_default (lua_State *L) API_RETURN_STRING(result); } -static int -weechat_lua_api_config_write_option (lua_State *L) +API_FUNC(config_write_option) { const char *config_file, *option; - API_FUNC(1, "config_write_option", API_RETURN_ERROR); + API_INIT_FUNC(1, "config_write_option", API_RETURN_ERROR); if (lua_gettop (L) < 2) API_WRONG_ARGS(API_RETURN_ERROR); @@ -1594,12 +1540,11 @@ weechat_lua_api_config_write_option (lua_State *L) API_RETURN_OK; } -static int -weechat_lua_api_config_write_line (lua_State *L) +API_FUNC(config_write_line) { const char *config_file, *option_name, *value; - API_FUNC(1, "config_write_line", API_RETURN_ERROR); + API_INIT_FUNC(1, "config_write_line", API_RETURN_ERROR); if (lua_gettop (L) < 3) API_WRONG_ARGS(API_RETURN_ERROR); @@ -1615,13 +1560,12 @@ weechat_lua_api_config_write_line (lua_State *L) API_RETURN_OK; } -static int -weechat_lua_api_config_write (lua_State *L) +API_FUNC(config_write) { const char *config_file; int rc; - API_FUNC(1, "config_write", API_RETURN_INT(-1)); + API_INIT_FUNC(1, "config_write", API_RETURN_INT(-1)); if (lua_gettop (L) < 1) API_WRONG_ARGS(API_RETURN_INT(-1)); @@ -1632,13 +1576,12 @@ weechat_lua_api_config_write (lua_State *L) API_RETURN_INT(rc); } -static int -weechat_lua_api_config_read (lua_State *L) +API_FUNC(config_read) { const char *config_file; int rc; - API_FUNC(1, "config_read", API_RETURN_INT(-1)); + API_INIT_FUNC(1, "config_read", API_RETURN_INT(-1)); if (lua_gettop (L) < 1) API_WRONG_ARGS(API_RETURN_INT(-1)); @@ -1649,13 +1592,12 @@ weechat_lua_api_config_read (lua_State *L) API_RETURN_INT(rc); } -static int -weechat_lua_api_config_reload (lua_State *L) +API_FUNC(config_reload) { const char *config_file; int rc; - API_FUNC(1, "config_reload", API_RETURN_INT(-1)); + API_INIT_FUNC(1, "config_reload", API_RETURN_INT(-1)); if (lua_gettop (L) < 1) API_WRONG_ARGS(API_RETURN_INT(-1)); @@ -1666,12 +1608,11 @@ weechat_lua_api_config_reload (lua_State *L) API_RETURN_INT(rc); } -static int -weechat_lua_api_config_option_free (lua_State *L) +API_FUNC(config_option_free) { const char *option; - API_FUNC(1, "config_option_free", API_RETURN_ERROR); + API_INIT_FUNC(1, "config_option_free", API_RETURN_ERROR); if (lua_gettop (L) < 1) API_WRONG_ARGS(API_RETURN_ERROR); @@ -1684,12 +1625,11 @@ weechat_lua_api_config_option_free (lua_State *L) API_RETURN_OK; } -static int -weechat_lua_api_config_section_free_options (lua_State *L) +API_FUNC(config_section_free_options) { const char *section; - API_FUNC(1, "config_section_free_options", API_RETURN_ERROR); + API_INIT_FUNC(1, "config_section_free_options", API_RETURN_ERROR); if (lua_gettop (L) < 1) API_WRONG_ARGS(API_RETURN_ERROR); @@ -1702,12 +1642,11 @@ weechat_lua_api_config_section_free_options (lua_State *L) API_RETURN_OK; } -static int -weechat_lua_api_config_section_free (lua_State *L) +API_FUNC(config_section_free) { const char *section; - API_FUNC(1, "config_section_free", API_RETURN_ERROR); + API_INIT_FUNC(1, "config_section_free", API_RETURN_ERROR); if (lua_gettop (L) < 1) API_WRONG_ARGS(API_RETURN_ERROR); @@ -1720,12 +1659,11 @@ weechat_lua_api_config_section_free (lua_State *L) API_RETURN_OK; } -static int -weechat_lua_api_config_free (lua_State *L) +API_FUNC(config_free) { const char *config_file; - API_FUNC(1, "config_free", API_RETURN_ERROR); + API_INIT_FUNC(1, "config_free", API_RETURN_ERROR); if (lua_gettop (L) < 1) API_WRONG_ARGS(API_RETURN_ERROR); @@ -1738,13 +1676,12 @@ weechat_lua_api_config_free (lua_State *L) API_RETURN_OK; } -static int -weechat_lua_api_config_get (lua_State *L) +API_FUNC(config_get) { const char *option; char *result; - API_FUNC(1, "config_get", API_RETURN_EMPTY); + API_INIT_FUNC(1, "config_get", API_RETURN_EMPTY); if (lua_gettop (L) < 1) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -1755,12 +1692,11 @@ weechat_lua_api_config_get (lua_State *L) API_RETURN_STRING_FREE(result); } -static int -weechat_lua_api_config_get_plugin (lua_State *L) +API_FUNC(config_get_plugin) { const char *option, *result; - API_FUNC(1, "config_get_plugin", API_RETURN_EMPTY); + API_INIT_FUNC(1, "config_get_plugin", API_RETURN_EMPTY); if (lua_gettop (L) < 1) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -1773,13 +1709,12 @@ weechat_lua_api_config_get_plugin (lua_State *L) API_RETURN_STRING(result); } -static int -weechat_lua_api_config_is_set_plugin (lua_State *L) +API_FUNC(config_is_set_plugin) { const char *option; int rc; - API_FUNC(1, "config_is_set_plugin", API_RETURN_INT(0)); + API_INIT_FUNC(1, "config_is_set_plugin", API_RETURN_INT(0)); if (lua_gettop (L) < 1) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -1792,13 +1727,12 @@ weechat_lua_api_config_is_set_plugin (lua_State *L) API_RETURN_INT(rc); } -static int -weechat_lua_api_config_set_plugin (lua_State *L) +API_FUNC(config_set_plugin) { const char *option, *value; int rc; - API_FUNC(1, "config_set_plugin", API_RETURN_INT(WEECHAT_CONFIG_OPTION_SET_ERROR)); + API_INIT_FUNC(1, "config_set_plugin", API_RETURN_INT(WEECHAT_CONFIG_OPTION_SET_ERROR)); if (lua_gettop (L) < 2) API_WRONG_ARGS(API_RETURN_INT(WEECHAT_CONFIG_OPTION_SET_ERROR)); @@ -1813,12 +1747,11 @@ weechat_lua_api_config_set_plugin (lua_State *L) API_RETURN_INT(rc); } -static int -weechat_lua_api_config_set_desc_plugin (lua_State *L) +API_FUNC(config_set_desc_plugin) { const char *option, *description; - API_FUNC(1, "config_set_desc_plugin", API_RETURN_ERROR); + API_INIT_FUNC(1, "config_set_desc_plugin", API_RETURN_ERROR); if (lua_gettop (L) < 2) API_WRONG_ARGS(API_RETURN_ERROR); @@ -1833,13 +1766,12 @@ weechat_lua_api_config_set_desc_plugin (lua_State *L) API_RETURN_OK; } -static int -weechat_lua_api_config_unset_plugin (lua_State *L) +API_FUNC(config_unset_plugin) { const char *option; int rc; - API_FUNC(1, "config_unset_plugin", API_RETURN_INT(WEECHAT_CONFIG_OPTION_UNSET_ERROR)); + API_INIT_FUNC(1, "config_unset_plugin", API_RETURN_INT(WEECHAT_CONFIG_OPTION_UNSET_ERROR)); if (lua_gettop (L) < 1) API_WRONG_ARGS(API_RETURN_INT(WEECHAT_CONFIG_OPTION_UNSET_ERROR)); @@ -1852,14 +1784,13 @@ weechat_lua_api_config_unset_plugin (lua_State *L) API_RETURN_INT(rc); } -static int -weechat_lua_api_key_bind (lua_State *L) +API_FUNC(key_bind) { const char *context; struct t_hashtable *hashtable; int num_keys; - API_FUNC(1, "key_bind", API_RETURN_INT(0)); + API_INIT_FUNC(1, "key_bind", API_RETURN_INT(0)); if (lua_gettop (L) < 2) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -1877,13 +1808,12 @@ weechat_lua_api_key_bind (lua_State *L) API_RETURN_INT(num_keys); } -static int -weechat_lua_api_key_unbind (lua_State *L) +API_FUNC(key_unbind) { const char *context, *key; int num_keys; - API_FUNC(1, "key_unbind", API_RETURN_INT(0)); + API_INIT_FUNC(1, "key_unbind", API_RETURN_INT(0)); if (lua_gettop (L) < 2) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -1895,12 +1825,11 @@ weechat_lua_api_key_unbind (lua_State *L) API_RETURN_INT(num_keys); } -static int -weechat_lua_api_prefix (lua_State *L) +API_FUNC(prefix) { const char *prefix, *result; - API_FUNC(0, "prefix", API_RETURN_EMPTY); + API_INIT_FUNC(0, "prefix", API_RETURN_EMPTY); if (lua_gettop (L) < 1) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -1911,12 +1840,11 @@ weechat_lua_api_prefix (lua_State *L) API_RETURN_STRING(result); } -static int -weechat_lua_api_color (lua_State *L) +API_FUNC(color) { const char *color, *result; - API_FUNC(0, "color", API_RETURN_EMPTY); + API_INIT_FUNC(0, "color", API_RETURN_EMPTY); if (lua_gettop (L) < 1) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -1927,12 +1855,11 @@ weechat_lua_api_color (lua_State *L) API_RETURN_STRING(result); } -static int -weechat_lua_api_print (lua_State *L) +API_FUNC(print) { const char *buffer, *message; - API_FUNC(0, "print", API_RETURN_ERROR); + API_INIT_FUNC(0, "print", API_RETURN_ERROR); if (lua_gettop (L) < 2) API_WRONG_ARGS(API_RETURN_ERROR); @@ -1947,13 +1874,12 @@ weechat_lua_api_print (lua_State *L) API_RETURN_OK; } -static int -weechat_lua_api_print_date_tags (lua_State *L) +API_FUNC(print_date_tags) { const char *buffer, *tags, *message; int date; - API_FUNC(1, "print_date_tags", API_RETURN_ERROR); + API_INIT_FUNC(1, "print_date_tags", API_RETURN_ERROR); if (lua_gettop (L) < 4) API_WRONG_ARGS(API_RETURN_ERROR); @@ -1972,13 +1898,12 @@ weechat_lua_api_print_date_tags (lua_State *L) API_RETURN_OK; } -static int -weechat_lua_api_print_y (lua_State *L) +API_FUNC(print_y) { const char *buffer, *message; int y; - API_FUNC(1, "print_y", API_RETURN_ERROR); + API_INIT_FUNC(1, "print_y", API_RETURN_ERROR); if (lua_gettop (L) < 3) API_WRONG_ARGS(API_RETURN_ERROR); @@ -1995,12 +1920,11 @@ weechat_lua_api_print_y (lua_State *L) API_RETURN_OK; } -static int -weechat_lua_api_log_print (lua_State *L) +API_FUNC(log_print) { const char *message; - API_FUNC(1, "log_print", API_RETURN_ERROR); + API_INIT_FUNC(1, "log_print", API_RETURN_ERROR); if (lua_gettop (L) < 1) API_WRONG_ARGS(API_RETURN_ERROR); @@ -2054,14 +1978,13 @@ weechat_lua_api_hook_command_cb (void *data, struct t_gui_buffer *buffer, return WEECHAT_RC_ERROR; } -static int -weechat_lua_api_hook_command (lua_State *L) +API_FUNC(hook_command) { const char *command, *description, *args, *args_description, *completion; const char *function, *data; char *result; - API_FUNC(1, "hook_command", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_command", API_RETURN_EMPTY); if (lua_gettop (L) < 7) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -2125,13 +2048,12 @@ weechat_lua_api_hook_command_run_cb (void *data, struct t_gui_buffer *buffer, return WEECHAT_RC_ERROR; } -static int -weechat_lua_api_hook_command_run (lua_State *L) +API_FUNC(hook_command_run) { const char *command, *function, *data; char *result; - API_FUNC(1, "hook_command_run", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_command_run", API_RETURN_EMPTY); if (lua_gettop (L) < 3) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -2186,14 +2108,13 @@ weechat_lua_api_hook_timer_cb (void *data, int remaining_calls) return WEECHAT_RC_ERROR; } -static int -weechat_lua_api_hook_timer (lua_State *L) +API_FUNC(hook_timer) { int interval, align_second, max_calls; const char *function, *data; char *result; - API_FUNC(1, "hook_timer", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_timer", API_RETURN_EMPTY); if (lua_gettop (L) < 5) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -2251,14 +2172,13 @@ weechat_lua_api_hook_fd_cb (void *data, int fd) return WEECHAT_RC_ERROR; } -static int -weechat_lua_api_hook_fd (lua_State *L) +API_FUNC(hook_fd) { int fd, read, write, exception; const char *function, *data; char *result; - API_FUNC(1, "hook_fd", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_fd", API_RETURN_EMPTY); if (lua_gettop (L) < 6) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -2321,14 +2241,13 @@ weechat_lua_api_hook_process_cb (void *data, return WEECHAT_RC_ERROR; } -static int -weechat_lua_api_hook_process (lua_State *L) +API_FUNC(hook_process) { const char *command, *function, *data; int timeout; char *result; - API_FUNC(1, "hook_process", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_process", API_RETURN_EMPTY); if (lua_gettop (L) < 4) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -2348,15 +2267,14 @@ weechat_lua_api_hook_process (lua_State *L) API_RETURN_STRING_FREE(result); } -static int -weechat_lua_api_hook_process_hashtable (lua_State *L) +API_FUNC(hook_process_hashtable) { const char *command, *function, *data; struct t_hashtable *options; int timeout; char *result; - API_FUNC(1, "hook_process_hashtable", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_process_hashtable", API_RETURN_EMPTY); if (lua_gettop (L) < 5) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -2429,14 +2347,13 @@ weechat_lua_api_hook_connect_cb (void *data, int status, int gnutls_rc, return WEECHAT_RC_ERROR; } -static int -weechat_lua_api_hook_connect (lua_State *L) +API_FUNC(hook_connect) { const char *proxy, *address, *local_hostname, *function, *data; int port, ipv6, retry; char *result; - API_FUNC(1, "hook_connect", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_connect", API_RETURN_EMPTY); if (lua_gettop (L) < 8) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -2524,14 +2441,13 @@ weechat_lua_api_hook_print_cb (void *data, struct t_gui_buffer *buffer, return WEECHAT_RC_ERROR; } -static int -weechat_lua_api_hook_print (lua_State *L) +API_FUNC(hook_print) { const char *buffer, *tags, *message, *function, *data; char *result; int strip_colors; - API_FUNC(1, "hook_print", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_print", API_RETURN_EMPTY); if (lua_gettop (L) < 6) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -2615,13 +2531,12 @@ weechat_lua_api_hook_signal_cb (void *data, const char *signal, return WEECHAT_RC_ERROR; } -static int -weechat_lua_api_hook_signal (lua_State *L) +API_FUNC(hook_signal) { const char *signal, *function, *data; char *result; - API_FUNC(1, "hook_signal", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_signal", API_RETURN_EMPTY); if (lua_gettop (L) < 3) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -2639,13 +2554,12 @@ weechat_lua_api_hook_signal (lua_State *L) API_RETURN_STRING_FREE(result); } -static int -weechat_lua_api_hook_signal_send (lua_State *L) +API_FUNC(hook_signal_send) { const char *signal, *type_data, *signal_data; int number, rc; - API_FUNC(1, "hook_signal_send", API_RETURN_INT(WEECHAT_RC_ERROR)); + API_INIT_FUNC(1, "hook_signal_send", API_RETURN_INT(WEECHAT_RC_ERROR)); signal_data = NULL; if (lua_gettop (L) < 3) @@ -2713,13 +2627,12 @@ weechat_lua_api_hook_hsignal_cb (void *data, const char *signal, return WEECHAT_RC_ERROR; } -static int -weechat_lua_api_hook_hsignal (lua_State *L) +API_FUNC(hook_hsignal) { const char *signal, *function, *data; char *result; - API_FUNC(1, "hook_hsignal", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_hsignal", API_RETURN_EMPTY); if (lua_gettop (L) < 3) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -2737,14 +2650,13 @@ weechat_lua_api_hook_hsignal (lua_State *L) API_RETURN_STRING_FREE(result); } -static int -weechat_lua_api_hook_hsignal_send (lua_State *L) +API_FUNC(hook_hsignal_send) { const char *signal; struct t_hashtable *hashtable; int rc; - API_FUNC(1, "hook_hsignal_send", API_RETURN_INT(WEECHAT_RC_ERROR)); + API_INIT_FUNC(1, "hook_hsignal_send", API_RETURN_INT(WEECHAT_RC_ERROR)); if (lua_gettop (L) < 2) API_WRONG_ARGS(API_RETURN_INT(WEECHAT_RC_ERROR)); @@ -2798,13 +2710,12 @@ weechat_lua_api_hook_config_cb (void *data, const char *option, return WEECHAT_RC_ERROR; } -static int -weechat_lua_api_hook_config (lua_State *L) +API_FUNC(hook_config) { const char *option, *function, *data; char *result; - API_FUNC(1, "hook_config", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_config", API_RETURN_EMPTY); if (lua_gettop (L) < 3) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -2864,13 +2775,12 @@ weechat_lua_api_hook_completion_cb (void *data, const char *completion_item, return WEECHAT_RC_ERROR; } -static int -weechat_lua_api_hook_completion (lua_State *L) +API_FUNC(hook_completion) { const char *completion, *description, *function, *data; char *result; - API_FUNC(1, "hook_completion", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_completion", API_RETURN_EMPTY); if (lua_gettop (L) < 4) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -2890,13 +2800,12 @@ weechat_lua_api_hook_completion (lua_State *L) API_RETURN_STRING_FREE(result); } -static int -weechat_lua_api_hook_completion_list_add (lua_State *L) +API_FUNC(hook_completion_list_add) { const char *completion, *word, *where; int nick_completion; - API_FUNC(1, "hook_completion_list_add", API_RETURN_ERROR); + API_INIT_FUNC(1, "hook_completion_list_add", API_RETURN_ERROR); if (lua_gettop (L) < 4) API_WRONG_ARGS(API_RETURN_ERROR); @@ -2940,13 +2849,12 @@ weechat_lua_api_hook_modifier_cb (void *data, const char *modifier, return NULL; } -static int -weechat_lua_api_hook_modifier (lua_State *L) +API_FUNC(hook_modifier) { const char *modifier, *function, *data; char *result; - API_FUNC(1, "hook_modifier", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_modifier", API_RETURN_EMPTY); if (lua_gettop (L) < 3) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -2964,13 +2872,12 @@ weechat_lua_api_hook_modifier (lua_State *L) API_RETURN_STRING_FREE(result); } -static int -weechat_lua_api_hook_modifier_exec (lua_State *L) +API_FUNC(hook_modifier_exec) { const char *modifier, *modifier_data, *string; char *result; - API_FUNC(1, "hook_modifier_exec", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_modifier_exec", API_RETURN_EMPTY); if (lua_gettop (L) < 3) API_WRONG_ARGS(API_RETURN_ERROR); @@ -3008,13 +2915,12 @@ weechat_lua_api_hook_info_cb (void *data, const char *info_name, return NULL; } -static int -weechat_lua_api_hook_info (lua_State *L) +API_FUNC(hook_info) { const char *info_name, *description, *args_description, *function, *data; char *result; - API_FUNC(1, "hook_info", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_info", API_RETURN_EMPTY); if (lua_gettop (L) < 5) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3061,14 +2967,13 @@ weechat_lua_api_hook_info_hashtable_cb (void *data, const char *info_name, return NULL; } -static int -weechat_lua_api_hook_info_hashtable (lua_State *L) +API_FUNC(hook_info_hashtable) { const char *info_name, *description, *args_description; const char *output_description, *function, *data; char *result; - API_FUNC(1, "hook_info_hashtable", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_info_hashtable", API_RETURN_EMPTY); if (lua_gettop (L) < 6) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3124,14 +3029,13 @@ weechat_lua_api_hook_infolist_cb (void *data, const char *info_name, return NULL; } -static int -weechat_lua_api_hook_infolist (lua_State *L) +API_FUNC(hook_infolist) { const char *infolist_name, *description, *pointer_description; const char *args_description, *function, *data; char *result; - API_FUNC(1, "hook_infolist", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_infolist", API_RETURN_EMPTY); if (lua_gettop (L) < 6) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3179,13 +3083,12 @@ weechat_lua_api_hook_focus_cb (void *data, return NULL; } -static int -weechat_lua_api_hook_focus (lua_State *L) +API_FUNC(hook_focus) { const char *area, *function, *data; char *result; - API_FUNC(1, "hook_focus", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_focus", API_RETURN_EMPTY); if (lua_gettop (L) < 3) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3203,12 +3106,11 @@ weechat_lua_api_hook_focus (lua_State *L) API_RETURN_STRING_FREE(result); } -static int -weechat_lua_api_hook_set (lua_State *L) +API_FUNC(hook_set) { const char *hook, *property, *value; - API_FUNC(1, "hook_set", API_RETURN_ERROR); + API_INIT_FUNC(1, "hook_set", API_RETURN_ERROR); if (lua_gettop (L) < 3) API_WRONG_ARGS(API_RETURN_ERROR); @@ -3221,12 +3123,11 @@ weechat_lua_api_hook_set (lua_State *L) API_RETURN_OK; } -static int -weechat_lua_api_unhook (lua_State *L) +API_FUNC(unhook) { const char *hook; - API_FUNC(1, "unhook", API_RETURN_ERROR); + API_INIT_FUNC(1, "unhook", API_RETURN_ERROR); if (lua_gettop (L) < 1) API_WRONG_ARGS(API_RETURN_ERROR); @@ -3239,10 +3140,9 @@ weechat_lua_api_unhook (lua_State *L) API_RETURN_OK; } -static int -weechat_lua_api_unhook_all (lua_State *L) +API_FUNC(unhook_all) { - API_FUNC(1, "unhook_all", API_RETURN_ERROR); + API_INIT_FUNC(1, "unhook_all", API_RETURN_ERROR); plugin_script_api_unhook_all (weechat_lua_plugin, lua_current_script); @@ -3323,14 +3223,13 @@ weechat_lua_api_buffer_close_cb (void *data, struct t_gui_buffer *buffer) return WEECHAT_RC_ERROR; } -static int -weechat_lua_api_buffer_new (lua_State *L) +API_FUNC(buffer_new) { const char *name, *function_input, *data_input, *function_close; const char *data_close; char *result; - API_FUNC(1, "buffer_new", API_RETURN_EMPTY); + API_INIT_FUNC(1, "buffer_new", API_RETURN_EMPTY); if (lua_gettop (L) < 5) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3353,13 +3252,12 @@ weechat_lua_api_buffer_new (lua_State *L) API_RETURN_STRING_FREE(result); } -static int -weechat_lua_api_buffer_search (lua_State *L) +API_FUNC(buffer_search) { const char *plugin, *name; char *result; - API_FUNC(1, "buffer_search", API_RETURN_EMPTY); + API_INIT_FUNC(1, "buffer_search", API_RETURN_EMPTY); if (lua_gettop (L) < 2) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3371,36 +3269,33 @@ weechat_lua_api_buffer_search (lua_State *L) API_RETURN_STRING_FREE(result); } -static int -weechat_lua_api_buffer_search_main (lua_State *L) +API_FUNC(buffer_search_main) { char *result; - API_FUNC(1, "buffer_search_main", API_RETURN_EMPTY); + API_INIT_FUNC(1, "buffer_search_main", API_RETURN_EMPTY); result = API_PTR2STR(weechat_buffer_search_main ()); API_RETURN_STRING_FREE(result); } -static int -weechat_lua_api_current_buffer (lua_State *L) +API_FUNC(current_buffer) { char *result; - API_FUNC(1, "current_buffer", API_RETURN_EMPTY); + API_INIT_FUNC(1, "current_buffer", API_RETURN_EMPTY); result = API_PTR2STR(weechat_current_buffer ()); API_RETURN_STRING_FREE(result); } -static int -weechat_lua_api_buffer_clear (lua_State *L) +API_FUNC(buffer_clear) { const char *buffer; - API_FUNC(1, "buffer_clear", API_RETURN_ERROR); + API_INIT_FUNC(1, "buffer_clear", API_RETURN_ERROR); if (lua_gettop (L) < 1) API_WRONG_ARGS(API_RETURN_ERROR); @@ -3411,12 +3306,11 @@ weechat_lua_api_buffer_clear (lua_State *L) API_RETURN_OK; } -static int -weechat_lua_api_buffer_close (lua_State *L) +API_FUNC(buffer_close) { const char *buffer; - API_FUNC(1, "buffer_close", API_RETURN_ERROR); + API_INIT_FUNC(1, "buffer_close", API_RETURN_ERROR); if (lua_gettop (L) < 1) API_WRONG_ARGS(API_RETURN_ERROR); @@ -3429,12 +3323,11 @@ weechat_lua_api_buffer_close (lua_State *L) API_RETURN_OK; } -static int -weechat_lua_api_buffer_merge (lua_State *L) +API_FUNC(buffer_merge) { const char *buffer, *target_buffer; - API_FUNC(1, "buffer_merge", API_RETURN_ERROR); + API_INIT_FUNC(1, "buffer_merge", API_RETURN_ERROR); if (lua_gettop (L) < 2) API_WRONG_ARGS(API_RETURN_ERROR); @@ -3447,13 +3340,12 @@ weechat_lua_api_buffer_merge (lua_State *L) API_RETURN_OK; } -static int -weechat_lua_api_buffer_unmerge (lua_State *L) +API_FUNC(buffer_unmerge) { const char *buffer; int number; - API_FUNC(1, "buffer_unmerge", API_RETURN_ERROR); + API_INIT_FUNC(1, "buffer_unmerge", API_RETURN_ERROR); if (lua_gettop (L) < 2) API_WRONG_ARGS(API_RETURN_ERROR); @@ -3465,13 +3357,12 @@ weechat_lua_api_buffer_unmerge (lua_State *L) API_RETURN_OK; } -static int -weechat_lua_api_buffer_get_integer (lua_State *L) +API_FUNC(buffer_get_integer) { const char *buffer, *property; int value; - API_FUNC(1, "buffer_get_integer", API_RETURN_INT(-1)); + API_INIT_FUNC(1, "buffer_get_integer", API_RETURN_INT(-1)); if (lua_gettop (L) < 2) API_WRONG_ARGS(API_RETURN_INT(-1)); @@ -3484,12 +3375,11 @@ weechat_lua_api_buffer_get_integer (lua_State *L) API_RETURN_INT(value); } -static int -weechat_lua_api_buffer_get_string (lua_State *L) +API_FUNC(buffer_get_string) { const char *buffer, *property, *result; - API_FUNC(1, "buffer_get_string", API_RETURN_EMPTY); + API_INIT_FUNC(1, "buffer_get_string", API_RETURN_EMPTY); if (lua_gettop (L) < 2) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3502,13 +3392,12 @@ weechat_lua_api_buffer_get_string (lua_State *L) API_RETURN_STRING(result); } -static int -weechat_lua_api_buffer_get_pointer (lua_State *L) +API_FUNC(buffer_get_pointer) { const char *buffer, *property; char *result; - API_FUNC(1, "buffer_get_pointer", API_RETURN_EMPTY); + API_INIT_FUNC(1, "buffer_get_pointer", API_RETURN_EMPTY); if (lua_gettop (L) < 2) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3521,12 +3410,11 @@ weechat_lua_api_buffer_get_pointer (lua_State *L) API_RETURN_STRING_FREE(result); } -static int -weechat_lua_api_buffer_set (lua_State *L) +API_FUNC(buffer_set) { const char *buffer, *property, *value; - API_FUNC(1, "buffer_set", API_RETURN_ERROR); + API_INIT_FUNC(1, "buffer_set", API_RETURN_ERROR); if (lua_gettop (L) < 3) API_WRONG_ARGS(API_RETURN_ERROR); @@ -3539,13 +3427,12 @@ weechat_lua_api_buffer_set (lua_State *L) API_RETURN_OK; } -static int -weechat_lua_api_buffer_string_replace_local_var (lua_State *L) +API_FUNC(buffer_string_replace_local_var) { const char *buffer, *string; char *result; - API_FUNC(1, "buffer_string_replace_local_var", API_RETURN_ERROR); + API_INIT_FUNC(1, "buffer_string_replace_local_var", API_RETURN_ERROR); if (lua_gettop (L) < 2) API_WRONG_ARGS(API_RETURN_ERROR); @@ -3557,13 +3444,12 @@ weechat_lua_api_buffer_string_replace_local_var (lua_State *L) API_RETURN_STRING_FREE(result); } -static int -weechat_lua_api_buffer_match_list (lua_State *L) +API_FUNC(buffer_match_list) { const char *buffer, *string; int value; - API_FUNC(1, "buffer_match_list", API_RETURN_INT(0)); + API_INIT_FUNC(1, "buffer_match_list", API_RETURN_INT(0)); if (lua_gettop (L) < 2) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -3576,25 +3462,23 @@ weechat_lua_api_buffer_match_list (lua_State *L) API_RETURN_INT(value); } -static int -weechat_lua_api_current_window (lua_State *L) +API_FUNC(current_window) { char *result; - API_FUNC(1, "current_window", API_RETURN_EMPTY); + API_INIT_FUNC(1, "current_window", API_RETURN_EMPTY); result = API_PTR2STR(weechat_current_window ()); API_RETURN_STRING_FREE(result); } -static int -weechat_lua_api_window_search_with_buffer (lua_State *L) +API_FUNC(window_search_with_buffer) { const char *buffer; char *result; - API_FUNC(1, "window_search_with_buffer", API_RETURN_EMPTY); + API_INIT_FUNC(1, "window_search_with_buffer", API_RETURN_EMPTY); if (lua_gettop (L) < 1) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3605,13 +3489,12 @@ weechat_lua_api_window_search_with_buffer (lua_State *L) API_RETURN_STRING_FREE(result); } -static int -weechat_lua_api_window_get_integer (lua_State *L) +API_FUNC(window_get_integer) { const char *window, *property; int value; - API_FUNC(1, "window_get_integer", API_RETURN_INT(-1)); + API_INIT_FUNC(1, "window_get_integer", API_RETURN_INT(-1)); if (lua_gettop (L) < 2) API_WRONG_ARGS(API_RETURN_INT(-1)); @@ -3624,12 +3507,11 @@ weechat_lua_api_window_get_integer (lua_State *L) API_RETURN_INT(value); } -static int -weechat_lua_api_window_get_string (lua_State *L) +API_FUNC(window_get_string) { const char *window, *property, *result; - API_FUNC(1, "window_get_string", API_RETURN_EMPTY); + API_INIT_FUNC(1, "window_get_string", API_RETURN_EMPTY); if (lua_gettop (L) < 2) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3642,13 +3524,12 @@ weechat_lua_api_window_get_string (lua_State *L) API_RETURN_STRING(result); } -static int -weechat_lua_api_window_get_pointer (lua_State *L) +API_FUNC(window_get_pointer) { const char *window, *property; char *result; - API_FUNC(1, "window_get_pointer", API_RETURN_EMPTY); + API_INIT_FUNC(1, "window_get_pointer", API_RETURN_EMPTY); if (lua_gettop (L) < 2) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3661,12 +3542,11 @@ weechat_lua_api_window_get_pointer (lua_State *L) API_RETURN_STRING_FREE(result); } -static int -weechat_lua_api_window_set_title (lua_State *L) +API_FUNC(window_set_title) { const char *title; - API_FUNC(1, "window_set_title", API_RETURN_ERROR); + API_INIT_FUNC(1, "window_set_title", API_RETURN_ERROR); if (lua_gettop (L) < 1) API_WRONG_ARGS(API_RETURN_ERROR); @@ -3677,14 +3557,13 @@ weechat_lua_api_window_set_title (lua_State *L) API_RETURN_OK; } -static int -weechat_lua_api_nicklist_add_group (lua_State *L) +API_FUNC(nicklist_add_group) { const char *buffer, *parent_group, *name, *color; char *result; int visible; - API_FUNC(1, "nicklist_add_group", API_RETURN_EMPTY); + API_INIT_FUNC(1, "nicklist_add_group", API_RETURN_EMPTY); if (lua_gettop (L) < 5) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3703,13 +3582,12 @@ weechat_lua_api_nicklist_add_group (lua_State *L) API_RETURN_STRING_FREE(result); } -static int -weechat_lua_api_nicklist_search_group (lua_State *L) +API_FUNC(nicklist_search_group) { const char *buffer, *from_group, *name; char *result; - API_FUNC(1, "nicklist_search_group", API_RETURN_EMPTY); + API_INIT_FUNC(1, "nicklist_search_group", API_RETURN_EMPTY); if (lua_gettop (L) < 3) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3724,14 +3602,13 @@ weechat_lua_api_nicklist_search_group (lua_State *L) API_RETURN_STRING_FREE(result); } -static int -weechat_lua_api_nicklist_add_nick (lua_State *L) +API_FUNC(nicklist_add_nick) { const char *buffer, *group, *name, *color, *prefix, *prefix_color; char *result; int visible; - API_FUNC(1, "nicklist_add_nick", API_RETURN_EMPTY); + API_INIT_FUNC(1, "nicklist_add_nick", API_RETURN_EMPTY); if (lua_gettop (L) < 7) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3754,13 +3631,12 @@ weechat_lua_api_nicklist_add_nick (lua_State *L) API_RETURN_STRING_FREE(result); } -static int -weechat_lua_api_nicklist_search_nick (lua_State *L) +API_FUNC(nicklist_search_nick) { const char *buffer, *from_group, *name; char *result; - API_FUNC(1, "nicklist_search_nick", API_RETURN_EMPTY); + API_INIT_FUNC(1, "nicklist_search_nick", API_RETURN_EMPTY); if (lua_gettop (L) < 3) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3775,12 +3651,11 @@ weechat_lua_api_nicklist_search_nick (lua_State *L) API_RETURN_STRING_FREE(result); } -static int -weechat_lua_api_nicklist_remove_group (lua_State *L) +API_FUNC(nicklist_remove_group) { const char *buffer, *group; - API_FUNC(1, "nicklist_remove_group", API_RETURN_ERROR); + API_INIT_FUNC(1, "nicklist_remove_group", API_RETURN_ERROR); if (lua_gettop (L) < 2) API_WRONG_ARGS(API_RETURN_ERROR); @@ -3793,12 +3668,11 @@ weechat_lua_api_nicklist_remove_group (lua_State *L) API_RETURN_OK; } -static int -weechat_lua_api_nicklist_remove_nick (lua_State *L) +API_FUNC(nicklist_remove_nick) { const char *buffer, *nick; - API_FUNC(1, "nicklist_remove_nick", API_RETURN_ERROR); + API_INIT_FUNC(1, "nicklist_remove_nick", API_RETURN_ERROR); if (lua_gettop (L) < 2) API_WRONG_ARGS(API_RETURN_ERROR); @@ -3811,12 +3685,11 @@ weechat_lua_api_nicklist_remove_nick (lua_State *L) API_RETURN_OK; } -static int -weechat_lua_api_nicklist_remove_all (lua_State *L) +API_FUNC(nicklist_remove_all) { const char *buffer; - API_FUNC(1, "nicklist_remove_all", API_RETURN_ERROR); + API_INIT_FUNC(1, "nicklist_remove_all", API_RETURN_ERROR); if (lua_gettop (L) < 1) API_WRONG_ARGS(API_RETURN_ERROR); @@ -3827,13 +3700,12 @@ weechat_lua_api_nicklist_remove_all (lua_State *L) API_RETURN_OK; } -static int -weechat_lua_api_nicklist_group_get_integer (lua_State *L) +API_FUNC(nicklist_group_get_integer) { const char *buffer, *group, *property; int value; - API_FUNC(1, "nicklist_group_get_integer", API_RETURN_INT(-1)); + API_INIT_FUNC(1, "nicklist_group_get_integer", API_RETURN_INT(-1)); if (lua_gettop (L) < 3) API_WRONG_ARGS(API_RETURN_INT(-1)); @@ -3848,12 +3720,11 @@ weechat_lua_api_nicklist_group_get_integer (lua_State *L) API_RETURN_INT(value); } -static int -weechat_lua_api_nicklist_group_get_string (lua_State *L) +API_FUNC(nicklist_group_get_string) { const char *buffer, *group, *property, *result; - API_FUNC(1, "nicklist_group_get_string", API_RETURN_EMPTY); + API_INIT_FUNC(1, "nicklist_group_get_string", API_RETURN_EMPTY); if (lua_gettop (L) < 3) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3868,13 +3739,12 @@ weechat_lua_api_nicklist_group_get_string (lua_State *L) API_RETURN_STRING(result); } -static int -weechat_lua_api_nicklist_group_get_pointer (lua_State *L) +API_FUNC(nicklist_group_get_pointer) { const char *buffer, *group, *property; char *result; - API_FUNC(1, "nicklist_group_get_pointer", API_RETURN_EMPTY); + API_INIT_FUNC(1, "nicklist_group_get_pointer", API_RETURN_EMPTY); if (lua_gettop (L) < 3) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3889,12 +3759,11 @@ weechat_lua_api_nicklist_group_get_pointer (lua_State *L) API_RETURN_STRING_FREE(result); } -static int -weechat_lua_api_nicklist_group_set (lua_State *L) +API_FUNC(nicklist_group_set) { const char *buffer, *group, *property, *value; - API_FUNC(1, "nicklist_group_set", API_RETURN_ERROR); + API_INIT_FUNC(1, "nicklist_group_set", API_RETURN_ERROR); if (lua_gettop (L) < 4) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3911,13 +3780,12 @@ weechat_lua_api_nicklist_group_set (lua_State *L) API_RETURN_OK; } -static int -weechat_lua_api_nicklist_nick_get_integer (lua_State *L) +API_FUNC(nicklist_nick_get_integer) { const char *buffer, *nick, *property; int value; - API_FUNC(1, "nicklist_nick_get_integer", API_RETURN_INT(-1)); + API_INIT_FUNC(1, "nicklist_nick_get_integer", API_RETURN_INT(-1)); if (lua_gettop (L) < 3) API_WRONG_ARGS(API_RETURN_INT(-1)); @@ -3932,12 +3800,11 @@ weechat_lua_api_nicklist_nick_get_integer (lua_State *L) API_RETURN_INT(value); } -static int -weechat_lua_api_nicklist_nick_get_string (lua_State *L) +API_FUNC(nicklist_nick_get_string) { const char *buffer, *nick, *property, *result; - API_FUNC(1, "nicklist_nick_get_string", API_RETURN_EMPTY); + API_INIT_FUNC(1, "nicklist_nick_get_string", API_RETURN_EMPTY); if (lua_gettop (L) < 3) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3952,13 +3819,12 @@ weechat_lua_api_nicklist_nick_get_string (lua_State *L) API_RETURN_STRING(result); } -static int -weechat_lua_api_nicklist_nick_get_pointer (lua_State *L) +API_FUNC(nicklist_nick_get_pointer) { const char *buffer, *nick, *property; char *result; - API_FUNC(1, "nicklist_nick_get_pointer", API_RETURN_EMPTY); + API_INIT_FUNC(1, "nicklist_nick_get_pointer", API_RETURN_EMPTY); if (lua_gettop (L) < 3) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3973,12 +3839,11 @@ weechat_lua_api_nicklist_nick_get_pointer (lua_State *L) API_RETURN_STRING_FREE(result); } -static int -weechat_lua_api_nicklist_nick_set (lua_State *L) +API_FUNC(nicklist_nick_set) { const char *buffer, *nick, *property, *value; - API_FUNC(1, "nicklist_nick_set", API_RETURN_ERROR); + API_INIT_FUNC(1, "nicklist_nick_set", API_RETURN_ERROR); if (lua_gettop (L) < 4) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3995,13 +3860,12 @@ weechat_lua_api_nicklist_nick_set (lua_State *L) API_RETURN_OK; } -static int -weechat_lua_api_bar_item_search (lua_State *L) +API_FUNC(bar_item_search) { const char *name; char *result; - API_FUNC(1, "bar_item_search", API_RETURN_EMPTY); + API_INIT_FUNC(1, "bar_item_search", API_RETURN_EMPTY); if (lua_gettop (L) < 1) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4071,13 +3935,12 @@ weechat_lua_api_bar_item_build_cb (void *data, struct t_gui_bar_item *item, return NULL; } -static int -weechat_lua_api_bar_item_new (lua_State *L) +API_FUNC(bar_item_new) { const char *name, *function, *data; char *result; - API_FUNC(1, "bar_item_new", API_RETURN_EMPTY); + API_INIT_FUNC(1, "bar_item_new", API_RETURN_EMPTY); if (lua_gettop (L) < 3) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4095,12 +3958,11 @@ weechat_lua_api_bar_item_new (lua_State *L) API_RETURN_STRING_FREE(result); } -static int -weechat_lua_api_bar_item_update (lua_State *L) +API_FUNC(bar_item_update) { const char *name; - API_FUNC(1, "bar_item_update", API_RETURN_ERROR); + API_INIT_FUNC(1, "bar_item_update", API_RETURN_ERROR); if (lua_gettop (L) < 1) API_WRONG_ARGS(API_RETURN_ERROR); @@ -4111,12 +3973,11 @@ weechat_lua_api_bar_item_update (lua_State *L) API_RETURN_OK; } -static int -weechat_lua_api_bar_item_remove (lua_State *L) +API_FUNC(bar_item_remove) { const char *item; - API_FUNC(1, "bar_item_remove", API_RETURN_ERROR); + API_INIT_FUNC(1, "bar_item_remove", API_RETURN_ERROR); if (lua_gettop (L) < 1) API_WRONG_ARGS(API_RETURN_ERROR); @@ -4129,13 +3990,12 @@ weechat_lua_api_bar_item_remove (lua_State *L) API_RETURN_OK; } -static int -weechat_lua_api_bar_search (lua_State *L) +API_FUNC(bar_search) { const char *name; char *result; - API_FUNC(1, "bar_search", API_RETURN_EMPTY); + API_INIT_FUNC(1, "bar_search", API_RETURN_EMPTY); if (lua_gettop (L) < 1) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4146,15 +4006,14 @@ weechat_lua_api_bar_search (lua_State *L) API_RETURN_STRING_FREE(result); } -static int -weechat_lua_api_bar_new (lua_State *L) +API_FUNC(bar_new) { const char *name, *hidden, *priority, *type, *conditions, *position; const char *filling_top_bottom, *filling_left_right, *size, *size_max; const char *color_fg, *color_delim, *color_bg, *separator, *items; char *result; - API_FUNC(1, "bar_new", API_RETURN_EMPTY); + API_INIT_FUNC(1, "bar_new", API_RETURN_EMPTY); if (lua_gettop (L) < 15) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4193,12 +4052,11 @@ weechat_lua_api_bar_new (lua_State *L) API_RETURN_STRING_FREE(result); } -static int -weechat_lua_api_bar_set (lua_State *L) +API_FUNC(bar_set) { const char *bar, *property, *value; - API_FUNC(1, "bar_set", API_RETURN_ERROR); + API_INIT_FUNC(1, "bar_set", API_RETURN_ERROR); if (lua_gettop (L) < 3) API_WRONG_ARGS(API_RETURN_ERROR); @@ -4213,12 +4071,11 @@ weechat_lua_api_bar_set (lua_State *L) API_RETURN_OK; } -static int -weechat_lua_api_bar_update (lua_State *L) +API_FUNC(bar_update) { const char *name; - API_FUNC(1, "bar_update", API_RETURN_ERROR); + API_INIT_FUNC(1, "bar_update", API_RETURN_ERROR); if (lua_gettop (L) < 1) API_WRONG_ARGS(API_RETURN_ERROR); @@ -4229,12 +4086,11 @@ weechat_lua_api_bar_update (lua_State *L) API_RETURN_OK; } -static int -weechat_lua_api_bar_remove (lua_State *L) +API_FUNC(bar_remove) { const char *bar; - API_FUNC(1, "bar_remove", API_RETURN_ERROR); + API_INIT_FUNC(1, "bar_remove", API_RETURN_ERROR); if (lua_gettop (L) < 1) API_WRONG_ARGS(API_RETURN_ERROR); @@ -4245,13 +4101,12 @@ weechat_lua_api_bar_remove (lua_State *L) API_RETURN_OK; } -static int -weechat_lua_api_command (lua_State *L) +API_FUNC(command) { const char *buffer, *command; int rc; - API_FUNC(1, "command", API_RETURN_ERROR); + API_INIT_FUNC(1, "command", API_RETURN_ERROR); if (lua_gettop (L) < 2) API_WRONG_ARGS(API_RETURN_ERROR); @@ -4266,12 +4121,11 @@ weechat_lua_api_command (lua_State *L) API_RETURN_INT(rc); } -static int -weechat_lua_api_info_get (lua_State *L) +API_FUNC(info_get) { const char *info_name, *arguments, *result; - API_FUNC(1, "info_get", API_RETURN_EMPTY); + API_INIT_FUNC(1, "info_get", API_RETURN_EMPTY); if (lua_gettop (L) < 2) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4283,13 +4137,12 @@ weechat_lua_api_info_get (lua_State *L) API_RETURN_STRING(result); } -static int -weechat_lua_api_info_get_hashtable (lua_State *L) +API_FUNC(info_get_hashtable) { const char *info_name; struct t_hashtable *table, *result_hashtable; - API_FUNC(1, "info_get_hashtable", API_RETURN_EMPTY); + API_INIT_FUNC(1, "info_get_hashtable", API_RETURN_EMPTY); if (lua_gettop (L) < 2) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4311,25 +4164,23 @@ weechat_lua_api_info_get_hashtable (lua_State *L) return 1; } -static int -weechat_lua_api_infolist_new (lua_State *L) +API_FUNC(infolist_new) { char *result; - API_FUNC(1, "infolist_new", API_RETURN_EMPTY); + API_INIT_FUNC(1, "infolist_new", API_RETURN_EMPTY); result = API_PTR2STR(weechat_infolist_new ()); API_RETURN_STRING_FREE(result); } -static int -weechat_lua_api_infolist_new_item (lua_State *L) +API_FUNC(infolist_new_item) { const char *infolist; char *result; - API_FUNC(1, "infolist_new_item", API_RETURN_EMPTY); + API_INIT_FUNC(1, "infolist_new_item", API_RETURN_EMPTY); if (lua_gettop (L) < 1) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4340,14 +4191,13 @@ weechat_lua_api_infolist_new_item (lua_State *L) API_RETURN_STRING_FREE(result); } -static int -weechat_lua_api_infolist_new_var_integer (lua_State *L) +API_FUNC(infolist_new_var_integer) { const char *infolist, *name; char *result; int value; - API_FUNC(1, "infolist_new_var_integer", API_RETURN_EMPTY); + API_INIT_FUNC(1, "infolist_new_var_integer", API_RETURN_EMPTY); if (lua_gettop (L) < 3) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4362,13 +4212,12 @@ weechat_lua_api_infolist_new_var_integer (lua_State *L) API_RETURN_STRING_FREE(result); } -static int -weechat_lua_api_infolist_new_var_string (lua_State *L) +API_FUNC(infolist_new_var_string) { const char *infolist, *name, *value; char *result; - API_FUNC(1, "infolist_new_var_string", API_RETURN_EMPTY); + API_INIT_FUNC(1, "infolist_new_var_string", API_RETURN_EMPTY); if (lua_gettop (L) < 3) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4383,13 +4232,12 @@ weechat_lua_api_infolist_new_var_string (lua_State *L) API_RETURN_STRING_FREE(result); } -static int -weechat_lua_api_infolist_new_var_pointer (lua_State *L) +API_FUNC(infolist_new_var_pointer) { const char *infolist, *name, *value; char *result; - API_FUNC(1, "infolist_new_var_pointer", API_RETURN_EMPTY); + API_INIT_FUNC(1, "infolist_new_var_pointer", API_RETURN_EMPTY); if (lua_gettop (L) < 3) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4404,14 +4252,13 @@ weechat_lua_api_infolist_new_var_pointer (lua_State *L) API_RETURN_STRING_FREE(result); } -static int -weechat_lua_api_infolist_new_var_time (lua_State *L) +API_FUNC(infolist_new_var_time) { const char *infolist, *name; char *result; int value; - API_FUNC(1, "infolist_new_var_time", API_RETURN_EMPTY); + API_INIT_FUNC(1, "infolist_new_var_time", API_RETURN_EMPTY); if (lua_gettop (L) < 3) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4426,13 +4273,12 @@ weechat_lua_api_infolist_new_var_time (lua_State *L) API_RETURN_STRING_FREE(result); } -static int -weechat_lua_api_infolist_get (lua_State *L) +API_FUNC(infolist_get) { const char *name, *pointer, *arguments; char *result; - API_FUNC(1, "infolist_get", API_RETURN_EMPTY); + API_INIT_FUNC(1, "infolist_get", API_RETURN_EMPTY); if (lua_gettop (L) < 3) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4447,13 +4293,12 @@ weechat_lua_api_infolist_get (lua_State *L) API_RETURN_STRING_FREE(result); } -static int -weechat_lua_api_infolist_next (lua_State *L) +API_FUNC(infolist_next) { const char *infolist; int value; - API_FUNC(1, "infolist_next", API_RETURN_INT(0)); + API_INIT_FUNC(1, "infolist_next", API_RETURN_INT(0)); if (lua_gettop (L) < 1) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -4464,13 +4309,12 @@ weechat_lua_api_infolist_next (lua_State *L) API_RETURN_INT(value); } -static int -weechat_lua_api_infolist_prev (lua_State *L) +API_FUNC(infolist_prev) { const char *infolist; int value; - API_FUNC(1, "infolist_prev", API_RETURN_INT(0)); + API_INIT_FUNC(1, "infolist_prev", API_RETURN_INT(0)); if (lua_gettop (L) < 1) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -4481,12 +4325,11 @@ weechat_lua_api_infolist_prev (lua_State *L) API_RETURN_INT(value); } -static int -weechat_lua_api_infolist_reset_item_cursor (lua_State *L) +API_FUNC(infolist_reset_item_cursor) { const char *infolist; - API_FUNC(1, "infolist_reset_item_cursor", API_RETURN_ERROR); + API_INIT_FUNC(1, "infolist_reset_item_cursor", API_RETURN_ERROR); if (lua_gettop (L) < 1) API_WRONG_ARGS(API_RETURN_ERROR); @@ -4497,12 +4340,11 @@ weechat_lua_api_infolist_reset_item_cursor (lua_State *L) API_RETURN_OK; } -static int -weechat_lua_api_infolist_fields (lua_State *L) +API_FUNC(infolist_fields) { const char *infolist, *result; - API_FUNC(1, "infolist_fields", API_RETURN_EMPTY); + API_INIT_FUNC(1, "infolist_fields", API_RETURN_EMPTY); if (lua_gettop (L) < 1) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4513,13 +4355,12 @@ weechat_lua_api_infolist_fields (lua_State *L) API_RETURN_STRING(result); } -static int -weechat_lua_api_infolist_integer (lua_State *L) +API_FUNC(infolist_integer) { const char *infolist, *variable; int value; - API_FUNC(1, "infolist_integer", API_RETURN_INT(0)); + API_INIT_FUNC(1, "infolist_integer", API_RETURN_INT(0)); if (lua_gettop (L) < 2) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -4532,12 +4373,11 @@ weechat_lua_api_infolist_integer (lua_State *L) API_RETURN_INT(value); } -static int -weechat_lua_api_infolist_string (lua_State *L) +API_FUNC(infolist_string) { const char *infolist, *variable, *result; - API_FUNC(1, "infolist_string", API_RETURN_EMPTY); + API_INIT_FUNC(1, "infolist_string", API_RETURN_EMPTY); if (lua_gettop (L) < 2) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4550,13 +4390,12 @@ weechat_lua_api_infolist_string (lua_State *L) API_RETURN_STRING(result); } -static int -weechat_lua_api_infolist_pointer (lua_State *L) +API_FUNC(infolist_pointer) { const char *infolist, *variable; char *result; - API_FUNC(1, "infolist_pointer", API_RETURN_EMPTY); + API_INIT_FUNC(1, "infolist_pointer", API_RETURN_EMPTY); if (lua_gettop (L) < 2) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4569,15 +4408,14 @@ weechat_lua_api_infolist_pointer (lua_State *L) API_RETURN_STRING_FREE(result); } -static int -weechat_lua_api_infolist_time (lua_State *L) +API_FUNC(infolist_time) { const char *infolist, *variable; time_t time; struct tm *date_tmp; char timebuffer[64], *result; - API_FUNC(1, "infolist_time", API_RETURN_EMPTY); + API_INIT_FUNC(1, "infolist_time", API_RETURN_EMPTY); if (lua_gettop (L) < 2) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4595,12 +4433,11 @@ weechat_lua_api_infolist_time (lua_State *L) API_RETURN_STRING_FREE(result); } -static int -weechat_lua_api_infolist_free (lua_State *L) +API_FUNC(infolist_free) { const char *infolist; - API_FUNC(1, "infolist_free", API_RETURN_ERROR); + API_INIT_FUNC(1, "infolist_free", API_RETURN_ERROR); if (lua_gettop (L) < 1) API_WRONG_ARGS(API_RETURN_ERROR); @@ -4611,13 +4448,12 @@ weechat_lua_api_infolist_free (lua_State *L) API_RETURN_OK; } -static int -weechat_lua_api_hdata_get (lua_State *L) +API_FUNC(hdata_get) { const char *name; char *result; - API_FUNC(1, "hdata_get", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hdata_get", API_RETURN_EMPTY); if (lua_gettop (L) < 1) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4628,13 +4464,12 @@ weechat_lua_api_hdata_get (lua_State *L) API_RETURN_STRING_FREE(result); } -static int -weechat_lua_api_hdata_get_var_offset (lua_State *L) +API_FUNC(hdata_get_var_offset) { const char *hdata, *name; int value; - API_FUNC(1, "hdata_get_var_offset", API_RETURN_INT(0)); + API_INIT_FUNC(1, "hdata_get_var_offset", API_RETURN_INT(0)); if (lua_gettop (L) < 2) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -4646,12 +4481,11 @@ weechat_lua_api_hdata_get_var_offset (lua_State *L) API_RETURN_INT(value); } -static int -weechat_lua_api_hdata_get_var_type_string (lua_State *L) +API_FUNC(hdata_get_var_type_string) { const char *hdata, *name, *result; - API_FUNC(1, "hdata_get_var_type_string", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hdata_get_var_type_string", API_RETURN_EMPTY); if (lua_gettop (L) < 2) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4663,13 +4497,12 @@ weechat_lua_api_hdata_get_var_type_string (lua_State *L) API_RETURN_STRING(result); } -static int -weechat_lua_api_hdata_get_var_array_size (lua_State *L) +API_FUNC(hdata_get_var_array_size) { const char *hdata, *pointer, *name; int value; - API_FUNC(1, "hdata_get_var_array_size", API_RETURN_INT(-1)); + API_INIT_FUNC(1, "hdata_get_var_array_size", API_RETURN_INT(-1)); if (lua_gettop (L) < 3) API_WRONG_ARGS(API_RETURN_INT(-1)); @@ -4684,12 +4517,11 @@ weechat_lua_api_hdata_get_var_array_size (lua_State *L) API_RETURN_INT(value); } -static int -weechat_lua_api_hdata_get_var_array_size_string (lua_State *L) +API_FUNC(hdata_get_var_array_size_string) { const char *hdata, *pointer, *name, *result; - API_FUNC(1, "hdata_get_var_array_size_string", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hdata_get_var_array_size_string", API_RETURN_EMPTY); if (lua_gettop (L) < 3) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4704,12 +4536,11 @@ weechat_lua_api_hdata_get_var_array_size_string (lua_State *L) API_RETURN_STRING(result); } -static int -weechat_lua_api_hdata_get_var_hdata (lua_State *L) +API_FUNC(hdata_get_var_hdata) { const char *hdata, *name, *result; - API_FUNC(1, "hdata_get_var_hdata", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hdata_get_var_hdata", API_RETURN_EMPTY); if (lua_gettop (L) < 2) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4721,13 +4552,12 @@ weechat_lua_api_hdata_get_var_hdata (lua_State *L) API_RETURN_STRING(result); } -static int -weechat_lua_api_hdata_get_list (lua_State *L) +API_FUNC(hdata_get_list) { const char *hdata, *name; char *result; - API_FUNC(1, "hdata_get_list", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hdata_get_list", API_RETURN_EMPTY); if (lua_gettop (L) < 2) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4740,13 +4570,12 @@ weechat_lua_api_hdata_get_list (lua_State *L) API_RETURN_STRING_FREE(result); } -static int -weechat_lua_api_hdata_check_pointer (lua_State *L) +API_FUNC(hdata_check_pointer) { const char *hdata, *list, *pointer; int value; - API_FUNC(1, "hdata_check_pointer", API_RETURN_INT(0)); + API_INIT_FUNC(1, "hdata_check_pointer", API_RETURN_INT(0)); if (lua_gettop (L) < 3) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -4761,14 +4590,13 @@ weechat_lua_api_hdata_check_pointer (lua_State *L) API_RETURN_INT(value); } -static int -weechat_lua_api_hdata_move (lua_State *L) +API_FUNC(hdata_move) { const char *hdata, *pointer; char *result; int count; - API_FUNC(1, "hdata_move", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hdata_move", API_RETURN_EMPTY); if (lua_gettop (L) < 3) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4783,14 +4611,13 @@ weechat_lua_api_hdata_move (lua_State *L) API_RETURN_STRING_FREE(result); } -static int -weechat_lua_api_hdata_search (lua_State *L) +API_FUNC(hdata_search) { const char *hdata, *pointer, *search; char *result; int move; - API_FUNC(1, "hdata_search", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hdata_search", API_RETURN_EMPTY); if (lua_gettop (L) < 4) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4807,13 +4634,12 @@ weechat_lua_api_hdata_search (lua_State *L) API_RETURN_STRING_FREE(result); } -static int -weechat_lua_api_hdata_char (lua_State *L) +API_FUNC(hdata_char) { const char *hdata, *pointer, *name; int value; - API_FUNC(1, "hdata_char", API_RETURN_INT(0)); + API_INIT_FUNC(1, "hdata_char", API_RETURN_INT(0)); if (lua_gettop (L) < 3) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -4828,13 +4654,12 @@ weechat_lua_api_hdata_char (lua_State *L) API_RETURN_INT(value); } -static int -weechat_lua_api_hdata_integer (lua_State *L) +API_FUNC(hdata_integer) { const char *hdata, *pointer, *name; int value; - API_FUNC(1, "hdata_integer", API_RETURN_INT(0)); + API_INIT_FUNC(1, "hdata_integer", API_RETURN_INT(0)); if (lua_gettop (L) < 3) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -4849,13 +4674,12 @@ weechat_lua_api_hdata_integer (lua_State *L) API_RETURN_INT(value); } -static int -weechat_lua_api_hdata_long (lua_State *L) +API_FUNC(hdata_long) { const char *hdata, *pointer, *name; long value; - API_FUNC(1, "hdata_long", API_RETURN_LONG(0)); + API_INIT_FUNC(1, "hdata_long", API_RETURN_LONG(0)); if (lua_gettop (L) < 3) API_WRONG_ARGS(API_RETURN_LONG(0)); @@ -4870,12 +4694,11 @@ weechat_lua_api_hdata_long (lua_State *L) API_RETURN_LONG(value); } -static int -weechat_lua_api_hdata_string (lua_State *L) +API_FUNC(hdata_string) { const char *hdata, *pointer, *name, *result; - API_FUNC(1, "hdata_string", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hdata_string", API_RETURN_EMPTY); if (lua_gettop (L) < 3) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4890,13 +4713,12 @@ weechat_lua_api_hdata_string (lua_State *L) API_RETURN_STRING(result); } -static int -weechat_lua_api_hdata_pointer (lua_State *L) +API_FUNC(hdata_pointer) { const char *hdata, *pointer, *name; char *result; - API_FUNC(1, "hdata_pointer", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hdata_pointer", API_RETURN_EMPTY); if (lua_gettop (L) < 3) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4911,14 +4733,13 @@ weechat_lua_api_hdata_pointer (lua_State *L) API_RETURN_STRING_FREE(result); } -static int -weechat_lua_api_hdata_time (lua_State *L) +API_FUNC(hdata_time) { const char *hdata, *pointer, *name; time_t time; char timebuffer[64], *result; - API_FUNC(1, "hdata_time", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hdata_time", API_RETURN_EMPTY); if (lua_gettop (L) < 3) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4936,12 +4757,11 @@ weechat_lua_api_hdata_time (lua_State *L) API_RETURN_STRING_FREE(result); } -static int -weechat_lua_api_hdata_hashtable (lua_State *L) +API_FUNC(hdata_hashtable) { const char *hdata, *pointer, *name; - API_FUNC(1, "hdata_hashtable", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hdata_hashtable", API_RETURN_EMPTY); if (lua_gettop (L) < 3) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4957,14 +4777,13 @@ weechat_lua_api_hdata_hashtable (lua_State *L) return 1; } -static int -weechat_lua_api_hdata_update (lua_State *L) +API_FUNC(hdata_update) { const char *hdata, *pointer; struct t_hashtable *hashtable; int value; - API_FUNC(1, "hdata_update", API_RETURN_INT(0)); + API_INIT_FUNC(1, "hdata_update", API_RETURN_INT(0)); if (lua_gettop (L) < 3) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -4985,12 +4804,11 @@ weechat_lua_api_hdata_update (lua_State *L) API_RETURN_INT(value); } -static int -weechat_lua_api_hdata_get_string (lua_State *L) +API_FUNC(hdata_get_string) { const char *hdata, *property, *result; - API_FUNC(1, "hdata_get_string", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hdata_get_string", API_RETURN_EMPTY); if (lua_gettop (L) < 2) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -5002,14 +4820,13 @@ weechat_lua_api_hdata_get_string (lua_State *L) API_RETURN_STRING(result); } -static int -weechat_lua_api_upgrade_new (lua_State *L) +API_FUNC(upgrade_new) { const char *filename; char *result; int write; - API_FUNC(1, "upgrade_new", API_RETURN_EMPTY); + API_INIT_FUNC(1, "upgrade_new", API_RETURN_EMPTY); if (lua_gettop (L) < 2) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -5021,13 +4838,12 @@ weechat_lua_api_upgrade_new (lua_State *L) API_RETURN_STRING_FREE(result); } -static int -weechat_lua_api_upgrade_write_object (lua_State *L) +API_FUNC(upgrade_write_object) { const char *upgrade_file, *infolist; int object_id, rc; - API_FUNC(1, "upgrade_write_object", API_RETURN_INT(0)); + API_INIT_FUNC(1, "upgrade_write_object", API_RETURN_INT(0)); if (lua_gettop (L) < 3) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -5087,13 +4903,12 @@ weechat_lua_api_upgrade_read_cb (void *data, return WEECHAT_RC_ERROR; } -static int -weechat_lua_api_upgrade_read (lua_State *L) +API_FUNC(upgrade_read) { const char *upgrade_file, *function, *data; int rc; - API_FUNC(1, "upgrade_read", API_RETURN_EMPTY); + API_INIT_FUNC(1, "upgrade_read", API_RETURN_EMPTY); if (lua_gettop (L) < 3) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -5111,12 +4926,11 @@ weechat_lua_api_upgrade_read (lua_State *L) API_RETURN_INT(rc); } -static int -weechat_lua_api_upgrade_close (lua_State *L) +API_FUNC(upgrade_close) { const char *upgrade_file; - API_FUNC(1, "upgrade_close", API_RETURN_ERROR); + API_INIT_FUNC(1, "upgrade_close", API_RETURN_ERROR); if (lua_gettop (L) < 1) API_WRONG_ARGS(API_RETURN_INT(0)); diff --git a/src/plugins/perl/weechat-perl-api.c b/src/plugins/perl/weechat-perl-api.c index c25e12fe4..3f293b8aa 100644 --- a/src/plugins/perl/weechat-perl-api.c +++ b/src/plugins/perl/weechat-perl-api.c @@ -35,7 +35,11 @@ #include "weechat-perl.h" -#define API_FUNC(__init, __name, __ret) \ +#define API_DEF_FUNC(__name) \ + newXS ("weechat::" #__name, XS_weechat_api_##__name, "weechat"); +#define API_FUNC(__name) \ + XS (XS_weechat_api_##__name) +#define API_INIT_FUNC(__init, __name, __ret) \ char *perl_function_name = __name; \ (void) cv; \ if (__init \ @@ -79,17 +83,14 @@ XSRETURN (1) #define API_RETURN_INT(__int) \ XST_mIV (0, __int); \ - XSRETURN (1); + XSRETURN (1) #define API_RETURN_LONG(__long) \ XST_mIV (0, __long); \ - XSRETURN (1); + XSRETURN (1) #define API_RETURN_OBJ(__obj) \ ST (0) = newRV_inc((SV *)__obj); \ if (SvREFCNT(ST(0))) sv_2mortal(ST(0)); \ - XSRETURN (1); - -#define API_DEF_FUNC(__name) \ - newXS ("weechat::" #__name, XS_weechat_api_##__name, "weechat"); + XSRETURN (1) #ifdef NO_PERL_MULTIPLICITY #undef MULTIPLICITY @@ -102,7 +103,7 @@ extern void boot_DynaLoader (pTHX_ CV* cv); * Registers a perl script. */ -XS (XS_weechat_api_register) +API_FUNC(register) { char *name, *author, *version, *license, *description, *shutdown_func; char *charset; @@ -111,7 +112,7 @@ XS (XS_weechat_api_register) /* make C compiler happy */ (void) items; - API_FUNC(0, "register", API_RETURN_ERROR); + API_INIT_FUNC(0, "register", API_RETURN_ERROR); if (perl_registered_script) { /* script already registered */ @@ -185,12 +186,12 @@ XS (XS_weechat_api_register) * core. */ -XS (XS_weechat_api_plugin_get_name) +API_FUNC(plugin_get_name) { const char *result; dXSARGS; - API_FUNC(1, "plugin_get_name", API_RETURN_EMPTY); + API_INIT_FUNC(1, "plugin_get_name", API_RETURN_EMPTY); if (items < 1) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -199,11 +200,11 @@ XS (XS_weechat_api_plugin_get_name) API_RETURN_STRING(result); } -XS (XS_weechat_api_charset_set) +API_FUNC(charset_set) { dXSARGS; - API_FUNC(1, "charset_set", API_RETURN_ERROR); + API_INIT_FUNC(1, "charset_set", API_RETURN_ERROR); if (items < 1) API_WRONG_ARGS(API_RETURN_ERROR); @@ -213,12 +214,12 @@ XS (XS_weechat_api_charset_set) API_RETURN_OK; } -XS (XS_weechat_api_iconv_to_internal) +API_FUNC(iconv_to_internal) { char *result, *charset, *string; dXSARGS; - API_FUNC(1, "iconv_to_internal", API_RETURN_EMPTY); + API_INIT_FUNC(1, "iconv_to_internal", API_RETURN_EMPTY); if (items < 2) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -230,12 +231,12 @@ XS (XS_weechat_api_iconv_to_internal) API_RETURN_STRING_FREE(result); } -XS (XS_weechat_api_iconv_from_internal) +API_FUNC(iconv_from_internal) { char *result, *charset, *string; dXSARGS; - API_FUNC(1, "iconv_from_internal", API_RETURN_EMPTY); + API_INIT_FUNC(1, "iconv_from_internal", API_RETURN_EMPTY); if (items < 2) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -247,12 +248,12 @@ XS (XS_weechat_api_iconv_from_internal) API_RETURN_STRING_FREE(result); } -XS (XS_weechat_api_gettext) +API_FUNC(gettext) { const char *result; dXSARGS; - API_FUNC(1, "gettext", API_RETURN_EMPTY); + API_INIT_FUNC(1, "gettext", API_RETURN_EMPTY); if (items < 1) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -261,13 +262,13 @@ XS (XS_weechat_api_gettext) API_RETURN_STRING(result); } -XS (XS_weechat_api_ngettext) +API_FUNC(ngettext) { char *single, *plural; const char *result; dXSARGS; - API_FUNC(1, "ngettext", API_RETURN_EMPTY); + API_INIT_FUNC(1, "ngettext", API_RETURN_EMPTY); if (items < 3) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -280,12 +281,12 @@ XS (XS_weechat_api_ngettext) API_RETURN_STRING(result); } -XS (XS_weechat_api_strlen_screen) +API_FUNC(strlen_screen) { int value; dXSARGS; - API_FUNC(1, "strlen_screen", API_RETURN_INT(0)); + API_INIT_FUNC(1, "strlen_screen", API_RETURN_INT(0)); if (items < 1) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -294,12 +295,12 @@ XS (XS_weechat_api_strlen_screen) API_RETURN_INT(value); } -XS (XS_weechat_api_string_match) +API_FUNC(string_match) { int value; dXSARGS; - API_FUNC(1, "string_match", API_RETURN_INT(0)); + API_INIT_FUNC(1, "string_match", API_RETURN_INT(0)); if (items < 3) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -310,12 +311,12 @@ XS (XS_weechat_api_string_match) API_RETURN_INT(value); } -XS (XS_weechat_api_string_has_highlight) +API_FUNC(string_has_highlight) { int value; dXSARGS; - API_FUNC(1, "string_has_highlight", API_RETURN_INT(0)); + API_INIT_FUNC(1, "string_has_highlight", API_RETURN_INT(0)); if (items < 2) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -325,12 +326,12 @@ XS (XS_weechat_api_string_has_highlight) API_RETURN_INT(value); } -XS (XS_weechat_api_string_has_highlight_regex) +API_FUNC(string_has_highlight_regex) { int value; dXSARGS; - API_FUNC(1, "string_has_highlight_regex", API_RETURN_INT(0)); + API_INIT_FUNC(1, "string_has_highlight_regex", API_RETURN_INT(0)); if (items < 2) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -340,12 +341,12 @@ XS (XS_weechat_api_string_has_highlight_regex) API_RETURN_INT(value); } -XS (XS_weechat_api_string_mask_to_regex) +API_FUNC(string_mask_to_regex) { char *result; dXSARGS; - API_FUNC(1, "string_mask_to_regex", API_RETURN_EMPTY); + API_INIT_FUNC(1, "string_mask_to_regex", API_RETURN_EMPTY); if (items < 1) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -354,12 +355,12 @@ XS (XS_weechat_api_string_mask_to_regex) API_RETURN_STRING_FREE(result); } -XS (XS_weechat_api_string_remove_color) +API_FUNC(string_remove_color) { char *result, *string, *replacement; dXSARGS; - API_FUNC(1, "string_remove_color", API_RETURN_EMPTY); + API_INIT_FUNC(1, "string_remove_color", API_RETURN_EMPTY); if (items < 2) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -371,12 +372,12 @@ XS (XS_weechat_api_string_remove_color) API_RETURN_STRING_FREE(result); } -XS (XS_weechat_api_string_is_command_char) +API_FUNC(string_is_command_char) { int value; dXSARGS; - API_FUNC(1, "string_is_command_char", API_RETURN_INT(0)); + API_INIT_FUNC(1, "string_is_command_char", API_RETURN_INT(0)); if (items < 1) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -385,12 +386,12 @@ XS (XS_weechat_api_string_is_command_char) API_RETURN_INT(value); } -XS (XS_weechat_api_string_input_for_buffer) +API_FUNC(string_input_for_buffer) { const char *result; dXSARGS; - API_FUNC(1, "string_input_for_buffer", API_RETURN_EMPTY); + API_INIT_FUNC(1, "string_input_for_buffer", API_RETURN_EMPTY); if (items < 1) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -399,13 +400,13 @@ XS (XS_weechat_api_string_input_for_buffer) API_RETURN_STRING(result); } -XS (XS_weechat_api_string_eval_expression) +API_FUNC(string_eval_expression) { char *expr, *result; struct t_hashtable *pointers, *extra_vars, *options; dXSARGS; - API_FUNC(1, "string_eval_expression", API_RETURN_EMPTY); + API_INIT_FUNC(1, "string_eval_expression", API_RETURN_EMPTY); if (items < 4) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -436,11 +437,11 @@ XS (XS_weechat_api_string_eval_expression) API_RETURN_STRING_FREE(result); } -XS (XS_weechat_api_mkdir_home) +API_FUNC(mkdir_home) { dXSARGS; - API_FUNC(1, "mkdir_home", API_RETURN_ERROR); + API_INIT_FUNC(1, "mkdir_home", API_RETURN_ERROR); if (items < 2) API_WRONG_ARGS(API_RETURN_ERROR); @@ -451,11 +452,11 @@ XS (XS_weechat_api_mkdir_home) API_RETURN_ERROR; } -XS (XS_weechat_api_mkdir) +API_FUNC(mkdir) { dXSARGS; - API_FUNC(1, "mkdir", API_RETURN_ERROR); + API_INIT_FUNC(1, "mkdir", API_RETURN_ERROR); if (items < 2) API_WRONG_ARGS(API_RETURN_ERROR); @@ -466,11 +467,11 @@ XS (XS_weechat_api_mkdir) API_RETURN_ERROR; } -XS (XS_weechat_api_mkdir_parents) +API_FUNC(mkdir_parents) { dXSARGS; - API_FUNC(1, "mkdir_parents", API_RETURN_ERROR); + API_INIT_FUNC(1, "mkdir_parents", API_RETURN_ERROR); if (items < 2) API_WRONG_ARGS(API_RETURN_ERROR); @@ -481,7 +482,7 @@ XS (XS_weechat_api_mkdir_parents) API_RETURN_ERROR; } -XS (XS_weechat_api_list_new) +API_FUNC(list_new) { char *result; dXSARGS; @@ -490,19 +491,19 @@ XS (XS_weechat_api_list_new) (void) items; (void) cv; - API_FUNC(1, "list_new", API_RETURN_EMPTY); + API_INIT_FUNC(1, "list_new", API_RETURN_EMPTY); result = API_PTR2STR(weechat_list_new ()); API_RETURN_STRING_FREE(result); } -XS (XS_weechat_api_list_add) +API_FUNC(list_add) { char *result, *weelist, *data, *where, *user_data; dXSARGS; - API_FUNC(1, "list_add", API_RETURN_EMPTY); + API_INIT_FUNC(1, "list_add", API_RETURN_EMPTY); if (items < 4) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -519,12 +520,12 @@ XS (XS_weechat_api_list_add) API_RETURN_STRING_FREE(result); } -XS (XS_weechat_api_list_search) +API_FUNC(list_search) { char *result, *weelist, *data; dXSARGS; - API_FUNC(1, "list_search", API_RETURN_EMPTY); + API_INIT_FUNC(1, "list_search", API_RETURN_EMPTY); if (items < 2) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -537,13 +538,13 @@ XS (XS_weechat_api_list_search) API_RETURN_STRING_FREE(result); } -XS (XS_weechat_api_list_search_pos) +API_FUNC(list_search_pos) { char *weelist, *data; int pos; dXSARGS; - API_FUNC(1, "list_search_pos", API_RETURN_INT(-1)); + API_INIT_FUNC(1, "list_search_pos", API_RETURN_INT(-1)); if (items < 2) API_WRONG_ARGS(API_RETURN_INT(-1)); @@ -555,12 +556,12 @@ XS (XS_weechat_api_list_search_pos) API_RETURN_INT(pos); } -XS (XS_weechat_api_list_casesearch) +API_FUNC(list_casesearch) { char *result, *weelist, *data; dXSARGS; - API_FUNC(1, "list_casesearch", API_RETURN_EMPTY); + API_INIT_FUNC(1, "list_casesearch", API_RETURN_EMPTY); if (items < 2) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -573,13 +574,13 @@ XS (XS_weechat_api_list_casesearch) API_RETURN_STRING_FREE(result); } -XS (XS_weechat_api_list_casesearch_pos) +API_FUNC(list_casesearch_pos) { char *weelist, *data; int pos; dXSARGS; - API_FUNC(1, "list_casesearch_pos", API_RETURN_INT(-1)); + API_INIT_FUNC(1, "list_casesearch_pos", API_RETURN_INT(-1)); if (items < 2) API_WRONG_ARGS(API_RETURN_INT(-1)); @@ -591,12 +592,12 @@ XS (XS_weechat_api_list_casesearch_pos) API_RETURN_INT(pos); } -XS (XS_weechat_api_list_get) +API_FUNC(list_get) { char *result; dXSARGS; - API_FUNC(1, "list_get", API_RETURN_EMPTY); + API_INIT_FUNC(1, "list_get", API_RETURN_EMPTY); if (items < 2) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -606,12 +607,12 @@ XS (XS_weechat_api_list_get) API_RETURN_STRING_FREE(result); } -XS (XS_weechat_api_list_set) +API_FUNC(list_set) { char *item, *new_value; dXSARGS; - API_FUNC(1, "list_set", API_RETURN_ERROR); + API_INIT_FUNC(1, "list_set", API_RETURN_ERROR); if (items < 2) API_WRONG_ARGS(API_RETURN_ERROR); @@ -623,12 +624,12 @@ XS (XS_weechat_api_list_set) API_RETURN_OK; } -XS (XS_weechat_api_list_next) +API_FUNC(list_next) { char *result; dXSARGS; - API_FUNC(1, "list_next", API_RETURN_EMPTY); + API_INIT_FUNC(1, "list_next", API_RETURN_EMPTY); if (items < 1) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -637,12 +638,12 @@ XS (XS_weechat_api_list_next) API_RETURN_STRING_FREE(result); } -XS (XS_weechat_api_list_prev) +API_FUNC(list_prev) { char *result; dXSARGS; - API_FUNC(1, "list_prev", API_RETURN_EMPTY); + API_INIT_FUNC(1, "list_prev", API_RETURN_EMPTY); if (items < 1) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -651,12 +652,12 @@ XS (XS_weechat_api_list_prev) API_RETURN_STRING_FREE(result); } -XS (XS_weechat_api_list_string) +API_FUNC(list_string) { const char *result; dXSARGS; - API_FUNC(1, "list_string", API_RETURN_EMPTY); + API_INIT_FUNC(1, "list_string", API_RETURN_EMPTY); if (items < 1) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -665,12 +666,12 @@ XS (XS_weechat_api_list_string) API_RETURN_STRING(result); } -XS (XS_weechat_api_list_size) +API_FUNC(list_size) { int size; dXSARGS; - API_FUNC(1, "list_size", API_RETURN_INT(0)); + API_INIT_FUNC(1, "list_size", API_RETURN_INT(0)); if (items < 1) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -679,12 +680,12 @@ XS (XS_weechat_api_list_size) API_RETURN_INT(size); } -XS (XS_weechat_api_list_remove) +API_FUNC(list_remove) { char *weelist, *item; dXSARGS; - API_FUNC(1, "list_remove", API_RETURN_ERROR); + API_INIT_FUNC(1, "list_remove", API_RETURN_ERROR); if (items < 2) API_WRONG_ARGS(API_RETURN_ERROR); @@ -697,11 +698,11 @@ XS (XS_weechat_api_list_remove) API_RETURN_OK; } -XS (XS_weechat_api_list_remove_all) +API_FUNC(list_remove_all) { dXSARGS; - API_FUNC(1, "list_remove_all", API_RETURN_ERROR); + API_INIT_FUNC(1, "list_remove_all", API_RETURN_ERROR); if (items < 1) API_WRONG_ARGS(API_RETURN_ERROR); @@ -710,11 +711,11 @@ XS (XS_weechat_api_list_remove_all) API_RETURN_OK; } -XS (XS_weechat_api_list_free) +API_FUNC(list_free) { dXSARGS; - API_FUNC(1, "list_free", API_RETURN_ERROR); + API_INIT_FUNC(1, "list_free", API_RETURN_ERROR); if (items < 1) API_WRONG_ARGS(API_RETURN_ERROR); @@ -760,12 +761,12 @@ weechat_perl_api_config_reload_cb (void *data, return WEECHAT_CONFIG_READ_FILE_NOT_FOUND; } -XS (XS_weechat_api_config_new) +API_FUNC(config_new) { char *result, *name, *function, *data; dXSARGS; - API_FUNC(1, "config_new", API_RETURN_EMPTY); + API_INIT_FUNC(1, "config_new", API_RETURN_EMPTY); if (items < 3) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -996,7 +997,7 @@ weechat_perl_api_config_section_delete_option_cb (void *data, return WEECHAT_CONFIG_OPTION_UNSET_ERROR; } -XS (XS_weechat_api_config_new_section) +API_FUNC(config_new_section) { char *result, *cfg_file, *name, *function_read, *data_read; char *function_write, *data_write, *function_write_default; @@ -1005,7 +1006,7 @@ XS (XS_weechat_api_config_new_section) dXSARGS; - API_FUNC(1, "config_new_section", API_RETURN_EMPTY); + API_INIT_FUNC(1, "config_new_section", API_RETURN_EMPTY); if (items < 14) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -1047,12 +1048,12 @@ XS (XS_weechat_api_config_new_section) API_RETURN_STRING_FREE(result); } -XS (XS_weechat_api_config_search_section) +API_FUNC(config_search_section) { char *result, *config_file, *section_name; dXSARGS; - API_FUNC(1, "config_search_section", API_RETURN_EMPTY); + API_INIT_FUNC(1, "config_search_section", API_RETURN_EMPTY); if (items < 2) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -1162,7 +1163,7 @@ weechat_perl_api_config_option_delete_cb (void *data, } } -XS (XS_weechat_api_config_new_option) +API_FUNC(config_new_option) { char *result, *config_file, *section, *name, *type; char *description, *string_values, *default_value, *value; @@ -1170,7 +1171,7 @@ XS (XS_weechat_api_config_new_option) char *data_change, *function_delete, *data_delete; dXSARGS; - API_FUNC(1, "config_new_option", API_RETURN_EMPTY); + API_INIT_FUNC(1, "config_new_option", API_RETURN_EMPTY); if (items < 17) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -1215,12 +1216,12 @@ XS (XS_weechat_api_config_new_option) API_RETURN_STRING_FREE(result); } -XS (XS_weechat_api_config_search_option) +API_FUNC(config_search_option) { char *result, *config_file, *section, *option_name; dXSARGS; - API_FUNC(1, "config_search_option", API_RETURN_EMPTY); + API_INIT_FUNC(1, "config_search_option", API_RETURN_EMPTY); if (items < 3) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -1235,12 +1236,12 @@ XS (XS_weechat_api_config_search_option) API_RETURN_STRING_FREE(result); } -XS (XS_weechat_api_config_string_to_boolean) +API_FUNC(config_string_to_boolean) { int value; dXSARGS; - API_FUNC(1, "config_string_to_boolean", API_RETURN_INT(0)); + API_INIT_FUNC(1, "config_string_to_boolean", API_RETURN_INT(0)); if (items < 1) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -1249,13 +1250,13 @@ XS (XS_weechat_api_config_string_to_boolean) API_RETURN_INT(value); } -XS (XS_weechat_api_config_option_reset) +API_FUNC(config_option_reset) { int rc; char *option; dXSARGS; - API_FUNC(1, "config_option_reset", API_RETURN_INT(0)); + API_INIT_FUNC(1, "config_option_reset", API_RETURN_INT(0)); if (items < 2) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -1267,13 +1268,13 @@ XS (XS_weechat_api_config_option_reset) API_RETURN_INT(rc); } -XS (XS_weechat_api_config_option_set) +API_FUNC(config_option_set) { int rc; char *option, *new_value; dXSARGS; - API_FUNC(1, "config_option_set", API_RETURN_INT(WEECHAT_CONFIG_OPTION_SET_ERROR)); + API_INIT_FUNC(1, "config_option_set", API_RETURN_INT(WEECHAT_CONFIG_OPTION_SET_ERROR)); if (items < 3) API_WRONG_ARGS(API_RETURN_INT(WEECHAT_CONFIG_OPTION_SET_ERROR)); @@ -1287,13 +1288,13 @@ XS (XS_weechat_api_config_option_set) API_RETURN_INT(rc); } -XS (XS_weechat_api_config_option_set_null) +API_FUNC(config_option_set_null) { int rc; char *option; dXSARGS; - API_FUNC(1, "config_option_set_null", API_RETURN_INT(WEECHAT_CONFIG_OPTION_SET_ERROR)); + API_INIT_FUNC(1, "config_option_set_null", API_RETURN_INT(WEECHAT_CONFIG_OPTION_SET_ERROR)); if (items < 2) API_WRONG_ARGS(API_RETURN_INT(WEECHAT_CONFIG_OPTION_SET_ERROR)); @@ -1305,13 +1306,13 @@ XS (XS_weechat_api_config_option_set_null) API_RETURN_INT(rc); } -XS (XS_weechat_api_config_option_unset) +API_FUNC(config_option_unset) { int rc; char *option; dXSARGS; - API_FUNC(1, "config_option_unset", API_RETURN_INT(WEECHAT_CONFIG_OPTION_UNSET_ERROR)); + API_INIT_FUNC(1, "config_option_unset", API_RETURN_INT(WEECHAT_CONFIG_OPTION_UNSET_ERROR)); if (items < 1) API_WRONG_ARGS(API_RETURN_INT(WEECHAT_CONFIG_OPTION_UNSET_ERROR)); @@ -1322,12 +1323,12 @@ XS (XS_weechat_api_config_option_unset) API_RETURN_INT(rc); } -XS (XS_weechat_api_config_option_rename) +API_FUNC(config_option_rename) { char *option, *new_name; dXSARGS; - API_FUNC(1, "config_option_rename", API_RETURN_ERROR); + API_INIT_FUNC(1, "config_option_rename", API_RETURN_ERROR); if (items < 2) API_WRONG_ARGS(API_RETURN_ERROR); @@ -1340,12 +1341,12 @@ XS (XS_weechat_api_config_option_rename) API_RETURN_OK; } -XS (XS_weechat_api_config_option_is_null) +API_FUNC(config_option_is_null) { int value; dXSARGS; - API_FUNC(1, "config_option_is_null", API_RETURN_INT(1)); + API_INIT_FUNC(1, "config_option_is_null", API_RETURN_INT(1)); if (items < 1) API_WRONG_ARGS(API_RETURN_INT(1)); @@ -1354,12 +1355,12 @@ XS (XS_weechat_api_config_option_is_null) API_RETURN_INT(value); } -XS (XS_weechat_api_config_option_default_is_null) +API_FUNC(config_option_default_is_null) { int value; dXSARGS; - API_FUNC(1, "config_option_default_is_null", API_RETURN_INT(1)); + API_INIT_FUNC(1, "config_option_default_is_null", API_RETURN_INT(1)); if (items < 1) API_WRONG_ARGS(API_RETURN_INT(1)); @@ -1368,12 +1369,12 @@ XS (XS_weechat_api_config_option_default_is_null) API_RETURN_INT(value); } -XS (XS_weechat_api_config_boolean) +API_FUNC(config_boolean) { int value; dXSARGS; - API_FUNC(1, "config_boolean", API_RETURN_INT(0)); + API_INIT_FUNC(1, "config_boolean", API_RETURN_INT(0)); if (items < 1) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -1382,12 +1383,12 @@ XS (XS_weechat_api_config_boolean) API_RETURN_INT(value); } -XS (XS_weechat_api_config_boolean_default) +API_FUNC(config_boolean_default) { int value; dXSARGS; - API_FUNC(1, "config_boolean_default", API_RETURN_INT(0)); + API_INIT_FUNC(1, "config_boolean_default", API_RETURN_INT(0)); if (items < 1) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -1396,12 +1397,12 @@ XS (XS_weechat_api_config_boolean_default) API_RETURN_INT(value); } -XS (XS_weechat_api_config_integer) +API_FUNC(config_integer) { int value; dXSARGS; - API_FUNC(1, "config_integer", API_RETURN_INT(0)); + API_INIT_FUNC(1, "config_integer", API_RETURN_INT(0)); if (items < 1) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -1410,12 +1411,12 @@ XS (XS_weechat_api_config_integer) API_RETURN_INT(value); } -XS (XS_weechat_api_config_integer_default) +API_FUNC(config_integer_default) { int value; dXSARGS; - API_FUNC(1, "config_integer_default", API_RETURN_INT(0)); + API_INIT_FUNC(1, "config_integer_default", API_RETURN_INT(0)); if (items < 1) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -1424,12 +1425,12 @@ XS (XS_weechat_api_config_integer_default) API_RETURN_INT(value); } -XS (XS_weechat_api_config_string) +API_FUNC(config_string) { const char *result; dXSARGS; - API_FUNC(1, "config_string", API_RETURN_EMPTY); + API_INIT_FUNC(1, "config_string", API_RETURN_EMPTY); if (items < 1) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -1438,12 +1439,12 @@ XS (XS_weechat_api_config_string) API_RETURN_STRING(result); } -XS (XS_weechat_api_config_string_default) +API_FUNC(config_string_default) { const char *result; dXSARGS; - API_FUNC(1, "config_string_default", API_RETURN_EMPTY); + API_INIT_FUNC(1, "config_string_default", API_RETURN_EMPTY); if (items < 1) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -1452,12 +1453,12 @@ XS (XS_weechat_api_config_string_default) API_RETURN_STRING(result); } -XS (XS_weechat_api_config_color) +API_FUNC(config_color) { const char *result; dXSARGS; - API_FUNC(1, "config_color", API_RETURN_INT(0)); + API_INIT_FUNC(1, "config_color", API_RETURN_INT(0)); if (items < 1) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -1466,12 +1467,12 @@ XS (XS_weechat_api_config_color) API_RETURN_STRING(result); } -XS (XS_weechat_api_config_color_default) +API_FUNC(config_color_default) { const char *result; dXSARGS; - API_FUNC(1, "config_color_default", API_RETURN_INT(0)); + API_INIT_FUNC(1, "config_color_default", API_RETURN_INT(0)); if (items < 1) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -1480,12 +1481,12 @@ XS (XS_weechat_api_config_color_default) API_RETURN_STRING(result); } -XS (XS_weechat_api_config_write_option) +API_FUNC(config_write_option) { char *config_file, *option; dXSARGS; - API_FUNC(1, "config_write_option", API_RETURN_ERROR); + API_INIT_FUNC(1, "config_write_option", API_RETURN_ERROR); if (items < 2) API_WRONG_ARGS(API_RETURN_ERROR); @@ -1498,12 +1499,12 @@ XS (XS_weechat_api_config_write_option) API_RETURN_OK; } -XS (XS_weechat_api_config_write_line) +API_FUNC(config_write_line) { char *config_file, *option_name, *value; dXSARGS; - API_FUNC(1, "config_write_line", API_RETURN_ERROR); + API_INIT_FUNC(1, "config_write_line", API_RETURN_ERROR); if (items < 3) API_WRONG_ARGS(API_RETURN_ERROR); @@ -1517,12 +1518,12 @@ XS (XS_weechat_api_config_write_line) API_RETURN_OK; } -XS (XS_weechat_api_config_write) +API_FUNC(config_write) { int rc; dXSARGS; - API_FUNC(1, "config_write", API_RETURN_INT(-1)); + API_INIT_FUNC(1, "config_write", API_RETURN_INT(-1)); if (items < 1) API_WRONG_ARGS(API_RETURN_INT(-1)); @@ -1531,12 +1532,12 @@ XS (XS_weechat_api_config_write) API_RETURN_INT(rc); } -XS (XS_weechat_api_config_read) +API_FUNC(config_read) { int rc; dXSARGS; - API_FUNC(1, "config_read", API_RETURN_INT(-1)); + API_INIT_FUNC(1, "config_read", API_RETURN_INT(-1)); if (items < 1) API_WRONG_ARGS(API_RETURN_INT(-1)); @@ -1545,12 +1546,12 @@ XS (XS_weechat_api_config_read) API_RETURN_INT(rc); } -XS (XS_weechat_api_config_reload) +API_FUNC(config_reload) { int rc; dXSARGS; - API_FUNC(1, "config_reload", API_RETURN_INT(-1)); + API_INIT_FUNC(1, "config_reload", API_RETURN_INT(-1)); if (items < 1) API_WRONG_ARGS(API_RETURN_INT(-1)); @@ -1559,11 +1560,11 @@ XS (XS_weechat_api_config_reload) API_RETURN_INT(rc); } -XS (XS_weechat_api_config_option_free) +API_FUNC(config_option_free) { dXSARGS; - API_FUNC(1, "config_option_free", API_RETURN_ERROR); + API_INIT_FUNC(1, "config_option_free", API_RETURN_ERROR); if (items < 1) API_WRONG_ARGS(API_RETURN_ERROR); @@ -1574,11 +1575,11 @@ XS (XS_weechat_api_config_option_free) API_RETURN_OK; } -XS (XS_weechat_api_config_section_free_options) +API_FUNC(config_section_free_options) { dXSARGS; - API_FUNC(1, "config_section_free_options", API_RETURN_ERROR); + API_INIT_FUNC(1, "config_section_free_options", API_RETURN_ERROR); if (items < 1) API_WRONG_ARGS(API_RETURN_ERROR); @@ -1589,11 +1590,11 @@ XS (XS_weechat_api_config_section_free_options) API_RETURN_OK; } -XS (XS_weechat_api_config_section_free) +API_FUNC(config_section_free) { dXSARGS; - API_FUNC(1, "config_section_free", API_RETURN_ERROR); + API_INIT_FUNC(1, "config_section_free", API_RETURN_ERROR); if (items < 1) API_WRONG_ARGS(API_RETURN_ERROR); @@ -1604,11 +1605,11 @@ XS (XS_weechat_api_config_section_free) API_RETURN_OK; } -XS (XS_weechat_api_config_free) +API_FUNC(config_free) { dXSARGS; - API_FUNC(1, "config_free", API_RETURN_ERROR); + API_INIT_FUNC(1, "config_free", API_RETURN_ERROR); if (items < 1) API_WRONG_ARGS(API_RETURN_ERROR); @@ -1619,12 +1620,12 @@ XS (XS_weechat_api_config_free) API_RETURN_OK; } -XS (XS_weechat_api_config_get) +API_FUNC(config_get) { char *result; dXSARGS; - API_FUNC(1, "config_get", API_RETURN_EMPTY); + API_INIT_FUNC(1, "config_get", API_RETURN_EMPTY); if (items < 1) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -1633,12 +1634,12 @@ XS (XS_weechat_api_config_get) API_RETURN_STRING_FREE(result); } -XS (XS_weechat_api_config_get_plugin) +API_FUNC(config_get_plugin) { const char *result; dXSARGS; - API_FUNC(1, "config_get_plugin", API_RETURN_EMPTY); + API_INIT_FUNC(1, "config_get_plugin", API_RETURN_EMPTY); if (items < 1) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -1649,13 +1650,13 @@ XS (XS_weechat_api_config_get_plugin) API_RETURN_STRING(result); } -XS (XS_weechat_api_config_is_set_plugin) +API_FUNC(config_is_set_plugin) { char *option; int rc; dXSARGS; - API_FUNC(1, "config_is_set_plugin", API_RETURN_INT(0)); + API_INIT_FUNC(1, "config_is_set_plugin", API_RETURN_INT(0)); if (items < 1) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -1668,13 +1669,13 @@ XS (XS_weechat_api_config_is_set_plugin) API_RETURN_INT(rc); } -XS (XS_weechat_api_config_set_plugin) +API_FUNC(config_set_plugin) { char *option, *value; int rc; dXSARGS; - API_FUNC(1, "config_set_plugin", API_RETURN_INT(WEECHAT_CONFIG_OPTION_SET_ERROR)); + API_INIT_FUNC(1, "config_set_plugin", API_RETURN_INT(WEECHAT_CONFIG_OPTION_SET_ERROR)); if (items < 2) API_WRONG_ARGS(API_RETURN_INT(WEECHAT_CONFIG_OPTION_SET_ERROR)); @@ -1689,12 +1690,12 @@ XS (XS_weechat_api_config_set_plugin) API_RETURN_INT(rc); } -XS (XS_weechat_api_config_set_desc_plugin) +API_FUNC(config_set_desc_plugin) { char *option, *description; dXSARGS; - API_FUNC(1, "config_set_desc_plugin", API_RETURN_ERROR); + API_INIT_FUNC(1, "config_set_desc_plugin", API_RETURN_ERROR); if (items < 2) API_WRONG_ARGS(API_RETURN_ERROR); @@ -1709,13 +1710,13 @@ XS (XS_weechat_api_config_set_desc_plugin) API_RETURN_OK; } -XS (XS_weechat_api_config_unset_plugin) +API_FUNC(config_unset_plugin) { char *option; int rc; dXSARGS; - API_FUNC(1, "config_unset_plugin", API_RETURN_INT(WEECHAT_CONFIG_OPTION_UNSET_ERROR)); + API_INIT_FUNC(1, "config_unset_plugin", API_RETURN_INT(WEECHAT_CONFIG_OPTION_UNSET_ERROR)); if (items < 1) API_WRONG_ARGS(API_RETURN_INT(WEECHAT_CONFIG_OPTION_UNSET_ERROR)); @@ -1728,14 +1729,14 @@ XS (XS_weechat_api_config_unset_plugin) API_RETURN_INT(rc); } -XS (XS_weechat_api_key_bind) +API_FUNC(key_bind) { char *context; struct t_hashtable *hashtable; int num_keys; dXSARGS; - API_FUNC(1, "key_bind", API_RETURN_INT(0)); + API_INIT_FUNC(1, "key_bind", API_RETURN_INT(0)); if (items < 2) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -1753,13 +1754,13 @@ XS (XS_weechat_api_key_bind) API_RETURN_INT(num_keys); } -XS (XS_weechat_api_key_unbind) +API_FUNC(key_unbind) { char *context, *key; int num_keys; dXSARGS; - API_FUNC(1, "key_unbind", API_RETURN_INT(0)); + API_INIT_FUNC(1, "key_unbind", API_RETURN_INT(0)); if (items < 2) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -1771,12 +1772,12 @@ XS (XS_weechat_api_key_unbind) API_RETURN_INT(num_keys); } -XS (XS_weechat_api_prefix) +API_FUNC(prefix) { const char *result; dXSARGS; - API_FUNC(0, "prefix", API_RETURN_EMPTY); + API_INIT_FUNC(0, "prefix", API_RETURN_EMPTY); if (items < 1) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -1785,12 +1786,12 @@ XS (XS_weechat_api_prefix) API_RETURN_STRING(result); } -XS (XS_weechat_api_color) +API_FUNC(color) { const char *result; dXSARGS; - API_FUNC(0, "color", API_RETURN_EMPTY); + API_INIT_FUNC(0, "color", API_RETURN_EMPTY); if (items < 1) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -1799,12 +1800,12 @@ XS (XS_weechat_api_color) API_RETURN_STRING(result); } -XS (XS_weechat_api_print) +API_FUNC(print) { char *buffer, *message; dXSARGS; - API_FUNC(0, "print", API_RETURN_ERROR); + API_INIT_FUNC(0, "print", API_RETURN_ERROR); if (items < 2) API_WRONG_ARGS(API_RETURN_ERROR); @@ -1819,12 +1820,12 @@ XS (XS_weechat_api_print) API_RETURN_OK; } -XS (XS_weechat_api_print_date_tags) +API_FUNC(print_date_tags) { char *buffer, *tags, *message; dXSARGS; - API_FUNC(1, "print_date_tags", API_RETURN_ERROR); + API_INIT_FUNC(1, "print_date_tags", API_RETURN_ERROR); if (items < 4) API_WRONG_ARGS(API_RETURN_ERROR); @@ -1842,12 +1843,12 @@ XS (XS_weechat_api_print_date_tags) API_RETURN_OK; } -XS (XS_weechat_api_print_y) +API_FUNC(print_y) { char *buffer, *message; dXSARGS; - API_FUNC(1, "print_y", API_RETURN_ERROR); + API_INIT_FUNC(1, "print_y", API_RETURN_ERROR); if (items < 3) API_WRONG_ARGS(API_RETURN_ERROR); @@ -1863,11 +1864,11 @@ XS (XS_weechat_api_print_y) API_RETURN_OK; } -XS (XS_weechat_api_log_print) +API_FUNC(log_print) { dXSARGS; - API_FUNC(1, "log_print", API_RETURN_ERROR); + API_INIT_FUNC(1, "log_print", API_RETURN_ERROR); if (items < 1) API_WRONG_ARGS(API_RETURN_ERROR); @@ -1920,13 +1921,13 @@ weechat_perl_api_hook_command_cb (void *data, struct t_gui_buffer *buffer, return WEECHAT_RC_ERROR; } -XS (XS_weechat_api_hook_command) +API_FUNC(hook_command) { char *result, *command, *description, *args, *args_description; char *completion, *function, *data; dXSARGS; - API_FUNC(1, "hook_command", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_command", API_RETURN_EMPTY); if (items < 7) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -1990,12 +1991,12 @@ weechat_perl_api_hook_command_run_cb (void *data, struct t_gui_buffer *buffer, return WEECHAT_RC_ERROR; } -XS (XS_weechat_api_hook_command_run) +API_FUNC(hook_command_run) { char *result, *command, *function, *data; dXSARGS; - API_FUNC(1, "hook_command_run", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_command_run", API_RETURN_EMPTY); if (items < 3) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -2050,12 +2051,12 @@ weechat_perl_api_hook_timer_cb (void *data, int remaining_calls) return WEECHAT_RC_ERROR; } -XS (XS_weechat_api_hook_timer) +API_FUNC(hook_timer) { char *result; dXSARGS; - API_FUNC(1, "hook_timer", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_timer", API_RETURN_EMPTY); if (items < 5) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -2107,12 +2108,12 @@ weechat_perl_api_hook_fd_cb (void *data, int fd) return WEECHAT_RC_ERROR; } -XS (XS_weechat_api_hook_fd) +API_FUNC(hook_fd) { char *result; dXSARGS; - API_FUNC(1, "hook_fd", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_fd", API_RETURN_EMPTY); if (items < 6) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -2168,12 +2169,12 @@ weechat_perl_api_hook_process_cb (void *data, return WEECHAT_RC_ERROR; } -XS (XS_weechat_api_hook_process) +API_FUNC(hook_process) { char *command, *function, *data, *result; dXSARGS; - API_FUNC(1, "hook_process", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_process", API_RETURN_EMPTY); if (items < 4) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -2192,13 +2193,13 @@ XS (XS_weechat_api_hook_process) API_RETURN_STRING_FREE(result); } -XS (XS_weechat_api_hook_process_hashtable) +API_FUNC(hook_process_hashtable) { char *command, *function, *data, *result; struct t_hashtable *options; dXSARGS; - API_FUNC(1, "hook_process_hashtable", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_process_hashtable", API_RETURN_EMPTY); if (items < 5) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -2270,12 +2271,12 @@ weechat_perl_api_hook_connect_cb (void *data, int status, int gnutls_rc, return WEECHAT_RC_ERROR; } -XS (XS_weechat_api_hook_connect) +API_FUNC(hook_connect) { char *proxy, *address, *local_hostname, *function, *data, *result; dXSARGS; - API_FUNC(1, "hook_connect", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_connect", API_RETURN_EMPTY); if (items < 8) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -2360,12 +2361,12 @@ weechat_perl_api_hook_print_cb (void *data, struct t_gui_buffer *buffer, return WEECHAT_RC_ERROR; } -XS (XS_weechat_api_hook_print) +API_FUNC(hook_print) { char *result, *buffer, *tags, *message, *function, *data; dXSARGS; - API_FUNC(1, "hook_print", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_print", API_RETURN_EMPTY); if (items < 6) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -2448,12 +2449,12 @@ weechat_perl_api_hook_signal_cb (void *data, const char *signal, const char *typ return WEECHAT_RC_ERROR; } -XS (XS_weechat_api_hook_signal) +API_FUNC(hook_signal) { char *result, *signal, *function, *data; dXSARGS; - API_FUNC(1, "hook_signal", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_signal", API_RETURN_EMPTY); if (items < 3) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -2471,13 +2472,13 @@ XS (XS_weechat_api_hook_signal) API_RETURN_STRING_FREE(result); } -XS (XS_weechat_api_hook_signal_send) +API_FUNC(hook_signal_send) { char *signal, *type_data; int number, rc; dXSARGS; - API_FUNC(1, "hook_signal_send", API_RETURN_INT(WEECHAT_RC_ERROR)); + API_INIT_FUNC(1, "hook_signal_send", API_RETURN_INT(WEECHAT_RC_ERROR)); if (items < 3) API_WRONG_ARGS(API_RETURN_INT(WEECHAT_RC_ERROR)); @@ -2545,12 +2546,12 @@ weechat_perl_api_hook_hsignal_cb (void *data, const char *signal, return WEECHAT_RC_ERROR; } -XS (XS_weechat_api_hook_hsignal) +API_FUNC(hook_hsignal) { char *result, *signal, *function, *data; dXSARGS; - API_FUNC(1, "hook_hsignal", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_hsignal", API_RETURN_EMPTY); if (items < 3) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -2568,14 +2569,14 @@ XS (XS_weechat_api_hook_hsignal) API_RETURN_STRING_FREE(result); } -XS (XS_weechat_api_hook_hsignal_send) +API_FUNC(hook_hsignal_send) { char *signal; struct t_hashtable *hashtable; int rc; dXSARGS; - API_FUNC(1, "hook_hsignal_send", API_RETURN_INT(WEECHAT_RC_ERROR)); + API_INIT_FUNC(1, "hook_hsignal_send", API_RETURN_INT(WEECHAT_RC_ERROR)); if (items < 2) API_WRONG_ARGS(API_RETURN_INT(WEECHAT_RC_ERROR)); @@ -2628,12 +2629,12 @@ weechat_perl_api_hook_config_cb (void *data, const char *option, const char *val return WEECHAT_RC_ERROR; } -XS (XS_weechat_api_hook_config) +API_FUNC(hook_config) { char *result, *option, *function, *data; dXSARGS; - API_FUNC(1, "hook_config", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_config", API_RETURN_EMPTY); if (items < 3) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -2693,12 +2694,12 @@ weechat_perl_api_hook_completion_cb (void *data, const char *completion_item, return WEECHAT_RC_ERROR; } -XS (XS_weechat_api_hook_completion) +API_FUNC(hook_completion) { char *result, *completion, *description, *function, *data; dXSARGS; - API_FUNC(1, "hook_completion", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_completion", API_RETURN_EMPTY); if (items < 4) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -2718,12 +2719,12 @@ XS (XS_weechat_api_hook_completion) API_RETURN_STRING_FREE(result); } -XS (XS_weechat_api_hook_completion_list_add) +API_FUNC(hook_completion_list_add) { char *completion, *word, *where; dXSARGS; - API_FUNC(1, "hook_completion_list_add", API_RETURN_ERROR); + API_INIT_FUNC(1, "hook_completion_list_add", API_RETURN_ERROR); if (items < 4) API_WRONG_ARGS(API_RETURN_ERROR); @@ -2765,12 +2766,12 @@ weechat_perl_api_hook_modifier_cb (void *data, const char *modifier, return NULL; } -XS (XS_weechat_api_hook_modifier) +API_FUNC(hook_modifier) { char *result, *modifier, *function, *data; dXSARGS; - API_FUNC(1, "hook_modifier", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_modifier", API_RETURN_EMPTY); if (items < 3) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -2788,12 +2789,12 @@ XS (XS_weechat_api_hook_modifier) API_RETURN_STRING_FREE(result); } -XS (XS_weechat_api_hook_modifier_exec) +API_FUNC(hook_modifier_exec) { char *result, *modifier, *modifier_data, *string; dXSARGS; - API_FUNC(1, "hook_modifier_exec", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_modifier_exec", API_RETURN_EMPTY); if (items < 3) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -2831,12 +2832,12 @@ weechat_perl_api_hook_info_cb (void *data, const char *info_name, return NULL; } -XS (XS_weechat_api_hook_info) +API_FUNC(hook_info) { char *result, *info_name, *description, *args_description, *function, *data; dXSARGS; - API_FUNC(1, "hook_info", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_info", API_RETURN_EMPTY); if (items < 5) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -2883,13 +2884,13 @@ weechat_perl_api_hook_info_hashtable_cb (void *data, const char *info_name, return NULL; } -XS (XS_weechat_api_hook_info_hashtable) +API_FUNC(hook_info_hashtable) { char *result, *info_name, *description, *args_description; char *output_description, *function, *data; dXSARGS; - API_FUNC(1, "hook_info_hashtable", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_info_hashtable", API_RETURN_EMPTY); if (items < 6) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -2945,13 +2946,13 @@ weechat_perl_api_hook_infolist_cb (void *data, const char *infolist_name, return NULL; } -XS (XS_weechat_api_hook_infolist) +API_FUNC(hook_infolist) { char *result, *infolist_name, *description, *pointer_description; char *args_description, *function, *data; dXSARGS; - API_FUNC(1, "hook_infolist", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_infolist", API_RETURN_EMPTY); if (items < 6) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -2999,12 +3000,12 @@ weechat_perl_api_hook_focus_cb (void *data, return NULL; } -XS (XS_weechat_api_hook_focus) +API_FUNC(hook_focus) { char *result, *area, *function, *data; dXSARGS; - API_FUNC(1, "hook_focus", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_focus", API_RETURN_EMPTY); if (items < 3) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3022,12 +3023,12 @@ XS (XS_weechat_api_hook_focus) API_RETURN_STRING_FREE(result); } -XS (XS_weechat_api_hook_set) +API_FUNC(hook_set) { char *hook, *property, *value; dXSARGS; - API_FUNC(1, "hook_set", API_RETURN_ERROR); + API_INIT_FUNC(1, "hook_set", API_RETURN_ERROR); if (items < 3) API_WRONG_ARGS(API_RETURN_ERROR); @@ -3040,11 +3041,11 @@ XS (XS_weechat_api_hook_set) API_RETURN_OK; } -XS (XS_weechat_api_unhook) +API_FUNC(unhook) { dXSARGS; - API_FUNC(1, "unhook", API_RETURN_ERROR); + API_INIT_FUNC(1, "unhook", API_RETURN_ERROR); if (items < 1) API_WRONG_ARGS(API_RETURN_ERROR); @@ -3055,7 +3056,7 @@ XS (XS_weechat_api_unhook) API_RETURN_OK; } -XS (XS_weechat_api_unhook_all) +API_FUNC(unhook_all) { dXSARGS; @@ -3063,7 +3064,7 @@ XS (XS_weechat_api_unhook_all) (void) cv; (void) items; - API_FUNC(1, "unhook_all", API_RETURN_ERROR); + API_INIT_FUNC(1, "unhook_all", API_RETURN_ERROR); plugin_script_api_unhook_all (weechat_perl_plugin, perl_current_script); @@ -3142,13 +3143,13 @@ weechat_perl_api_buffer_close_cb (void *data, struct t_gui_buffer *buffer) return WEECHAT_RC_ERROR; } -XS (XS_weechat_api_buffer_new) +API_FUNC(buffer_new) { char *result, *name, *function_input, *data_input, *function_close; char *data_close; dXSARGS; - API_FUNC(1, "buffer_new", API_RETURN_EMPTY); + API_INIT_FUNC(1, "buffer_new", API_RETURN_EMPTY); if (items < 5) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3171,12 +3172,12 @@ XS (XS_weechat_api_buffer_new) API_RETURN_STRING_FREE(result); } -XS (XS_weechat_api_buffer_search) +API_FUNC(buffer_search) { char *result, *plugin, *name; dXSARGS; - API_FUNC(1, "buffer_search", API_RETURN_EMPTY); + API_INIT_FUNC(1, "buffer_search", API_RETURN_EMPTY); if (items < 2) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3188,7 +3189,7 @@ XS (XS_weechat_api_buffer_search) API_RETURN_STRING_FREE(result); } -XS (XS_weechat_api_buffer_search_main) +API_FUNC(buffer_search_main) { char *result; dXSARGS; @@ -3197,14 +3198,14 @@ XS (XS_weechat_api_buffer_search_main) (void) items; (void) cv; - API_FUNC(1, "buffer_search_main", API_RETURN_EMPTY); + API_INIT_FUNC(1, "buffer_search_main", API_RETURN_EMPTY); result = API_PTR2STR(weechat_buffer_search_main ()); API_RETURN_STRING_FREE(result); } -XS (XS_weechat_api_current_buffer) +API_FUNC(current_buffer) { char *result; dXSARGS; @@ -3213,18 +3214,18 @@ XS (XS_weechat_api_current_buffer) (void) items; (void) cv; - API_FUNC(1, "current_buffer", API_RETURN_EMPTY); + API_INIT_FUNC(1, "current_buffer", API_RETURN_EMPTY); result = API_PTR2STR(weechat_current_buffer ()); API_RETURN_STRING_FREE(result); } -XS (XS_weechat_api_buffer_clear) +API_FUNC(buffer_clear) { dXSARGS; - API_FUNC(1, "buffer_clear", API_RETURN_ERROR); + API_INIT_FUNC(1, "buffer_clear", API_RETURN_ERROR); if (items < 1) API_WRONG_ARGS(API_RETURN_ERROR); @@ -3233,11 +3234,11 @@ XS (XS_weechat_api_buffer_clear) API_RETURN_OK; } -XS (XS_weechat_api_buffer_close) +API_FUNC(buffer_close) { dXSARGS; - API_FUNC(1, "buffer_close", API_RETURN_ERROR); + API_INIT_FUNC(1, "buffer_close", API_RETURN_ERROR); if (items < 1) API_WRONG_ARGS(API_RETURN_ERROR); @@ -3248,11 +3249,11 @@ XS (XS_weechat_api_buffer_close) API_RETURN_OK; } -XS (XS_weechat_api_buffer_merge) +API_FUNC(buffer_merge) { dXSARGS; - API_FUNC(1, "buffer_merge", API_RETURN_ERROR); + API_INIT_FUNC(1, "buffer_merge", API_RETURN_ERROR); if (items < 2) API_WRONG_ARGS(API_RETURN_ERROR); @@ -3262,11 +3263,11 @@ XS (XS_weechat_api_buffer_merge) API_RETURN_OK; } -XS (XS_weechat_api_buffer_unmerge) +API_FUNC(buffer_unmerge) { dXSARGS; - API_FUNC(1, "buffer_unmerge", API_RETURN_ERROR); + API_INIT_FUNC(1, "buffer_unmerge", API_RETURN_ERROR); if (items < 2) API_WRONG_ARGS(API_RETURN_ERROR); @@ -3276,13 +3277,13 @@ XS (XS_weechat_api_buffer_unmerge) API_RETURN_OK; } -XS (XS_weechat_api_buffer_get_integer) +API_FUNC(buffer_get_integer) { char *buffer, *property; int value; dXSARGS; - API_FUNC(1, "buffer_get_integer", API_RETURN_INT(-1)); + API_INIT_FUNC(1, "buffer_get_integer", API_RETURN_INT(-1)); if (items < 2) API_WRONG_ARGS(API_RETURN_INT(-1)); @@ -3294,13 +3295,13 @@ XS (XS_weechat_api_buffer_get_integer) API_RETURN_INT(value); } -XS (XS_weechat_api_buffer_get_string) +API_FUNC(buffer_get_string) { char *buffer, *property; const char *result; dXSARGS; - API_FUNC(1, "buffer_get_string", API_RETURN_EMPTY); + API_INIT_FUNC(1, "buffer_get_string", API_RETURN_EMPTY); if (items < 2) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3312,12 +3313,12 @@ XS (XS_weechat_api_buffer_get_string) API_RETURN_STRING(result); } -XS (XS_weechat_api_buffer_get_pointer) +API_FUNC(buffer_get_pointer) { char *result, *buffer, *property; dXSARGS; - API_FUNC(1, "buffer_get_pointer", API_RETURN_EMPTY); + API_INIT_FUNC(1, "buffer_get_pointer", API_RETURN_EMPTY); if (items < 2) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3330,12 +3331,12 @@ XS (XS_weechat_api_buffer_get_pointer) API_RETURN_STRING_FREE(result); } -XS (XS_weechat_api_buffer_set) +API_FUNC(buffer_set) { char *buffer, *property, *value; dXSARGS; - API_FUNC(1, "buffer_set", API_RETURN_ERROR); + API_INIT_FUNC(1, "buffer_set", API_RETURN_ERROR); if (items < 3) API_WRONG_ARGS(API_RETURN_ERROR); @@ -3348,12 +3349,12 @@ XS (XS_weechat_api_buffer_set) API_RETURN_OK; } -XS (XS_weechat_api_buffer_string_replace_local_var) +API_FUNC(buffer_string_replace_local_var) { char *buffer, *string, *result; dXSARGS; - API_FUNC(1, "buffer_string_replace_local_var", API_RETURN_ERROR); + API_INIT_FUNC(1, "buffer_string_replace_local_var", API_RETURN_ERROR); if (items < 2) API_WRONG_ARGS(API_RETURN_ERROR); @@ -3365,13 +3366,13 @@ XS (XS_weechat_api_buffer_string_replace_local_var) API_RETURN_STRING_FREE(result); } -XS (XS_weechat_api_buffer_match_list) +API_FUNC(buffer_match_list) { char *buffer, *string; int value; dXSARGS; - API_FUNC(1, "buffer_match_list", API_RETURN_INT(0)); + API_INIT_FUNC(1, "buffer_match_list", API_RETURN_INT(0)); if (items < 2) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -3383,7 +3384,7 @@ XS (XS_weechat_api_buffer_match_list) API_RETURN_INT(value); } -XS (XS_weechat_api_current_window) +API_FUNC(current_window) { char *result; dXSARGS; @@ -3392,19 +3393,19 @@ XS (XS_weechat_api_current_window) (void) items; (void) cv; - API_FUNC(1, "current_window", API_RETURN_EMPTY); + API_INIT_FUNC(1, "current_window", API_RETURN_EMPTY); result = API_PTR2STR(weechat_current_window ()); API_RETURN_STRING_FREE(result); } -XS (XS_weechat_api_window_search_with_buffer) +API_FUNC(window_search_with_buffer) { char *result; dXSARGS; - API_FUNC(1, "window_search_with_buffer", API_RETURN_EMPTY); + API_INIT_FUNC(1, "window_search_with_buffer", API_RETURN_EMPTY); if (items < 1) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3414,13 +3415,13 @@ XS (XS_weechat_api_window_search_with_buffer) } -XS (XS_weechat_api_window_get_integer) +API_FUNC(window_get_integer) { char *window, *property; int value; dXSARGS; - API_FUNC(1, "window_get_integer", API_RETURN_INT(-1)); + API_INIT_FUNC(1, "window_get_integer", API_RETURN_INT(-1)); if (items < 2) API_WRONG_ARGS(API_RETURN_INT(-1)); @@ -3432,13 +3433,13 @@ XS (XS_weechat_api_window_get_integer) API_RETURN_INT(value); } -XS (XS_weechat_api_window_get_string) +API_FUNC(window_get_string) { char *window, *property; const char *result; dXSARGS; - API_FUNC(1, "window_get_string", API_RETURN_EMPTY); + API_INIT_FUNC(1, "window_get_string", API_RETURN_EMPTY); if (items < 2) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3450,12 +3451,12 @@ XS (XS_weechat_api_window_get_string) API_RETURN_STRING(result); } -XS (XS_weechat_api_window_get_pointer) +API_FUNC(window_get_pointer) { char *result, *window, *property; dXSARGS; - API_FUNC(1, "window_get_pointer", API_RETURN_EMPTY); + API_INIT_FUNC(1, "window_get_pointer", API_RETURN_EMPTY); if (items < 2) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3468,11 +3469,11 @@ XS (XS_weechat_api_window_get_pointer) API_RETURN_STRING_FREE(result); } -XS (XS_weechat_api_window_set_title) +API_FUNC(window_set_title) { dXSARGS; - API_FUNC(1, "window_set_title", API_RETURN_ERROR); + API_INIT_FUNC(1, "window_set_title", API_RETURN_ERROR); if (items < 1) API_WRONG_ARGS(API_RETURN_ERROR); @@ -3481,12 +3482,12 @@ XS (XS_weechat_api_window_set_title) API_RETURN_OK; } -XS (XS_weechat_api_nicklist_add_group) +API_FUNC(nicklist_add_group) { char *result, *buffer, *parent_group, *name, *color; dXSARGS; - API_FUNC(1, "nicklist_add_group", API_RETURN_EMPTY); + API_INIT_FUNC(1, "nicklist_add_group", API_RETURN_EMPTY); if (items < 5) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3504,12 +3505,12 @@ XS (XS_weechat_api_nicklist_add_group) API_RETURN_STRING_FREE(result); } -XS (XS_weechat_api_nicklist_search_group) +API_FUNC(nicklist_search_group) { char *result, *buffer, *from_group, *name; dXSARGS; - API_FUNC(1, "nicklist_search_group", API_RETURN_EMPTY); + API_INIT_FUNC(1, "nicklist_search_group", API_RETURN_EMPTY); if (items < 3) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3524,12 +3525,12 @@ XS (XS_weechat_api_nicklist_search_group) API_RETURN_STRING_FREE(result); } -XS (XS_weechat_api_nicklist_add_nick) +API_FUNC(nicklist_add_nick) { char *result, *buffer, *group, *name, *color, *prefix, *prefix_color; dXSARGS; - API_FUNC(1, "nicklist_add_nick", API_RETURN_EMPTY); + API_INIT_FUNC(1, "nicklist_add_nick", API_RETURN_EMPTY); if (items < 7) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3551,12 +3552,12 @@ XS (XS_weechat_api_nicklist_add_nick) API_RETURN_STRING_FREE(result); } -XS (XS_weechat_api_nicklist_search_nick) +API_FUNC(nicklist_search_nick) { char *result, *buffer, *from_group, *name; dXSARGS; - API_FUNC(1, "nicklist_search_nick", API_RETURN_EMPTY); + API_INIT_FUNC(1, "nicklist_search_nick", API_RETURN_EMPTY); if (items < 3) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3571,12 +3572,12 @@ XS (XS_weechat_api_nicklist_search_nick) API_RETURN_STRING_FREE(result); } -XS (XS_weechat_api_nicklist_remove_group) +API_FUNC(nicklist_remove_group) { char *buffer, *group; dXSARGS; - API_FUNC(1, "nicklist_remove_group", API_RETURN_ERROR); + API_INIT_FUNC(1, "nicklist_remove_group", API_RETURN_ERROR); if (items < 2) API_WRONG_ARGS(API_RETURN_ERROR); @@ -3589,12 +3590,12 @@ XS (XS_weechat_api_nicklist_remove_group) API_RETURN_OK; } -XS (XS_weechat_api_nicklist_remove_nick) +API_FUNC(nicklist_remove_nick) { char *buffer, *nick; dXSARGS; - API_FUNC(1, "nicklist_remove_nick", API_RETURN_ERROR); + API_INIT_FUNC(1, "nicklist_remove_nick", API_RETURN_ERROR); if (items < 2) API_WRONG_ARGS(API_RETURN_ERROR); @@ -3607,11 +3608,11 @@ XS (XS_weechat_api_nicklist_remove_nick) API_RETURN_OK; } -XS (XS_weechat_api_nicklist_remove_all) +API_FUNC(nicklist_remove_all) { dXSARGS; - API_FUNC(1, "nicklist_remove_all", API_RETURN_ERROR); + API_INIT_FUNC(1, "nicklist_remove_all", API_RETURN_ERROR); if (items < 2) API_WRONG_ARGS(API_RETURN_ERROR); @@ -3620,13 +3621,13 @@ XS (XS_weechat_api_nicklist_remove_all) API_RETURN_OK; } -XS (XS_weechat_api_nicklist_group_get_integer) +API_FUNC(nicklist_group_get_integer) { char *buffer, *group, *property; int value; dXSARGS; - API_FUNC(1, "nicklist_group_get_integer", API_RETURN_INT(-1)); + API_INIT_FUNC(1, "nicklist_group_get_integer", API_RETURN_INT(-1)); if (items < 3) API_WRONG_ARGS(API_RETURN_INT(-1)); @@ -3641,13 +3642,13 @@ XS (XS_weechat_api_nicklist_group_get_integer) API_RETURN_INT(value); } -XS (XS_weechat_api_nicklist_group_get_string) +API_FUNC(nicklist_group_get_string) { char *buffer, *group, *property; const char *result; dXSARGS; - API_FUNC(1, "nicklist_group_get_string", API_RETURN_EMPTY); + API_INIT_FUNC(1, "nicklist_group_get_string", API_RETURN_EMPTY); if (items < 3) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3662,12 +3663,12 @@ XS (XS_weechat_api_nicklist_group_get_string) API_RETURN_STRING(result); } -XS (XS_weechat_api_nicklist_group_get_pointer) +API_FUNC(nicklist_group_get_pointer) { char *result, *buffer, *group, *property; dXSARGS; - API_FUNC(1, "nicklist_group_get_pointer", API_RETURN_EMPTY); + API_INIT_FUNC(1, "nicklist_group_get_pointer", API_RETURN_EMPTY); if (items < 3) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3682,12 +3683,12 @@ XS (XS_weechat_api_nicklist_group_get_pointer) API_RETURN_STRING_FREE(result); } -XS (XS_weechat_api_nicklist_group_set) +API_FUNC(nicklist_group_set) { char *buffer, *group, *property, *value; dXSARGS; - API_FUNC(1, "nicklist_group_set", API_RETURN_ERROR); + API_INIT_FUNC(1, "nicklist_group_set", API_RETURN_ERROR); if (items < 4) API_WRONG_ARGS(API_RETURN_ERROR); @@ -3704,13 +3705,13 @@ XS (XS_weechat_api_nicklist_group_set) API_RETURN_OK; } -XS (XS_weechat_api_nicklist_nick_get_integer) +API_FUNC(nicklist_nick_get_integer) { char *buffer, *nick, *property; int value; dXSARGS; - API_FUNC(1, "nicklist_nick_get_integer", API_RETURN_INT(-1)); + API_INIT_FUNC(1, "nicklist_nick_get_integer", API_RETURN_INT(-1)); if (items < 3) API_WRONG_ARGS(API_RETURN_INT(-1)); @@ -3725,13 +3726,13 @@ XS (XS_weechat_api_nicklist_nick_get_integer) API_RETURN_INT(value); } -XS (XS_weechat_api_nicklist_nick_get_string) +API_FUNC(nicklist_nick_get_string) { char *buffer, *nick, *property; const char *result; dXSARGS; - API_FUNC(1, "nicklist_nick_get_string", API_RETURN_EMPTY); + API_INIT_FUNC(1, "nicklist_nick_get_string", API_RETURN_EMPTY); if (items < 3) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3746,12 +3747,12 @@ XS (XS_weechat_api_nicklist_nick_get_string) API_RETURN_STRING(result); } -XS (XS_weechat_api_nicklist_nick_get_pointer) +API_FUNC(nicklist_nick_get_pointer) { char *result, *buffer, *nick, *property; dXSARGS; - API_FUNC(1, "nicklist_nick_get_pointer", API_RETURN_EMPTY); + API_INIT_FUNC(1, "nicklist_nick_get_pointer", API_RETURN_EMPTY); if (items < 3) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3766,12 +3767,12 @@ XS (XS_weechat_api_nicklist_nick_get_pointer) API_RETURN_STRING_FREE(result); } -XS (XS_weechat_api_nicklist_nick_set) +API_FUNC(nicklist_nick_set) { char *buffer, *nick, *property, *value; dXSARGS; - API_FUNC(1, "nicklist_nick_set", API_RETURN_ERROR); + API_INIT_FUNC(1, "nicklist_nick_set", API_RETURN_ERROR); if (items < 4) API_WRONG_ARGS(API_RETURN_ERROR); @@ -3788,12 +3789,12 @@ XS (XS_weechat_api_nicklist_nick_set) API_RETURN_OK; } -XS (XS_weechat_api_bar_item_search) +API_FUNC(bar_item_search) { char *result; dXSARGS; - API_FUNC(1, "bar_item_search", API_RETURN_EMPTY); + API_INIT_FUNC(1, "bar_item_search", API_RETURN_EMPTY); if (items < 1) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3861,12 +3862,12 @@ weechat_perl_api_bar_item_build_cb (void *data, struct t_gui_bar_item *item, return NULL; } -XS (XS_weechat_api_bar_item_new) +API_FUNC(bar_item_new) { char *result, *name, *function, *data; dXSARGS; - API_FUNC(1, "bar_item_new", API_RETURN_EMPTY); + API_INIT_FUNC(1, "bar_item_new", API_RETURN_EMPTY); if (items < 3) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3884,11 +3885,11 @@ XS (XS_weechat_api_bar_item_new) API_RETURN_STRING_FREE(result); } -XS (XS_weechat_api_bar_item_update) +API_FUNC(bar_item_update) { dXSARGS; - API_FUNC(1, "bar_item_update", API_RETURN_ERROR); + API_INIT_FUNC(1, "bar_item_update", API_RETURN_ERROR); if (items < 1) API_WRONG_ARGS(API_RETURN_ERROR); @@ -3897,11 +3898,11 @@ XS (XS_weechat_api_bar_item_update) API_RETURN_OK; } -XS (XS_weechat_api_bar_item_remove) +API_FUNC(bar_item_remove) { dXSARGS; - API_FUNC(1, "bar_item_remove", API_RETURN_ERROR); + API_INIT_FUNC(1, "bar_item_remove", API_RETURN_ERROR); if (items < 1) API_WRONG_ARGS(API_RETURN_ERROR); @@ -3912,12 +3913,12 @@ XS (XS_weechat_api_bar_item_remove) API_RETURN_OK; } -XS (XS_weechat_api_bar_search) +API_FUNC(bar_search) { char *result; dXSARGS; - API_FUNC(1, "bar_search", API_RETURN_EMPTY); + API_INIT_FUNC(1, "bar_search", API_RETURN_EMPTY); if (items < 1) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3926,14 +3927,14 @@ XS (XS_weechat_api_bar_search) API_RETURN_STRING_FREE(result); } -XS (XS_weechat_api_bar_new) +API_FUNC(bar_new) { char *result, *name, *hidden, *priority, *type, *conditions, *position; char *filling_top_bottom, *filling_left_right, *size, *size_max, *color_fg; char *color_delim, *color_bg, *separator, *bar_items; dXSARGS; - API_FUNC(1, "bar_new", API_RETURN_EMPTY); + API_INIT_FUNC(1, "bar_new", API_RETURN_EMPTY); if (items < 15) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3972,12 +3973,12 @@ XS (XS_weechat_api_bar_new) API_RETURN_STRING_FREE(result); } -XS (XS_weechat_api_bar_set) +API_FUNC(bar_set) { char *bar, *property, *value; dXSARGS; - API_FUNC(1, "bar_set", API_RETURN_ERROR); + API_INIT_FUNC(1, "bar_set", API_RETURN_ERROR); if (items < 3) API_WRONG_ARGS(API_RETURN_ERROR); @@ -3990,11 +3991,11 @@ XS (XS_weechat_api_bar_set) API_RETURN_OK; } -XS (XS_weechat_api_bar_update) +API_FUNC(bar_update) { dXSARGS; - API_FUNC(1, "bar_update", API_RETURN_ERROR); + API_INIT_FUNC(1, "bar_update", API_RETURN_ERROR); if (items < 1) API_WRONG_ARGS(API_RETURN_ERROR); @@ -4003,11 +4004,11 @@ XS (XS_weechat_api_bar_update) API_RETURN_OK; } -XS (XS_weechat_api_bar_remove) +API_FUNC(bar_remove) { dXSARGS; - API_FUNC(1, "bar_remove", API_RETURN_ERROR); + API_INIT_FUNC(1, "bar_remove", API_RETURN_ERROR); if (items < 1) API_WRONG_ARGS(API_RETURN_ERROR); @@ -4016,13 +4017,13 @@ XS (XS_weechat_api_bar_remove) API_RETURN_OK; } -XS (XS_weechat_api_command) +API_FUNC(command) { char *buffer, *command; int rc; dXSARGS; - API_FUNC(1, "command", API_RETURN_ERROR); + API_INIT_FUNC(1, "command", API_RETURN_ERROR); if (items < 2) API_WRONG_ARGS(API_RETURN_ERROR); @@ -4037,13 +4038,13 @@ XS (XS_weechat_api_command) API_RETURN_INT(rc); } -XS (XS_weechat_api_info_get) +API_FUNC(info_get) { char *info_name, *arguments; const char *result; dXSARGS; - API_FUNC(1, "info_get", API_RETURN_EMPTY); + API_INIT_FUNC(1, "info_get", API_RETURN_EMPTY); if (items < 2) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4055,14 +4056,14 @@ XS (XS_weechat_api_info_get) API_RETURN_STRING(result); } -XS (XS_weechat_api_info_get_hashtable) +API_FUNC(info_get_hashtable) { char *info_name; struct t_hashtable *hashtable, *result_hashtable; HV *result_hash; dXSARGS; - API_FUNC(1, "info_get_hashtable", API_RETURN_EMPTY); + API_INIT_FUNC(1, "info_get_hashtable", API_RETURN_EMPTY); if (items < 2) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4083,7 +4084,7 @@ XS (XS_weechat_api_info_get_hashtable) API_RETURN_OBJ(result_hash); } -XS (XS_weechat_api_infolist_new) +API_FUNC(infolist_new) { char *result; dXSARGS; @@ -4092,19 +4093,19 @@ XS (XS_weechat_api_infolist_new) (void) items; (void) cv; - API_FUNC(1, "infolist_new", API_RETURN_EMPTY); + API_INIT_FUNC(1, "infolist_new", API_RETURN_EMPTY); result = API_PTR2STR(weechat_infolist_new ()); API_RETURN_STRING_FREE(result); } -XS (XS_weechat_api_infolist_new_item) +API_FUNC(infolist_new_item) { char *infolist, *result; dXSARGS; - API_FUNC(1, "infolist_new_item", API_RETURN_EMPTY); + API_INIT_FUNC(1, "infolist_new_item", API_RETURN_EMPTY); if (items < 1) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4115,12 +4116,12 @@ XS (XS_weechat_api_infolist_new_item) API_RETURN_STRING_FREE(result); } -XS (XS_weechat_api_infolist_new_var_integer) +API_FUNC(infolist_new_var_integer) { char *infolist, *name, *result; dXSARGS; - API_FUNC(1, "infolist_new_var_integer", API_RETURN_EMPTY); + API_INIT_FUNC(1, "infolist_new_var_integer", API_RETURN_EMPTY); if (items < 3) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4134,12 +4135,12 @@ XS (XS_weechat_api_infolist_new_var_integer) API_RETURN_STRING_FREE(result); } -XS (XS_weechat_api_infolist_new_var_string) +API_FUNC(infolist_new_var_string) { char *infolist, *name, *value, *result; dXSARGS; - API_FUNC(1, "infolist_new_var_string", API_RETURN_EMPTY); + API_INIT_FUNC(1, "infolist_new_var_string", API_RETURN_EMPTY); if (items < 3) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4154,12 +4155,12 @@ XS (XS_weechat_api_infolist_new_var_string) API_RETURN_STRING_FREE(result); } -XS (XS_weechat_api_infolist_new_var_pointer) +API_FUNC(infolist_new_var_pointer) { char *infolist, *name, *value, *result; dXSARGS; - API_FUNC(1, "infolist_new_var_pointer", API_RETURN_EMPTY); + API_INIT_FUNC(1, "infolist_new_var_pointer", API_RETURN_EMPTY); if (items < 3) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4174,12 +4175,12 @@ XS (XS_weechat_api_infolist_new_var_pointer) API_RETURN_STRING_FREE(result); } -XS (XS_weechat_api_infolist_new_var_time) +API_FUNC(infolist_new_var_time) { char *infolist, *name, *result; dXSARGS; - API_FUNC(1, "infolist_new_var_time", API_RETURN_EMPTY); + API_INIT_FUNC(1, "infolist_new_var_time", API_RETURN_EMPTY); if (items < 3) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4193,12 +4194,12 @@ XS (XS_weechat_api_infolist_new_var_time) API_RETURN_STRING_FREE(result); } -XS (XS_weechat_api_infolist_get) +API_FUNC(infolist_get) { char *result, *name, *pointer, *arguments; dXSARGS; - API_FUNC(1, "infolist_get", API_RETURN_EMPTY); + API_INIT_FUNC(1, "infolist_get", API_RETURN_EMPTY); if (items < 3) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4213,12 +4214,12 @@ XS (XS_weechat_api_infolist_get) API_RETURN_STRING_FREE(result); } -XS (XS_weechat_api_infolist_next) +API_FUNC(infolist_next) { int value; dXSARGS; - API_FUNC(1, "infolist_next", API_RETURN_INT(0)); + API_INIT_FUNC(1, "infolist_next", API_RETURN_INT(0)); if (items < 1) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -4227,12 +4228,12 @@ XS (XS_weechat_api_infolist_next) API_RETURN_INT(value); } -XS (XS_weechat_api_infolist_prev) +API_FUNC(infolist_prev) { int value; dXSARGS; - API_FUNC(1, "infolist_prev", API_RETURN_INT(0)); + API_INIT_FUNC(1, "infolist_prev", API_RETURN_INT(0)); if (items < 1) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -4241,11 +4242,11 @@ XS (XS_weechat_api_infolist_prev) API_RETURN_INT(value); } -XS (XS_weechat_api_infolist_reset_item_cursor) +API_FUNC(infolist_reset_item_cursor) { dXSARGS; - API_FUNC(1, "infolist_reset_item_cursor", API_RETURN_ERROR); + API_INIT_FUNC(1, "infolist_reset_item_cursor", API_RETURN_ERROR); if (items < 1) API_WRONG_ARGS(API_RETURN_ERROR); @@ -4254,12 +4255,12 @@ XS (XS_weechat_api_infolist_reset_item_cursor) API_RETURN_OK; } -XS (XS_weechat_api_infolist_fields) +API_FUNC(infolist_fields) { const char *result; dXSARGS; - API_FUNC(1, "infolist_fields", API_RETURN_EMPTY); + API_INIT_FUNC(1, "infolist_fields", API_RETURN_EMPTY); if (items < 1) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4268,13 +4269,13 @@ XS (XS_weechat_api_infolist_fields) API_RETURN_STRING(result); } -XS (XS_weechat_api_infolist_integer) +API_FUNC(infolist_integer) { char *infolist, *variable; int value; dXSARGS; - API_FUNC(1, "infolist_integer", API_RETURN_INT(0)); + API_INIT_FUNC(1, "infolist_integer", API_RETURN_INT(0)); if (items < 2) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -4286,13 +4287,13 @@ XS (XS_weechat_api_infolist_integer) API_RETURN_INT(value); } -XS (XS_weechat_api_infolist_string) +API_FUNC(infolist_string) { char *infolist, *variable; const char *result; dXSARGS; - API_FUNC(1, "infolist_string", API_RETURN_EMPTY); + API_INIT_FUNC(1, "infolist_string", API_RETURN_EMPTY); if (items < 2) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4304,13 +4305,13 @@ XS (XS_weechat_api_infolist_string) API_RETURN_STRING(result); } -XS (XS_weechat_api_infolist_pointer) +API_FUNC(infolist_pointer) { char *infolist, *variable; char *result; dXSARGS; - API_FUNC(1, "infolist_pointer", API_RETURN_EMPTY); + API_INIT_FUNC(1, "infolist_pointer", API_RETURN_EMPTY); if (items < 2) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4322,14 +4323,14 @@ XS (XS_weechat_api_infolist_pointer) API_RETURN_STRING_FREE(result); } -XS (XS_weechat_api_infolist_time) +API_FUNC(infolist_time) { time_t time; struct tm *date_tmp; char timebuffer[64], *result, *infolist, *variable; dXSARGS; - API_FUNC(1, "infolist_time", API_RETURN_EMPTY); + API_INIT_FUNC(1, "infolist_time", API_RETURN_EMPTY); if (items < 2) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4346,11 +4347,11 @@ XS (XS_weechat_api_infolist_time) API_RETURN_STRING_FREE(result); } -XS (XS_weechat_api_infolist_free) +API_FUNC(infolist_free) { dXSARGS; - API_FUNC(1, "infolist_free", API_RETURN_ERROR); + API_INIT_FUNC(1, "infolist_free", API_RETURN_ERROR); if (items < 1) API_WRONG_ARGS(API_RETURN_ERROR); @@ -4359,12 +4360,12 @@ XS (XS_weechat_api_infolist_free) API_RETURN_OK; } -XS (XS_weechat_api_hdata_get) +API_FUNC(hdata_get) { char *result, *name; dXSARGS; - API_FUNC(1, "hdata_get", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hdata_get", API_RETURN_EMPTY); if (items < 1) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4375,13 +4376,13 @@ XS (XS_weechat_api_hdata_get) API_RETURN_STRING_FREE(result); } -XS (XS_weechat_api_hdata_get_var_offset) +API_FUNC(hdata_get_var_offset) { char *hdata, *name; int value; dXSARGS; - API_FUNC(1, "hdata_get_var_offset", API_RETURN_INT(0)); + API_INIT_FUNC(1, "hdata_get_var_offset", API_RETURN_INT(0)); if (items < 2) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -4393,13 +4394,13 @@ XS (XS_weechat_api_hdata_get_var_offset) API_RETURN_INT(value); } -XS (XS_weechat_api_hdata_get_var_type_string) +API_FUNC(hdata_get_var_type_string) { const char *result; char *hdata, *name; dXSARGS; - API_FUNC(1, "hdata_get_var_type_string", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hdata_get_var_type_string", API_RETURN_EMPTY); if (items < 2) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4411,13 +4412,13 @@ XS (XS_weechat_api_hdata_get_var_type_string) API_RETURN_STRING(result); } -XS (XS_weechat_api_hdata_get_var_array_size) +API_FUNC(hdata_get_var_array_size) { char *hdata, *pointer, *name; int value; dXSARGS; - API_FUNC(1, "hdata_get_var_array_size", API_RETURN_INT(-1)); + API_INIT_FUNC(1, "hdata_get_var_array_size", API_RETURN_INT(-1)); if (items < 3) API_WRONG_ARGS(API_RETURN_INT(-1)); @@ -4432,13 +4433,13 @@ XS (XS_weechat_api_hdata_get_var_array_size) API_RETURN_INT(value); } -XS (XS_weechat_api_hdata_get_var_array_size_string) +API_FUNC(hdata_get_var_array_size_string) { const char *result; char *hdata, *pointer, *name; dXSARGS; - API_FUNC(1, "hdata_get_var_array_size_string", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hdata_get_var_array_size_string", API_RETURN_EMPTY); if (items < 3) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4453,13 +4454,13 @@ XS (XS_weechat_api_hdata_get_var_array_size_string) API_RETURN_STRING(result); } -XS (XS_weechat_api_hdata_get_var_hdata) +API_FUNC(hdata_get_var_hdata) { const char *result; char *hdata, *name; dXSARGS; - API_FUNC(1, "hdata_get_var_hdata", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hdata_get_var_hdata", API_RETURN_EMPTY); if (items < 2) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4471,13 +4472,13 @@ XS (XS_weechat_api_hdata_get_var_hdata) API_RETURN_STRING(result); } -XS (XS_weechat_api_hdata_get_list) +API_FUNC(hdata_get_list) { char *hdata, *name; char *result; dXSARGS; - API_FUNC(1, "hdata_get_list", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hdata_get_list", API_RETURN_EMPTY); if (items < 2) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4490,13 +4491,13 @@ XS (XS_weechat_api_hdata_get_list) API_RETURN_STRING_FREE(result); } -XS (XS_weechat_api_hdata_check_pointer) +API_FUNC(hdata_check_pointer) { char *hdata, *list, *pointer; int value; dXSARGS; - API_FUNC(1, "hdata_check_pointer", API_RETURN_INT(0)); + API_INIT_FUNC(1, "hdata_check_pointer", API_RETURN_INT(0)); if (items < 3) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -4511,13 +4512,13 @@ XS (XS_weechat_api_hdata_check_pointer) API_RETURN_INT(value); } -XS (XS_weechat_api_hdata_move) +API_FUNC(hdata_move) { char *result, *hdata, *pointer; int count; dXSARGS; - API_FUNC(1, "hdata_move", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hdata_move", API_RETURN_EMPTY); if (items < 3) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4532,13 +4533,13 @@ XS (XS_weechat_api_hdata_move) API_RETURN_STRING_FREE(result); } -XS (XS_weechat_api_hdata_search) +API_FUNC(hdata_search) { char *result, *hdata, *pointer, *search; int move; dXSARGS; - API_FUNC(1, "hdata_search", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hdata_search", API_RETURN_EMPTY); if (items < 4) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4555,13 +4556,13 @@ XS (XS_weechat_api_hdata_search) API_RETURN_STRING_FREE(result); } -XS (XS_weechat_api_hdata_char) +API_FUNC(hdata_char) { char *hdata, *pointer, *name; int value; dXSARGS; - API_FUNC(1, "hdata_char", API_RETURN_INT(0)); + API_INIT_FUNC(1, "hdata_char", API_RETURN_INT(0)); if (items < 3) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -4576,13 +4577,13 @@ XS (XS_weechat_api_hdata_char) API_RETURN_INT(value); } -XS (XS_weechat_api_hdata_integer) +API_FUNC(hdata_integer) { char *hdata, *pointer, *name; int value; dXSARGS; - API_FUNC(1, "hdata_integer", API_RETURN_INT(0)); + API_INIT_FUNC(1, "hdata_integer", API_RETURN_INT(0)); if (items < 3) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -4597,13 +4598,13 @@ XS (XS_weechat_api_hdata_integer) API_RETURN_INT(value); } -XS (XS_weechat_api_hdata_long) +API_FUNC(hdata_long) { char *hdata, *pointer, *name; long value; dXSARGS; - API_FUNC(1, "hdata_long", API_RETURN_LONG(0)); + API_INIT_FUNC(1, "hdata_long", API_RETURN_LONG(0)); if (items < 3) API_WRONG_ARGS(API_RETURN_LONG(0)); @@ -4618,13 +4619,13 @@ XS (XS_weechat_api_hdata_long) API_RETURN_LONG(value); } -XS (XS_weechat_api_hdata_string) +API_FUNC(hdata_string) { char *hdata, *pointer, *name; const char *result; dXSARGS; - API_FUNC(1, "hdata_string", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hdata_string", API_RETURN_EMPTY); if (items < 3) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4639,13 +4640,13 @@ XS (XS_weechat_api_hdata_string) API_RETURN_STRING(result); } -XS (XS_weechat_api_hdata_pointer) +API_FUNC(hdata_pointer) { char *hdata, *pointer, *name; char *result; dXSARGS; - API_FUNC(1, "hdata_pointer", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hdata_pointer", API_RETURN_EMPTY); if (items < 3) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4660,13 +4661,13 @@ XS (XS_weechat_api_hdata_pointer) API_RETURN_STRING_FREE(result); } -XS (XS_weechat_api_hdata_time) +API_FUNC(hdata_time) { time_t time; char timebuffer[64], *result, *hdata, *pointer, *name; dXSARGS; - API_FUNC(1, "hdata_time", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hdata_time", API_RETURN_EMPTY); if (items < 3) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4684,13 +4685,13 @@ XS (XS_weechat_api_hdata_time) API_RETURN_STRING_FREE(result); } -XS (XS_weechat_api_hdata_hashtable) +API_FUNC(hdata_hashtable) { char *hdata, *pointer, *name; HV *result_hash; dXSARGS; - API_FUNC(1, "hdata_hashtable", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hdata_hashtable", API_RETURN_EMPTY); if (items < 3) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4706,14 +4707,14 @@ XS (XS_weechat_api_hdata_hashtable) API_RETURN_OBJ(result_hash); } -XS (XS_weechat_api_hdata_update) +API_FUNC(hdata_update) { char *hdata, *pointer; struct t_hashtable *hashtable; int value; dXSARGS; - API_FUNC(1, "hdata_update", API_RETURN_INT(0)); + API_INIT_FUNC(1, "hdata_update", API_RETURN_INT(0)); if (items < 3) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -4734,13 +4735,13 @@ XS (XS_weechat_api_hdata_update) API_RETURN_INT(value); } -XS (XS_weechat_api_hdata_get_string) +API_FUNC(hdata_get_string) { char *hdata, *property; const char *result; dXSARGS; - API_FUNC(1, "hdata_get_string", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hdata_get_string", API_RETURN_EMPTY); if (items < 2) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4752,12 +4753,12 @@ XS (XS_weechat_api_hdata_get_string) API_RETURN_STRING(result); } -XS (XS_weechat_api_upgrade_new) +API_FUNC(upgrade_new) { char *result, *filename; dXSARGS; - API_FUNC(1, "upgrade_new", API_RETURN_EMPTY); + API_INIT_FUNC(1, "upgrade_new", API_RETURN_EMPTY); if (items < 2) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4769,13 +4770,13 @@ XS (XS_weechat_api_upgrade_new) API_RETURN_STRING_FREE(result); } -XS (XS_weechat_api_upgrade_write_object) +API_FUNC(upgrade_write_object) { char *upgrade_file, *infolist; int rc; dXSARGS; - API_FUNC(1, "upgrade_write_object", API_RETURN_INT(0)); + API_INIT_FUNC(1, "upgrade_write_object", API_RETURN_INT(0)); if (items < 3) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -4834,13 +4835,13 @@ weechat_perl_api_upgrade_read_cb (void *data, return WEECHAT_RC_ERROR; } -XS (XS_weechat_api_upgrade_read) +API_FUNC(upgrade_read) { char *upgrade_file, *function, *data; int rc; dXSARGS; - API_FUNC(1, "upgrade_read", API_RETURN_INT(0)); + API_INIT_FUNC(1, "upgrade_read", API_RETURN_INT(0)); if (items < 3) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -4858,12 +4859,12 @@ XS (XS_weechat_api_upgrade_read) API_RETURN_INT(rc); } -XS (XS_weechat_api_upgrade_close) +API_FUNC(upgrade_close) { char *upgrade_file; dXSARGS; - API_FUNC(1, "upgrade_close", API_RETURN_ERROR); + API_INIT_FUNC(1, "upgrade_close", API_RETURN_ERROR); if (items < 1) API_WRONG_ARGS(API_RETURN_ERROR); diff --git a/src/plugins/python/weechat-python-api.c b/src/plugins/python/weechat-python-api.c index c009b4d26..a270b0db6 100644 --- a/src/plugins/python/weechat-python-api.c +++ b/src/plugins/python/weechat-python-api.c @@ -33,7 +33,12 @@ #include "weechat-python.h" -#define API_FUNC(__init, __name, __ret) \ +#define API_DEF_FUNC(__name) \ + { #__name, &weechat_python_api_##__name, METH_VARARGS, "" } +#define API_FUNC(__name) \ + static PyObject * \ + weechat_python_api_##__name (PyObject *self, PyObject *args) +#define API_INIT_FUNC(__init, __name, __ret) \ char *python_function_name = __name; \ (void) self; \ if (__init \ @@ -55,11 +60,11 @@ plugin_script_str2ptr (weechat_python_plugin, \ PYTHON_CURRENT_SCRIPT_NAME, \ python_function_name, __string) -#define API_RETURN_OK return PyLong_FromLong((long)1); -#define API_RETURN_ERROR return PyLong_FromLong ((long)0); +#define API_RETURN_OK return PyLong_FromLong((long)1) +#define API_RETURN_ERROR return PyLong_FromLong ((long)0) #define API_RETURN_EMPTY \ Py_INCREF (Py_None); \ - return Py_None; + return Py_None #define API_RETURN_STRING(__string) \ if (__string) \ return Py_BuildValue ("s", __string); \ @@ -73,25 +78,21 @@ } \ return Py_BuildValue ("s", "") #define API_RETURN_INT(__int) \ - return PyLong_FromLong((long)__int); + return PyLong_FromLong((long)__int) #define API_RETURN_LONG(__long) \ - return PyLong_FromLong(__long); - -#define API_DEF_FUNC(__name) \ - { #__name, &weechat_python_api_##__name, METH_VARARGS, "" } + return PyLong_FromLong(__long) /* * Registers a python script. */ -static PyObject * -weechat_python_api_register (PyObject *self, PyObject *args) +API_FUNC(register) { char *name, *author, *version, *license, *shutdown_func, *description; char *charset; - API_FUNC(0, "register", API_RETURN_ERROR); + API_INIT_FUNC(0, "register", API_RETURN_ERROR); if (python_registered_script) { /* script already registered */ @@ -160,13 +161,12 @@ weechat_python_api_register (PyObject *self, PyObject *args) * core. */ -static PyObject * -weechat_python_api_plugin_get_name (PyObject *self, PyObject *args) +API_FUNC(plugin_get_name) { char *plugin; const char *result; - API_FUNC(1, "plugin_get_name", API_RETURN_EMPTY); + API_INIT_FUNC(1, "plugin_get_name", API_RETURN_EMPTY); plugin = NULL; if (!PyArg_ParseTuple (args, "s", &plugin)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -176,29 +176,26 @@ weechat_python_api_plugin_get_name (PyObject *self, PyObject *args) API_RETURN_STRING(result); } -static PyObject * -weechat_python_api_charset_set (PyObject *self, PyObject *args) +API_FUNC(charset_set) { char *charset; - API_FUNC(1, "charset_set", API_RETURN_ERROR); + API_INIT_FUNC(1, "charset_set", API_RETURN_ERROR); charset = NULL; if (!PyArg_ParseTuple (args, "s", &charset)) API_WRONG_ARGS(API_RETURN_ERROR); - plugin_script_api_charset_set (python_current_script, - charset); + plugin_script_api_charset_set (python_current_script, charset); API_RETURN_OK; } -static PyObject * -weechat_python_api_iconv_to_internal (PyObject *self, PyObject *args) +API_FUNC(iconv_to_internal) { char *charset, *string, *result; PyObject *return_value; - API_FUNC(1, "iconv_to_internal", API_RETURN_EMPTY); + API_INIT_FUNC(1, "iconv_to_internal", API_RETURN_EMPTY); charset = NULL; string = NULL; if (!PyArg_ParseTuple (args, "ss", &charset, &string)) @@ -209,13 +206,12 @@ weechat_python_api_iconv_to_internal (PyObject *self, PyObject *args) API_RETURN_STRING_FREE(result); } -static PyObject * -weechat_python_api_iconv_from_internal (PyObject *self, PyObject *args) +API_FUNC(iconv_from_internal) { char *charset, *string, *result; PyObject *return_value; - API_FUNC(1, "iconv_from_internal", API_RETURN_EMPTY); + API_INIT_FUNC(1, "iconv_from_internal", API_RETURN_EMPTY); charset = NULL; string = NULL; if (!PyArg_ParseTuple (args, "ss", &charset, &string)) @@ -226,13 +222,12 @@ weechat_python_api_iconv_from_internal (PyObject *self, PyObject *args) API_RETURN_STRING_FREE(result); } -static PyObject * -weechat_python_api_gettext (PyObject *self, PyObject *args) +API_FUNC(gettext) { char *string; const char *result; - API_FUNC(1, "gettext", API_RETURN_EMPTY); + API_INIT_FUNC(1, "gettext", API_RETURN_EMPTY); string = NULL; if (!PyArg_ParseTuple (args, "s", &string)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -242,14 +237,13 @@ weechat_python_api_gettext (PyObject *self, PyObject *args) API_RETURN_STRING(result); } -static PyObject * -weechat_python_api_ngettext (PyObject *self, PyObject *args) +API_FUNC(ngettext) { char *single, *plural; const char *result; int count; - API_FUNC(1, "ngettext", API_RETURN_EMPTY); + API_INIT_FUNC(1, "ngettext", API_RETURN_EMPTY); single = NULL; plural = NULL; count = 0; @@ -261,13 +255,12 @@ weechat_python_api_ngettext (PyObject *self, PyObject *args) API_RETURN_STRING(result); } -static PyObject * -weechat_python_api_strlen_screen (PyObject *self, PyObject *args) +API_FUNC(strlen_screen) { char *string; int value; - API_FUNC(1, "strlen_screen", API_RETURN_INT(0)); + API_INIT_FUNC(1, "strlen_screen", API_RETURN_INT(0)); string = NULL; if (!PyArg_ParseTuple (args, "s", &string)) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -277,13 +270,12 @@ weechat_python_api_strlen_screen (PyObject *self, PyObject *args) API_RETURN_INT(value); } -static PyObject * -weechat_python_api_string_match (PyObject *self, PyObject *args) +API_FUNC(string_match) { char *string, *mask; int case_sensitive, value; - API_FUNC(1, "string_match", API_RETURN_INT(0)); + API_INIT_FUNC(1, "string_match", API_RETURN_INT(0)); string = NULL; mask = NULL; case_sensitive = 0; @@ -295,13 +287,12 @@ weechat_python_api_string_match (PyObject *self, PyObject *args) API_RETURN_INT(value); } -static PyObject * -weechat_python_api_string_has_highlight (PyObject *self, PyObject *args) +API_FUNC(string_has_highlight) { char *string, *highlight_words; int value; - API_FUNC(1, "string_has_highlight", API_RETURN_INT(0)); + API_INIT_FUNC(1, "string_has_highlight", API_RETURN_INT(0)); string = NULL; highlight_words = NULL; if (!PyArg_ParseTuple (args, "ss", &string, &highlight_words)) @@ -312,13 +303,12 @@ weechat_python_api_string_has_highlight (PyObject *self, PyObject *args) API_RETURN_INT(value); } -static PyObject * -weechat_python_api_string_has_highlight_regex (PyObject *self, PyObject *args) +API_FUNC(string_has_highlight_regex) { char *string, *regex; int value; - API_FUNC(1, "string_has_highlight_regex", API_RETURN_INT(0)); + API_INIT_FUNC(1, "string_has_highlight_regex", API_RETURN_INT(0)); string = NULL; regex = NULL; if (!PyArg_ParseTuple (args, "ss", &string, ®ex)) @@ -329,13 +319,12 @@ weechat_python_api_string_has_highlight_regex (PyObject *self, PyObject *args) API_RETURN_INT(value); } -static PyObject * -weechat_python_api_string_mask_to_regex (PyObject *self, PyObject *args) +API_FUNC(string_mask_to_regex) { char *mask, *result; PyObject *return_value; - API_FUNC(1, "string_mask_to_regex", API_RETURN_EMPTY); + API_INIT_FUNC(1, "string_mask_to_regex", API_RETURN_EMPTY); mask = NULL; if (!PyArg_ParseTuple (args, "s", &mask)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -345,13 +334,12 @@ weechat_python_api_string_mask_to_regex (PyObject *self, PyObject *args) API_RETURN_STRING_FREE(result); } -static PyObject * -weechat_python_api_string_remove_color (PyObject *self, PyObject *args) +API_FUNC(string_remove_color) { char *string, *replacement, *result; PyObject *return_value; - API_FUNC(1, "string_remove_color", API_RETURN_EMPTY); + API_INIT_FUNC(1, "string_remove_color", API_RETURN_EMPTY); string = NULL; replacement = NULL; if (!PyArg_ParseTuple (args, "ss", &string, &replacement)) @@ -362,13 +350,12 @@ weechat_python_api_string_remove_color (PyObject *self, PyObject *args) API_RETURN_STRING_FREE(result); } -static PyObject * -weechat_python_api_string_is_command_char (PyObject *self, PyObject *args) +API_FUNC(string_is_command_char) { char *string; int value; - API_FUNC(1, "string_is_command_char", API_RETURN_INT(0)); + API_INIT_FUNC(1, "string_is_command_char", API_RETURN_INT(0)); string = NULL; if (!PyArg_ParseTuple (args, "s", &string)) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -378,13 +365,12 @@ weechat_python_api_string_is_command_char (PyObject *self, PyObject *args) API_RETURN_INT(value); } -static PyObject * -weechat_python_api_string_input_for_buffer (PyObject *self, PyObject *args) +API_FUNC(string_input_for_buffer) { char *string; const char *result; - API_FUNC(1, "string_input_for_buffer", API_RETURN_EMPTY); + API_INIT_FUNC(1, "string_input_for_buffer", API_RETURN_EMPTY); string = NULL; if (!PyArg_ParseTuple (args, "s", &string)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -394,14 +380,13 @@ weechat_python_api_string_input_for_buffer (PyObject *self, PyObject *args) API_RETURN_STRING(result); } -static PyObject * -weechat_python_api_string_eval_expression (PyObject *self, PyObject *args) +API_FUNC(string_eval_expression) { char *expr, *result; struct t_hashtable *pointers, *extra_vars, *options; PyObject *dict, *dict2, *dict3, *return_value; - API_FUNC(1, "string_eval_expression", API_RETURN_EMPTY); + API_INIT_FUNC(1, "string_eval_expression", API_RETURN_EMPTY); expr = NULL; pointers = NULL; extra_vars = NULL; @@ -434,13 +419,12 @@ weechat_python_api_string_eval_expression (PyObject *self, PyObject *args) API_RETURN_STRING_FREE(result); } -static PyObject * -weechat_python_api_mkdir_home (PyObject *self, PyObject *args) +API_FUNC(mkdir_home) { char *directory; int mode; - API_FUNC(1, "mkdir_home", API_RETURN_ERROR); + API_INIT_FUNC(1, "mkdir_home", API_RETURN_ERROR); directory = NULL; mode = 0; if (!PyArg_ParseTuple (args, "si", &directory, &mode)) @@ -452,13 +436,12 @@ weechat_python_api_mkdir_home (PyObject *self, PyObject *args) API_RETURN_ERROR; } -static PyObject * -weechat_python_api_mkdir (PyObject *self, PyObject *args) +API_FUNC(mkdir) { char *directory; int mode; - API_FUNC(1, "mkdir", API_RETURN_ERROR); + API_INIT_FUNC(1, "mkdir", API_RETURN_ERROR); directory = NULL; mode = 0; if (!PyArg_ParseTuple (args, "si", &directory, &mode)) @@ -470,13 +453,12 @@ weechat_python_api_mkdir (PyObject *self, PyObject *args) API_RETURN_ERROR; } -static PyObject * -weechat_python_api_mkdir_parents (PyObject *self, PyObject *args) +API_FUNC(mkdir_parents) { char *directory; int mode; - API_FUNC(1, "mkdir_parents", API_RETURN_ERROR); + API_INIT_FUNC(1, "mkdir_parents", API_RETURN_ERROR); directory = NULL; mode = 0; if (!PyArg_ParseTuple (args, "si", &directory, &mode)) @@ -488,8 +470,7 @@ weechat_python_api_mkdir_parents (PyObject *self, PyObject *args) API_RETURN_ERROR; } -static PyObject * -weechat_python_api_list_new (PyObject *self, PyObject *args) +API_FUNC(list_new) { char *result; PyObject *return_value; @@ -497,20 +478,19 @@ weechat_python_api_list_new (PyObject *self, PyObject *args) /* make C compiler happy */ (void) args; - API_FUNC(1, "list_new", API_RETURN_EMPTY); + API_INIT_FUNC(1, "list_new", API_RETURN_EMPTY); result = API_PTR2STR(weechat_list_new ()); API_RETURN_STRING_FREE(result); } -static PyObject * -weechat_python_api_list_add (PyObject *self, PyObject *args) +API_FUNC(list_add) { char *weelist, *data, *where, *user_data, *result; PyObject *return_value; - API_FUNC(1, "list_add", API_RETURN_EMPTY); + API_INIT_FUNC(1, "list_add", API_RETURN_EMPTY); weelist = NULL; data = NULL; where = NULL; @@ -526,13 +506,12 @@ weechat_python_api_list_add (PyObject *self, PyObject *args) API_RETURN_STRING_FREE(result); } -static PyObject * -weechat_python_api_list_search (PyObject *self, PyObject *args) +API_FUNC(list_search) { char *weelist, *data, *result; PyObject *return_value; - API_FUNC(1, "list_search", API_RETURN_EMPTY); + API_INIT_FUNC(1, "list_search", API_RETURN_EMPTY); weelist = NULL; data = NULL; if (!PyArg_ParseTuple (args, "ss", &weelist, &data)) @@ -544,13 +523,12 @@ weechat_python_api_list_search (PyObject *self, PyObject *args) API_RETURN_STRING_FREE(result); } -static PyObject * -weechat_python_api_list_search_pos (PyObject *self, PyObject *args) +API_FUNC(list_search_pos) { char *weelist, *data; int pos; - API_FUNC(1, "list_search_pos", API_RETURN_INT(-1)); + API_INIT_FUNC(1, "list_search_pos", API_RETURN_INT(-1)); weelist = NULL; data = NULL; if (!PyArg_ParseTuple (args, "ss", &weelist, &data)) @@ -561,13 +539,12 @@ weechat_python_api_list_search_pos (PyObject *self, PyObject *args) API_RETURN_INT(pos); } -static PyObject * -weechat_python_api_list_casesearch (PyObject *self, PyObject *args) +API_FUNC(list_casesearch) { char *weelist, *data, *result; PyObject *return_value; - API_FUNC(1, "list_casesearch", API_RETURN_EMPTY); + API_INIT_FUNC(1, "list_casesearch", API_RETURN_EMPTY); weelist = NULL; data = NULL; if (!PyArg_ParseTuple (args, "ss", &weelist, &data)) @@ -579,13 +556,12 @@ weechat_python_api_list_casesearch (PyObject *self, PyObject *args) API_RETURN_STRING_FREE(result); } -static PyObject * -weechat_python_api_list_casesearch_pos (PyObject *self, PyObject *args) +API_FUNC(list_casesearch_pos) { char *weelist, *data; int pos; - API_FUNC(1, "list_casesearch_pos", API_RETURN_INT(-1)); + API_INIT_FUNC(1, "list_casesearch_pos", API_RETURN_INT(-1)); weelist = NULL; data = NULL; if (!PyArg_ParseTuple (args, "ss", &weelist, &data)) @@ -596,14 +572,13 @@ weechat_python_api_list_casesearch_pos (PyObject *self, PyObject *args) API_RETURN_INT(pos); } -static PyObject * -weechat_python_api_list_get (PyObject *self, PyObject *args) +API_FUNC(list_get) { char *weelist, *result; int position; PyObject *return_value; - API_FUNC(1, "list_get", API_RETURN_EMPTY); + API_INIT_FUNC(1, "list_get", API_RETURN_EMPTY); weelist = NULL; position = 0; if (!PyArg_ParseTuple (args, "si", &weelist, &position)) @@ -614,12 +589,11 @@ weechat_python_api_list_get (PyObject *self, PyObject *args) API_RETURN_STRING_FREE(result); } -static PyObject * -weechat_python_api_list_set (PyObject *self, PyObject *args) +API_FUNC(list_set) { char *item, *new_value; - API_FUNC(1, "list_set", API_RETURN_ERROR); + API_INIT_FUNC(1, "list_set", API_RETURN_ERROR); item = NULL; new_value = NULL; if (!PyArg_ParseTuple (args, "ss", &item, &new_value)) @@ -631,13 +605,12 @@ weechat_python_api_list_set (PyObject *self, PyObject *args) API_RETURN_OK; } -static PyObject * -weechat_python_api_list_next (PyObject *self, PyObject *args) +API_FUNC(list_next) { char *item, *result; PyObject *return_value; - API_FUNC(1, "list_next", API_RETURN_EMPTY); + API_INIT_FUNC(1, "list_next", API_RETURN_EMPTY); item = NULL; if (!PyArg_ParseTuple (args, "s", &item)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -647,13 +620,12 @@ weechat_python_api_list_next (PyObject *self, PyObject *args) API_RETURN_STRING_FREE(result); } -static PyObject * -weechat_python_api_list_prev (PyObject *self, PyObject *args) +API_FUNC(list_prev) { char *item, *result; PyObject *return_value; - API_FUNC(1, "list_prev", API_RETURN_EMPTY); + API_INIT_FUNC(1, "list_prev", API_RETURN_EMPTY); item = NULL; if (!PyArg_ParseTuple (args, "s", &item)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -663,13 +635,12 @@ weechat_python_api_list_prev (PyObject *self, PyObject *args) API_RETURN_STRING_FREE(result); } -static PyObject * -weechat_python_api_list_string (PyObject *self, PyObject *args) +API_FUNC(list_string) { char *item; const char *result; - API_FUNC(1, "list_string", API_RETURN_EMPTY); + API_INIT_FUNC(1, "list_string", API_RETURN_EMPTY); item = NULL; if (!PyArg_ParseTuple (args, "s", &item)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -679,13 +650,12 @@ weechat_python_api_list_string (PyObject *self, PyObject *args) API_RETURN_STRING(result); } -static PyObject * -weechat_python_api_list_size (PyObject *self, PyObject *args) +API_FUNC(list_size) { char *weelist; int size; - API_FUNC(1, "list_size", API_RETURN_INT(0)); + API_INIT_FUNC(1, "list_size", API_RETURN_INT(0)); weelist = NULL; if (!PyArg_ParseTuple (args, "s", &weelist)) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -695,12 +665,11 @@ weechat_python_api_list_size (PyObject *self, PyObject *args) API_RETURN_INT(size); } -static PyObject * -weechat_python_api_list_remove (PyObject *self, PyObject *args) +API_FUNC(list_remove) { char *weelist, *item; - API_FUNC(1, "list_remove", API_RETURN_ERROR); + API_INIT_FUNC(1, "list_remove", API_RETURN_ERROR); weelist = NULL; item = NULL; if (!PyArg_ParseTuple (args, "ss", &weelist, &item)) @@ -712,12 +681,11 @@ weechat_python_api_list_remove (PyObject *self, PyObject *args) API_RETURN_OK; } -static PyObject * -weechat_python_api_list_remove_all (PyObject *self, PyObject *args) +API_FUNC(list_remove_all) { char *weelist; - API_FUNC(1, "list_remove_all", API_RETURN_ERROR); + API_INIT_FUNC(1, "list_remove_all", API_RETURN_ERROR); weelist = NULL; if (!PyArg_ParseTuple (args, "s", &weelist)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -727,12 +695,11 @@ weechat_python_api_list_remove_all (PyObject *self, PyObject *args) API_RETURN_OK; } -static PyObject * -weechat_python_api_list_free (PyObject *self, PyObject *args) +API_FUNC(list_free) { char *weelist; - API_FUNC(1, "list_free", API_RETURN_ERROR); + API_INIT_FUNC(1, "list_free", API_RETURN_ERROR); weelist = NULL; if (!PyArg_ParseTuple (args, "s", &weelist)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -779,13 +746,12 @@ weechat_python_api_config_reload_cb (void *data, return WEECHAT_CONFIG_READ_FILE_NOT_FOUND; } -static PyObject * -weechat_python_api_config_new (PyObject *self, PyObject *args) +API_FUNC(config_new) { char *name, *function, *data, *result; PyObject *return_value; - API_FUNC(1, "config_new", API_RETURN_EMPTY); + API_INIT_FUNC(1, "config_new", API_RETURN_EMPTY); name = NULL; function = NULL; data = NULL; @@ -1014,8 +980,7 @@ weechat_python_api_config_section_delete_option_cb (void *data, return WEECHAT_CONFIG_OPTION_UNSET_ERROR; } -static PyObject * -weechat_python_api_config_new_section (PyObject *self, PyObject *args) +API_FUNC(config_new_section) { char *config_file, *name, *function_read, *data_read, *function_write; char *data_write, *function_write_default, *data_write_default; @@ -1024,7 +989,7 @@ weechat_python_api_config_new_section (PyObject *self, PyObject *args) int user_can_add_options, user_can_delete_options; PyObject *return_value; - API_FUNC(1, "config_new_section", API_RETURN_EMPTY); + API_INIT_FUNC(1, "config_new_section", API_RETURN_EMPTY); config_file = NULL; name = NULL; user_can_add_options = 0; @@ -1073,13 +1038,12 @@ weechat_python_api_config_new_section (PyObject *self, PyObject *args) API_RETURN_STRING_FREE(result); } -static PyObject * -weechat_python_api_config_search_section (PyObject *self, PyObject *args) +API_FUNC(config_search_section) { char *config_file, *section_name, *result; PyObject *return_value; - API_FUNC(1, "config_search_section", API_RETURN_EMPTY); + API_INIT_FUNC(1, "config_search_section", API_RETURN_EMPTY); config_file = NULL; section_name = NULL; if (!PyArg_ParseTuple (args, "ss", &config_file, §ion_name)) @@ -1188,8 +1152,7 @@ weechat_python_api_config_option_delete_cb (void *data, } } -static PyObject * -weechat_python_api_config_new_option (PyObject *self, PyObject *args) +API_FUNC(config_new_option) { char *config_file, *section, *name, *type, *description, *string_values; char *default_value, *value, *result; @@ -1198,7 +1161,7 @@ weechat_python_api_config_new_option (PyObject *self, PyObject *args) int min, max, null_value_allowed; PyObject *return_value; - API_FUNC(1, "config_new_option", API_RETURN_EMPTY); + API_INIT_FUNC(1, "config_new_option", API_RETURN_EMPTY); config_file = NULL; section = NULL; name = NULL; @@ -1247,13 +1210,12 @@ weechat_python_api_config_new_option (PyObject *self, PyObject *args) API_RETURN_STRING_FREE(result); } -static PyObject * -weechat_python_api_config_search_option (PyObject *self, PyObject *args) +API_FUNC(config_search_option) { char *config_file, *section, *option_name, *result; PyObject *return_value; - API_FUNC(1, "config_search_option", API_RETURN_EMPTY); + API_INIT_FUNC(1, "config_search_option", API_RETURN_EMPTY); config_file = NULL; section = NULL; option_name = NULL; @@ -1267,13 +1229,12 @@ weechat_python_api_config_search_option (PyObject *self, PyObject *args) API_RETURN_STRING_FREE(result); } -static PyObject * -weechat_python_api_config_string_to_boolean (PyObject *self, PyObject *args) +API_FUNC(config_string_to_boolean) { char *text; int value; - API_FUNC(1, "config_string_to_boolean", API_RETURN_INT(0)); + API_INIT_FUNC(1, "config_string_to_boolean", API_RETURN_INT(0)); text = NULL; if (!PyArg_ParseTuple (args, "s", &text)) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -1283,13 +1244,12 @@ weechat_python_api_config_string_to_boolean (PyObject *self, PyObject *args) API_RETURN_INT(value); } -static PyObject * -weechat_python_api_config_option_reset (PyObject *self, PyObject *args) +API_FUNC(config_option_reset) { char *option; int run_callback, rc; - API_FUNC(1, "config_option_reset", API_RETURN_INT(0)); + API_INIT_FUNC(1, "config_option_reset", API_RETURN_INT(0)); option = NULL; run_callback = 0; if (!PyArg_ParseTuple (args, "si", &option, &run_callback)) @@ -1301,13 +1261,12 @@ weechat_python_api_config_option_reset (PyObject *self, PyObject *args) API_RETURN_INT(rc); } -static PyObject * -weechat_python_api_config_option_set (PyObject *self, PyObject *args) +API_FUNC(config_option_set) { char *option, *new_value; int run_callback, rc; - API_FUNC(1, "config_option_set", API_RETURN_INT(WEECHAT_CONFIG_OPTION_SET_ERROR)); + API_INIT_FUNC(1, "config_option_set", API_RETURN_INT(WEECHAT_CONFIG_OPTION_SET_ERROR)); option = NULL; new_value = NULL; run_callback = 0; @@ -1321,13 +1280,12 @@ weechat_python_api_config_option_set (PyObject *self, PyObject *args) API_RETURN_INT(rc); } -static PyObject * -weechat_python_api_config_option_set_null (PyObject *self, PyObject *args) +API_FUNC(config_option_set_null) { char *option; int run_callback, rc; - API_FUNC(1, "config_option_set_null", API_RETURN_INT(WEECHAT_CONFIG_OPTION_SET_ERROR)); + API_INIT_FUNC(1, "config_option_set_null", API_RETURN_INT(WEECHAT_CONFIG_OPTION_SET_ERROR)); option = NULL; run_callback = 0; if (!PyArg_ParseTuple (args, "si", &option, &run_callback)) @@ -1339,13 +1297,12 @@ weechat_python_api_config_option_set_null (PyObject *self, PyObject *args) API_RETURN_INT(rc); } -static PyObject * -weechat_python_api_config_option_unset (PyObject *self, PyObject *args) +API_FUNC(config_option_unset) { char *option; int rc; - API_FUNC(1, "config_option_unset", API_RETURN_INT(WEECHAT_CONFIG_OPTION_UNSET_ERROR)); + API_INIT_FUNC(1, "config_option_unset", API_RETURN_INT(WEECHAT_CONFIG_OPTION_UNSET_ERROR)); option = NULL; if (!PyArg_ParseTuple (args, "s", &option)) API_WRONG_ARGS(API_RETURN_INT(WEECHAT_CONFIG_OPTION_UNSET_ERROR)); @@ -1355,12 +1312,11 @@ weechat_python_api_config_option_unset (PyObject *self, PyObject *args) API_RETURN_INT(rc); } -static PyObject * -weechat_python_api_config_option_rename (PyObject *self, PyObject *args) +API_FUNC(config_option_rename) { char *option, *new_name; - API_FUNC(1, "config_option_rename", API_RETURN_ERROR); + API_INIT_FUNC(1, "config_option_rename", API_RETURN_ERROR); option = NULL; new_name = NULL; if (!PyArg_ParseTuple (args, "ss", &option, &new_name)) @@ -1372,13 +1328,12 @@ weechat_python_api_config_option_rename (PyObject *self, PyObject *args) API_RETURN_OK; } -static PyObject * -weechat_python_api_config_option_is_null (PyObject *self, PyObject *args) +API_FUNC(config_option_is_null) { char *option; int value; - API_FUNC(1, "config_option_is_null", API_RETURN_INT(1)); + API_INIT_FUNC(1, "config_option_is_null", API_RETURN_INT(1)); option = NULL; if (!PyArg_ParseTuple (args, "s", &option)) API_WRONG_ARGS(API_RETURN_INT(1)); @@ -1388,13 +1343,12 @@ weechat_python_api_config_option_is_null (PyObject *self, PyObject *args) API_RETURN_INT(value); } -static PyObject * -weechat_python_api_config_option_default_is_null (PyObject *self, PyObject *args) +API_FUNC(config_option_default_is_null) { char *option; int value; - API_FUNC(1, "config_option_default_is_null", API_RETURN_INT(1)); + API_INIT_FUNC(1, "config_option_default_is_null", API_RETURN_INT(1)); option = NULL; if (!PyArg_ParseTuple (args, "s", &option)) API_WRONG_ARGS(API_RETURN_INT(1)); @@ -1404,13 +1358,12 @@ weechat_python_api_config_option_default_is_null (PyObject *self, PyObject *args API_RETURN_INT(value); } -static PyObject * -weechat_python_api_config_boolean (PyObject *self, PyObject *args) +API_FUNC(config_boolean) { char *option; int value; - API_FUNC(1, "config_boolean", API_RETURN_INT(0)); + API_INIT_FUNC(1, "config_boolean", API_RETURN_INT(0)); option = NULL; if (!PyArg_ParseTuple (args, "s", &option)) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -1420,13 +1373,12 @@ weechat_python_api_config_boolean (PyObject *self, PyObject *args) API_RETURN_INT(value); } -static PyObject * -weechat_python_api_config_boolean_default (PyObject *self, PyObject *args) +API_FUNC(config_boolean_default) { char *option; int value; - API_FUNC(1, "config_boolean_default", API_RETURN_INT(0)); + API_INIT_FUNC(1, "config_boolean_default", API_RETURN_INT(0)); option = NULL; if (!PyArg_ParseTuple (args, "s", &option)) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -1436,13 +1388,12 @@ weechat_python_api_config_boolean_default (PyObject *self, PyObject *args) API_RETURN_INT(value); } -static PyObject * -weechat_python_api_config_integer (PyObject *self, PyObject *args) +API_FUNC(config_integer) { char *option; int value; - API_FUNC(1, "config_integer", API_RETURN_INT(0)); + API_INIT_FUNC(1, "config_integer", API_RETURN_INT(0)); option = NULL; if (!PyArg_ParseTuple (args, "s", &option)) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -1452,13 +1403,12 @@ weechat_python_api_config_integer (PyObject *self, PyObject *args) API_RETURN_INT(value); } -static PyObject * -weechat_python_api_config_integer_default (PyObject *self, PyObject *args) +API_FUNC(config_integer_default) { char *option; int value; - API_FUNC(1, "config_integer_default", API_RETURN_INT(0)); + API_INIT_FUNC(1, "config_integer_default", API_RETURN_INT(0)); option = NULL; if (!PyArg_ParseTuple (args, "s", &option)) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -1468,13 +1418,12 @@ weechat_python_api_config_integer_default (PyObject *self, PyObject *args) API_RETURN_INT(value); } -static PyObject * -weechat_python_api_config_string (PyObject *self, PyObject *args) +API_FUNC(config_string) { char *option; const char *result; - API_FUNC(1, "config_string", API_RETURN_EMPTY); + API_INIT_FUNC(1, "config_string", API_RETURN_EMPTY); option = NULL; if (!PyArg_ParseTuple (args, "s", &option)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -1484,13 +1433,12 @@ weechat_python_api_config_string (PyObject *self, PyObject *args) API_RETURN_STRING(result); } -static PyObject * -weechat_python_api_config_string_default (PyObject *self, PyObject *args) +API_FUNC(config_string_default) { char *option; const char *result; - API_FUNC(1, "config_string_default", API_RETURN_EMPTY); + API_INIT_FUNC(1, "config_string_default", API_RETURN_EMPTY); option = NULL; if (!PyArg_ParseTuple (args, "s", &option)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -1500,13 +1448,12 @@ weechat_python_api_config_string_default (PyObject *self, PyObject *args) API_RETURN_STRING(result); } -static PyObject * -weechat_python_api_config_color (PyObject *self, PyObject *args) +API_FUNC(config_color) { char *option; const char *result; - API_FUNC(1, "config_color", API_RETURN_INT(0)); + API_INIT_FUNC(1, "config_color", API_RETURN_INT(0)); option = NULL; if (!PyArg_ParseTuple (args, "s", &option)) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -1516,13 +1463,12 @@ weechat_python_api_config_color (PyObject *self, PyObject *args) API_RETURN_STRING(result); } -static PyObject * -weechat_python_api_config_color_default (PyObject *self, PyObject *args) +API_FUNC(config_color_default) { char *option; const char *result; - API_FUNC(1, "config_color_default", API_RETURN_INT(0)); + API_INIT_FUNC(1, "config_color_default", API_RETURN_INT(0)); option = NULL; if (!PyArg_ParseTuple (args, "s", &option)) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -1532,12 +1478,11 @@ weechat_python_api_config_color_default (PyObject *self, PyObject *args) API_RETURN_STRING(result); } -static PyObject * -weechat_python_api_config_write_option (PyObject *self, PyObject *args) +API_FUNC(config_write_option) { char *config_file, *option; - API_FUNC(1, "config_write_option", API_RETURN_ERROR); + API_INIT_FUNC(1, "config_write_option", API_RETURN_ERROR); config_file = NULL; option = NULL; if (!PyArg_ParseTuple (args, "ss", &config_file, &option)) @@ -1549,12 +1494,11 @@ weechat_python_api_config_write_option (PyObject *self, PyObject *args) API_RETURN_OK; } -static PyObject * -weechat_python_api_config_write_line (PyObject *self, PyObject *args) +API_FUNC(config_write_line) { char *config_file, *option_name, *value; - API_FUNC(1, "config_write_line", API_RETURN_ERROR); + API_INIT_FUNC(1, "config_write_line", API_RETURN_ERROR); config_file = NULL; option_name = NULL; value = NULL; @@ -1569,13 +1513,12 @@ weechat_python_api_config_write_line (PyObject *self, PyObject *args) API_RETURN_OK; } -static PyObject * -weechat_python_api_config_write (PyObject *self, PyObject *args) +API_FUNC(config_write) { char *config_file; int rc; - API_FUNC(1, "config_write", API_RETURN_INT(-1)); + API_INIT_FUNC(1, "config_write", API_RETURN_INT(-1)); config_file = NULL; if (!PyArg_ParseTuple (args, "s", &config_file)) API_WRONG_ARGS(API_RETURN_INT(-1)); @@ -1585,13 +1528,12 @@ weechat_python_api_config_write (PyObject *self, PyObject *args) API_RETURN_INT(rc); } -static PyObject * -weechat_python_api_config_read (PyObject *self, PyObject *args) +API_FUNC(config_read) { char *config_file; int rc; - API_FUNC(1, "config_read", API_RETURN_INT(-1)); + API_INIT_FUNC(1, "config_read", API_RETURN_INT(-1)); config_file = NULL; if (!PyArg_ParseTuple (args, "s", &config_file)) API_WRONG_ARGS(API_RETURN_INT(-1)); @@ -1601,13 +1543,12 @@ weechat_python_api_config_read (PyObject *self, PyObject *args) API_RETURN_INT(rc); } -static PyObject * -weechat_python_api_config_reload (PyObject *self, PyObject *args) +API_FUNC(config_reload) { char *config_file; int rc; - API_FUNC(1, "config_reload", API_RETURN_INT(-1)); + API_INIT_FUNC(1, "config_reload", API_RETURN_INT(-1)); config_file = NULL; if (!PyArg_ParseTuple (args, "s", &config_file)) API_WRONG_ARGS(API_RETURN_INT(-1)); @@ -1617,12 +1558,11 @@ weechat_python_api_config_reload (PyObject *self, PyObject *args) API_RETURN_INT(rc); } -static PyObject * -weechat_python_api_config_option_free (PyObject *self, PyObject *args) +API_FUNC(config_option_free) { char *option; - API_FUNC(1, "config_option_free", API_RETURN_ERROR); + API_INIT_FUNC(1, "config_option_free", API_RETURN_ERROR); option = NULL; if (!PyArg_ParseTuple (args, "s", &option)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -1634,12 +1574,11 @@ weechat_python_api_config_option_free (PyObject *self, PyObject *args) API_RETURN_OK; } -static PyObject * -weechat_python_api_config_section_free_options (PyObject *self, PyObject *args) +API_FUNC(config_section_free_options) { char *section; - API_FUNC(1, "config_section_free_options", API_RETURN_ERROR); + API_INIT_FUNC(1, "config_section_free_options", API_RETURN_ERROR); section = NULL; if (!PyArg_ParseTuple (args, "s", §ion)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -1651,12 +1590,11 @@ weechat_python_api_config_section_free_options (PyObject *self, PyObject *args) API_RETURN_OK; } -static PyObject * -weechat_python_api_config_section_free (PyObject *self, PyObject *args) +API_FUNC(config_section_free) { char *section; - API_FUNC(1, "config_section_free", API_RETURN_ERROR); + API_INIT_FUNC(1, "config_section_free", API_RETURN_ERROR); section = NULL; if (!PyArg_ParseTuple (args, "s", §ion)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -1668,12 +1606,11 @@ weechat_python_api_config_section_free (PyObject *self, PyObject *args) API_RETURN_OK; } -static PyObject * -weechat_python_api_config_free (PyObject *self, PyObject *args) +API_FUNC(config_free) { char *config_file; - API_FUNC(1, "config_free", API_RETURN_ERROR); + API_INIT_FUNC(1, "config_free", API_RETURN_ERROR); config_file = NULL; if (!PyArg_ParseTuple (args, "s", &config_file)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -1685,13 +1622,12 @@ weechat_python_api_config_free (PyObject *self, PyObject *args) API_RETURN_OK; } -static PyObject * -weechat_python_api_config_get (PyObject *self, PyObject *args) +API_FUNC(config_get) { char *option, *result; PyObject *return_value; - API_FUNC(1, "config_get", API_RETURN_EMPTY); + API_INIT_FUNC(1, "config_get", API_RETURN_EMPTY); option = NULL; if (!PyArg_ParseTuple (args, "s", &option)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -1701,13 +1637,12 @@ weechat_python_api_config_get (PyObject *self, PyObject *args) API_RETURN_STRING_FREE(result); } -static PyObject * -weechat_python_api_config_get_plugin (PyObject *self, PyObject *args) +API_FUNC(config_get_plugin) { char *option; const char *result; - API_FUNC(1, "config_get_plugin", API_RETURN_EMPTY); + API_INIT_FUNC(1, "config_get_plugin", API_RETURN_EMPTY); option = NULL; if (!PyArg_ParseTuple (args, "s", &option)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -1719,13 +1654,12 @@ weechat_python_api_config_get_plugin (PyObject *self, PyObject *args) API_RETURN_STRING(result); } -static PyObject * -weechat_python_api_config_is_set_plugin (PyObject *self, PyObject *args) +API_FUNC(config_is_set_plugin) { char *option; int rc; - API_FUNC(1, "config_is_set_plugin", API_RETURN_INT(0)); + API_INIT_FUNC(1, "config_is_set_plugin", API_RETURN_INT(0)); option = NULL; if (!PyArg_ParseTuple (args, "s", &option)) API_WRONG_ARGS(API_RETURN_INT(WEECHAT_CONFIG_OPTION_SET_ERROR)); @@ -1737,13 +1671,12 @@ weechat_python_api_config_is_set_plugin (PyObject *self, PyObject *args) API_RETURN_INT(rc); } -static PyObject * -weechat_python_api_config_set_plugin (PyObject *self, PyObject *args) +API_FUNC(config_set_plugin) { char *option, *value; int rc; - API_FUNC(1, "config_set_plugin", API_RETURN_INT(WEECHAT_CONFIG_OPTION_SET_ERROR)); + API_INIT_FUNC(1, "config_set_plugin", API_RETURN_INT(WEECHAT_CONFIG_OPTION_SET_ERROR)); option = NULL; value = NULL; if (!PyArg_ParseTuple (args, "ss", &option, &value)) @@ -1757,12 +1690,11 @@ weechat_python_api_config_set_plugin (PyObject *self, PyObject *args) API_RETURN_INT(rc); } -static PyObject * -weechat_python_api_config_set_desc_plugin (PyObject *self, PyObject *args) +API_FUNC(config_set_desc_plugin) { char *option, *description; - API_FUNC(1, "config_set_desc_plugin", API_RETURN_ERROR); + API_INIT_FUNC(1, "config_set_desc_plugin", API_RETURN_ERROR); option = NULL; description = NULL; if (!PyArg_ParseTuple (args, "ss", &option, &description)) @@ -1776,13 +1708,12 @@ weechat_python_api_config_set_desc_plugin (PyObject *self, PyObject *args) API_RETURN_OK; } -static PyObject * -weechat_python_api_config_unset_plugin (PyObject *self, PyObject *args) +API_FUNC(config_unset_plugin) { char *option; int rc; - API_FUNC(1, "config_unset_plugin", API_RETURN_INT(WEECHAT_CONFIG_OPTION_UNSET_ERROR)); + API_INIT_FUNC(1, "config_unset_plugin", API_RETURN_INT(WEECHAT_CONFIG_OPTION_UNSET_ERROR)); option = NULL; if (!PyArg_ParseTuple (args, "s", &option)) API_WRONG_ARGS(API_RETURN_INT(WEECHAT_CONFIG_OPTION_UNSET_ERROR)); @@ -1794,15 +1725,14 @@ weechat_python_api_config_unset_plugin (PyObject *self, PyObject *args) API_RETURN_INT(rc); } -static PyObject * -weechat_python_api_key_bind (PyObject *self, PyObject *args) +API_FUNC(key_bind) { char *context; struct t_hashtable *hashtable; PyObject *dict; int num_keys; - API_FUNC(1, "key_bind", API_RETURN_INT(0)); + API_INIT_FUNC(1, "key_bind", API_RETURN_INT(0)); context = NULL; dict = NULL; if (!PyArg_ParseTuple (args, "sO", &context, &dict)) @@ -1821,13 +1751,12 @@ weechat_python_api_key_bind (PyObject *self, PyObject *args) API_RETURN_INT(num_keys); } -static PyObject * -weechat_python_api_key_unbind (PyObject *self, PyObject *args) +API_FUNC(key_unbind) { char *context, *key; int num_keys; - API_FUNC(1, "key_unbind", API_RETURN_INT(0)); + API_INIT_FUNC(1, "key_unbind", API_RETURN_INT(0)); context = NULL; key = NULL; if (!PyArg_ParseTuple (args, "ss", &context, &key)) @@ -1838,13 +1767,12 @@ weechat_python_api_key_unbind (PyObject *self, PyObject *args) API_RETURN_INT(num_keys); } -static PyObject * -weechat_python_api_prefix (PyObject *self, PyObject *args) +API_FUNC(prefix) { char *prefix; const char *result; - API_FUNC(0, "prefix", API_RETURN_EMPTY); + API_INIT_FUNC(0, "prefix", API_RETURN_EMPTY); prefix = NULL; if (!PyArg_ParseTuple (args, "s", &prefix)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -1854,13 +1782,12 @@ weechat_python_api_prefix (PyObject *self, PyObject *args) API_RETURN_STRING(result); } -static PyObject * -weechat_python_api_color (PyObject *self, PyObject *args) +API_FUNC(color) { char *color; const char *result; - API_FUNC(0, "color", API_RETURN_EMPTY); + API_INIT_FUNC(0, "color", API_RETURN_EMPTY); color = NULL; if (!PyArg_ParseTuple (args, "s", &color)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -1870,12 +1797,11 @@ weechat_python_api_color (PyObject *self, PyObject *args) API_RETURN_STRING(result); } -static PyObject * -weechat_python_api_prnt (PyObject *self, PyObject *args) +API_FUNC(prnt) { char *buffer, *message; - API_FUNC(0, "prnt", API_RETURN_ERROR); + API_INIT_FUNC(0, "prnt", API_RETURN_ERROR); buffer = NULL; message = NULL; if (!PyArg_ParseTuple (args, "ss", &buffer, &message)) @@ -1889,13 +1815,12 @@ weechat_python_api_prnt (PyObject *self, PyObject *args) API_RETURN_OK; } -static PyObject * -weechat_python_api_prnt_date_tags (PyObject *self, PyObject *args) +API_FUNC(prnt_date_tags) { char *buffer, *tags, *message; int date; - API_FUNC(1, "prnt_date_tags", API_RETURN_ERROR); + API_INIT_FUNC(1, "prnt_date_tags", API_RETURN_ERROR); buffer = NULL; date = 0; tags = NULL; @@ -1913,13 +1838,12 @@ weechat_python_api_prnt_date_tags (PyObject *self, PyObject *args) API_RETURN_OK; } -static PyObject * -weechat_python_api_prnt_y (PyObject *self, PyObject *args) +API_FUNC(prnt_y) { char *buffer, *message; int y; - API_FUNC(1, "prnt_y", API_RETURN_ERROR); + API_INIT_FUNC(1, "prnt_y", API_RETURN_ERROR); buffer = NULL; y = 0; message = NULL; @@ -1935,12 +1859,11 @@ weechat_python_api_prnt_y (PyObject *self, PyObject *args) API_RETURN_OK; } -static PyObject * -weechat_python_api_log_print (PyObject *self, PyObject *args) +API_FUNC(log_print) { char *message; - API_FUNC(1, "log_print", API_RETURN_ERROR); + API_INIT_FUNC(1, "log_print", API_RETURN_ERROR); message = NULL; if (!PyArg_ParseTuple (args, "s", &message)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -1993,14 +1916,13 @@ weechat_python_api_hook_command_cb (void *data, struct t_gui_buffer *buffer, return WEECHAT_RC_ERROR; } -static PyObject * -weechat_python_api_hook_command (PyObject *self, PyObject *args) +API_FUNC(hook_command) { char *command, *description, *arguments, *args_description, *completion; char *function, *data, *result; PyObject *return_value; - API_FUNC(1, "hook_command", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_command", API_RETURN_EMPTY); command = NULL; description = NULL; arguments = NULL; @@ -2064,13 +1986,12 @@ weechat_python_api_hook_command_run_cb (void *data, struct t_gui_buffer *buffer, return WEECHAT_RC_ERROR; } -static PyObject * -weechat_python_api_hook_command_run (PyObject *self, PyObject *args) +API_FUNC(hook_command_run) { char *command, *function, *data, *result; PyObject *return_value; - API_FUNC(1, "hook_command_run", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_command_run", API_RETURN_EMPTY); command = NULL; function = NULL; data = NULL; @@ -2124,14 +2045,13 @@ weechat_python_api_hook_timer_cb (void *data, int remaining_calls) return WEECHAT_RC_ERROR; } -static PyObject * -weechat_python_api_hook_timer (PyObject *self, PyObject *args) +API_FUNC(hook_timer) { int interval, align_second, max_calls; char *function, *data, *result; PyObject *return_value; - API_FUNC(1, "hook_timer", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_timer", API_RETURN_EMPTY); interval = 10; align_second = 0; max_calls = 0; @@ -2189,14 +2109,13 @@ weechat_python_api_hook_fd_cb (void *data, int fd) return WEECHAT_RC_ERROR; } -static PyObject * -weechat_python_api_hook_fd (PyObject *self, PyObject *args) +API_FUNC(hook_fd) { int fd, read, write, exception; char *function, *data, *result; PyObject *return_value; - API_FUNC(1, "hook_fd", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_fd", API_RETURN_EMPTY); fd = 0; read = 0; write = 0; @@ -2263,14 +2182,13 @@ weechat_python_api_hook_process_cb (void *data, return WEECHAT_RC_ERROR; } -static PyObject * -weechat_python_api_hook_process (PyObject *self, PyObject *args) +API_FUNC(hook_process) { char *command, *function, *data, *result; int timeout; PyObject *return_value; - API_FUNC(1, "hook_process", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_process", API_RETURN_EMPTY); command = NULL; timeout = 0; function = NULL; @@ -2289,15 +2207,14 @@ weechat_python_api_hook_process (PyObject *self, PyObject *args) API_RETURN_STRING_FREE(result); } -static PyObject * -weechat_python_api_hook_process_hashtable (PyObject *self, PyObject *args) +API_FUNC(hook_process_hashtable) { char *command, *function, *data, *result; int timeout; struct t_hashtable *options; PyObject *dict, *return_value; - API_FUNC(1, "hook_process_hashtable", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_process_hashtable", API_RETURN_EMPTY); command = NULL; dict = NULL; options = NULL; @@ -2371,14 +2288,13 @@ weechat_python_api_hook_connect_cb (void *data, int status, int gnutls_rc, return WEECHAT_RC_ERROR; } -static PyObject * -weechat_python_api_hook_connect (PyObject *self, PyObject *args) +API_FUNC(hook_connect) { char *proxy, *address, *local_hostname, *function, *data, *result; int port, ipv6, retry; PyObject *return_value; - API_FUNC(1, "hook_connect", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_connect", API_RETURN_EMPTY); proxy = NULL; address = NULL; port = 0; @@ -2474,14 +2390,13 @@ weechat_python_api_hook_print_cb (void *data, struct t_gui_buffer *buffer, return WEECHAT_RC_ERROR; } -static PyObject * -weechat_python_api_hook_print (PyObject *self, PyObject *args) +API_FUNC(hook_print) { char *buffer, *tags, *message, *function, *data, *result; int strip_colors; PyObject *return_value; - API_FUNC(1, "hook_print", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_print", API_RETURN_EMPTY); buffer = NULL; tags = NULL; message = NULL; @@ -2565,13 +2480,12 @@ weechat_python_api_hook_signal_cb (void *data, const char *signal, const char *t return WEECHAT_RC_ERROR; } -static PyObject * -weechat_python_api_hook_signal (PyObject *self, PyObject *args) +API_FUNC(hook_signal) { char *signal, *function, *data, *result; PyObject *return_value; - API_FUNC(1, "hook_signal", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_signal", API_RETURN_EMPTY); signal = NULL; function = NULL; data = NULL; @@ -2588,13 +2502,12 @@ weechat_python_api_hook_signal (PyObject *self, PyObject *args) API_RETURN_STRING_FREE(result); } -static PyObject * -weechat_python_api_hook_signal_send (PyObject *self, PyObject *args) +API_FUNC(hook_signal_send) { char *signal, *type_data, *signal_data, *error; int number, rc; - API_FUNC(1, "hook_signal_send", API_RETURN_INT(WEECHAT_RC_ERROR)); + API_INIT_FUNC(1, "hook_signal_send", API_RETURN_INT(WEECHAT_RC_ERROR)); signal = NULL; type_data = NULL; signal_data = NULL; @@ -2666,13 +2579,12 @@ weechat_python_api_hook_hsignal_cb (void *data, const char *signal, return WEECHAT_RC_ERROR; } -static PyObject * -weechat_python_api_hook_hsignal (PyObject *self, PyObject *args) +API_FUNC(hook_hsignal) { char *signal, *function, *data, *result; PyObject *return_value; - API_FUNC(1, "hook_hsignal", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_hsignal", API_RETURN_EMPTY); signal = NULL; function = NULL; data = NULL; @@ -2689,15 +2601,14 @@ weechat_python_api_hook_hsignal (PyObject *self, PyObject *args) API_RETURN_STRING_FREE(result); } -static PyObject * -weechat_python_api_hook_hsignal_send (PyObject *self, PyObject *args) +API_FUNC(hook_hsignal_send) { char *signal; struct t_hashtable *hashtable; PyObject *dict; int rc; - API_FUNC(1, "hook_hsignal_send", API_RETURN_INT(WEECHAT_RC_ERROR)); + API_INIT_FUNC(1, "hook_hsignal_send", API_RETURN_INT(WEECHAT_RC_ERROR)); signal = NULL; dict = NULL; if (!PyArg_ParseTuple (args, "sO", &signal, &dict)) @@ -2751,13 +2662,12 @@ weechat_python_api_hook_config_cb (void *data, const char *option, const char *v return WEECHAT_RC_ERROR; } -static PyObject * -weechat_python_api_hook_config (PyObject *self, PyObject *args) +API_FUNC(hook_config) { char *option, *function, *data, *result; PyObject *return_value; - API_FUNC(1, "hook_config", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_config", API_RETURN_EMPTY); option = NULL; function = NULL; data = NULL; @@ -2816,13 +2726,12 @@ weechat_python_api_hook_completion_cb (void *data, const char *completion_item, return WEECHAT_RC_ERROR; } -static PyObject * -weechat_python_api_hook_completion (PyObject *self, PyObject *args) +API_FUNC(hook_completion) { char *completion, *description, *function, *data, *result; PyObject *return_value; - API_FUNC(1, "hook_completion", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_completion", API_RETURN_EMPTY); completion = NULL; description = NULL; function = NULL; @@ -2842,13 +2751,12 @@ weechat_python_api_hook_completion (PyObject *self, PyObject *args) API_RETURN_STRING_FREE(result); } -static PyObject * -weechat_python_api_hook_completion_list_add (PyObject *self, PyObject *args) +API_FUNC(hook_completion_list_add) { char *completion, *word, *where; int nick_completion; - API_FUNC(1, "hook_completion_list_add", API_RETURN_ERROR); + API_INIT_FUNC(1, "hook_completion_list_add", API_RETURN_ERROR); completion = NULL; word = NULL; nick_completion = 0; @@ -2891,13 +2799,12 @@ weechat_python_api_hook_modifier_cb (void *data, const char *modifier, return NULL; } -static PyObject * -weechat_python_api_hook_modifier (PyObject *self, PyObject *args) +API_FUNC(hook_modifier) { char *modifier, *function, *data, *result; PyObject *return_value; - API_FUNC(1, "hook_modifier", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_modifier", API_RETURN_EMPTY); modifier = NULL; function = NULL; data = NULL; @@ -2914,13 +2821,12 @@ weechat_python_api_hook_modifier (PyObject *self, PyObject *args) API_RETURN_STRING_FREE(result); } -static PyObject * -weechat_python_api_hook_modifier_exec (PyObject *self, PyObject *args) +API_FUNC(hook_modifier_exec) { char *modifier, *modifier_data, *string, *result; PyObject *return_value; - API_FUNC(1, "hook_modifier_exec", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_modifier_exec", API_RETURN_EMPTY); modifier = NULL; modifier_data = NULL; string = NULL; @@ -2957,13 +2863,12 @@ weechat_python_api_hook_info_cb (void *data, const char *info_name, return NULL; } -static PyObject * -weechat_python_api_hook_info (PyObject *self, PyObject *args) +API_FUNC(hook_info) { char *info_name, *description, *args_description, *function, *data, *result; PyObject *return_value; - API_FUNC(1, "hook_info", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_info", API_RETURN_EMPTY); info_name = NULL; description = NULL; args_description = NULL; @@ -3018,14 +2923,13 @@ weechat_python_api_hook_info_hashtable_cb (void *data, const char *info_name, return NULL; } -static PyObject * -weechat_python_api_hook_info_hashtable (PyObject *self, PyObject *args) +API_FUNC(hook_info_hashtable) { char *info_name, *description, *args_description, *output_description; char *function, *data, *result; PyObject *return_value; - API_FUNC(1, "hook_info_hashtable", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_info_hashtable", API_RETURN_EMPTY); info_name = NULL; description = NULL; args_description = NULL; @@ -3082,14 +2986,13 @@ weechat_python_api_hook_infolist_cb (void *data, const char *infolist_name, return NULL; } -static PyObject * -weechat_python_api_hook_infolist (PyObject *self, PyObject *args) +API_FUNC(hook_infolist) { char *infolist_name, *description, *pointer_description, *args_description; char *function, *data, *result; PyObject *return_value; - API_FUNC(1, "hook_infolist", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_infolist", API_RETURN_EMPTY); infolist_name = NULL; description = NULL; pointer_description = NULL; @@ -3145,13 +3048,12 @@ weechat_python_api_hook_focus_cb (void *data, return NULL; } -static PyObject * -weechat_python_api_hook_focus (PyObject *self, PyObject *args) +API_FUNC(hook_focus) { char *area, *function, *data, *result; PyObject *return_value; - API_FUNC(1, "hook_focus", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_focus", API_RETURN_EMPTY); area = NULL; function = NULL; data = NULL; @@ -3168,12 +3070,11 @@ weechat_python_api_hook_focus (PyObject *self, PyObject *args) API_RETURN_STRING_FREE(result); } -static PyObject * -weechat_python_api_hook_set (PyObject *self, PyObject *args) +API_FUNC(hook_set) { char *hook, *property, *value; - API_FUNC(1, "hook_set", API_RETURN_ERROR); + API_INIT_FUNC(1, "hook_set", API_RETURN_ERROR); hook = NULL; property = NULL; value = NULL; @@ -3187,12 +3088,11 @@ weechat_python_api_hook_set (PyObject *self, PyObject *args) API_RETURN_OK; } -static PyObject * -weechat_python_api_unhook (PyObject *self, PyObject *args) +API_FUNC(unhook) { char *hook; - API_FUNC(1, "unhook", API_RETURN_ERROR); + API_INIT_FUNC(1, "unhook", API_RETURN_ERROR); hook = NULL; if (!PyArg_ParseTuple (args, "s", &hook)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -3204,13 +3104,12 @@ weechat_python_api_unhook (PyObject *self, PyObject *args) API_RETURN_OK; } -static PyObject * -weechat_python_api_unhook_all (PyObject *self, PyObject *args) +API_FUNC(unhook_all) { /* make C compiler happy */ (void) args; - API_FUNC(1, "unhook_all", API_RETURN_ERROR); + API_INIT_FUNC(1, "unhook_all", API_RETURN_ERROR); plugin_script_api_unhook_all (weechat_python_plugin, python_current_script); @@ -3289,14 +3188,13 @@ weechat_python_api_buffer_close_cb (void *data, struct t_gui_buffer *buffer) return WEECHAT_RC_ERROR; } -static PyObject * -weechat_python_api_buffer_new (PyObject *self, PyObject *args) +API_FUNC(buffer_new) { char *name, *function_input, *data_input, *function_close, *data_close; char *result; PyObject *return_value; - API_FUNC(1, "buffer_new", API_RETURN_EMPTY); + API_INIT_FUNC(1, "buffer_new", API_RETURN_EMPTY); name = NULL; function_input = NULL; data_input = NULL; @@ -3319,14 +3217,13 @@ weechat_python_api_buffer_new (PyObject *self, PyObject *args) API_RETURN_STRING_FREE(result); } -static PyObject * -weechat_python_api_buffer_search (PyObject *self, PyObject *args) +API_FUNC(buffer_search) { char *plugin, *name; char *result; PyObject *return_value; - API_FUNC(1, "buffer_search", API_RETURN_EMPTY); + API_INIT_FUNC(1, "buffer_search", API_RETURN_EMPTY); plugin = NULL; name = NULL; if (!PyArg_ParseTuple (args, "ss", &plugin, &name)) @@ -3337,8 +3234,7 @@ weechat_python_api_buffer_search (PyObject *self, PyObject *args) API_RETURN_STRING_FREE(result); } -static PyObject * -weechat_python_api_buffer_search_main (PyObject *self, PyObject *args) +API_FUNC(buffer_search_main) { char *result; PyObject *return_value; @@ -3346,15 +3242,14 @@ weechat_python_api_buffer_search_main (PyObject *self, PyObject *args) /* make C compiler happy */ (void) args; - API_FUNC(1, "buffer_search_main", API_RETURN_EMPTY); + API_INIT_FUNC(1, "buffer_search_main", API_RETURN_EMPTY); result = API_PTR2STR(weechat_buffer_search_main ()); API_RETURN_STRING_FREE(result); } -static PyObject * -weechat_python_api_current_buffer (PyObject *self, PyObject *args) +API_FUNC(current_buffer) { char *result; PyObject *return_value; @@ -3362,19 +3257,18 @@ weechat_python_api_current_buffer (PyObject *self, PyObject *args) /* make C compiler happy */ (void) args; - API_FUNC(1, "current_buffer", API_RETURN_EMPTY); + API_INIT_FUNC(1, "current_buffer", API_RETURN_EMPTY); result = API_PTR2STR(weechat_current_buffer ()); API_RETURN_STRING_FREE(result); } -static PyObject * -weechat_python_api_buffer_clear (PyObject *self, PyObject *args) +API_FUNC(buffer_clear) { char *buffer; - API_FUNC(1, "buffer_clear", API_RETURN_ERROR); + API_INIT_FUNC(1, "buffer_clear", API_RETURN_ERROR); buffer = NULL; if (!PyArg_ParseTuple (args, "s", &buffer)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -3384,12 +3278,11 @@ weechat_python_api_buffer_clear (PyObject *self, PyObject *args) API_RETURN_OK; } -static PyObject * -weechat_python_api_buffer_close (PyObject *self, PyObject *args) +API_FUNC(buffer_close) { char *buffer; - API_FUNC(1, "buffer_close", API_RETURN_ERROR); + API_INIT_FUNC(1, "buffer_close", API_RETURN_ERROR); buffer = NULL; if (!PyArg_ParseTuple (args, "s", &buffer)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -3401,12 +3294,11 @@ weechat_python_api_buffer_close (PyObject *self, PyObject *args) API_RETURN_OK; } -static PyObject * -weechat_python_api_buffer_merge (PyObject *self, PyObject *args) +API_FUNC(buffer_merge) { char *buffer, *target_buffer; - API_FUNC(1, "buffer_merge", API_RETURN_ERROR); + API_INIT_FUNC(1, "buffer_merge", API_RETURN_ERROR); buffer = NULL; target_buffer = NULL; if (!PyArg_ParseTuple (args, "ss", &buffer, &target_buffer)) @@ -3418,13 +3310,12 @@ weechat_python_api_buffer_merge (PyObject *self, PyObject *args) API_RETURN_OK; } -static PyObject * -weechat_python_api_buffer_unmerge (PyObject *self, PyObject *args) +API_FUNC(buffer_unmerge) { char *buffer; int number; - API_FUNC(1, "buffer_unmerge", API_RETURN_ERROR); + API_INIT_FUNC(1, "buffer_unmerge", API_RETURN_ERROR); buffer = NULL; number = 0; if (!PyArg_ParseTuple (args, "si", &buffer, &number)) @@ -3435,13 +3326,12 @@ weechat_python_api_buffer_unmerge (PyObject *self, PyObject *args) API_RETURN_OK; } -static PyObject * -weechat_python_api_buffer_get_integer (PyObject *self, PyObject *args) +API_FUNC(buffer_get_integer) { char *buffer, *property; int value; - API_FUNC(1, "buffer_get_integer", API_RETURN_INT(-1)); + API_INIT_FUNC(1, "buffer_get_integer", API_RETURN_INT(-1)); buffer = NULL; property = NULL; if (!PyArg_ParseTuple (args, "ss", &buffer, &property)) @@ -3452,13 +3342,12 @@ weechat_python_api_buffer_get_integer (PyObject *self, PyObject *args) API_RETURN_INT(value); } -static PyObject * -weechat_python_api_buffer_get_string (PyObject *self, PyObject *args) +API_FUNC(buffer_get_string) { char *buffer, *property; const char *result; - API_FUNC(1, "buffer_get_string", API_RETURN_ERROR); + API_INIT_FUNC(1, "buffer_get_string", API_RETURN_ERROR); buffer = NULL; property = NULL; if (!PyArg_ParseTuple (args, "ss", &buffer, &property)) @@ -3469,13 +3358,12 @@ weechat_python_api_buffer_get_string (PyObject *self, PyObject *args) API_RETURN_STRING(result); } -static PyObject * -weechat_python_api_buffer_get_pointer (PyObject *self, PyObject *args) +API_FUNC(buffer_get_pointer) { char *buffer, *property, *result; PyObject *return_value; - API_FUNC(1, "buffer_get_pointer", API_RETURN_EMPTY); + API_INIT_FUNC(1, "buffer_get_pointer", API_RETURN_EMPTY); buffer = NULL; property = NULL; if (!PyArg_ParseTuple (args, "ss", &buffer, &property)) @@ -3487,12 +3375,11 @@ weechat_python_api_buffer_get_pointer (PyObject *self, PyObject *args) API_RETURN_STRING_FREE(result); } -static PyObject * -weechat_python_api_buffer_set (PyObject *self, PyObject *args) +API_FUNC(buffer_set) { char *buffer, *property, *value; - API_FUNC(1, "buffer_set", API_RETURN_ERROR); + API_INIT_FUNC(1, "buffer_set", API_RETURN_ERROR); buffer = NULL; property = NULL; value = NULL; @@ -3506,13 +3393,12 @@ weechat_python_api_buffer_set (PyObject *self, PyObject *args) API_RETURN_OK; } -static PyObject * -weechat_python_api_buffer_string_replace_local_var (PyObject *self, PyObject *args) +API_FUNC(buffer_string_replace_local_var) { char *buffer, *string, *result; PyObject *return_value; - API_FUNC(1, "buffer_string_replace_local_var", API_RETURN_ERROR); + API_INIT_FUNC(1, "buffer_string_replace_local_var", API_RETURN_ERROR); buffer = NULL; string = NULL; if (!PyArg_ParseTuple (args, "ss", &buffer, &string)) @@ -3523,13 +3409,12 @@ weechat_python_api_buffer_string_replace_local_var (PyObject *self, PyObject *ar API_RETURN_STRING_FREE(result); } -static PyObject * -weechat_python_api_buffer_match_list (PyObject *self, PyObject *args) +API_FUNC(buffer_match_list) { char *buffer, *string; int value; - API_FUNC(1, "buffer_match_list", API_RETURN_INT(0)); + API_INIT_FUNC(1, "buffer_match_list", API_RETURN_INT(0)); buffer = NULL; string = NULL; if (!PyArg_ParseTuple (args, "ss", &buffer, &string)) @@ -3540,8 +3425,7 @@ weechat_python_api_buffer_match_list (PyObject *self, PyObject *args) API_RETURN_INT(value); } -static PyObject * -weechat_python_api_current_window (PyObject *self, PyObject *args) +API_FUNC(current_window) { char *result; PyObject *return_value; @@ -3549,20 +3433,19 @@ weechat_python_api_current_window (PyObject *self, PyObject *args) /* make C compiler happy */ (void) args; - API_FUNC(1, "current_window", API_RETURN_EMPTY); + API_INIT_FUNC(1, "current_window", API_RETURN_EMPTY); result = API_PTR2STR(weechat_current_window ()); API_RETURN_STRING_FREE(result); } -static PyObject * -weechat_python_api_window_search_with_buffer (PyObject *self, PyObject *args) +API_FUNC(window_search_with_buffer) { char *buffer, *result; PyObject *return_value; - API_FUNC(1, "window_search_with_buffer", API_RETURN_EMPTY); + API_INIT_FUNC(1, "window_search_with_buffer", API_RETURN_EMPTY); buffer = NULL; if (!PyArg_ParseTuple (args, "s", &buffer)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3572,13 +3455,12 @@ weechat_python_api_window_search_with_buffer (PyObject *self, PyObject *args) API_RETURN_STRING_FREE(result); } -static PyObject * -weechat_python_api_window_get_integer (PyObject *self, PyObject *args) +API_FUNC(window_get_integer) { char *window, *property; int value; - API_FUNC(1, "window_get_integer", API_RETURN_INT(-1)); + API_INIT_FUNC(1, "window_get_integer", API_RETURN_INT(-1)); window = NULL; property = NULL; if (!PyArg_ParseTuple (args, "ss", &window, &property)) @@ -3589,13 +3471,12 @@ weechat_python_api_window_get_integer (PyObject *self, PyObject *args) API_RETURN_INT(value); } -static PyObject * -weechat_python_api_window_get_string (PyObject *self, PyObject *args) +API_FUNC(window_get_string) { char *window, *property; const char *result; - API_FUNC(1, "window_get_string", API_RETURN_EMPTY); + API_INIT_FUNC(1, "window_get_string", API_RETURN_EMPTY); window = NULL; property = NULL; if (!PyArg_ParseTuple (args, "ss", &window, &property)) @@ -3606,13 +3487,12 @@ weechat_python_api_window_get_string (PyObject *self, PyObject *args) API_RETURN_STRING(result); } -static PyObject * -weechat_python_api_window_get_pointer (PyObject *self, PyObject *args) +API_FUNC(window_get_pointer) { char *window, *property, *result; PyObject *return_value; - API_FUNC(1, "window_get_pointer", API_RETURN_EMPTY); + API_INIT_FUNC(1, "window_get_pointer", API_RETURN_EMPTY); window = NULL; property = NULL; if (!PyArg_ParseTuple (args, "ss", &window, &property)) @@ -3624,12 +3504,11 @@ weechat_python_api_window_get_pointer (PyObject *self, PyObject *args) API_RETURN_STRING_FREE(result); } -static PyObject * -weechat_python_api_window_set_title (PyObject *self, PyObject *args) +API_FUNC(window_set_title) { char *title; - API_FUNC(1, "window_set_title", API_RETURN_ERROR); + API_INIT_FUNC(1, "window_set_title", API_RETURN_ERROR); title = NULL; if (!PyArg_ParseTuple (args, "s", &title)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -3639,14 +3518,13 @@ weechat_python_api_window_set_title (PyObject *self, PyObject *args) API_RETURN_OK; } -static PyObject * -weechat_python_api_nicklist_add_group (PyObject *self, PyObject *args) +API_FUNC(nicklist_add_group) { char *buffer, *parent_group, *name, *color, *result; int visible; PyObject *return_value; - API_FUNC(1, "nicklist_add_group", API_RETURN_EMPTY); + API_INIT_FUNC(1, "nicklist_add_group", API_RETURN_EMPTY); buffer = NULL; parent_group = NULL; name = NULL; @@ -3665,13 +3543,12 @@ weechat_python_api_nicklist_add_group (PyObject *self, PyObject *args) API_RETURN_STRING_FREE(result); } -static PyObject * -weechat_python_api_nicklist_search_group (PyObject *self, PyObject *args) +API_FUNC(nicklist_search_group) { char *buffer, *from_group, *name, *result; PyObject *return_value; - API_FUNC(1, "nicklist_search_group", API_RETURN_EMPTY); + API_INIT_FUNC(1, "nicklist_search_group", API_RETURN_EMPTY); buffer = NULL; from_group = NULL; name = NULL; @@ -3685,14 +3562,13 @@ weechat_python_api_nicklist_search_group (PyObject *self, PyObject *args) API_RETURN_STRING_FREE(result); } -static PyObject * -weechat_python_api_nicklist_add_nick (PyObject *self, PyObject *args) +API_FUNC(nicklist_add_nick) { char *buffer, *group, *name, *color, *prefix, *prefix_color, *result; int visible; PyObject *return_value; - API_FUNC(1, "nicklist_add_nick", API_RETURN_EMPTY); + API_INIT_FUNC(1, "nicklist_add_nick", API_RETURN_EMPTY); buffer = NULL; group = NULL; name = NULL; @@ -3715,13 +3591,12 @@ weechat_python_api_nicklist_add_nick (PyObject *self, PyObject *args) API_RETURN_STRING_FREE(result); } -static PyObject * -weechat_python_api_nicklist_search_nick (PyObject *self, PyObject *args) +API_FUNC(nicklist_search_nick) { char *buffer, *from_group, *name, *result; PyObject *return_value; - API_FUNC(1, "nicklist_search_nick", API_RETURN_EMPTY); + API_INIT_FUNC(1, "nicklist_search_nick", API_RETURN_EMPTY); buffer = NULL; from_group = NULL; name = NULL; @@ -3735,12 +3610,11 @@ weechat_python_api_nicklist_search_nick (PyObject *self, PyObject *args) API_RETURN_STRING_FREE(result); } -static PyObject * -weechat_python_api_nicklist_remove_group (PyObject *self, PyObject *args) +API_FUNC(nicklist_remove_group) { char *buffer, *group; - API_FUNC(1, "nicklist_remove_group", API_RETURN_ERROR); + API_INIT_FUNC(1, "nicklist_remove_group", API_RETURN_ERROR); buffer = NULL; group = NULL; if (!PyArg_ParseTuple (args, "ss", &buffer, &group)) @@ -3752,12 +3626,11 @@ weechat_python_api_nicklist_remove_group (PyObject *self, PyObject *args) API_RETURN_OK; } -static PyObject * -weechat_python_api_nicklist_remove_nick (PyObject *self, PyObject *args) +API_FUNC(nicklist_remove_nick) { char *buffer, *nick; - API_FUNC(1, "nicklist_remove_nick", API_RETURN_ERROR); + API_INIT_FUNC(1, "nicklist_remove_nick", API_RETURN_ERROR); buffer = NULL; nick = NULL; if (!PyArg_ParseTuple (args, "ss", &buffer, &nick)) @@ -3769,12 +3642,11 @@ weechat_python_api_nicklist_remove_nick (PyObject *self, PyObject *args) API_RETURN_OK; } -static PyObject * -weechat_python_api_nicklist_remove_all (PyObject *self, PyObject *args) +API_FUNC(nicklist_remove_all) { char *buffer; - API_FUNC(1, "nicklist_remove_all", API_RETURN_ERROR); + API_INIT_FUNC(1, "nicklist_remove_all", API_RETURN_ERROR); buffer = NULL; if (!PyArg_ParseTuple (args, "s", &buffer)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -3784,13 +3656,12 @@ weechat_python_api_nicklist_remove_all (PyObject *self, PyObject *args) API_RETURN_OK; } -static PyObject * -weechat_python_api_nicklist_group_get_integer (PyObject *self, PyObject *args) +API_FUNC(nicklist_group_get_integer) { char *buffer, *group, *property; int value; - API_FUNC(1, "nicklist_group_get_integer", API_RETURN_INT(-1)); + API_INIT_FUNC(1, "nicklist_group_get_integer", API_RETURN_INT(-1)); buffer = NULL; group = NULL; property = NULL; @@ -3804,13 +3675,12 @@ weechat_python_api_nicklist_group_get_integer (PyObject *self, PyObject *args) API_RETURN_INT(value); } -static PyObject * -weechat_python_api_nicklist_group_get_string (PyObject *self, PyObject *args) +API_FUNC(nicklist_group_get_string) { char *buffer, *group, *property; const char *result; - API_FUNC(1, "nicklist_group_get_string", API_RETURN_ERROR); + API_INIT_FUNC(1, "nicklist_group_get_string", API_RETURN_ERROR); buffer = NULL; group = NULL; property = NULL; @@ -3824,13 +3694,12 @@ weechat_python_api_nicklist_group_get_string (PyObject *self, PyObject *args) API_RETURN_STRING(result); } -static PyObject * -weechat_python_api_nicklist_group_get_pointer (PyObject *self, PyObject *args) +API_FUNC(nicklist_group_get_pointer) { char *buffer, *group, *property, *result; PyObject *return_value; - API_FUNC(1, "nicklist_group_get_pointer", API_RETURN_EMPTY); + API_INIT_FUNC(1, "nicklist_group_get_pointer", API_RETURN_EMPTY); buffer = NULL; group = NULL; property = NULL; @@ -3844,12 +3713,11 @@ weechat_python_api_nicklist_group_get_pointer (PyObject *self, PyObject *args) API_RETURN_STRING_FREE(result); } -static PyObject * -weechat_python_api_nicklist_group_set (PyObject *self, PyObject *args) +API_FUNC(nicklist_group_set) { char *buffer, *group, *property, *value; - API_FUNC(1, "nicklist_group_set", API_RETURN_ERROR); + API_INIT_FUNC(1, "nicklist_group_set", API_RETURN_ERROR); buffer = NULL; group = NULL; property = NULL; @@ -3865,13 +3733,12 @@ weechat_python_api_nicklist_group_set (PyObject *self, PyObject *args) API_RETURN_OK; } -static PyObject * -weechat_python_api_nicklist_nick_get_integer (PyObject *self, PyObject *args) +API_FUNC(nicklist_nick_get_integer) { char *buffer, *nick, *property; int value; - API_FUNC(1, "nicklist_nick_get_integer", API_RETURN_INT(-1)); + API_INIT_FUNC(1, "nicklist_nick_get_integer", API_RETURN_INT(-1)); buffer = NULL; nick = NULL; property = NULL; @@ -3885,13 +3752,12 @@ weechat_python_api_nicklist_nick_get_integer (PyObject *self, PyObject *args) API_RETURN_INT(value); } -static PyObject * -weechat_python_api_nicklist_nick_get_string (PyObject *self, PyObject *args) +API_FUNC(nicklist_nick_get_string) { char *buffer, *nick, *property; const char *result; - API_FUNC(1, "nicklist_nick_get_string", API_RETURN_ERROR); + API_INIT_FUNC(1, "nicklist_nick_get_string", API_RETURN_ERROR); buffer = NULL; nick = NULL; property = NULL; @@ -3905,13 +3771,12 @@ weechat_python_api_nicklist_nick_get_string (PyObject *self, PyObject *args) API_RETURN_STRING(result); } -static PyObject * -weechat_python_api_nicklist_nick_get_pointer (PyObject *self, PyObject *args) +API_FUNC(nicklist_nick_get_pointer) { char *buffer, *nick, *property, *result; PyObject *return_value; - API_FUNC(1, "nicklist_nick_get_pointer", API_RETURN_EMPTY); + API_INIT_FUNC(1, "nicklist_nick_get_pointer", API_RETURN_EMPTY); buffer = NULL; nick = NULL; property = NULL; @@ -3925,12 +3790,11 @@ weechat_python_api_nicklist_nick_get_pointer (PyObject *self, PyObject *args) API_RETURN_STRING_FREE(result); } -static PyObject * -weechat_python_api_nicklist_nick_set (PyObject *self, PyObject *args) +API_FUNC(nicklist_nick_set) { char *buffer, *nick, *property, *value; - API_FUNC(1, "nicklist_nick_set", API_RETURN_ERROR); + API_INIT_FUNC(1, "nicklist_nick_set", API_RETURN_ERROR); buffer = NULL; nick = NULL; property = NULL; @@ -3946,13 +3810,12 @@ weechat_python_api_nicklist_nick_set (PyObject *self, PyObject *args) API_RETURN_OK; } -static PyObject * -weechat_python_api_bar_item_search (PyObject *self, PyObject *args) +API_FUNC(bar_item_search) { char *name, *result; PyObject *return_value; - API_FUNC(1, "bar_item_search", API_RETURN_EMPTY); + API_INIT_FUNC(1, "bar_item_search", API_RETURN_EMPTY); name = NULL; if (!PyArg_ParseTuple (args, "s", &name)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4025,13 +3888,12 @@ weechat_python_api_bar_item_build_cb (void *data, struct t_gui_bar_item *item, return NULL; } -static PyObject * -weechat_python_api_bar_item_new (PyObject *self, PyObject *args) +API_FUNC(bar_item_new) { char *name, *function, *data, *result; PyObject *return_value; - API_FUNC(1, "bar_item_new", API_RETURN_EMPTY); + API_INIT_FUNC(1, "bar_item_new", API_RETURN_EMPTY); name = NULL; function = NULL; data = NULL; @@ -4048,12 +3910,11 @@ weechat_python_api_bar_item_new (PyObject *self, PyObject *args) API_RETURN_STRING_FREE(result); } -static PyObject * -weechat_python_api_bar_item_update (PyObject *self, PyObject *args) +API_FUNC(bar_item_update) { char *name; - API_FUNC(1, "bar_item_update", API_RETURN_ERROR); + API_INIT_FUNC(1, "bar_item_update", API_RETURN_ERROR); name = NULL; if (!PyArg_ParseTuple (args, "s", &name)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -4063,12 +3924,11 @@ weechat_python_api_bar_item_update (PyObject *self, PyObject *args) API_RETURN_OK; } -static PyObject * -weechat_python_api_bar_item_remove (PyObject *self, PyObject *args) +API_FUNC(bar_item_remove) { char *item; - API_FUNC(1, "bar_item_remove", API_RETURN_ERROR); + API_INIT_FUNC(1, "bar_item_remove", API_RETURN_ERROR); item = NULL; if (!PyArg_ParseTuple (args, "s", &item)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -4080,13 +3940,12 @@ weechat_python_api_bar_item_remove (PyObject *self, PyObject *args) API_RETURN_OK; } -static PyObject * -weechat_python_api_bar_search (PyObject *self, PyObject *args) +API_FUNC(bar_search) { char *name, *result; PyObject *return_value; - API_FUNC(1, "bar_search", API_RETURN_EMPTY); + API_INIT_FUNC(1, "bar_search", API_RETURN_EMPTY); name = NULL; if (!PyArg_ParseTuple (args, "s", &name)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4096,15 +3955,14 @@ weechat_python_api_bar_search (PyObject *self, PyObject *args) API_RETURN_STRING_FREE(result); } -static PyObject * -weechat_python_api_bar_new (PyObject *self, PyObject *args) +API_FUNC(bar_new) { char *name, *hidden, *priority, *type, *conditions, *position; char *filling_top_bottom, *filling_left_right, *size, *size_max; char *color_fg, *color_delim, *color_bg, *separator, *items, *result; PyObject *return_value; - API_FUNC(1, "bar_new", API_RETURN_EMPTY); + API_INIT_FUNC(1, "bar_new", API_RETURN_EMPTY); name = NULL; hidden = NULL; priority = NULL; @@ -4145,12 +4003,11 @@ weechat_python_api_bar_new (PyObject *self, PyObject *args) API_RETURN_STRING_FREE(result); } -static PyObject * -weechat_python_api_bar_set (PyObject *self, PyObject *args) +API_FUNC(bar_set) { char *bar, *property, *value; - API_FUNC(1, "bar_set", API_RETURN_ERROR); + API_INIT_FUNC(1, "bar_set", API_RETURN_ERROR); bar = NULL; property = NULL; value = NULL; @@ -4164,12 +4021,11 @@ weechat_python_api_bar_set (PyObject *self, PyObject *args) API_RETURN_OK; } -static PyObject * -weechat_python_api_bar_update (PyObject *self, PyObject *args) +API_FUNC(bar_update) { char *name; - API_FUNC(1, "bar_item", API_RETURN_ERROR); + API_INIT_FUNC(1, "bar_item", API_RETURN_ERROR); name = NULL; if (!PyArg_ParseTuple (args, "s", &name)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -4179,12 +4035,11 @@ weechat_python_api_bar_update (PyObject *self, PyObject *args) API_RETURN_OK; } -static PyObject * -weechat_python_api_bar_remove (PyObject *self, PyObject *args) +API_FUNC(bar_remove) { char *bar; - API_FUNC(1, "bar_remove", API_RETURN_ERROR); + API_INIT_FUNC(1, "bar_remove", API_RETURN_ERROR); bar = NULL; if (!PyArg_ParseTuple (args, "s", &bar)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -4194,13 +4049,12 @@ weechat_python_api_bar_remove (PyObject *self, PyObject *args) API_RETURN_OK; } -static PyObject * -weechat_python_api_command (PyObject *self, PyObject *args) +API_FUNC(command) { char *buffer, *command; int rc; - API_FUNC(1, "command", API_RETURN_ERROR); + API_INIT_FUNC(1, "command", API_RETURN_ERROR); buffer = NULL; command = NULL; if (!PyArg_ParseTuple (args, "ss", &buffer, &command)) @@ -4214,13 +4068,12 @@ weechat_python_api_command (PyObject *self, PyObject *args) API_RETURN_INT(rc); } -static PyObject * -weechat_python_api_info_get (PyObject *self, PyObject *args) +API_FUNC(info_get) { char *info_name, *arguments; const char *result; - API_FUNC(1, "info_get", API_RETURN_EMPTY); + API_INIT_FUNC(1, "info_get", API_RETURN_EMPTY); info_name = NULL; arguments = NULL; if (!PyArg_ParseTuple (args, "ss", &info_name, &arguments)) @@ -4231,14 +4084,13 @@ weechat_python_api_info_get (PyObject *self, PyObject *args) API_RETURN_STRING(result); } -static PyObject * -weechat_python_api_info_get_hashtable (PyObject *self, PyObject *args) +API_FUNC(info_get_hashtable) { char *info_name; struct t_hashtable *hashtable, *result_hashtable; PyObject *dict, *result_dict; - API_FUNC(1, "info_get_hashtable", API_RETURN_EMPTY); + API_INIT_FUNC(1, "info_get_hashtable", API_RETURN_EMPTY); info_name = NULL; dict = NULL; if (!PyArg_ParseTuple (args, "sO", &info_name, &dict)) @@ -4259,8 +4111,7 @@ weechat_python_api_info_get_hashtable (PyObject *self, PyObject *args) return result_dict; } -static PyObject * -weechat_python_api_infolist_new (PyObject *self, PyObject *args) +API_FUNC(infolist_new) { char *result; PyObject *return_value; @@ -4268,19 +4119,18 @@ weechat_python_api_infolist_new (PyObject *self, PyObject *args) /* make C compiler happy */ (void) args; - API_FUNC(1, "infolist_new", API_RETURN_EMPTY); + API_INIT_FUNC(1, "infolist_new", API_RETURN_EMPTY); result = API_PTR2STR(weechat_infolist_new ()); API_RETURN_STRING_FREE(result); } -static PyObject * -weechat_python_api_infolist_new_item (PyObject *self, PyObject *args) +API_FUNC(infolist_new_item) { char *infolist, *result; PyObject *return_value; - API_FUNC(1, "infolist_new_item", API_RETURN_EMPTY); + API_INIT_FUNC(1, "infolist_new_item", API_RETURN_EMPTY); infolist = NULL; if (!PyArg_ParseTuple (args, "s", &infolist)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4290,14 +4140,13 @@ weechat_python_api_infolist_new_item (PyObject *self, PyObject *args) API_RETURN_STRING_FREE(result); } -static PyObject * -weechat_python_api_infolist_new_var_integer (PyObject *self, PyObject *args) +API_FUNC(infolist_new_var_integer) { char *infolist, *name, *result; int value; PyObject *return_value; - API_FUNC(1, "infolist_new_var_integer", API_RETURN_EMPTY); + API_INIT_FUNC(1, "infolist_new_var_integer", API_RETURN_EMPTY); infolist = NULL; name = NULL; value = 0; @@ -4311,13 +4160,12 @@ weechat_python_api_infolist_new_var_integer (PyObject *self, PyObject *args) API_RETURN_STRING_FREE(result); } -static PyObject * -weechat_python_api_infolist_new_var_string (PyObject *self, PyObject *args) +API_FUNC(infolist_new_var_string) { char *infolist, *name, *value, *result; PyObject *return_value; - API_FUNC(1, "infolist_new_var_string", API_RETURN_EMPTY); + API_INIT_FUNC(1, "infolist_new_var_string", API_RETURN_EMPTY); infolist = NULL; name = NULL; value = NULL; @@ -4331,13 +4179,12 @@ weechat_python_api_infolist_new_var_string (PyObject *self, PyObject *args) API_RETURN_STRING_FREE(result); } -static PyObject * -weechat_python_api_infolist_new_var_pointer (PyObject *self, PyObject *args) +API_FUNC(infolist_new_var_pointer) { char *infolist, *name, *value, *result; PyObject *return_value; - API_FUNC(1, "infolist_new_var_pointer", API_RETURN_EMPTY); + API_INIT_FUNC(1, "infolist_new_var_pointer", API_RETURN_EMPTY); infolist = NULL; name = NULL; value = NULL; @@ -4351,14 +4198,13 @@ weechat_python_api_infolist_new_var_pointer (PyObject *self, PyObject *args) API_RETURN_STRING_FREE(result); } -static PyObject * -weechat_python_api_infolist_new_var_time (PyObject *self, PyObject *args) +API_FUNC(infolist_new_var_time) { char *infolist, *name, *result; int value; PyObject *return_value; - API_FUNC(1, "infolist_new_var_time", API_RETURN_EMPTY); + API_INIT_FUNC(1, "infolist_new_var_time", API_RETURN_EMPTY); infolist = NULL; name = NULL; value = 0; @@ -4372,13 +4218,12 @@ weechat_python_api_infolist_new_var_time (PyObject *self, PyObject *args) API_RETURN_STRING_FREE(result); } -static PyObject * -weechat_python_api_infolist_get (PyObject *self, PyObject *args) +API_FUNC(infolist_get) { char *name, *pointer, *arguments, *result; PyObject *return_value; - API_FUNC(1, "infolist_get", API_RETURN_EMPTY); + API_INIT_FUNC(1, "infolist_get", API_RETURN_EMPTY); name = NULL; pointer = NULL; arguments = NULL; @@ -4392,13 +4237,12 @@ weechat_python_api_infolist_get (PyObject *self, PyObject *args) API_RETURN_STRING_FREE(result); } -static PyObject * -weechat_python_api_infolist_next (PyObject *self, PyObject *args) +API_FUNC(infolist_next) { char *infolist; int value; - API_FUNC(1, "infolist_next", API_RETURN_INT(0)); + API_INIT_FUNC(1, "infolist_next", API_RETURN_INT(0)); infolist = NULL; if (!PyArg_ParseTuple (args, "s", &infolist)) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -4408,13 +4252,12 @@ weechat_python_api_infolist_next (PyObject *self, PyObject *args) API_RETURN_INT(value); } -static PyObject * -weechat_python_api_infolist_prev (PyObject *self, PyObject *args) +API_FUNC(infolist_prev) { char *infolist; int value; - API_FUNC(1, "infolist_prev", API_RETURN_INT(0)); + API_INIT_FUNC(1, "infolist_prev", API_RETURN_INT(0)); infolist = NULL; if (!PyArg_ParseTuple (args, "s", &infolist)) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -4424,12 +4267,11 @@ weechat_python_api_infolist_prev (PyObject *self, PyObject *args) API_RETURN_INT(value); } -static PyObject * -weechat_python_api_infolist_reset_item_cursor (PyObject *self, PyObject *args) +API_FUNC(infolist_reset_item_cursor) { char *infolist; - API_FUNC(1, "infolist_reset_item_cursor", API_RETURN_ERROR); + API_INIT_FUNC(1, "infolist_reset_item_cursor", API_RETURN_ERROR); infolist = NULL; if (!PyArg_ParseTuple (args, "s", &infolist)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -4439,13 +4281,12 @@ weechat_python_api_infolist_reset_item_cursor (PyObject *self, PyObject *args) API_RETURN_OK; } -static PyObject * -weechat_python_api_infolist_fields (PyObject *self, PyObject *args) +API_FUNC(infolist_fields) { char *infolist; const char *result; - API_FUNC(1, "infolist_fields", API_RETURN_EMPTY); + API_INIT_FUNC(1, "infolist_fields", API_RETURN_EMPTY); infolist = NULL; if (!PyArg_ParseTuple (args, "s", &infolist)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4455,13 +4296,12 @@ weechat_python_api_infolist_fields (PyObject *self, PyObject *args) API_RETURN_STRING(result); } -static PyObject * -weechat_python_api_infolist_integer (PyObject *self, PyObject *args) +API_FUNC(infolist_integer) { char *infolist, *variable; int value; - API_FUNC(1, "infolist_integer", API_RETURN_INT(0)); + API_INIT_FUNC(1, "infolist_integer", API_RETURN_INT(0)); infolist = NULL; variable = NULL; if (!PyArg_ParseTuple (args, "ss", &infolist, &variable)) @@ -4473,13 +4313,12 @@ weechat_python_api_infolist_integer (PyObject *self, PyObject *args) API_RETURN_INT(value); } -static PyObject * -weechat_python_api_infolist_string (PyObject *self, PyObject *args) +API_FUNC(infolist_string) { char *infolist, *variable; const char *result; - API_FUNC(1, "infolist_string", API_RETURN_EMPTY); + API_INIT_FUNC(1, "infolist_string", API_RETURN_EMPTY); infolist = NULL; variable = NULL; if (!PyArg_ParseTuple (args, "ss", &infolist, &variable)) @@ -4491,13 +4330,12 @@ weechat_python_api_infolist_string (PyObject *self, PyObject *args) API_RETURN_STRING(result); } -static PyObject * -weechat_python_api_infolist_pointer (PyObject *self, PyObject *args) +API_FUNC(infolist_pointer) { char *infolist, *variable, *result; PyObject *return_value; - API_FUNC(1, "infolist_pointer", API_RETURN_EMPTY); + API_INIT_FUNC(1, "infolist_pointer", API_RETURN_EMPTY); infolist = NULL; variable = NULL; if (!PyArg_ParseTuple (args, "ss", &infolist, &variable)) @@ -4509,15 +4347,14 @@ weechat_python_api_infolist_pointer (PyObject *self, PyObject *args) API_RETURN_STRING_FREE(result); } -static PyObject * -weechat_python_api_infolist_time (PyObject *self, PyObject *args) +API_FUNC(infolist_time) { char *infolist, *variable, timebuffer[64], *result; time_t time; struct tm *date_tmp; PyObject *return_value; - API_FUNC(1, "infolist_time", API_RETURN_EMPTY); + API_INIT_FUNC(1, "infolist_time", API_RETURN_EMPTY); infolist = NULL; variable = NULL; if (!PyArg_ParseTuple (args, "ss", &infolist, &variable)) @@ -4534,12 +4371,11 @@ weechat_python_api_infolist_time (PyObject *self, PyObject *args) API_RETURN_STRING_FREE(result); } -static PyObject * -weechat_python_api_infolist_free (PyObject *self, PyObject *args) +API_FUNC(infolist_free) { char *infolist; - API_FUNC(1, "infolist_free", API_RETURN_ERROR); + API_INIT_FUNC(1, "infolist_free", API_RETURN_ERROR); infolist = NULL; if (!PyArg_ParseTuple (args, "s", &infolist)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -4549,13 +4385,12 @@ weechat_python_api_infolist_free (PyObject *self, PyObject *args) API_RETURN_OK; } -static PyObject * -weechat_python_api_hdata_get (PyObject *self, PyObject *args) +API_FUNC(hdata_get) { char *name, *result; PyObject *return_value; - API_FUNC(1, "hdata_get", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hdata_get", API_RETURN_EMPTY); name = NULL; if (!PyArg_ParseTuple (args, "s", &name)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4565,13 +4400,12 @@ weechat_python_api_hdata_get (PyObject *self, PyObject *args) API_RETURN_STRING_FREE(result); } -static PyObject * -weechat_python_api_hdata_get_var_offset (PyObject *self, PyObject *args) +API_FUNC(hdata_get_var_offset) { char *hdata, *name; int value; - API_FUNC(1, "hdata_get_var_offset", API_RETURN_INT(0)); + API_INIT_FUNC(1, "hdata_get_var_offset", API_RETURN_INT(0)); hdata = NULL; name = NULL; if (!PyArg_ParseTuple (args, "ss", &hdata, &name)) @@ -4582,13 +4416,12 @@ weechat_python_api_hdata_get_var_offset (PyObject *self, PyObject *args) API_RETURN_INT(value); } -static PyObject * -weechat_python_api_hdata_get_var_type_string (PyObject *self, PyObject *args) +API_FUNC(hdata_get_var_type_string) { char *hdata, *name; const char *result; - API_FUNC(1, "hdata_get_var_type_string", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hdata_get_var_type_string", API_RETURN_EMPTY); hdata = NULL; name = NULL; if (!PyArg_ParseTuple (args, "ss", &hdata, &name)) @@ -4599,13 +4432,12 @@ weechat_python_api_hdata_get_var_type_string (PyObject *self, PyObject *args) API_RETURN_STRING(result); } -static PyObject * -weechat_python_api_hdata_get_var_array_size (PyObject *self, PyObject *args) +API_FUNC(hdata_get_var_array_size) { char *hdata, *pointer, *name; int value; - API_FUNC(1, "hdata_get_var_array_size", API_RETURN_INT(-1)); + API_INIT_FUNC(1, "hdata_get_var_array_size", API_RETURN_INT(-1)); hdata = NULL; pointer = NULL; name = NULL; @@ -4619,14 +4451,12 @@ weechat_python_api_hdata_get_var_array_size (PyObject *self, PyObject *args) API_RETURN_INT(value); } -static PyObject * -weechat_python_api_hdata_get_var_array_size_string (PyObject *self, - PyObject *args) +API_FUNC(hdata_get_var_array_size_string) { char *hdata, *pointer, *name; const char *result; - API_FUNC(1, "hdata_get_var_array_size_string", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hdata_get_var_array_size_string", API_RETURN_EMPTY); hdata = NULL; pointer = NULL; name = NULL; @@ -4640,13 +4470,12 @@ weechat_python_api_hdata_get_var_array_size_string (PyObject *self, API_RETURN_STRING(result); } -static PyObject * -weechat_python_api_hdata_get_var_hdata (PyObject *self, PyObject *args) +API_FUNC(hdata_get_var_hdata) { char *hdata, *name; const char *result; - API_FUNC(1, "hdata_get_var_hdata", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hdata_get_var_hdata", API_RETURN_EMPTY); hdata = NULL; name = NULL; if (!PyArg_ParseTuple (args, "ss", &hdata, &name)) @@ -4657,13 +4486,12 @@ weechat_python_api_hdata_get_var_hdata (PyObject *self, PyObject *args) API_RETURN_STRING(result); } -static PyObject * -weechat_python_api_hdata_get_list (PyObject *self, PyObject *args) +API_FUNC(hdata_get_list) { char *hdata, *name, *result; PyObject *return_value; - API_FUNC(1, "hdata_get_list", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hdata_get_list", API_RETURN_EMPTY); hdata = NULL; name = NULL; if (!PyArg_ParseTuple (args, "ss", &hdata, &name)) @@ -4675,13 +4503,12 @@ weechat_python_api_hdata_get_list (PyObject *self, PyObject *args) API_RETURN_STRING_FREE(result); } -static PyObject * -weechat_python_api_hdata_check_pointer (PyObject *self, PyObject *args) +API_FUNC(hdata_check_pointer) { char *hdata, *list, *pointer; int value; - API_FUNC(1, "hdata_check_pointer", API_RETURN_INT(0)); + API_INIT_FUNC(1, "hdata_check_pointer", API_RETURN_INT(0)); hdata = NULL; list = NULL; pointer = NULL; @@ -4695,14 +4522,13 @@ weechat_python_api_hdata_check_pointer (PyObject *self, PyObject *args) API_RETURN_INT(value); } -static PyObject * -weechat_python_api_hdata_move (PyObject *self, PyObject *args) +API_FUNC(hdata_move) { char *result, *hdata, *pointer; int count; PyObject *return_value; - API_FUNC(1, "hdata_move", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hdata_move", API_RETURN_EMPTY); hdata = NULL; pointer = NULL; count = 0; @@ -4716,14 +4542,13 @@ weechat_python_api_hdata_move (PyObject *self, PyObject *args) API_RETURN_STRING_FREE(result); } -static PyObject * -weechat_python_api_hdata_search (PyObject *self, PyObject *args) +API_FUNC(hdata_search) { char *result, *hdata, *pointer, *search; int move; PyObject *return_value; - API_FUNC(1, "hdata_search", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hdata_search", API_RETURN_EMPTY); hdata = NULL; pointer = NULL; search = NULL; @@ -4739,13 +4564,12 @@ weechat_python_api_hdata_search (PyObject *self, PyObject *args) API_RETURN_STRING_FREE(result); } -static PyObject * -weechat_python_api_hdata_char (PyObject *self, PyObject *args) +API_FUNC(hdata_char) { char *hdata, *pointer, *name; int value; - API_FUNC(1, "hdata_char", API_RETURN_INT(0)); + API_INIT_FUNC(1, "hdata_char", API_RETURN_INT(0)); hdata = NULL; pointer = NULL; name = NULL; @@ -4759,13 +4583,12 @@ weechat_python_api_hdata_char (PyObject *self, PyObject *args) API_RETURN_INT(value); } -static PyObject * -weechat_python_api_hdata_integer (PyObject *self, PyObject *args) +API_FUNC(hdata_integer) { char *hdata, *pointer, *name; int value; - API_FUNC(1, "hdata_integer", API_RETURN_INT(0)); + API_INIT_FUNC(1, "hdata_integer", API_RETURN_INT(0)); hdata = NULL; pointer = NULL; name = NULL; @@ -4779,13 +4602,12 @@ weechat_python_api_hdata_integer (PyObject *self, PyObject *args) API_RETURN_INT(value); } -static PyObject * -weechat_python_api_hdata_long (PyObject *self, PyObject *args) +API_FUNC(hdata_long) { char *hdata, *pointer, *name; long value; - API_FUNC(1, "hdata_long", API_RETURN_LONG(0)); + API_INIT_FUNC(1, "hdata_long", API_RETURN_LONG(0)); hdata = NULL; pointer = NULL; name = NULL; @@ -4799,13 +4621,12 @@ weechat_python_api_hdata_long (PyObject *self, PyObject *args) API_RETURN_LONG(value); } -static PyObject * -weechat_python_api_hdata_string (PyObject *self, PyObject *args) +API_FUNC(hdata_string) { char *hdata, *pointer, *name; const char *result; - API_FUNC(1, "hdata_string", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hdata_string", API_RETURN_EMPTY); hdata = NULL; pointer = NULL; name = NULL; @@ -4819,13 +4640,12 @@ weechat_python_api_hdata_string (PyObject *self, PyObject *args) API_RETURN_STRING(result); } -static PyObject * -weechat_python_api_hdata_pointer (PyObject *self, PyObject *args) +API_FUNC(hdata_pointer) { char *hdata, *pointer, *name, *result; PyObject *return_value; - API_FUNC(1, "hdata_pointer", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hdata_pointer", API_RETURN_EMPTY); hdata = NULL; pointer = NULL; name = NULL; @@ -4839,13 +4659,12 @@ weechat_python_api_hdata_pointer (PyObject *self, PyObject *args) API_RETURN_STRING_FREE(result); } -static PyObject * -weechat_python_api_hdata_time (PyObject *self, PyObject *args) +API_FUNC(hdata_time) { char *hdata, *pointer, *name; time_t time; - API_FUNC(1, "hdata_time", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hdata_time", API_RETURN_EMPTY); hdata = NULL; pointer = NULL; name = NULL; @@ -4859,13 +4678,12 @@ weechat_python_api_hdata_time (PyObject *self, PyObject *args) API_RETURN_LONG(time); } -static PyObject * -weechat_python_api_hdata_hashtable (PyObject *self, PyObject *args) +API_FUNC(hdata_hashtable) { char *hdata, *pointer, *name; PyObject *result_dict; - API_FUNC(1, "hdata_hashtable", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hdata_hashtable", API_RETURN_EMPTY); hdata = NULL; pointer = NULL; name = NULL; @@ -4880,15 +4698,14 @@ weechat_python_api_hdata_hashtable (PyObject *self, PyObject *args) return result_dict; } -static PyObject * -weechat_python_api_hdata_update (PyObject *self, PyObject *args) +API_FUNC(hdata_update) { char *hdata, *pointer; struct t_hashtable *hashtable; PyObject *dict; int value; - API_FUNC(1, "hdata_update", API_RETURN_INT(0)); + API_INIT_FUNC(1, "hdata_update", API_RETURN_INT(0)); hdata = NULL; pointer = NULL; dict = NULL; @@ -4909,13 +4726,12 @@ weechat_python_api_hdata_update (PyObject *self, PyObject *args) API_RETURN_INT(value); } -static PyObject * -weechat_python_api_hdata_get_string (PyObject *self, PyObject *args) +API_FUNC(hdata_get_string) { char *hdata, *property; const char *result; - API_FUNC(1, "hdata_get_string", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hdata_get_string", API_RETURN_EMPTY); hdata = NULL; property = NULL; if (!PyArg_ParseTuple (args, "ss", &hdata, &property)) @@ -4926,14 +4742,13 @@ weechat_python_api_hdata_get_string (PyObject *self, PyObject *args) API_RETURN_STRING(result); } -static PyObject * -weechat_python_api_upgrade_new (PyObject *self, PyObject *args) +API_FUNC(upgrade_new) { char *filename, *result; int write; PyObject *return_value; - API_FUNC(1, "upgrade_new", API_RETURN_EMPTY); + API_INIT_FUNC(1, "upgrade_new", API_RETURN_EMPTY); filename = NULL; write = 0; if (!PyArg_ParseTuple (args, "si", &filename, &write)) @@ -4944,13 +4759,12 @@ weechat_python_api_upgrade_new (PyObject *self, PyObject *args) API_RETURN_STRING_FREE(result); } -static PyObject * -weechat_python_api_upgrade_write_object (PyObject *self, PyObject *args) +API_FUNC(upgrade_write_object) { char *upgrade_file, *infolist; int object_id, rc; - API_FUNC(1, "upgrade_write_object", API_RETURN_INT(0)); + API_INIT_FUNC(1, "upgrade_write_object", API_RETURN_INT(0)); upgrade_file = NULL; object_id = 0; infolist = NULL; @@ -5009,13 +4823,12 @@ weechat_python_api_upgrade_read_cb (void *data, return WEECHAT_RC_ERROR; } -static PyObject * -weechat_python_api_upgrade_read (PyObject *self, PyObject *args) +API_FUNC(upgrade_read) { char *upgrade_file, *function, *data; int rc; - API_FUNC(1, "upgrade_read", API_RETURN_INT(0)); + API_INIT_FUNC(1, "upgrade_read", API_RETURN_INT(0)); upgrade_file = NULL; function = NULL; data = NULL; @@ -5032,12 +4845,11 @@ weechat_python_api_upgrade_read (PyObject *self, PyObject *args) API_RETURN_INT(rc); } -static PyObject * -weechat_python_api_upgrade_close (PyObject *self, PyObject *args) +API_FUNC(upgrade_close) { char *upgrade_file; - API_FUNC(1, "upgrade_close", API_RETURN_ERROR); + API_INIT_FUNC(1, "upgrade_close", API_RETURN_ERROR); upgrade_file = NULL; if (!PyArg_ParseTuple (args, "s", &upgrade_file)) API_WRONG_ARGS(API_RETURN_ERROR); diff --git a/src/plugins/ruby/weechat-ruby-api.c b/src/plugins/ruby/weechat-ruby-api.c index 8fc80ce83..cfc2e6f3b 100644 --- a/src/plugins/ruby/weechat-ruby-api.c +++ b/src/plugins/ruby/weechat-ruby-api.c @@ -33,7 +33,10 @@ #include "weechat-ruby.h" -#define API_FUNC(__init, __name, __ret) \ +#define API_DEF_FUNC(__name, __argc) \ + rb_define_module_function (ruby_mWeechat, #__name, \ + &weechat_ruby_api_##__name, __argc); +#define API_INIT_FUNC(__init, __name, __ret) \ char *ruby_function_name = __name; \ (void) class; \ if (__init \ @@ -55,9 +58,9 @@ plugin_script_str2ptr (weechat_ruby_plugin, \ RUBY_CURRENT_SCRIPT_NAME, \ ruby_function_name, __string) -#define API_RETURN_OK return INT2FIX (1); -#define API_RETURN_ERROR return INT2FIX (0); -#define API_RETURN_EMPTY return Qnil; +#define API_RETURN_OK return INT2FIX (1) +#define API_RETURN_ERROR return INT2FIX (0) +#define API_RETURN_EMPTY return Qnil #define API_RETURN_STRING(__string) \ if (__string) \ return rb_str_new2 (__string); \ @@ -71,13 +74,9 @@ } \ return rb_str_new2 ("") #define API_RETURN_INT(__int) \ - return INT2FIX (__int); + return INT2FIX (__int) #define API_RETURN_LONG(__long) \ - return LONG2FIX (__long); - -#define API_DEF_FUNC(__name, __argc) \ - rb_define_module_function (ruby_mWeechat, #__name, \ - &weechat_ruby_api_##__name, __argc); + return LONG2FIX (__long) /* @@ -92,7 +91,7 @@ weechat_ruby_api_register (VALUE class, VALUE name, VALUE author, char *c_name, *c_author, *c_version, *c_license, *c_description; char *c_shutdown_func, *c_charset; - API_FUNC(0, "register", API_RETURN_ERROR); + API_INIT_FUNC(0, "register", API_RETURN_ERROR); if (ruby_registered_script) { /* script already registered */ @@ -179,7 +178,7 @@ weechat_ruby_api_plugin_get_name (VALUE class, VALUE plugin) char *c_plugin; const char *result; - API_FUNC(1, "plugin_get_name", API_RETURN_EMPTY); + API_INIT_FUNC(1, "plugin_get_name", API_RETURN_EMPTY); if (NIL_P (plugin)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -197,7 +196,7 @@ weechat_ruby_api_charset_set (VALUE class, VALUE charset) { char *c_charset; - API_FUNC(1, "charset_set", API_RETURN_ERROR); + API_INIT_FUNC(1, "charset_set", API_RETURN_ERROR); if (NIL_P (charset)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -216,7 +215,7 @@ weechat_ruby_api_iconv_to_internal (VALUE class, VALUE charset, VALUE string) char *c_charset, *c_string, *result; VALUE return_value; - API_FUNC(1, "iconv_to_internal", API_RETURN_EMPTY); + API_INIT_FUNC(1, "iconv_to_internal", API_RETURN_EMPTY); if (NIL_P (charset) || NIL_P (string)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -237,7 +236,7 @@ weechat_ruby_api_iconv_from_internal (VALUE class, VALUE charset, VALUE string) char *c_charset, *c_string, *result; VALUE return_value; - API_FUNC(1, "iconv_from_internal", API_RETURN_EMPTY); + API_INIT_FUNC(1, "iconv_from_internal", API_RETURN_EMPTY); if (NIL_P (charset) || NIL_P (string)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -258,7 +257,7 @@ weechat_ruby_api_gettext (VALUE class, VALUE string) char *c_string; const char *result; - API_FUNC(1, "gettext", API_RETURN_EMPTY); + API_INIT_FUNC(1, "gettext", API_RETURN_EMPTY); if (NIL_P (string)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -279,7 +278,7 @@ weechat_ruby_api_ngettext (VALUE class, VALUE single, VALUE plural, const char *result; int c_count; - API_FUNC(1, "ngettext", API_RETURN_EMPTY); + API_INIT_FUNC(1, "ngettext", API_RETURN_EMPTY); if (NIL_P (single) || NIL_P (plural) || NIL_P (count)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -302,7 +301,7 @@ weechat_ruby_api_strlen_screen (VALUE class, VALUE string) char *c_string; int value; - API_FUNC(1, "strlen_screen", API_RETURN_INT(0)); + API_INIT_FUNC(1, "strlen_screen", API_RETURN_INT(0)); if (NIL_P (string)) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -322,7 +321,7 @@ weechat_ruby_api_string_match (VALUE class, VALUE string, VALUE mask, char *c_string, *c_mask; int c_case_sensitive, value; - API_FUNC(1, "string_match", API_RETURN_INT(0)); + API_INIT_FUNC(1, "string_match", API_RETURN_INT(0)); if (NIL_P (string) || NIL_P (mask) || NIL_P (case_sensitive)) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -346,7 +345,7 @@ weechat_ruby_api_string_has_highlight (VALUE class, VALUE string, char *c_string, *c_highlight_words; int value; - API_FUNC(1, "string_has_highlight", API_RETURN_INT(0)); + API_INIT_FUNC(1, "string_has_highlight", API_RETURN_INT(0)); if (NIL_P (string) || NIL_P (highlight_words)) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -368,7 +367,7 @@ weechat_ruby_api_string_has_highlight_regex (VALUE class, VALUE string, char *c_string, *c_regex; int value; - API_FUNC(1, "string_has_highlight_regex", API_RETURN_INT(0)); + API_INIT_FUNC(1, "string_has_highlight_regex", API_RETURN_INT(0)); if (NIL_P (string) || NIL_P (regex)) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -389,7 +388,7 @@ weechat_ruby_api_string_mask_to_regex (VALUE class, VALUE mask) char *c_mask, *result; VALUE return_value; - API_FUNC(1, "string_mask_to_regex", API_RETURN_EMPTY); + API_INIT_FUNC(1, "string_mask_to_regex", API_RETURN_EMPTY); if (NIL_P (mask)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -409,7 +408,7 @@ weechat_ruby_api_string_remove_color (VALUE class, VALUE string, char *c_string, *c_replacement, *result; VALUE return_value; - API_FUNC(1, "string_remove_color", API_RETURN_EMPTY); + API_INIT_FUNC(1, "string_remove_color", API_RETURN_EMPTY); if (NIL_P (string) || NIL_P (replacement)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -430,7 +429,7 @@ weechat_ruby_api_string_is_command_char (VALUE class, VALUE string) char *c_string; int value; - API_FUNC(1, "string_is_command_char", API_RETURN_INT(0)); + API_INIT_FUNC(1, "string_is_command_char", API_RETURN_INT(0)); if (NIL_P (string)) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -449,7 +448,7 @@ weechat_ruby_api_string_input_for_buffer (VALUE class, VALUE string) char *c_string; const char *result; - API_FUNC(1, "string_input_for_buffer", API_RETURN_EMPTY); + API_INIT_FUNC(1, "string_input_for_buffer", API_RETURN_EMPTY); if (NIL_P (string)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -471,7 +470,7 @@ weechat_ruby_api_string_eval_expression (VALUE class, VALUE expr, struct t_hashtable *c_pointers, *c_extra_vars, *c_options; VALUE return_value; - API_FUNC(1, "string_eval_expression", API_RETURN_EMPTY); + API_INIT_FUNC(1, "string_eval_expression", API_RETURN_EMPTY); if (NIL_P (expr) || NIL_P (pointers) || NIL_P (extra_vars) || NIL_P (options)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -514,7 +513,7 @@ weechat_ruby_api_mkdir_home (VALUE class, VALUE directory, VALUE mode) char *c_directory; int c_mode; - API_FUNC(1, "mkdir_home", API_RETURN_ERROR); + API_INIT_FUNC(1, "mkdir_home", API_RETURN_ERROR); if (NIL_P (directory) || NIL_P (mode)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -536,7 +535,7 @@ weechat_ruby_api_mkdir (VALUE class, VALUE directory, VALUE mode) char *c_directory; int c_mode; - API_FUNC(1, "mkdir", API_RETURN_ERROR); + API_INIT_FUNC(1, "mkdir", API_RETURN_ERROR); if (NIL_P (directory) || NIL_P (mode)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -558,7 +557,7 @@ weechat_ruby_api_mkdir_parents (VALUE class, VALUE directory, VALUE mode) char *c_directory; int c_mode; - API_FUNC(1, "mkdir_parents", API_RETURN_ERROR); + API_INIT_FUNC(1, "mkdir_parents", API_RETURN_ERROR); if (NIL_P (directory) || NIL_P (mode)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -579,7 +578,7 @@ weechat_ruby_api_list_new (VALUE class) { char *result; - API_FUNC(1, "list_new", API_RETURN_EMPTY); + API_INIT_FUNC(1, "list_new", API_RETURN_EMPTY); result = API_PTR2STR(weechat_list_new ()); @@ -592,7 +591,7 @@ weechat_ruby_api_list_add (VALUE class, VALUE weelist, VALUE data, VALUE where, { char *c_weelist, *c_data, *c_where, *c_user_data, *result; - API_FUNC(1, "list_add", API_RETURN_EMPTY); + API_INIT_FUNC(1, "list_add", API_RETURN_EMPTY); if (NIL_P (weelist) || NIL_P (data) || NIL_P (where) || NIL_P (user_data)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -619,7 +618,7 @@ weechat_ruby_api_list_search (VALUE class, VALUE weelist, VALUE data) { char *c_weelist, *c_data, *result; - API_FUNC(1, "list_search", API_RETURN_EMPTY); + API_INIT_FUNC(1, "list_search", API_RETURN_EMPTY); if (NIL_P (weelist) || NIL_P (data)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -641,7 +640,7 @@ weechat_ruby_api_list_search_pos (VALUE class, VALUE weelist, VALUE data) char *c_weelist, *c_data; int pos; - API_FUNC(1, "list_search_pos", API_RETURN_INT(-1)); + API_INIT_FUNC(1, "list_search_pos", API_RETURN_INT(-1)); if (NIL_P (weelist) || NIL_P (data)) API_WRONG_ARGS(API_RETURN_INT(-1)); @@ -661,7 +660,7 @@ weechat_ruby_api_list_casesearch (VALUE class, VALUE weelist, VALUE data) { char *c_weelist, *c_data, *result; - API_FUNC(1, "list_casesearch", API_RETURN_EMPTY); + API_INIT_FUNC(1, "list_casesearch", API_RETURN_EMPTY); if (NIL_P (weelist) || NIL_P (data)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -683,7 +682,7 @@ weechat_ruby_api_list_casesearch_pos (VALUE class, VALUE weelist, VALUE data) char *c_weelist, *c_data; int pos; - API_FUNC(1, "list_casesearch_pos", API_RETURN_INT(-1)); + API_INIT_FUNC(1, "list_casesearch_pos", API_RETURN_INT(-1)); if (NIL_P (weelist) || NIL_P (data)) API_WRONG_ARGS(API_RETURN_INT(-1)); @@ -704,7 +703,7 @@ weechat_ruby_api_list_get (VALUE class, VALUE weelist, VALUE position) char *c_weelist, *result; int c_position; - API_FUNC(1, "list_get", API_RETURN_EMPTY); + API_INIT_FUNC(1, "list_get", API_RETURN_EMPTY); if (NIL_P (weelist) || NIL_P (position)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -725,7 +724,7 @@ weechat_ruby_api_list_set (VALUE class, VALUE item, VALUE new_value) { char *c_item, *c_new_value; - API_FUNC(1, "list_set", API_RETURN_ERROR); + API_INIT_FUNC(1, "list_set", API_RETURN_ERROR); if (NIL_P (item) || NIL_P (new_value)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -746,7 +745,7 @@ weechat_ruby_api_list_next (VALUE class, VALUE item) { char *c_item, *result; - API_FUNC(1, "list_next", API_RETURN_EMPTY); + API_INIT_FUNC(1, "list_next", API_RETURN_EMPTY); if (NIL_P (item)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -764,7 +763,7 @@ weechat_ruby_api_list_prev (VALUE class, VALUE item) { char *c_item, *result; - API_FUNC(1, "list_prev", API_RETURN_EMPTY); + API_INIT_FUNC(1, "list_prev", API_RETURN_EMPTY); if (NIL_P (item)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -783,7 +782,7 @@ weechat_ruby_api_list_string (VALUE class, VALUE item) char *c_item; const char *result; - API_FUNC(1, "list_string", API_RETURN_EMPTY); + API_INIT_FUNC(1, "list_string", API_RETURN_EMPTY); if (NIL_P (item)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -802,7 +801,7 @@ weechat_ruby_api_list_size (VALUE class, VALUE weelist) char *c_weelist; int size; - API_FUNC(1, "list_size", API_RETURN_INT(0)); + API_INIT_FUNC(1, "list_size", API_RETURN_INT(0)); if (NIL_P (weelist)) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -820,7 +819,7 @@ weechat_ruby_api_list_remove (VALUE class, VALUE weelist, VALUE item) { char *c_weelist, *c_item; - API_FUNC(1, "list_remove", API_RETURN_ERROR); + API_INIT_FUNC(1, "list_remove", API_RETURN_ERROR); if (NIL_P (weelist) || NIL_P (item)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -841,7 +840,7 @@ weechat_ruby_api_list_remove_all (VALUE class, VALUE weelist) { char *c_weelist; - API_FUNC(1, "list_remove_all", API_RETURN_ERROR); + API_INIT_FUNC(1, "list_remove_all", API_RETURN_ERROR); if (NIL_P (weelist)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -859,7 +858,7 @@ weechat_ruby_api_list_free (VALUE class, VALUE weelist) { char *c_weelist; - API_FUNC(1, "list_free", API_RETURN_ERROR); + API_INIT_FUNC(1, "list_free", API_RETURN_ERROR); if (NIL_P (weelist)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -916,7 +915,7 @@ weechat_ruby_api_config_new (VALUE class, VALUE name, VALUE function, char *c_name, *c_function, *c_data, *result; VALUE return_value; - API_FUNC(1, "config_new", API_RETURN_EMPTY); + API_INIT_FUNC(1, "config_new", API_RETURN_EMPTY); if (NIL_P (name) || NIL_P (function) || NIL_P (data)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -1173,7 +1172,7 @@ weechat_ruby_api_config_new_section (VALUE class, VALUE config_file, int c_user_can_add_options, c_user_can_delete_options; VALUE return_value; - API_FUNC(1, "config_new_section", API_RETURN_EMPTY); + API_INIT_FUNC(1, "config_new_section", API_RETURN_EMPTY); if (NIL_P (config_file) || NIL_P (name) || NIL_P (user_can_add_options) || NIL_P (user_can_delete_options) || NIL_P (function_read) || NIL_P (data_read) || NIL_P (function_write) || NIL_P (data_write) @@ -1244,7 +1243,7 @@ weechat_ruby_api_config_search_section (VALUE class, VALUE config_file, char *c_config_file, *c_section_name, *result; VALUE return_value; - API_FUNC(1, "config_search_section", API_RETURN_EMPTY); + API_INIT_FUNC(1, "config_search_section", API_RETURN_EMPTY); if (NIL_P (config_file) || NIL_P (section_name)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -1373,7 +1372,7 @@ weechat_ruby_api_config_new_option (VALUE class, VALUE config_file, VALUE function_check_value, data_check_value, function_change, data_change; VALUE function_delete, data_delete, return_value; - API_FUNC(1, "config_new_option", API_RETURN_EMPTY); + API_INIT_FUNC(1, "config_new_option", API_RETURN_EMPTY); if (NIL_P (config_file) || NIL_P (section) || NIL_P (name) || NIL_P (type) || NIL_P (description) || NIL_P (string_values) || NIL_P (min) || NIL_P (max) || NIL_P (default_value) || NIL_P (value) @@ -1458,7 +1457,7 @@ weechat_ruby_api_config_search_option (VALUE class, VALUE config_file, char *c_config_file, *c_section, *c_option_name, *result; VALUE return_value; - API_FUNC(1, "config_search_option", API_RETURN_EMPTY); + API_INIT_FUNC(1, "config_search_option", API_RETURN_EMPTY); if (NIL_P (config_file) || NIL_P (section) || NIL_P (option_name)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -1483,7 +1482,7 @@ weechat_ruby_api_config_string_to_boolean (VALUE class, VALUE text) char *c_text; int value; - API_FUNC(1, "config_string_to_boolean", API_RETURN_INT(0)); + API_INIT_FUNC(1, "config_string_to_boolean", API_RETURN_INT(0)); if (NIL_P (text)) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -1503,7 +1502,7 @@ weechat_ruby_api_config_option_reset (VALUE class, VALUE option, char *c_option; int c_run_callback, rc; - API_FUNC(1, "config_option_reset", API_RETURN_INT(0)); + API_INIT_FUNC(1, "config_option_reset", API_RETURN_INT(0)); if (NIL_P (option) || NIL_P (run_callback)) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -1526,7 +1525,7 @@ weechat_ruby_api_config_option_set (VALUE class, VALUE option, VALUE new_value, char *c_option, *c_new_value; int c_run_callback, rc; - API_FUNC(1, "config_option_set", API_RETURN_INT(WEECHAT_CONFIG_OPTION_SET_ERROR)); + API_INIT_FUNC(1, "config_option_set", API_RETURN_INT(WEECHAT_CONFIG_OPTION_SET_ERROR)); if (NIL_P (option) || NIL_P (new_value) || NIL_P (run_callback)) API_WRONG_ARGS(API_RETURN_INT(WEECHAT_CONFIG_OPTION_SET_ERROR)); @@ -1552,7 +1551,7 @@ weechat_ruby_api_config_option_set_null (VALUE class, VALUE option, char *c_option; int c_run_callback, rc; - API_FUNC(1, "config_option_set_null", API_RETURN_INT(WEECHAT_CONFIG_OPTION_SET_ERROR)); + API_INIT_FUNC(1, "config_option_set_null", API_RETURN_INT(WEECHAT_CONFIG_OPTION_SET_ERROR)); if (NIL_P (option) || NIL_P (run_callback)) API_WRONG_ARGS(API_RETURN_INT(WEECHAT_CONFIG_OPTION_SET_ERROR)); @@ -1574,7 +1573,7 @@ weechat_ruby_api_config_option_unset (VALUE class, VALUE option) char *c_option; int rc; - API_FUNC(1, "config_option_unset", API_RETURN_INT(WEECHAT_CONFIG_OPTION_UNSET_ERROR)); + API_INIT_FUNC(1, "config_option_unset", API_RETURN_INT(WEECHAT_CONFIG_OPTION_UNSET_ERROR)); if (NIL_P (option)) API_WRONG_ARGS(API_RETURN_INT(WEECHAT_CONFIG_OPTION_UNSET_ERROR)); @@ -1593,7 +1592,7 @@ weechat_ruby_api_config_option_rename (VALUE class, VALUE option, { char *c_option, *c_new_name; - API_FUNC(1, "config_option_rename", API_RETURN_ERROR); + API_INIT_FUNC(1, "config_option_rename", API_RETURN_ERROR); if (NIL_P (option) || NIL_P (new_name)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -1615,7 +1614,7 @@ weechat_ruby_api_config_option_is_null (VALUE class, VALUE option) char *c_option; int value; - API_FUNC(1, "config_option_is_null", API_RETURN_INT(1)); + API_INIT_FUNC(1, "config_option_is_null", API_RETURN_INT(1)); if (NIL_P (option)) API_WRONG_ARGS(API_RETURN_INT(1)); @@ -1634,7 +1633,7 @@ weechat_ruby_api_config_option_default_is_null (VALUE class, VALUE option) char *c_option; int value; - API_FUNC(1, "config_option_default_is_null", API_RETURN_INT(1)); + API_INIT_FUNC(1, "config_option_default_is_null", API_RETURN_INT(1)); if (NIL_P (option)) API_WRONG_ARGS(API_RETURN_INT(1)); @@ -1653,7 +1652,7 @@ weechat_ruby_api_config_boolean (VALUE class, VALUE option) char *c_option; int value; - API_FUNC(1, "config_boolean", API_RETURN_INT(0)); + API_INIT_FUNC(1, "config_boolean", API_RETURN_INT(0)); if (NIL_P (option)) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -1672,7 +1671,7 @@ weechat_ruby_api_config_boolean_default (VALUE class, VALUE option) char *c_option; int value; - API_FUNC(1, "config_boolean_default", API_RETURN_INT(0)); + API_INIT_FUNC(1, "config_boolean_default", API_RETURN_INT(0)); if (NIL_P (option)) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -1691,7 +1690,7 @@ weechat_ruby_api_config_integer (VALUE class, VALUE option) char *c_option; int value; - API_FUNC(1, "config_integer", API_RETURN_INT(0)); + API_INIT_FUNC(1, "config_integer", API_RETURN_INT(0)); if (NIL_P (option)) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -1710,7 +1709,7 @@ weechat_ruby_api_config_integer_default (VALUE class, VALUE option) char *c_option; int value; - API_FUNC(1, "config_integer_default", API_RETURN_INT(0)); + API_INIT_FUNC(1, "config_integer_default", API_RETURN_INT(0)); if (NIL_P (option)) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -1729,7 +1728,7 @@ weechat_ruby_api_config_string (VALUE class, VALUE option) char *c_option; const char *result; - API_FUNC(1, "config_string", API_RETURN_EMPTY); + API_INIT_FUNC(1, "config_string", API_RETURN_EMPTY); if (NIL_P (option)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -1748,7 +1747,7 @@ weechat_ruby_api_config_string_default (VALUE class, VALUE option) char *c_option; const char *result; - API_FUNC(1, "config_string_default", API_RETURN_EMPTY); + API_INIT_FUNC(1, "config_string_default", API_RETURN_EMPTY); if (NIL_P (option)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -1767,7 +1766,7 @@ weechat_ruby_api_config_color (VALUE class, VALUE option) char *c_option; const char *result; - API_FUNC(1, "config_color", API_RETURN_INT(0)); + API_INIT_FUNC(1, "config_color", API_RETURN_INT(0)); if (NIL_P (option)) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -1786,7 +1785,7 @@ weechat_ruby_api_config_color_default (VALUE class, VALUE option) char *c_option; const char *result; - API_FUNC(1, "config_color_default", API_RETURN_INT(0)); + API_INIT_FUNC(1, "config_color_default", API_RETURN_INT(0)); if (NIL_P (option)) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -1805,7 +1804,7 @@ weechat_ruby_api_config_write_option (VALUE class, VALUE config_file, { char *c_config_file, *c_option; - API_FUNC(1, "config_write_option", API_RETURN_ERROR); + API_INIT_FUNC(1, "config_write_option", API_RETURN_ERROR); if (NIL_P (config_file) || NIL_P (option)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -1827,7 +1826,7 @@ weechat_ruby_api_config_write_line (VALUE class, VALUE config_file, { char *c_config_file, *c_option_name, *c_value; - API_FUNC(1, "config_write_line", API_RETURN_ERROR); + API_INIT_FUNC(1, "config_write_line", API_RETURN_ERROR); if (NIL_P (config_file) || NIL_P (option_name) || NIL_P (value)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -1853,7 +1852,7 @@ weechat_ruby_api_config_write (VALUE class, VALUE config_file) char *c_config_file; int rc; - API_FUNC(1, "config_write", API_RETURN_INT(-1)); + API_INIT_FUNC(1, "config_write", API_RETURN_INT(-1)); if (NIL_P (config_file)) API_WRONG_ARGS(API_RETURN_INT(-1)); @@ -1872,7 +1871,7 @@ weechat_ruby_api_config_read (VALUE class, VALUE config_file) char *c_config_file; int rc; - API_FUNC(1, "config_read", API_RETURN_INT(-1)); + API_INIT_FUNC(1, "config_read", API_RETURN_INT(-1)); if (NIL_P (config_file)) API_WRONG_ARGS(API_RETURN_INT(-1)); @@ -1891,7 +1890,7 @@ weechat_ruby_api_config_reload (VALUE class, VALUE config_file) char *c_config_file; int rc; - API_FUNC(1, "config_reload", API_RETURN_INT(-1)); + API_INIT_FUNC(1, "config_reload", API_RETURN_INT(-1)); if (NIL_P (config_file)) API_WRONG_ARGS(API_RETURN_INT(-1)); @@ -1909,7 +1908,7 @@ weechat_ruby_api_config_option_free (VALUE class, VALUE option) { char *c_option; - API_FUNC(1, "config_option_free", API_RETURN_ERROR); + API_INIT_FUNC(1, "config_option_free", API_RETURN_ERROR); if (NIL_P (option)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -1929,7 +1928,7 @@ weechat_ruby_api_config_section_free_options (VALUE class, VALUE section) { char *c_section; - API_FUNC(1, "config_section_free_options", API_RETURN_ERROR); + API_INIT_FUNC(1, "config_section_free_options", API_RETURN_ERROR); if (NIL_P (section)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -1949,7 +1948,7 @@ weechat_ruby_api_config_section_free (VALUE class, VALUE section) { char *c_section; - API_FUNC(1, "config_section_free", API_RETURN_ERROR); + API_INIT_FUNC(1, "config_section_free", API_RETURN_ERROR); if (NIL_P (section)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -1969,7 +1968,7 @@ weechat_ruby_api_config_free (VALUE class, VALUE config_file) { char *c_config_file; - API_FUNC(1, "config_free", API_RETURN_ERROR); + API_INIT_FUNC(1, "config_free", API_RETURN_ERROR); if (NIL_P (config_file)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -1990,7 +1989,7 @@ weechat_ruby_api_config_get (VALUE class, VALUE option) char *c_option, *result; VALUE return_value; - API_FUNC(1, "config_get", API_RETURN_EMPTY); + API_INIT_FUNC(1, "config_get", API_RETURN_EMPTY); if (NIL_P (option)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -2009,7 +2008,7 @@ weechat_ruby_api_config_get_plugin (VALUE class, VALUE option) char *c_option; const char *result; - API_FUNC(1, "config_get_plugin", API_RETURN_EMPTY); + API_INIT_FUNC(1, "config_get_plugin", API_RETURN_EMPTY); if (NIL_P (option)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -2030,7 +2029,7 @@ weechat_ruby_api_config_is_set_plugin (VALUE class, VALUE option) char *c_option; int rc; - API_FUNC(1, "config_is_set_plugin", API_RETURN_INT(0)); + API_INIT_FUNC(1, "config_is_set_plugin", API_RETURN_INT(0)); if (NIL_P (option)) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -2051,7 +2050,7 @@ weechat_ruby_api_config_set_plugin (VALUE class, VALUE option, VALUE value) char *c_option, *c_value; int rc; - API_FUNC(1, "config_set_plugin", API_RETURN_INT(WEECHAT_CONFIG_OPTION_SET_ERROR)); + API_INIT_FUNC(1, "config_set_plugin", API_RETURN_INT(WEECHAT_CONFIG_OPTION_SET_ERROR)); if (NIL_P (option) || NIL_P (value)) API_WRONG_ARGS(API_RETURN_INT(WEECHAT_CONFIG_OPTION_SET_ERROR)); @@ -2075,7 +2074,7 @@ weechat_ruby_api_config_set_desc_plugin (VALUE class, VALUE option, { char *c_option, *c_description; - API_FUNC(1, "config_set_desc_plugin", API_RETURN_ERROR); + API_INIT_FUNC(1, "config_set_desc_plugin", API_RETURN_ERROR); if (NIL_P (option) || NIL_P (description)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -2099,7 +2098,7 @@ weechat_ruby_api_config_unset_plugin (VALUE class, VALUE option) char *c_option; int rc; - API_FUNC(1, "config_unset_plugin", API_RETURN_INT(WEECHAT_CONFIG_OPTION_UNSET_ERROR)); + API_INIT_FUNC(1, "config_unset_plugin", API_RETURN_INT(WEECHAT_CONFIG_OPTION_UNSET_ERROR)); if (NIL_P (option)) API_WRONG_ARGS(API_RETURN_INT(WEECHAT_CONFIG_OPTION_UNSET_ERROR)); @@ -2121,7 +2120,7 @@ weechat_ruby_api_key_bind (VALUE class, VALUE context, VALUE keys) struct t_hashtable *c_keys; int num_keys; - API_FUNC(1, "key_bind", API_RETURN_INT(0)); + API_INIT_FUNC(1, "key_bind", API_RETURN_INT(0)); if (NIL_P (context) || NIL_P (keys)) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -2148,7 +2147,7 @@ weechat_ruby_api_key_unbind (VALUE class, VALUE context, VALUE key) char *c_context, *c_key; int num_keys; - API_FUNC(1, "key_unbind", API_RETURN_INT(0)); + API_INIT_FUNC(1, "key_unbind", API_RETURN_INT(0)); if (NIL_P (context) || NIL_P (key)) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -2169,7 +2168,7 @@ weechat_ruby_api_prefix (VALUE class, VALUE prefix) char *c_prefix; const char *result; - API_FUNC(0, "prefix", API_RETURN_EMPTY); + API_INIT_FUNC(0, "prefix", API_RETURN_EMPTY); if (NIL_P (prefix)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -2188,7 +2187,7 @@ weechat_ruby_api_color (VALUE class, VALUE color) char *c_color; const char *result; - API_FUNC(0, "color", API_RETURN_EMPTY); + API_INIT_FUNC(0, "color", API_RETURN_EMPTY); if (NIL_P (color)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -2206,7 +2205,7 @@ weechat_ruby_api_print (VALUE class, VALUE buffer, VALUE message) { char *c_buffer, *c_message; - API_FUNC(0, "print", API_RETURN_ERROR); + API_INIT_FUNC(0, "print", API_RETURN_ERROR); if (NIL_P (buffer) || NIL_P (message)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -2231,7 +2230,7 @@ weechat_ruby_api_print_date_tags (VALUE class, VALUE buffer, VALUE date, char *c_buffer, *c_tags, *c_message; int c_date; - API_FUNC(1, "print_date_tags", API_RETURN_ERROR); + API_INIT_FUNC(1, "print_date_tags", API_RETURN_ERROR); if (NIL_P (buffer) || NIL_P (date) || NIL_P (tags) || NIL_P (message)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -2261,7 +2260,7 @@ weechat_ruby_api_print_y (VALUE class, VALUE buffer, VALUE y, VALUE message) char *c_buffer, *c_message; int c_y; - API_FUNC(1, "print_y", API_RETURN_ERROR); + API_INIT_FUNC(1, "print_y", API_RETURN_ERROR); if (NIL_P (buffer) || NIL_P (y) || NIL_P (message)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -2287,7 +2286,7 @@ weechat_ruby_api_log_print (VALUE class, VALUE message) { char *c_message; - API_FUNC(1, "log_print", API_RETURN_ERROR); + API_INIT_FUNC(1, "log_print", API_RETURN_ERROR); if (NIL_P (message)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -2352,7 +2351,7 @@ weechat_ruby_api_hook_command (VALUE class, VALUE command, VALUE description, char *c_completion, *c_function, *c_data, *result; VALUE return_value; - API_FUNC(1, "hook_command", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_command", API_RETURN_EMPTY); if (NIL_P (command) || NIL_P (description) || NIL_P (args) || NIL_P (args_description) || NIL_P (completion) || NIL_P (function) || NIL_P (data)) @@ -2433,7 +2432,7 @@ weechat_ruby_api_hook_command_run (VALUE class, VALUE command, VALUE function, char *c_command, *c_function, *c_data, *result; VALUE return_value; - API_FUNC(1, "hook_command_run", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_command_run", API_RETURN_EMPTY); if (NIL_P (command) || NIL_P (function) || NIL_P (data)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -2500,7 +2499,7 @@ weechat_ruby_api_hook_timer (VALUE class, VALUE interval, VALUE align_second, char *c_function, *c_data, *result; VALUE return_value; - API_FUNC(1, "hook_timer", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_timer", API_RETURN_EMPTY); if (NIL_P (interval) || NIL_P (align_second) || NIL_P (max_calls) || NIL_P (function) || NIL_P (data)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -2573,7 +2572,7 @@ weechat_ruby_api_hook_fd (VALUE class, VALUE fd, VALUE read, VALUE write, char *c_function, *c_data, *result; VALUE return_value; - API_FUNC(1, "hook_fd", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_fd", API_RETURN_EMPTY); if (NIL_P (fd) || NIL_P (read) || NIL_P (write) || NIL_P (exception) || NIL_P (function) || NIL_P (data)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -2652,7 +2651,7 @@ weechat_ruby_api_hook_process (VALUE class, VALUE command, VALUE timeout, int c_timeout; VALUE return_value; - API_FUNC(1, "hook_process", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_process", API_RETURN_EMPTY); if (NIL_P (command) || NIL_P (timeout) || NIL_P (function) || NIL_P (data)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -2687,7 +2686,7 @@ weechat_ruby_api_hook_process_hashtable (VALUE class, VALUE command, int c_timeout; VALUE return_value; - API_FUNC(1, "hook_process_hashtable", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_process_hashtable", API_RETURN_EMPTY); if (NIL_P (command) || NIL_P (options) || NIL_P (timeout) || NIL_P (function) || NIL_P (data)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -2777,7 +2776,7 @@ weechat_ruby_api_hook_connect (VALUE class, VALUE proxy, VALUE address, int c_port, c_ipv6, c_retry; VALUE return_value; - API_FUNC(1, "hook_connect", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_connect", API_RETURN_EMPTY); if (NIL_P (proxy) || NIL_P (address) || NIL_P (port) || NIL_P (ipv6) || NIL_P (retry) || NIL_P (local_hostname) || NIL_P (function) || NIL_P (data)) @@ -2885,7 +2884,7 @@ weechat_ruby_api_hook_print (VALUE class, VALUE buffer, VALUE tags, int c_strip_colors; VALUE return_value; - API_FUNC(1, "hook_print", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_print", API_RETURN_EMPTY); if (NIL_P (buffer) || NIL_P (tags) || NIL_P (message) || NIL_P (strip_colors) || NIL_P (function) || NIL_P (data)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -2984,7 +2983,7 @@ weechat_ruby_api_hook_signal (VALUE class, VALUE signal, VALUE function, char *c_signal, *c_function, *c_data, *result; VALUE return_value; - API_FUNC(1, "hook_signal", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_signal", API_RETURN_EMPTY); if (NIL_P (signal) || NIL_P (function) || NIL_P (data)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3013,7 +3012,7 @@ weechat_ruby_api_hook_signal_send (VALUE class, VALUE signal, VALUE type_data, char *c_signal, *c_type_data, *c_signal_data; int number, rc; - API_FUNC(1, "hook_signal_send", API_RETURN_INT(WEECHAT_RC_ERROR)); + API_INIT_FUNC(1, "hook_signal_send", API_RETURN_INT(WEECHAT_RC_ERROR)); if (NIL_P (signal) || NIL_P (type_data) || NIL_P (signal_data)) API_WRONG_ARGS(API_RETURN_INT(WEECHAT_RC_ERROR)); @@ -3092,7 +3091,7 @@ weechat_ruby_api_hook_hsignal (VALUE class, VALUE signal, VALUE function, char *c_signal, *c_function, *c_data, *result; VALUE return_value; - API_FUNC(1, "hook_hsignal", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_hsignal", API_RETURN_EMPTY); if (NIL_P (signal) || NIL_P (function) || NIL_P (data)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3121,7 +3120,7 @@ weechat_ruby_api_hook_hsignal_send (VALUE class, VALUE signal, VALUE hashtable) struct t_hashtable *c_hashtable; int rc; - API_FUNC(1, "hook_hsignal_send", API_RETURN_INT(WEECHAT_RC_ERROR)); + API_INIT_FUNC(1, "hook_hsignal_send", API_RETURN_INT(WEECHAT_RC_ERROR)); if (NIL_P (signal) || NIL_P (hashtable)) API_WRONG_ARGS(API_RETURN_INT(WEECHAT_RC_ERROR)); @@ -3184,7 +3183,7 @@ weechat_ruby_api_hook_config (VALUE class, VALUE option, VALUE function, char *c_option, *c_function, *c_data, *result; VALUE return_value; - API_FUNC(1, "hook_config", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_config", API_RETURN_EMPTY); if (NIL_P (option) || NIL_P (function) || NIL_P (data)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3256,7 +3255,7 @@ weechat_ruby_api_hook_completion (VALUE class, VALUE completion, char *c_completion, *c_description, *c_function, *c_data, *result; VALUE return_value; - API_FUNC(1, "hook_completion", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_completion", API_RETURN_EMPTY); if (NIL_P (completion) || NIL_P (description) || NIL_P (function) || NIL_P (data)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3290,7 +3289,7 @@ weechat_ruby_api_hook_completion_list_add (VALUE class, VALUE completion, char *c_completion, *c_word, *c_where; int c_nick_completion; - API_FUNC(1, "hook_completion_list_add", API_RETURN_ERROR); + API_INIT_FUNC(1, "hook_completion_list_add", API_RETURN_ERROR); if (NIL_P (completion) || NIL_P (word) || NIL_P (nick_completion) || NIL_P (where)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -3346,7 +3345,7 @@ weechat_ruby_api_hook_modifier (VALUE class, VALUE modifier, VALUE function, char *c_modifier, *c_function, *c_data, *result; VALUE return_value; - API_FUNC(1, "hook_modifier", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_modifier", API_RETURN_EMPTY); if (NIL_P (modifier) || NIL_P (function) || NIL_P (data)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3375,7 +3374,7 @@ weechat_ruby_api_hook_modifier_exec (VALUE class, VALUE modifier, char *c_modifier, *c_modifier_data, *c_string, *result; VALUE return_value; - API_FUNC(1, "hook_modifier_exec", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_modifier_exec", API_RETURN_EMPTY); if (NIL_P (modifier) || NIL_P (modifier_data) || NIL_P (string)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3425,7 +3424,7 @@ weechat_ruby_api_hook_info (VALUE class, VALUE info_name, VALUE description, char *c_data, *result; VALUE return_value; - API_FUNC(1, "hook_info", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_info", API_RETURN_EMPTY); if (NIL_P (info_name) || NIL_P (description) || NIL_P (args_description) || NIL_P (function) || NIL_P (data)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3491,7 +3490,7 @@ weechat_ruby_api_hook_info_hashtable (VALUE class, VALUE info_name, char *c_data, *result; VALUE return_value; - API_FUNC(1, "hook_info_hashtable", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_info_hashtable", API_RETURN_EMPTY); if (NIL_P (info_name) || NIL_P (description) || NIL_P (args_description) || NIL_P (output_description) || NIL_P (function) || NIL_P (data)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3565,7 +3564,7 @@ weechat_ruby_api_hook_infolist (VALUE class, VALUE infolist_name, char *c_args_description, *c_function, *c_data, *result; VALUE return_value; - API_FUNC(1, "hook_infolist", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_infolist", API_RETURN_EMPTY); if (NIL_P (infolist_name) || NIL_P (description) || NIL_P (pointer_description) || NIL_P (args_description) || NIL_P (function) || NIL_P (data)) @@ -3628,7 +3627,7 @@ weechat_ruby_api_hook_focus (VALUE class, VALUE area, VALUE function, char *c_area, *c_function, *c_data, *result; VALUE return_value; - API_FUNC(1, "hook_focus", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_focus", API_RETURN_EMPTY); if (NIL_P (area) || NIL_P (function) || NIL_P (data)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3656,7 +3655,7 @@ weechat_ruby_api_hook_set (VALUE class, VALUE hook, VALUE property, { char *c_hook, *c_property, *c_value; - API_FUNC(1, "hook_set", API_RETURN_ERROR); + API_INIT_FUNC(1, "hook_set", API_RETURN_ERROR); if (NIL_P (hook) || NIL_P (property) || NIL_P (value)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -3680,7 +3679,7 @@ weechat_ruby_api_unhook (VALUE class, VALUE hook) { char *c_hook; - API_FUNC(1, "unhook", API_RETURN_ERROR); + API_INIT_FUNC(1, "unhook", API_RETURN_ERROR); if (NIL_P (hook)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -3698,7 +3697,7 @@ weechat_ruby_api_unhook (VALUE class, VALUE hook) static VALUE weechat_ruby_api_unhook_all (VALUE class) { - API_FUNC(1, "unhook_all", API_RETURN_ERROR); + API_INIT_FUNC(1, "unhook_all", API_RETURN_ERROR); plugin_script_api_unhook_all (weechat_ruby_plugin, ruby_current_script); @@ -3788,7 +3787,7 @@ weechat_ruby_api_buffer_new (VALUE class, VALUE name, VALUE function_input, char *c_data_close, *result; VALUE return_value; - API_FUNC(1, "buffer_new", API_RETURN_EMPTY); + API_INIT_FUNC(1, "buffer_new", API_RETURN_EMPTY); if (NIL_P (name) || NIL_P (function_input) || NIL_P (data_input) || NIL_P (function_close) || NIL_P (data_close)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3824,7 +3823,7 @@ weechat_ruby_api_buffer_search (VALUE class, VALUE plugin, VALUE name) char *c_plugin, *c_name, *result; VALUE return_value; - API_FUNC(1, "buffer_search", API_RETURN_EMPTY); + API_INIT_FUNC(1, "buffer_search", API_RETURN_EMPTY); if (NIL_P (plugin) || NIL_P (name)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3845,7 +3844,7 @@ weechat_ruby_api_buffer_search_main (VALUE class) char *result; VALUE return_value; - API_FUNC(1, "buffer_search_main", API_RETURN_EMPTY); + API_INIT_FUNC(1, "buffer_search_main", API_RETURN_EMPTY); result = API_PTR2STR(weechat_buffer_search_main ()); @@ -3858,7 +3857,7 @@ weechat_ruby_api_current_buffer (VALUE class) char *result; VALUE return_value; - API_FUNC(1, "current_buffer", API_RETURN_EMPTY); + API_INIT_FUNC(1, "current_buffer", API_RETURN_EMPTY); result = API_PTR2STR(weechat_current_buffer ()); @@ -3870,7 +3869,7 @@ weechat_ruby_api_buffer_clear (VALUE class, VALUE buffer) { char *c_buffer; - API_FUNC(1, "buffer_clear", API_RETURN_ERROR); + API_INIT_FUNC(1, "buffer_clear", API_RETURN_ERROR); if (NIL_P (buffer)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -3888,7 +3887,7 @@ weechat_ruby_api_buffer_close (VALUE class, VALUE buffer) { char *c_buffer; - API_FUNC(1, "buffer_close", API_RETURN_ERROR); + API_INIT_FUNC(1, "buffer_close", API_RETURN_ERROR); if (NIL_P (buffer)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -3908,7 +3907,7 @@ weechat_ruby_api_buffer_merge (VALUE class, VALUE buffer, VALUE target_buffer) { char *c_buffer, *c_target_buffer; - API_FUNC(1, "buffer_merge", API_RETURN_ERROR); + API_INIT_FUNC(1, "buffer_merge", API_RETURN_ERROR); if (NIL_P (buffer) || NIL_P (target_buffer)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -3930,7 +3929,7 @@ weechat_ruby_api_buffer_unmerge (VALUE class, VALUE buffer, VALUE number) char *c_buffer; int c_number; - API_FUNC(1, "buffer_unmerge", API_RETURN_ERROR); + API_INIT_FUNC(1, "buffer_unmerge", API_RETURN_ERROR); if (NIL_P (buffer) || NIL_P (number)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -3951,7 +3950,7 @@ weechat_ruby_api_buffer_get_integer (VALUE class, VALUE buffer, VALUE property) char *c_buffer, *c_property; int value; - API_FUNC(1, "buffer_get_integer", API_RETURN_INT(-1)); + API_INIT_FUNC(1, "buffer_get_integer", API_RETURN_INT(-1)); if (NIL_P (buffer) || NIL_P (property)) API_WRONG_ARGS(API_RETURN_INT(-1)); @@ -3973,7 +3972,7 @@ weechat_ruby_api_buffer_get_string (VALUE class, VALUE buffer, VALUE property) char *c_buffer, *c_property; const char *result; - API_FUNC(1, "buffer_get_string", API_RETURN_EMPTY); + API_INIT_FUNC(1, "buffer_get_string", API_RETURN_EMPTY); if (NIL_P (buffer) || NIL_P (property)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3995,7 +3994,7 @@ weechat_ruby_api_buffer_get_pointer (VALUE class, VALUE buffer, VALUE property) char *c_buffer, *c_property, *result; VALUE return_value; - API_FUNC(1, "buffer_get_pointer", API_RETURN_EMPTY); + API_INIT_FUNC(1, "buffer_get_pointer", API_RETURN_EMPTY); if (NIL_P (buffer) || NIL_P (property)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4017,7 +4016,7 @@ weechat_ruby_api_buffer_set (VALUE class, VALUE buffer, VALUE property, { char *c_buffer, *c_property, *c_value; - API_FUNC(1, "buffer_set", API_RETURN_ERROR); + API_INIT_FUNC(1, "buffer_set", API_RETURN_ERROR); if (NIL_P (buffer) || NIL_P (property) || NIL_P (value)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -4042,7 +4041,7 @@ weechat_ruby_api_buffer_string_replace_local_var (VALUE class, VALUE buffer, VAL char *c_buffer, *c_string, *result; VALUE return_value; - API_FUNC(1, "buffer_string_replace_local_var", API_RETURN_ERROR); + API_INIT_FUNC(1, "buffer_string_replace_local_var", API_RETURN_ERROR); if (NIL_P (buffer) || NIL_P (string)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -4063,7 +4062,7 @@ weechat_ruby_api_buffer_match_list (VALUE class, VALUE buffer, VALUE string) char *c_buffer, *c_string; int value; - API_FUNC(1, "buffer_match_list", API_RETURN_INT(0)); + API_INIT_FUNC(1, "buffer_match_list", API_RETURN_INT(0)); if (NIL_P (buffer) || NIL_P (string)) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -4085,7 +4084,7 @@ weechat_ruby_api_current_window (VALUE class) char *result; VALUE return_value; - API_FUNC(1, "current_window", API_RETURN_EMPTY); + API_INIT_FUNC(1, "current_window", API_RETURN_EMPTY); result = API_PTR2STR(weechat_current_window ()); @@ -4098,7 +4097,7 @@ weechat_ruby_api_window_search_with_buffer (VALUE class, VALUE buffer) char *c_buffer, *result; VALUE return_value; - API_FUNC(1, "window_search_with_buffer", API_RETURN_EMPTY); + API_INIT_FUNC(1, "window_search_with_buffer", API_RETURN_EMPTY); if (NIL_P (buffer)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4117,7 +4116,7 @@ weechat_ruby_api_window_get_integer (VALUE class, VALUE window, VALUE property) char *c_window, *c_property; int value; - API_FUNC(1, "window_get_integer", API_RETURN_INT(-1)); + API_INIT_FUNC(1, "window_get_integer", API_RETURN_INT(-1)); if (NIL_P (window) || NIL_P (property)) API_WRONG_ARGS(API_RETURN_INT(-1)); @@ -4139,7 +4138,7 @@ weechat_ruby_api_window_get_string (VALUE class, VALUE window, VALUE property) char *c_window, *c_property; const char *result; - API_FUNC(1, "window_get_string", API_RETURN_EMPTY); + API_INIT_FUNC(1, "window_get_string", API_RETURN_EMPTY); if (NIL_P (window) || NIL_P (property)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4161,7 +4160,7 @@ weechat_ruby_api_window_get_pointer (VALUE class, VALUE window, VALUE property) char *c_window, *c_property, *result; VALUE return_value; - API_FUNC(1, "window_get_pointer", API_RETURN_EMPTY); + API_INIT_FUNC(1, "window_get_pointer", API_RETURN_EMPTY); if (NIL_P (window) || NIL_P (property)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4182,7 +4181,7 @@ weechat_ruby_api_window_set_title (VALUE class, VALUE title) { char *c_title; - API_FUNC(1, "window_set_title", API_RETURN_ERROR); + API_INIT_FUNC(1, "window_set_title", API_RETURN_ERROR); if (NIL_P (title)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -4204,7 +4203,7 @@ weechat_ruby_api_nicklist_add_group (VALUE class, VALUE buffer, int c_visible; VALUE return_value; - API_FUNC(1, "nicklist_add_group", API_RETURN_EMPTY); + API_INIT_FUNC(1, "nicklist_add_group", API_RETURN_EMPTY); if (NIL_P (buffer) || NIL_P (parent_group) || NIL_P (name) || NIL_P (color) || NIL_P (visible)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4237,7 +4236,7 @@ weechat_ruby_api_nicklist_search_group (VALUE class, VALUE buffer, char *c_buffer, *c_from_group, *c_name, *result; VALUE return_value; - API_FUNC(1, "nicklist_search_group", API_RETURN_EMPTY); + API_INIT_FUNC(1, "nicklist_search_group", API_RETURN_EMPTY); if (NIL_P (buffer) || NIL_P (from_group) || NIL_P (name)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4266,7 +4265,7 @@ weechat_ruby_api_nicklist_add_nick (VALUE class, VALUE buffer, VALUE group, int c_visible; VALUE return_value; - API_FUNC(1, "nicklist_add_nick", API_RETURN_EMPTY); + API_INIT_FUNC(1, "nicklist_add_nick", API_RETURN_EMPTY); if (NIL_P (buffer) || NIL_P (group) || NIL_P (name) || NIL_P (color) || NIL_P (prefix) || NIL_P (prefix_color) || NIL_P (visible)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4305,7 +4304,7 @@ weechat_ruby_api_nicklist_search_nick (VALUE class, VALUE buffer, char *c_buffer, *c_from_group, *c_name, *result; VALUE return_value; - API_FUNC(1, "nicklist_search_nick", API_RETURN_EMPTY); + API_INIT_FUNC(1, "nicklist_search_nick", API_RETURN_EMPTY); if (NIL_P (buffer) || NIL_P (from_group) || NIL_P (name)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4329,7 +4328,7 @@ weechat_ruby_api_nicklist_remove_group (VALUE class, VALUE buffer, VALUE group) { char *c_buffer, *c_group; - API_FUNC(1, "nicklist_remove_group", API_RETURN_ERROR); + API_INIT_FUNC(1, "nicklist_remove_group", API_RETURN_ERROR); if (NIL_P (buffer) || NIL_P (group)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -4350,7 +4349,7 @@ weechat_ruby_api_nicklist_remove_nick (VALUE class, VALUE buffer, VALUE nick) { char *c_buffer, *c_nick; - API_FUNC(1, "nicklist_remove_nick", API_RETURN_ERROR); + API_INIT_FUNC(1, "nicklist_remove_nick", API_RETURN_ERROR); if (NIL_P (buffer) || NIL_P (nick)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -4371,7 +4370,7 @@ weechat_ruby_api_nicklist_remove_all (VALUE class, VALUE buffer) { char *c_buffer; - API_FUNC(1, "nicklist_remove_all", API_RETURN_ERROR); + API_INIT_FUNC(1, "nicklist_remove_all", API_RETURN_ERROR); if (NIL_P (buffer)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -4391,7 +4390,7 @@ weechat_ruby_api_nicklist_group_get_integer (VALUE class, VALUE buffer, char *c_buffer, *c_group, *c_property; int value; - API_FUNC(1, "nicklist_group_get_integer", API_RETURN_INT(-1)); + API_INIT_FUNC(1, "nicklist_group_get_integer", API_RETURN_INT(-1)); if (NIL_P (buffer) || NIL_P (group) || NIL_P (property)) API_WRONG_ARGS(API_RETURN_INT(-1)); @@ -4417,7 +4416,7 @@ weechat_ruby_api_nicklist_group_get_string (VALUE class, VALUE buffer, char *c_buffer, *c_group, *c_property; const char *result; - API_FUNC(1, "nicklist_group_get_string", API_RETURN_EMPTY); + API_INIT_FUNC(1, "nicklist_group_get_string", API_RETURN_EMPTY); if (NIL_P (buffer) || NIL_P (group) || NIL_P (property)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4443,7 +4442,7 @@ weechat_ruby_api_nicklist_group_get_pointer (VALUE class, VALUE buffer, char *c_buffer, *c_group, *c_property, *result; VALUE return_value; - API_FUNC(1, "nicklist_group_get_pointer", API_RETURN_EMPTY); + API_INIT_FUNC(1, "nicklist_group_get_pointer", API_RETURN_EMPTY); if (NIL_P (buffer) || NIL_P (group) || NIL_P (property)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4468,7 +4467,7 @@ weechat_ruby_api_nicklist_group_set (VALUE class, VALUE buffer, VALUE group, { char *c_buffer, *c_group, *c_property, *c_value; - API_FUNC(1, "nicklist_group_set", API_RETURN_ERROR); + API_INIT_FUNC(1, "nicklist_group_set", API_RETURN_ERROR); if (NIL_P (buffer) || NIL_P (group) || NIL_P (property) || NIL_P (value)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -4497,7 +4496,7 @@ weechat_ruby_api_nicklist_nick_get_integer (VALUE class, VALUE buffer, char *c_buffer, *c_nick, *c_property; int value; - API_FUNC(1, "nicklist_nick_get_integer", API_RETURN_INT(-1)); + API_INIT_FUNC(1, "nicklist_nick_get_integer", API_RETURN_INT(-1)); if (NIL_P (buffer) || NIL_P (nick) || NIL_P (property)) API_WRONG_ARGS(API_RETURN_INT(-1)); @@ -4523,7 +4522,7 @@ weechat_ruby_api_nicklist_nick_get_string (VALUE class, VALUE buffer, char *c_buffer, *c_nick, *c_property; const char *result; - API_FUNC(1, "nicklist_nick_get_string", API_RETURN_EMPTY); + API_INIT_FUNC(1, "nicklist_nick_get_string", API_RETURN_EMPTY); if (NIL_P (buffer) || NIL_P (nick) || NIL_P (property)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4549,7 +4548,7 @@ weechat_ruby_api_nicklist_nick_get_pointer (VALUE class, VALUE buffer, char *c_buffer, *c_nick, *c_property, *result; VALUE return_value; - API_FUNC(1, "nicklist_nick_get_pointer", API_RETURN_EMPTY); + API_INIT_FUNC(1, "nicklist_nick_get_pointer", API_RETURN_EMPTY); if (NIL_P (buffer) || NIL_P (nick) || NIL_P (property)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4574,7 +4573,7 @@ weechat_ruby_api_nicklist_nick_set (VALUE class, VALUE buffer, VALUE nick, { char *c_buffer, *c_nick, *c_property, *c_value; - API_FUNC(1, "nicklist_nick_set", API_RETURN_ERROR); + API_INIT_FUNC(1, "nicklist_nick_set", API_RETURN_ERROR); if (NIL_P (buffer) || NIL_P (nick) || NIL_P (property) || NIL_P (value)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -4602,7 +4601,7 @@ weechat_ruby_api_bar_item_search (VALUE class, VALUE name) char *c_name, *result; VALUE return_value; - API_FUNC(1, "bar_item_search", API_RETURN_EMPTY); + API_INIT_FUNC(1, "bar_item_search", API_RETURN_EMPTY); if (NIL_P (name)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4681,7 +4680,7 @@ weechat_ruby_api_bar_item_new (VALUE class, VALUE name, VALUE function, char *c_name, *c_function, *c_data, *result; VALUE return_value; - API_FUNC(1, "bar_item_new", API_RETURN_EMPTY); + API_INIT_FUNC(1, "bar_item_new", API_RETURN_EMPTY); if (NIL_P (name) || NIL_P (function) || NIL_P (data)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4708,7 +4707,7 @@ weechat_ruby_api_bar_item_update (VALUE class, VALUE name) { char *c_name; - API_FUNC(1, "bar_item_update", API_RETURN_ERROR); + API_INIT_FUNC(1, "bar_item_update", API_RETURN_ERROR); if (NIL_P (name)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -4726,7 +4725,7 @@ weechat_ruby_api_bar_item_remove (VALUE class, VALUE item) { char *c_item; - API_FUNC(1, "bar_item_remove", API_RETURN_ERROR); + API_INIT_FUNC(1, "bar_item_remove", API_RETURN_ERROR); if (NIL_P (item)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -4747,7 +4746,7 @@ weechat_ruby_api_bar_search (VALUE class, VALUE name) char *c_name, *result; VALUE return_value; - API_FUNC(1, "bar_search", API_RETURN_EMPTY); + API_INIT_FUNC(1, "bar_search", API_RETURN_EMPTY); if (NIL_P (name)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4774,7 +4773,7 @@ weechat_ruby_api_bar_new (VALUE class, VALUE name, VALUE hidden, char *result; VALUE return_value; - API_FUNC(1, "bar_new", API_RETURN_EMPTY); + API_INIT_FUNC(1, "bar_new", API_RETURN_EMPTY); if (NIL_P (name) || NIL_P (hidden) || NIL_P (priority) || NIL_P (type) || NIL_P (conditions) || NIL_P (position) || NIL_P (filling_top_bottom) || NIL_P (filling_left_right) || NIL_P (size) || NIL_P (size_max) @@ -4838,7 +4837,7 @@ weechat_ruby_api_bar_set (VALUE class, VALUE bar, VALUE property, VALUE value) { char *c_bar, *c_property, *c_value; - API_FUNC(1, "bar_set", API_RETURN_ERROR); + API_INIT_FUNC(1, "bar_set", API_RETURN_ERROR); if (NIL_P (bar) || NIL_P (property) || NIL_P (value)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -4862,7 +4861,7 @@ weechat_ruby_api_bar_update (VALUE class, VALUE name) { char *c_name; - API_FUNC(1, "bar_update", API_RETURN_ERROR); + API_INIT_FUNC(1, "bar_update", API_RETURN_ERROR); if (NIL_P (name)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -4880,7 +4879,7 @@ weechat_ruby_api_bar_remove (VALUE class, VALUE bar) { char *c_bar; - API_FUNC(1, "bar_remove", API_RETURN_ERROR); + API_INIT_FUNC(1, "bar_remove", API_RETURN_ERROR); if (NIL_P (bar)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -4899,7 +4898,7 @@ weechat_ruby_api_command (VALUE class, VALUE buffer, VALUE command) char *c_buffer, *c_command; int rc; - API_FUNC(1, "command", API_RETURN_ERROR); + API_INIT_FUNC(1, "command", API_RETURN_ERROR); if (NIL_P (buffer) || NIL_P (command)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -4923,7 +4922,7 @@ weechat_ruby_api_info_get (VALUE class, VALUE info_name, VALUE arguments) char *c_info_name, *c_arguments; const char *result; - API_FUNC(1, "info_get", API_RETURN_EMPTY); + API_INIT_FUNC(1, "info_get", API_RETURN_EMPTY); if (NIL_P (info_name) || NIL_P (arguments)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4946,7 +4945,7 @@ weechat_ruby_api_info_get_hashtable (VALUE class, VALUE info_name, struct t_hashtable *c_hashtable, *result_hashtable; VALUE result_hash; - API_FUNC(1, "info_get_hashtable", API_RETURN_EMPTY); + API_INIT_FUNC(1, "info_get_hashtable", API_RETURN_EMPTY); if (NIL_P (info_name) || NIL_P (hash)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4976,7 +4975,7 @@ weechat_ruby_api_infolist_new (VALUE class) char *result; VALUE return_value; - API_FUNC(1, "infolist_new", API_RETURN_EMPTY); + API_INIT_FUNC(1, "infolist_new", API_RETURN_EMPTY); result = API_PTR2STR(weechat_infolist_new ()); @@ -4989,7 +4988,7 @@ weechat_ruby_api_infolist_new_item (VALUE class, VALUE infolist) char *c_infolist, *result; VALUE return_value; - API_FUNC(1, "infolist_new_item", API_RETURN_EMPTY); + API_INIT_FUNC(1, "infolist_new_item", API_RETURN_EMPTY); if (NIL_P (infolist)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -5010,7 +5009,7 @@ weechat_ruby_api_infolist_new_var_integer (VALUE class, VALUE infolist, int c_value; VALUE return_value; - API_FUNC(1, "infolist_new_var_integer", API_RETURN_EMPTY); + API_INIT_FUNC(1, "infolist_new_var_integer", API_RETURN_EMPTY); if (NIL_P (infolist) || NIL_P (name) || NIL_P (value)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -5036,7 +5035,7 @@ weechat_ruby_api_infolist_new_var_string (VALUE class, VALUE infolist, char *c_infolist, *c_name, *c_value, *result; VALUE return_value; - API_FUNC(1, "infolist_new_var_string", API_RETURN_EMPTY); + API_INIT_FUNC(1, "infolist_new_var_string", API_RETURN_EMPTY); if (NIL_P (infolist) || NIL_P (name) || NIL_P (value)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -5062,7 +5061,7 @@ weechat_ruby_api_infolist_new_var_pointer (VALUE class, VALUE infolist, char *c_infolist, *c_name, *c_value, *result; VALUE return_value; - API_FUNC(1, "infolist_new_var_pointer", API_RETURN_EMPTY); + API_INIT_FUNC(1, "infolist_new_var_pointer", API_RETURN_EMPTY); if (NIL_P (infolist) || NIL_P (name) || NIL_P (value)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -5089,7 +5088,7 @@ weechat_ruby_api_infolist_new_var_time (VALUE class, VALUE infolist, int c_value; VALUE return_value; - API_FUNC(1, "infolist_new_var_time", API_RETURN_EMPTY); + API_INIT_FUNC(1, "infolist_new_var_time", API_RETURN_EMPTY); if (NIL_P (infolist) || NIL_P (name) || NIL_P (value)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -5115,7 +5114,7 @@ weechat_ruby_api_infolist_get (VALUE class, VALUE name, VALUE pointer, char *c_name, *c_pointer, *c_arguments, *result; VALUE return_value; - API_FUNC(1, "infolist_get", API_RETURN_EMPTY); + API_INIT_FUNC(1, "infolist_get", API_RETURN_EMPTY); if (NIL_P (name) || NIL_P (pointer) || NIL_P (arguments)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -5140,7 +5139,7 @@ weechat_ruby_api_infolist_next (VALUE class, VALUE infolist) char *c_infolist; int value; - API_FUNC(1, "infolist_next", API_RETURN_INT(0)); + API_INIT_FUNC(1, "infolist_next", API_RETURN_INT(0)); if (NIL_P (infolist)) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -5159,7 +5158,7 @@ weechat_ruby_api_infolist_prev (VALUE class, VALUE infolist) char *c_infolist; int value; - API_FUNC(1, "infolist_prev", API_RETURN_INT(0)); + API_INIT_FUNC(1, "infolist_prev", API_RETURN_INT(0)); if (NIL_P (infolist)) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -5177,7 +5176,7 @@ weechat_ruby_api_infolist_reset_item_cursor (VALUE class, VALUE infolist) { char *c_infolist; - API_FUNC(1, "infolist_reset_item_cursor", API_RETURN_ERROR); + API_INIT_FUNC(1, "infolist_reset_item_cursor", API_RETURN_ERROR); if (NIL_P (infolist)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -5196,7 +5195,7 @@ weechat_ruby_api_infolist_fields (VALUE class, VALUE infolist) char *c_infolist; const char *result; - API_FUNC(1, "infolist_fields", API_RETURN_EMPTY); + API_INIT_FUNC(1, "infolist_fields", API_RETURN_EMPTY); if (NIL_P (infolist)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -5215,7 +5214,7 @@ weechat_ruby_api_infolist_integer (VALUE class, VALUE infolist, VALUE variable) char *c_infolist, *c_variable; int value; - API_FUNC(1, "infolist_integer", API_RETURN_INT(0)); + API_INIT_FUNC(1, "infolist_integer", API_RETURN_INT(0)); if (NIL_P (infolist) || NIL_P (variable)) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -5236,7 +5235,7 @@ weechat_ruby_api_infolist_string (VALUE class, VALUE infolist, VALUE variable) char *c_infolist, *c_variable; const char *result; - API_FUNC(1, "infolist_string", API_RETURN_EMPTY); + API_INIT_FUNC(1, "infolist_string", API_RETURN_EMPTY); if (NIL_P (infolist) || NIL_P (variable)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -5257,7 +5256,7 @@ weechat_ruby_api_infolist_pointer (VALUE class, VALUE infolist, VALUE variable) char *c_infolist, *c_variable, *result; VALUE return_value; - API_FUNC(1, "infolist_pointer", API_RETURN_EMPTY); + API_INIT_FUNC(1, "infolist_pointer", API_RETURN_EMPTY); if (NIL_P (infolist) || NIL_P (variable)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -5280,7 +5279,7 @@ weechat_ruby_api_infolist_time (VALUE class, VALUE infolist, VALUE variable) struct tm *date_tmp; VALUE return_value; - API_FUNC(1, "infolist_time", API_RETURN_EMPTY); + API_INIT_FUNC(1, "infolist_time", API_RETURN_EMPTY); if (NIL_P (infolist) || NIL_P (variable)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -5305,7 +5304,7 @@ weechat_ruby_api_infolist_free (VALUE class, VALUE infolist) { char *c_infolist; - API_FUNC(1, "infolist_free", API_RETURN_ERROR); + API_INIT_FUNC(1, "infolist_free", API_RETURN_ERROR); if (NIL_P (infolist)) API_WRONG_ARGS(API_RETURN_ERROR); @@ -5324,7 +5323,7 @@ weechat_ruby_api_hdata_get (VALUE class, VALUE name) char *c_name, *result; VALUE return_value; - API_FUNC(1, "hdata_get", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hdata_get", API_RETURN_EMPTY); if (NIL_P (name)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -5343,7 +5342,7 @@ weechat_ruby_api_hdata_get_var_offset (VALUE class, VALUE hdata, VALUE name) char *c_hdata, *c_name; int value; - API_FUNC(1, "hdata_get_var_offset", API_RETURN_INT(0)); + API_INIT_FUNC(1, "hdata_get_var_offset", API_RETURN_INT(0)); if (NIL_P (hdata) || NIL_P (name)) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -5365,7 +5364,7 @@ weechat_ruby_api_hdata_get_var_type_string (VALUE class, VALUE hdata, char *c_hdata, *c_name; const char *result; - API_FUNC(1, "hdata_get_var_type_string", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hdata_get_var_type_string", API_RETURN_EMPTY); if (NIL_P (hdata) || NIL_P (name)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -5387,7 +5386,7 @@ weechat_ruby_api_hdata_get_var_array_size (VALUE class, VALUE hdata, VALUE point char *c_hdata, *c_pointer, *c_name; int value; - API_FUNC(1, "hdata_get_var_array_size", API_RETURN_INT(-1)); + API_INIT_FUNC(1, "hdata_get_var_array_size", API_RETURN_INT(-1)); if (NIL_P (hdata) || NIL_P (pointer) || NIL_P (name)) API_WRONG_ARGS(API_RETURN_INT(-1)); @@ -5413,7 +5412,7 @@ weechat_ruby_api_hdata_get_var_array_size_string (VALUE class, VALUE hdata, char *c_hdata, *c_pointer, *c_name; const char *result; - API_FUNC(1, "hdata_get_var_array_size_string", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hdata_get_var_array_size_string", API_RETURN_EMPTY); if (NIL_P (hdata) || NIL_P (pointer) || NIL_P (name)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -5438,7 +5437,7 @@ weechat_ruby_api_hdata_get_var_hdata (VALUE class, VALUE hdata, VALUE name) char *c_hdata, *c_name; const char *result; - API_FUNC(1, "hdata_get_var_hdata", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hdata_get_var_hdata", API_RETURN_EMPTY); if (NIL_P (hdata) || NIL_P (name)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -5459,7 +5458,7 @@ weechat_ruby_api_hdata_get_list (VALUE class, VALUE hdata, VALUE name) char *c_hdata, *c_name, *result; VALUE return_value; - API_FUNC(1, "hdata_get_list", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hdata_get_list", API_RETURN_EMPTY); if (NIL_P (hdata) || NIL_P (name)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -5482,7 +5481,7 @@ weechat_ruby_api_hdata_check_pointer (VALUE class, VALUE hdata, VALUE list, char *c_hdata, *c_list, *c_pointer; int value; - API_FUNC(1, "hdata_check_pointer", API_RETURN_INT(0)); + API_INIT_FUNC(1, "hdata_check_pointer", API_RETURN_INT(0)); if (NIL_P (hdata) || NIL_P (list) || NIL_P (pointer)) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -5509,7 +5508,7 @@ weechat_ruby_api_hdata_move (VALUE class, VALUE hdata, VALUE pointer, int c_count; VALUE return_value; - API_FUNC(1, "hdata_move", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hdata_move", API_RETURN_EMPTY); if (NIL_P (hdata) || NIL_P (pointer) || NIL_P (count)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -5536,7 +5535,7 @@ weechat_ruby_api_hdata_search (VALUE class, VALUE hdata, VALUE pointer, int c_move; VALUE return_value; - API_FUNC(1, "hdata_search", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hdata_search", API_RETURN_EMPTY); if (NIL_P (hdata) || NIL_P (pointer) || NIL_P (search) || NIL_P (move)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -5565,7 +5564,7 @@ weechat_ruby_api_hdata_char (VALUE class, VALUE hdata, VALUE pointer, char *c_hdata, *c_pointer, *c_name; int value; - API_FUNC(1, "hdata_char", API_RETURN_INT(0)); + API_INIT_FUNC(1, "hdata_char", API_RETURN_INT(0)); if (NIL_P (hdata) || NIL_P (pointer) || NIL_P (name)) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -5591,7 +5590,7 @@ weechat_ruby_api_hdata_integer (VALUE class, VALUE hdata, VALUE pointer, char *c_hdata, *c_pointer, *c_name; int value; - API_FUNC(1, "hdata_integer", API_RETURN_INT(0)); + API_INIT_FUNC(1, "hdata_integer", API_RETURN_INT(0)); if (NIL_P (hdata) || NIL_P (pointer) || NIL_P (name)) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -5617,7 +5616,7 @@ weechat_ruby_api_hdata_long (VALUE class, VALUE hdata, VALUE pointer, char *c_hdata, *c_pointer, *c_name; long value; - API_FUNC(1, "hdata_long", API_RETURN_LONG(0)); + API_INIT_FUNC(1, "hdata_long", API_RETURN_LONG(0)); if (NIL_P (hdata) || NIL_P (pointer) || NIL_P (name)) API_WRONG_ARGS(API_RETURN_LONG(0)); @@ -5643,7 +5642,7 @@ weechat_ruby_api_hdata_string (VALUE class, VALUE hdata, VALUE pointer, char *c_hdata, *c_pointer, *c_name; const char *result; - API_FUNC(1, "hdata_string", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hdata_string", API_RETURN_EMPTY); if (NIL_P (hdata) || NIL_P (pointer) || NIL_P (name)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -5669,7 +5668,7 @@ weechat_ruby_api_hdata_pointer (VALUE class, VALUE hdata, VALUE pointer, char *c_hdata, *c_pointer, *c_name, *result; VALUE return_value; - API_FUNC(1, "hdata_pointer", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hdata_pointer", API_RETURN_EMPTY); if (NIL_P (hdata) || NIL_P (pointer) || NIL_P (name)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -5696,7 +5695,7 @@ weechat_ruby_api_hdata_time (VALUE class, VALUE hdata, VALUE pointer, time_t time; VALUE return_value; - API_FUNC(1, "hdata_time", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hdata_time", API_RETURN_EMPTY); if (NIL_P (hdata) || NIL_P (pointer) || NIL_P (name)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -5725,7 +5724,7 @@ weechat_ruby_api_hdata_hashtable (VALUE class, VALUE hdata, VALUE pointer, char *c_hdata, *c_pointer, *c_name; VALUE result_hash; - API_FUNC(1, "hdata_hashtable", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hdata_hashtable", API_RETURN_EMPTY); if (NIL_P (hdata) || NIL_P (pointer) || NIL_P (name)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -5753,7 +5752,7 @@ weechat_ruby_api_hdata_update (VALUE class, VALUE hdata, VALUE pointer, struct t_hashtable *c_hashtable; int value; - API_FUNC(1, "hdata_update", API_RETURN_INT(0)); + API_INIT_FUNC(1, "hdata_update", API_RETURN_INT(0)); if (NIL_P (hdata) || NIL_P (pointer) || NIL_P (hashtable)) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -5784,7 +5783,7 @@ weechat_ruby_api_hdata_get_string (VALUE class, VALUE hdata, VALUE property) char *c_hdata, *c_property; const char *result; - API_FUNC(1, "hdata_get_string", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hdata_get_string", API_RETURN_EMPTY); if (NIL_P (hdata) || NIL_P (property)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -5807,7 +5806,7 @@ weechat_ruby_api_upgrade_new (VALUE class, VALUE filename, VALUE write) int c_write; VALUE return_value; - API_FUNC(1, "upgrade_new", API_RETURN_EMPTY); + API_INIT_FUNC(1, "upgrade_new", API_RETURN_EMPTY); if (NIL_P (filename) || NIL_P (write)) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -5830,7 +5829,7 @@ weechat_ruby_api_upgrade_write_object (VALUE class, VALUE upgrade_file, char *c_upgrade_file, *c_infolist; int c_object_id, rc; - API_FUNC(1, "upgrade_write_object", API_RETURN_INT(0)); + API_INIT_FUNC(1, "upgrade_write_object", API_RETURN_INT(0)); if (NIL_P (upgrade_file) || NIL_P (object_id) || NIL_P (infolist)) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -5901,7 +5900,7 @@ weechat_ruby_api_upgrade_read (VALUE class, VALUE upgrade_file, char *c_upgrade_file, *c_function, *c_data; int rc; - API_FUNC(1, "upgrade_read", API_RETURN_INT(0)); + API_INIT_FUNC(1, "upgrade_read", API_RETURN_INT(0)); if (NIL_P (upgrade_file) || NIL_P (function) || NIL_P (data)) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -5928,7 +5927,7 @@ weechat_ruby_api_upgrade_close (VALUE class, VALUE upgrade_file) { char *c_upgrade_file; - API_FUNC(1, "upgrade_close", API_RETURN_ERROR); + API_INIT_FUNC(1, "upgrade_close", API_RETURN_ERROR); if (NIL_P (upgrade_file)) API_WRONG_ARGS(API_RETURN_ERROR); diff --git a/src/plugins/tcl/weechat-tcl-api.c b/src/plugins/tcl/weechat-tcl-api.c index bb8b47191..421847a48 100644 --- a/src/plugins/tcl/weechat-tcl-api.c +++ b/src/plugins/tcl/weechat-tcl-api.c @@ -36,7 +36,18 @@ #include "weechat-tcl.h" -#define API_FUNC(__init, __name, __ret) \ +#define API_DEF_FUNC(__name) \ + Tcl_CreateObjCommand (interp, "weechat::" #__name, \ + weechat_tcl_api_##__name, \ + (ClientData) NULL, \ + (Tcl_CmdDeleteProc*)NULL); +#define API_FUNC(__name) \ + static int \ + weechat_tcl_api_##__name (ClientData clientData, \ + Tcl_Interp *interp, \ + int objc, \ + Tcl_Obj *CONST objv[]) +#define API_INIT_FUNC(__init, __name, __ret) \ char *tcl_function_name = __name; \ (void) clientData; \ if (__init \ @@ -199,27 +210,19 @@ return TCL_OK; \ } -#define API_DEF_FUNC(__name) \ - Tcl_CreateObjCommand (interp, "weechat::" #__name, \ - weechat_tcl_api_##__name, \ - (ClientData) NULL, \ - (Tcl_CmdDeleteProc*)NULL); - /* * Registers a tcl script. */ -static int -weechat_tcl_api_register (ClientData clientData, Tcl_Interp *interp, int objc, - Tcl_Obj *CONST objv[]) +API_FUNC(register) { Tcl_Obj *objp; char *name, *author, *version, *license, *description, *shutdown_func; char *charset; int i; - API_FUNC(0, "register", API_RETURN_ERROR); + API_INIT_FUNC(0, "register", API_RETURN_ERROR); if (tcl_registered_script) { /* script already registered */ @@ -289,16 +292,14 @@ weechat_tcl_api_register (ClientData clientData, Tcl_Interp *interp, int objc, * core. */ -static int -weechat_tcl_api_plugin_get_name (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(plugin_get_name) { Tcl_Obj *objp; char *plugin; const char *result; int i; - API_FUNC(1, "plugin_get_name", API_RETURN_EMPTY); + API_INIT_FUNC(1, "plugin_get_name", API_RETURN_EMPTY); if (objc < 2) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -309,14 +310,12 @@ weechat_tcl_api_plugin_get_name (ClientData clientData, Tcl_Interp *interp, API_RETURN_STRING(result); } -static int -weechat_tcl_api_charset_set (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(charset_set) { Tcl_Obj *objp; int i; - API_FUNC(1, "charset_set", API_RETURN_ERROR); + API_INIT_FUNC(1, "charset_set", API_RETURN_ERROR); if (objc < 2) API_WRONG_ARGS(API_RETURN_ERROR); @@ -326,15 +325,13 @@ weechat_tcl_api_charset_set (ClientData clientData, Tcl_Interp *interp, API_RETURN_OK; } -static int -weechat_tcl_api_iconv_to_internal (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(iconv_to_internal) { Tcl_Obj *objp; char *result, *charset, *string; int i; - API_FUNC(1, "iconv_to_internal", API_RETURN_EMPTY); + API_INIT_FUNC(1, "iconv_to_internal", API_RETURN_EMPTY); if (objc < 3) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -346,15 +343,13 @@ weechat_tcl_api_iconv_to_internal (ClientData clientData, Tcl_Interp *interp, API_RETURN_STRING_FREE(result); } -static int -weechat_tcl_api_iconv_from_internal (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(iconv_from_internal) { Tcl_Obj *objp; char *result, *charset, *string; int i; - API_FUNC(1, "iconv_from_internal", API_RETURN_EMPTY); + API_INIT_FUNC(1, "iconv_from_internal", API_RETURN_EMPTY); if (objc < 3) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -366,15 +361,13 @@ weechat_tcl_api_iconv_from_internal (ClientData clientData, Tcl_Interp *interp, API_RETURN_STRING_FREE(result); } -static int -weechat_tcl_api_gettext (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(gettext) { Tcl_Obj *objp; const char *result; int i; - API_FUNC(1, "gettext", API_RETURN_EMPTY); + API_INIT_FUNC(1, "gettext", API_RETURN_EMPTY); if (objc < 2) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -383,16 +376,14 @@ weechat_tcl_api_gettext (ClientData clientData, Tcl_Interp *interp, API_RETURN_STRING(result); } -static int -weechat_tcl_api_ngettext (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(ngettext) { Tcl_Obj *objp; char *single, *plural; const char *result; int i, count; - API_FUNC(1, "ngettext", API_RETURN_EMPTY); + API_INIT_FUNC(1, "ngettext", API_RETURN_EMPTY); if (objc < 4) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -407,15 +398,13 @@ weechat_tcl_api_ngettext (ClientData clientData, Tcl_Interp *interp, API_RETURN_STRING(result); } -static int -weechat_tcl_api_strlen_screen (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(strlen_screen) { Tcl_Obj *objp; char *string; int result, i; - API_FUNC(1, "strlen_screen", API_RETURN_INT(0)); + API_INIT_FUNC(1, "strlen_screen", API_RETURN_INT(0)); if (objc < 2) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -426,15 +415,13 @@ weechat_tcl_api_strlen_screen (ClientData clientData, Tcl_Interp *interp, API_RETURN_INT(result); } -static int -weechat_tcl_api_string_match (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(string_match) { Tcl_Obj *objp; char *string, *mask; int case_sensitive, result, i; - API_FUNC(1, "string_match", API_RETURN_INT(0)); + API_INIT_FUNC(1, "string_match", API_RETURN_INT(0)); if (objc < 4) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -449,16 +436,13 @@ weechat_tcl_api_string_match (ClientData clientData, Tcl_Interp *interp, API_RETURN_INT(result); } -static int -weechat_tcl_api_string_has_highlight (ClientData clientData, - Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(string_has_highlight) { Tcl_Obj *objp; char *string, *highlight_words; int result, i; - API_FUNC(1, "string_has_highlight", API_RETURN_INT(0)); + API_INIT_FUNC(1, "string_has_highlight", API_RETURN_INT(0)); if (objc < 3) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -470,16 +454,13 @@ weechat_tcl_api_string_has_highlight (ClientData clientData, API_RETURN_INT(result); } -static int -weechat_tcl_api_string_has_highlight_regex (ClientData clientData, - Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(string_has_highlight_regex) { Tcl_Obj *objp; char *string, *regex; int result, i; - API_FUNC(1, "string_has_highlight_regex", API_RETURN_INT(0)); + API_INIT_FUNC(1, "string_has_highlight_regex", API_RETURN_INT(0)); if (objc < 3) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -491,16 +472,13 @@ weechat_tcl_api_string_has_highlight_regex (ClientData clientData, API_RETURN_INT(result); } -static int -weechat_tcl_api_string_mask_to_regex (ClientData clientData, - Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(string_mask_to_regex) { Tcl_Obj *objp; char *result, *mask; int i; - API_FUNC(1, "string_mask_to_regex", API_RETURN_EMPTY); + API_INIT_FUNC(1, "string_mask_to_regex", API_RETURN_EMPTY); if (objc < 2) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -511,15 +489,13 @@ weechat_tcl_api_string_mask_to_regex (ClientData clientData, API_RETURN_STRING_FREE(result); } -static int -weechat_tcl_api_string_remove_color (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(string_remove_color) { Tcl_Obj *objp; char *result, *replacement, *string; int i; - API_FUNC(1, "string_remove_color", API_RETURN_EMPTY); + API_INIT_FUNC(1, "string_remove_color", API_RETURN_EMPTY); if (objc < 3) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -531,14 +507,12 @@ weechat_tcl_api_string_remove_color (ClientData clientData, Tcl_Interp *interp, API_RETURN_STRING_FREE(result); } -static int -weechat_tcl_api_string_is_command_char (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(string_is_command_char) { Tcl_Obj *objp; int result, i; - API_FUNC(1, "string_is_command_char", API_RETURN_INT(0)); + API_INIT_FUNC(1, "string_is_command_char", API_RETURN_INT(0)); if (objc < 2) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -547,15 +521,13 @@ weechat_tcl_api_string_is_command_char (ClientData clientData, Tcl_Interp *inter API_RETURN_INT(result); } -static int -weechat_tcl_api_string_input_for_buffer (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(string_input_for_buffer) { Tcl_Obj *objp; const char *result; int i; - API_FUNC(1, "string_input_for_buffer", API_RETURN_EMPTY); + API_INIT_FUNC(1, "string_input_for_buffer", API_RETURN_EMPTY); if (objc < 2) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -564,17 +536,14 @@ weechat_tcl_api_string_input_for_buffer (ClientData clientData, Tcl_Interp *inte API_RETURN_STRING(result); } -static int -weechat_tcl_api_string_eval_expression (ClientData clientData, - Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(string_eval_expression) { Tcl_Obj *objp; char *expr, *result; struct t_hashtable *pointers, *extra_vars, *options; int i; - API_FUNC(1, "string_eval_expression", API_RETURN_EMPTY); + API_INIT_FUNC(1, "string_eval_expression", API_RETURN_EMPTY); if (objc < 5) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -605,14 +574,12 @@ weechat_tcl_api_string_eval_expression (ClientData clientData, API_RETURN_STRING_FREE(result); } -static int -weechat_tcl_api_mkdir_home (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(mkdir_home) { Tcl_Obj *objp; int i, mode; - API_FUNC(1, "mkdir_home", API_RETURN_ERROR); + API_INIT_FUNC(1, "mkdir_home", API_RETURN_ERROR); if (objc < 3) API_WRONG_ARGS(API_RETURN_ERROR); @@ -626,14 +593,12 @@ weechat_tcl_api_mkdir_home (ClientData clientData, Tcl_Interp *interp, API_RETURN_ERROR; } -static int -weechat_tcl_api_mkdir (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(mkdir) { Tcl_Obj *objp; int i, mode; - API_FUNC(1, "mkdir", API_RETURN_ERROR); + API_INIT_FUNC(1, "mkdir", API_RETURN_ERROR); if (objc < 3) API_WRONG_ARGS(API_RETURN_ERROR); @@ -647,14 +612,12 @@ weechat_tcl_api_mkdir (ClientData clientData, Tcl_Interp *interp, API_RETURN_ERROR; } -static int -weechat_tcl_api_mkdir_parents (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(mkdir_parents) { Tcl_Obj *objp; int i, mode; - API_FUNC(1, "mkdir_parents", API_RETURN_ERROR); + API_INIT_FUNC(1, "mkdir_parents", API_RETURN_ERROR); if (objc < 3) API_WRONG_ARGS(API_RETURN_ERROR); @@ -668,9 +631,7 @@ weechat_tcl_api_mkdir_parents (ClientData clientData, Tcl_Interp *interp, API_RETURN_ERROR; } -static int -weechat_tcl_api_list_new (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(list_new) { Tcl_Obj *objp; char *result; @@ -680,23 +641,21 @@ weechat_tcl_api_list_new (ClientData clientData, Tcl_Interp *interp, (void) objc; (void) objv; - API_FUNC(1, "list_new", API_RETURN_EMPTY); + API_INIT_FUNC(1, "list_new", API_RETURN_EMPTY); result = API_PTR2STR(weechat_list_new ()); API_RETURN_STRING_FREE(result); } -static int -weechat_tcl_api_list_add (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(list_add) { Tcl_Obj *objp; char *result, *weelist, *data, *where, *user_data; int i; - API_FUNC(1, "list_add", API_RETURN_EMPTY); + API_INIT_FUNC(1, "list_add", API_RETURN_EMPTY); if (objc < 5) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -713,15 +672,13 @@ weechat_tcl_api_list_add (ClientData clientData, Tcl_Interp *interp, API_RETURN_STRING_FREE(result); } -static int -weechat_tcl_api_list_search (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(list_search) { Tcl_Obj *objp; char *result, *weelist, *data; int i; - API_FUNC(1, "list_search", API_RETURN_EMPTY); + API_INIT_FUNC(1, "list_search", API_RETURN_EMPTY); if (objc < 3) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -734,15 +691,13 @@ weechat_tcl_api_list_search (ClientData clientData, Tcl_Interp *interp, API_RETURN_STRING_FREE(result); } -static int -weechat_tcl_api_list_search_pos (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(list_search_pos) { Tcl_Obj *objp; char *weelist, *data; int i, pos; - API_FUNC(1, "list_search_pos", API_RETURN_INT(-1)); + API_INIT_FUNC(1, "list_search_pos", API_RETURN_INT(-1)); if (objc < 3) API_WRONG_ARGS(API_RETURN_INT(-1)); @@ -754,15 +709,13 @@ weechat_tcl_api_list_search_pos (ClientData clientData, Tcl_Interp *interp, API_RETURN_INT(pos); } -static int -weechat_tcl_api_list_casesearch (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(list_casesearch) { Tcl_Obj *objp; char *result, *weelist, *data; int i; - API_FUNC(1, "list_casesearch", API_RETURN_EMPTY); + API_INIT_FUNC(1, "list_casesearch", API_RETURN_EMPTY); if (objc < 3) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -775,15 +728,13 @@ weechat_tcl_api_list_casesearch (ClientData clientData, Tcl_Interp *interp, API_RETURN_STRING_FREE(result); } -static int -weechat_tcl_api_list_casesearch_pos (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(list_casesearch_pos) { Tcl_Obj *objp; char *weelist, *data; int i, pos; - API_FUNC(1, "list_casesearch_pos", API_RETURN_INT(-1)); + API_INIT_FUNC(1, "list_casesearch_pos", API_RETURN_INT(-1)); if (objc < 3) API_WRONG_ARGS(API_RETURN_INT(-1)); @@ -795,15 +746,13 @@ weechat_tcl_api_list_casesearch_pos (ClientData clientData, Tcl_Interp *interp, API_RETURN_INT(pos); } -static int -weechat_tcl_api_list_get (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(list_get) { Tcl_Obj *objp; char *result; int i, position; - API_FUNC(1, "list_get", API_RETURN_EMPTY); + API_INIT_FUNC(1, "list_get", API_RETURN_EMPTY); if (objc < 3) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -816,15 +765,13 @@ weechat_tcl_api_list_get (ClientData clientData, Tcl_Interp *interp, API_RETURN_STRING_FREE(result); } -static int -weechat_tcl_api_list_set (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(list_set) { Tcl_Obj *objp; char *item, *new_value; int i; - API_FUNC(1, "list_set", API_RETURN_ERROR); + API_INIT_FUNC(1, "list_set", API_RETURN_ERROR); if (objc < 3) API_WRONG_ARGS(API_RETURN_ERROR); @@ -836,15 +783,13 @@ weechat_tcl_api_list_set (ClientData clientData, Tcl_Interp *interp, API_RETURN_OK; } -static int -weechat_tcl_api_list_next (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(list_next) { Tcl_Obj *objp; char *result; int i; - API_FUNC(1, "list_next", API_RETURN_EMPTY); + API_INIT_FUNC(1, "list_next", API_RETURN_EMPTY); if (objc < 2) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -853,15 +798,13 @@ weechat_tcl_api_list_next (ClientData clientData, Tcl_Interp *interp, API_RETURN_STRING_FREE(result); } -static int -weechat_tcl_api_list_prev (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(list_prev) { Tcl_Obj *objp; char *result; int i; - API_FUNC(1, "list_prev", API_RETURN_EMPTY); + API_INIT_FUNC(1, "list_prev", API_RETURN_EMPTY); if (objc < 2) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -870,15 +813,13 @@ weechat_tcl_api_list_prev (ClientData clientData, Tcl_Interp *interp, API_RETURN_STRING_FREE(result); } -static int -weechat_tcl_api_list_string (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(list_string) { Tcl_Obj *objp; const char *result; int i; - API_FUNC(1, "list_string", API_RETURN_EMPTY); + API_INIT_FUNC(1, "list_string", API_RETURN_EMPTY); if (objc < 2) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -887,15 +828,13 @@ weechat_tcl_api_list_string (ClientData clientData, Tcl_Interp *interp, API_RETURN_STRING(result); } -static int -weechat_tcl_api_list_size (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(list_size) { Tcl_Obj *objp; int size; int i; - API_FUNC(1, "list_size", API_RETURN_INT(0)); + API_INIT_FUNC(1, "list_size", API_RETURN_INT(0)); if (objc < 2) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -904,15 +843,13 @@ weechat_tcl_api_list_size (ClientData clientData, Tcl_Interp *interp, API_RETURN_INT(size); } -static int -weechat_tcl_api_list_remove (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(list_remove) { Tcl_Obj *objp; char *weelist, *item; int i; - API_FUNC(1, "list_remove", API_RETURN_ERROR); + API_INIT_FUNC(1, "list_remove", API_RETURN_ERROR); if (objc < 3) API_WRONG_ARGS(API_RETURN_ERROR); @@ -925,16 +862,14 @@ weechat_tcl_api_list_remove (ClientData clientData, Tcl_Interp *interp, API_RETURN_OK; } -static int -weechat_tcl_api_list_remove_all (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(list_remove_all) { Tcl_Obj *objp; int i; (void) clientData; - API_FUNC(1, "list_remove_all", API_RETURN_ERROR); + API_INIT_FUNC(1, "list_remove_all", API_RETURN_ERROR); if (objc < 2) API_WRONG_ARGS(API_RETURN_ERROR); @@ -943,14 +878,12 @@ weechat_tcl_api_list_remove_all (ClientData clientData, Tcl_Interp *interp, API_RETURN_OK; } -static int -weechat_tcl_api_list_free (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(list_free) { Tcl_Obj *objp; int i; - API_FUNC(1, "list_free", API_RETURN_ERROR); + API_INIT_FUNC(1, "list_free", API_RETURN_ERROR); if (objc < 2) API_WRONG_ARGS(API_RETURN_ERROR); @@ -997,15 +930,13 @@ weechat_tcl_api_config_reload_cb (void *data, return WEECHAT_CONFIG_READ_FILE_NOT_FOUND; } -static int -weechat_tcl_api_config_new (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(config_new) { Tcl_Obj *objp; char *result, *name, *function, *data; int i; - API_FUNC(1, "config_new", API_RETURN_EMPTY); + API_INIT_FUNC(1, "config_new", API_RETURN_EMPTY); if (objc < 4) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -1235,9 +1166,7 @@ weechat_tcl_api_config_section_delete_option_cb (void *data, return WEECHAT_CONFIG_OPTION_UNSET_ERROR; } -static int -weechat_tcl_api_config_new_section (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(config_new_section) { Tcl_Obj *objp; char *result, *cfg_file, *name, *function_read, *data_read; @@ -1249,7 +1178,7 @@ weechat_tcl_api_config_new_section (ClientData clientData, Tcl_Interp *interp, /* make C compiler happy */ (void) clientData; - API_FUNC(1, "config_new_section", API_RETURN_EMPTY); + API_INIT_FUNC(1, "config_new_section", API_RETURN_EMPTY); if (objc < 15) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -1295,15 +1224,13 @@ weechat_tcl_api_config_new_section (ClientData clientData, Tcl_Interp *interp, API_RETURN_STRING_FREE(result); } -static int -weechat_tcl_api_config_search_section (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(config_search_section) { Tcl_Obj *objp; char *result, *config_file, *section_name; int i; - API_FUNC(1, "config_search_section", API_RETURN_EMPTY); + API_INIT_FUNC(1, "config_search_section", API_RETURN_EMPTY); if (objc < 3) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -1414,9 +1341,7 @@ weechat_tcl_api_config_option_delete_cb (void *data, } } -static int -weechat_tcl_api_config_new_option (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(config_new_option) { Tcl_Obj *objp; char *result, *config_file, *section, *name, *type; @@ -1425,7 +1350,7 @@ weechat_tcl_api_config_new_option (ClientData clientData, Tcl_Interp *interp, char *data_change, *function_delete, *data_delete; int i, min, max, null_value_allowed; - API_FUNC(1, "config_new_option", API_RETURN_EMPTY); + API_INIT_FUNC(1, "config_new_option", API_RETURN_EMPTY); if (objc < 18) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -1475,15 +1400,13 @@ weechat_tcl_api_config_new_option (ClientData clientData, Tcl_Interp *interp, API_RETURN_STRING_FREE(result); } -static int -weechat_tcl_api_config_search_option (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(config_search_option) { Tcl_Obj *objp; char *result, *config_file, *section, *option_name; int i; - API_FUNC(1, "config_search_option", API_RETURN_EMPTY); + API_INIT_FUNC(1, "config_search_option", API_RETURN_EMPTY); if (objc < 4) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -1498,14 +1421,12 @@ weechat_tcl_api_config_search_option (ClientData clientData, Tcl_Interp *interp, API_RETURN_STRING_FREE(result); } -static int -weechat_tcl_api_config_string_to_boolean (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(config_string_to_boolean) { Tcl_Obj *objp; int result, i; - API_FUNC(1, "config_string_to_boolean", API_RETURN_INT(0)); + API_INIT_FUNC(1, "config_string_to_boolean", API_RETURN_INT(0)); if (objc < 2) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -1514,16 +1435,14 @@ weechat_tcl_api_config_string_to_boolean (ClientData clientData, Tcl_Interp *int API_RETURN_INT(result); } -static int -weechat_tcl_api_config_option_reset (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(config_option_reset) { Tcl_Obj *objp; int rc; char *option; int i, run_callback; - API_FUNC(1, "config_option_reset", API_RETURN_INT(0)); + API_INIT_FUNC(1, "config_option_reset", API_RETURN_INT(0)); if (objc < 3) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -1538,16 +1457,14 @@ weechat_tcl_api_config_option_reset (ClientData clientData, Tcl_Interp *interp, API_RETURN_INT(rc); } -static int -weechat_tcl_api_config_option_set (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(config_option_set) { Tcl_Obj *objp; int rc; char *option, *new_value; int i, run_callback; - API_FUNC(1, "config_option_set", API_RETURN_INT(WEECHAT_CONFIG_OPTION_SET_ERROR)); + API_INIT_FUNC(1, "config_option_set", API_RETURN_INT(WEECHAT_CONFIG_OPTION_SET_ERROR)); if (objc < 4) API_WRONG_ARGS(API_RETURN_INT(WEECHAT_CONFIG_OPTION_SET_ERROR)); @@ -1564,16 +1481,14 @@ weechat_tcl_api_config_option_set (ClientData clientData, Tcl_Interp *interp, API_RETURN_INT(rc); } -static int -weechat_tcl_api_config_option_set_null (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(config_option_set_null) { Tcl_Obj *objp; int rc; char *option; int i, run_callback; - API_FUNC(1, "config_option_set_null", API_RETURN_INT(WEECHAT_CONFIG_OPTION_SET_ERROR)); + API_INIT_FUNC(1, "config_option_set_null", API_RETURN_INT(WEECHAT_CONFIG_OPTION_SET_ERROR)); if (objc < 3) API_WRONG_ARGS(API_RETURN_INT(WEECHAT_CONFIG_OPTION_SET_ERROR)); @@ -1588,16 +1503,14 @@ weechat_tcl_api_config_option_set_null (ClientData clientData, Tcl_Interp *inter API_RETURN_INT(rc); } -static int -weechat_tcl_api_config_option_unset (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(config_option_unset) { Tcl_Obj *objp; int rc; char *option; int i; - API_FUNC(1, "config_option_unset", API_RETURN_INT(WEECHAT_CONFIG_OPTION_UNSET_ERROR)); + API_INIT_FUNC(1, "config_option_unset", API_RETURN_INT(WEECHAT_CONFIG_OPTION_UNSET_ERROR)); if (objc < 2) API_WRONG_ARGS(API_RETURN_INT(WEECHAT_CONFIG_OPTION_UNSET_ERROR)); @@ -1608,15 +1521,13 @@ weechat_tcl_api_config_option_unset (ClientData clientData, Tcl_Interp *interp, API_RETURN_INT(rc); } -static int -weechat_tcl_api_config_option_rename (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(config_option_rename) { Tcl_Obj *objp; char *option, *new_name; int i; - API_FUNC(1, "config_option_rename", API_RETURN_ERROR); + API_INIT_FUNC(1, "config_option_rename", API_RETURN_ERROR); if (objc < 3) API_WRONG_ARGS(API_RETURN_ERROR); @@ -1629,14 +1540,12 @@ weechat_tcl_api_config_option_rename (ClientData clientData, Tcl_Interp *interp, API_RETURN_OK; } -static int -weechat_tcl_api_config_option_is_null (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(config_option_is_null) { Tcl_Obj *objp; int result, i; - API_FUNC(1, "config_option_is_null", API_RETURN_INT(1)); + API_INIT_FUNC(1, "config_option_is_null", API_RETURN_INT(1)); if (objc < 2) API_WRONG_ARGS(API_RETURN_INT(1)); @@ -1645,15 +1554,12 @@ weechat_tcl_api_config_option_is_null (ClientData clientData, Tcl_Interp *interp API_RETURN_INT(result); } -static int -weechat_tcl_api_config_option_default_is_null (ClientData clientData, - Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(config_option_default_is_null) { Tcl_Obj *objp; int result, i; - API_FUNC(1, "config_option_default_is_null", API_RETURN_INT(1)); + API_INIT_FUNC(1, "config_option_default_is_null", API_RETURN_INT(1)); if (objc < 2) API_WRONG_ARGS(API_RETURN_INT(1)); @@ -1662,14 +1568,12 @@ weechat_tcl_api_config_option_default_is_null (ClientData clientData, API_RETURN_INT(result); } -static int -weechat_tcl_api_config_boolean (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(config_boolean) { Tcl_Obj *objp; int result, i; - API_FUNC(1, "config_boolean", API_RETURN_INT(0)); + API_INIT_FUNC(1, "config_boolean", API_RETURN_INT(0)); if (objc < 2) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -1678,14 +1582,12 @@ weechat_tcl_api_config_boolean (ClientData clientData, Tcl_Interp *interp, API_RETURN_INT(result); } -static int -weechat_tcl_api_config_boolean_default (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(config_boolean_default) { Tcl_Obj *objp; int result, i; - API_FUNC(1, "config_boolean_default", API_RETURN_INT(0)); + API_INIT_FUNC(1, "config_boolean_default", API_RETURN_INT(0)); if (objc < 2) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -1694,14 +1596,12 @@ weechat_tcl_api_config_boolean_default (ClientData clientData, Tcl_Interp *inter API_RETURN_INT(result); } -static int -weechat_tcl_api_config_integer (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(config_integer) { Tcl_Obj *objp; int result, i; - API_FUNC(1, "config_integer", API_RETURN_INT(0)); + API_INIT_FUNC(1, "config_integer", API_RETURN_INT(0)); if (objc < 2) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -1710,14 +1610,12 @@ weechat_tcl_api_config_integer (ClientData clientData, Tcl_Interp *interp, API_RETURN_INT(result); } -static int -weechat_tcl_api_config_integer_default (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(config_integer_default) { Tcl_Obj *objp; int result, i; - API_FUNC(1, "config_integer_default", API_RETURN_INT(0)); + API_INIT_FUNC(1, "config_integer_default", API_RETURN_INT(0)); if (objc < 2) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -1726,15 +1624,13 @@ weechat_tcl_api_config_integer_default (ClientData clientData, Tcl_Interp *inter API_RETURN_INT(result); } -static int -weechat_tcl_api_config_string (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(config_string) { Tcl_Obj *objp; const char *result; int i; - API_FUNC(1, "config_string", API_RETURN_EMPTY); + API_INIT_FUNC(1, "config_string", API_RETURN_EMPTY); if (objc < 2) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -1743,15 +1639,13 @@ weechat_tcl_api_config_string (ClientData clientData, Tcl_Interp *interp, API_RETURN_STRING(result); } -static int -weechat_tcl_api_config_string_default (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(config_string_default) { Tcl_Obj *objp; const char *result; int i; - API_FUNC(1, "config_string_default", API_RETURN_EMPTY); + API_INIT_FUNC(1, "config_string_default", API_RETURN_EMPTY); if (objc < 2) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -1760,15 +1654,13 @@ weechat_tcl_api_config_string_default (ClientData clientData, Tcl_Interp *interp API_RETURN_STRING(result); } -static int -weechat_tcl_api_config_color (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(config_color) { Tcl_Obj *objp; const char *result; int i; - API_FUNC(1, "config_color", API_RETURN_INT(0)); + API_INIT_FUNC(1, "config_color", API_RETURN_INT(0)); if (objc < 2) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -1777,15 +1669,13 @@ weechat_tcl_api_config_color (ClientData clientData, Tcl_Interp *interp, API_RETURN_STRING(result); } -static int -weechat_tcl_api_config_color_default (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(config_color_default) { Tcl_Obj *objp; const char *result; int i; - API_FUNC(1, "config_color_default", API_RETURN_INT(0)); + API_INIT_FUNC(1, "config_color_default", API_RETURN_INT(0)); if (objc < 2) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -1794,15 +1684,13 @@ weechat_tcl_api_config_color_default (ClientData clientData, Tcl_Interp *interp, API_RETURN_STRING(result); } -static int -weechat_tcl_api_config_write_option (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(config_write_option) { Tcl_Obj *objp; char *config_file, *option; int i; - API_FUNC(1, "config_write_option", API_RETURN_ERROR); + API_INIT_FUNC(1, "config_write_option", API_RETURN_ERROR); if (objc < 3) API_WRONG_ARGS(API_RETURN_ERROR); @@ -1815,15 +1703,13 @@ weechat_tcl_api_config_write_option (ClientData clientData, Tcl_Interp *interp, API_RETURN_OK; } -static int -weechat_tcl_api_config_write_line (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(config_write_line) { Tcl_Obj *objp; char *config_file, *option_name, *value; int i; - API_FUNC(1, "config_write_line", API_RETURN_ERROR); + API_INIT_FUNC(1, "config_write_line", API_RETURN_ERROR); if (objc < 4) API_WRONG_ARGS(API_RETURN_ERROR); @@ -1837,15 +1723,13 @@ weechat_tcl_api_config_write_line (ClientData clientData, Tcl_Interp *interp, API_RETURN_OK; } -static int -weechat_tcl_api_config_write (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(config_write) { Tcl_Obj *objp; int rc; int i; - API_FUNC(1, "config_write", API_RETURN_INT(-1)); + API_INIT_FUNC(1, "config_write", API_RETURN_INT(-1)); if (objc < 2) API_WRONG_ARGS(API_RETURN_INT(-1)); @@ -1854,15 +1738,13 @@ weechat_tcl_api_config_write (ClientData clientData, Tcl_Interp *interp, API_RETURN_INT(rc); } -static int -weechat_tcl_api_config_read (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(config_read) { Tcl_Obj *objp; int rc; int i; - API_FUNC(1, "config_read", API_RETURN_INT(-1)); + API_INIT_FUNC(1, "config_read", API_RETURN_INT(-1)); if (objc < 2) API_WRONG_ARGS(API_RETURN_INT(-1)); @@ -1871,15 +1753,13 @@ weechat_tcl_api_config_read (ClientData clientData, Tcl_Interp *interp, API_RETURN_INT(rc); } -static int -weechat_tcl_api_config_reload (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(config_reload) { Tcl_Obj *objp; int rc; int i; - API_FUNC(1, "config_reload", API_RETURN_INT(-1)); + API_INIT_FUNC(1, "config_reload", API_RETURN_INT(-1)); if (objc < 2) API_WRONG_ARGS(API_RETURN_INT(-1)); @@ -1888,14 +1768,12 @@ weechat_tcl_api_config_reload (ClientData clientData, Tcl_Interp *interp, API_RETURN_INT(rc); } -static int -weechat_tcl_api_config_option_free (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(config_option_free) { Tcl_Obj *objp; int i; - API_FUNC(1, "config_option_free", API_RETURN_ERROR); + API_INIT_FUNC(1, "config_option_free", API_RETURN_ERROR); if (objc < 2) API_WRONG_ARGS(API_RETURN_ERROR); @@ -1906,14 +1784,12 @@ weechat_tcl_api_config_option_free (ClientData clientData, Tcl_Interp *interp, API_RETURN_OK; } -static int -weechat_tcl_api_config_section_free_options (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(config_section_free_options) { Tcl_Obj *objp; int i; - API_FUNC(1, "config_section_free_options", API_RETURN_ERROR); + API_INIT_FUNC(1, "config_section_free_options", API_RETURN_ERROR); if (objc < 2) API_WRONG_ARGS(API_RETURN_ERROR); @@ -1924,14 +1800,12 @@ weechat_tcl_api_config_section_free_options (ClientData clientData, Tcl_Interp * API_RETURN_OK; } -static int -weechat_tcl_api_config_section_free (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(config_section_free) { Tcl_Obj *objp; int i; - API_FUNC(1, "config_section_free", API_RETURN_ERROR); + API_INIT_FUNC(1, "config_section_free", API_RETURN_ERROR); if (objc < 2) API_WRONG_ARGS(API_RETURN_ERROR); @@ -1942,14 +1816,12 @@ weechat_tcl_api_config_section_free (ClientData clientData, Tcl_Interp *interp, API_RETURN_OK; } -static int -weechat_tcl_api_config_free (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(config_free) { Tcl_Obj *objp; int i; - API_FUNC(1, "config_free", API_RETURN_ERROR); + API_INIT_FUNC(1, "config_free", API_RETURN_ERROR); if (objc < 2) API_WRONG_ARGS(API_RETURN_ERROR); @@ -1960,15 +1832,13 @@ weechat_tcl_api_config_free (ClientData clientData, Tcl_Interp *interp, API_RETURN_OK; } -static int -weechat_tcl_api_config_get (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(config_get) { Tcl_Obj *objp; char *result; int i; - API_FUNC(1, "config_get", API_RETURN_EMPTY); + API_INIT_FUNC(1, "config_get", API_RETURN_EMPTY); if (objc < 2) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -1977,15 +1847,13 @@ weechat_tcl_api_config_get (ClientData clientData, Tcl_Interp *interp, API_RETURN_STRING_FREE(result); } -static int -weechat_tcl_api_config_get_plugin (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(config_get_plugin) { Tcl_Obj *objp; const char *result; int i; - API_FUNC(1, "config_get_plugin", API_RETURN_EMPTY); + API_INIT_FUNC(1, "config_get_plugin", API_RETURN_EMPTY); if (objc < 2) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -1996,15 +1864,13 @@ weechat_tcl_api_config_get_plugin (ClientData clientData, Tcl_Interp *interp, API_RETURN_STRING(result); } -static int -weechat_tcl_api_config_is_set_plugin (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(config_is_set_plugin) { Tcl_Obj *objp; char *option; int i, rc; - API_FUNC(1, "config_is_set_plugin", API_RETURN_INT(0)); + API_INIT_FUNC(1, "config_is_set_plugin", API_RETURN_INT(0)); if (objc < 2) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -2017,15 +1883,13 @@ weechat_tcl_api_config_is_set_plugin (ClientData clientData, Tcl_Interp *interp, API_RETURN_INT(rc); } -static int -weechat_tcl_api_config_set_plugin (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(config_set_plugin) { Tcl_Obj *objp; char *option, *value; int i, rc; - API_FUNC(1, "config_set_plugin", API_RETURN_INT(WEECHAT_CONFIG_OPTION_SET_ERROR)); + API_INIT_FUNC(1, "config_set_plugin", API_RETURN_INT(WEECHAT_CONFIG_OPTION_SET_ERROR)); if (objc < 3) API_WRONG_ARGS(API_RETURN_INT(WEECHAT_CONFIG_OPTION_SET_ERROR)); @@ -2040,15 +1904,13 @@ weechat_tcl_api_config_set_plugin (ClientData clientData, Tcl_Interp *interp, API_RETURN_INT(rc); } -static int -weechat_tcl_api_config_set_desc_plugin (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(config_set_desc_plugin) { Tcl_Obj *objp; char *option, *description; int i; - API_FUNC(1, "config_set_desc_plugin", API_RETURN_ERROR); + API_INIT_FUNC(1, "config_set_desc_plugin", API_RETURN_ERROR); if (objc < 3) API_WRONG_ARGS(API_RETURN_ERROR); @@ -2063,15 +1925,13 @@ weechat_tcl_api_config_set_desc_plugin (ClientData clientData, Tcl_Interp *inter API_RETURN_OK; } -static int -weechat_tcl_api_config_unset_plugin (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(config_unset_plugin) { Tcl_Obj *objp; char *option; int i, rc; - API_FUNC(1, "config_unset_plugin", API_RETURN_INT(WEECHAT_CONFIG_OPTION_UNSET_ERROR)); + API_INIT_FUNC(1, "config_unset_plugin", API_RETURN_INT(WEECHAT_CONFIG_OPTION_UNSET_ERROR)); if (objc < 2) API_WRONG_ARGS(API_RETURN_INT(WEECHAT_CONFIG_OPTION_UNSET_ERROR)); @@ -2084,16 +1944,14 @@ weechat_tcl_api_config_unset_plugin (ClientData clientData, Tcl_Interp *interp, API_RETURN_INT(rc); } -static int -weechat_tcl_api_key_bind (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(key_bind) { Tcl_Obj *objp; char *context; struct t_hashtable *hashtable; int i, num_keys; - API_FUNC(1, "key_bind", API_RETURN_INT(0)); + API_INIT_FUNC(1, "key_bind", API_RETURN_INT(0)); if (objc < 3) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -2111,15 +1969,13 @@ weechat_tcl_api_key_bind (ClientData clientData, Tcl_Interp *interp, API_RETURN_INT(num_keys); } -static int -weechat_tcl_api_key_unbind (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(key_unbind) { Tcl_Obj *objp; char *context, *key; int i, num_keys; - API_FUNC(1, "key_unbind", API_RETURN_INT(0)); + API_INIT_FUNC(1, "key_unbind", API_RETURN_INT(0)); if (objc < 3) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -2131,15 +1987,13 @@ weechat_tcl_api_key_unbind (ClientData clientData, Tcl_Interp *interp, API_RETURN_INT(num_keys); } -static int -weechat_tcl_api_prefix (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(prefix) { Tcl_Obj *objp; const char *result; int i; - API_FUNC(0, "prefix", API_RETURN_EMPTY); + API_INIT_FUNC(0, "prefix", API_RETURN_EMPTY); if (objc < 2) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -2148,15 +2002,13 @@ weechat_tcl_api_prefix (ClientData clientData, Tcl_Interp *interp, API_RETURN_STRING(result); } -static int -weechat_tcl_api_color (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(color) { Tcl_Obj *objp; const char *result; int i; - API_FUNC(0, "color", API_RETURN_EMPTY); + API_INIT_FUNC(0, "color", API_RETURN_EMPTY); if (objc < 2) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -2165,15 +2017,13 @@ weechat_tcl_api_color (ClientData clientData, Tcl_Interp *interp, API_RETURN_STRING(result); } -static int -weechat_tcl_api_print (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(print) { Tcl_Obj *objp; char *buffer, *message; int i; - API_FUNC(0, "print", API_RETURN_ERROR); + API_INIT_FUNC(0, "print", API_RETURN_ERROR); if (objc < 3) API_WRONG_ARGS(API_RETURN_ERROR); @@ -2188,15 +2038,13 @@ weechat_tcl_api_print (ClientData clientData, Tcl_Interp *interp, API_RETURN_OK; } -static int -weechat_tcl_api_print_date_tags (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(print_date_tags) { Tcl_Obj *objp; char *buffer, *tags, *message; int i, tdate; - API_FUNC(1, "print_date_tags", API_RETURN_ERROR); + API_INIT_FUNC(1, "print_date_tags", API_RETURN_ERROR); if (objc < 5) API_WRONG_ARGS(API_RETURN_ERROR); @@ -2217,15 +2065,13 @@ weechat_tcl_api_print_date_tags (ClientData clientData, Tcl_Interp *interp, API_RETURN_OK; } -static int -weechat_tcl_api_print_y (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(print_y) { Tcl_Obj *objp; char *buffer, *message; int i, y; - API_FUNC(1, "print_y", API_RETURN_ERROR); + API_INIT_FUNC(1, "print_y", API_RETURN_ERROR); if (objc < 4) API_WRONG_ARGS(API_RETURN_ERROR); @@ -2244,9 +2090,7 @@ weechat_tcl_api_print_y (ClientData clientData, Tcl_Interp *interp, API_RETURN_OK; } -static int -weechat_tcl_api_log_print (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(log_print) { Tcl_Obj *objp; int i; @@ -2254,7 +2098,7 @@ weechat_tcl_api_log_print (ClientData clientData, Tcl_Interp *interp, /* make C compiler happy */ (void) clientData; - API_FUNC(1, "log_print", API_RETURN_ERROR); + API_INIT_FUNC(1, "log_print", API_RETURN_ERROR); if (objc < 2) API_WRONG_ARGS(API_RETURN_ERROR); @@ -2307,16 +2151,14 @@ weechat_tcl_api_hook_command_cb (void *data, struct t_gui_buffer *buffer, return WEECHAT_RC_ERROR; } -static int -weechat_tcl_api_hook_command (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(hook_command) { Tcl_Obj *objp; char *result, *command, *description, *args, *args_description; char *completion, *function, *data; int i; - API_FUNC(1, "hook_command", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_command", API_RETURN_EMPTY); if (objc < 8) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -2380,15 +2222,13 @@ weechat_tcl_api_hook_command_run_cb (void *data, struct t_gui_buffer *buffer, return WEECHAT_RC_ERROR; } -static int -weechat_tcl_api_hook_command_run (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(hook_command_run) { Tcl_Obj *objp; char *result, *command, *function, *data; int i; - API_FUNC(1, "hook_command_run", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_command_run", API_RETURN_EMPTY); if (objc < 4) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -2443,15 +2283,13 @@ weechat_tcl_api_hook_timer_cb (void *data, int remaining_calls) return WEECHAT_RC_ERROR; } -static int -weechat_tcl_api_hook_timer (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(hook_timer) { Tcl_Obj *objp; char *result; int i, interval, align_second, max_calls; - API_FUNC(1, "hook_timer", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_timer", API_RETURN_EMPTY); if (objc < 6) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -2509,15 +2347,13 @@ weechat_tcl_api_hook_fd_cb (void *data, int fd) return WEECHAT_RC_ERROR; } -static int -weechat_tcl_api_hook_fd (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(hook_fd) { Tcl_Obj *objp; char *result; int i, fd, read, write, exception; - API_FUNC(1, "hook_fd", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_fd", API_RETURN_EMPTY); if (objc < 7) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -2579,15 +2415,13 @@ weechat_tcl_api_hook_process_cb (void *data, return WEECHAT_RC_ERROR; } -static int -weechat_tcl_api_hook_process (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(hook_process) { Tcl_Obj *objp; char *command, *function, *data, *result; int i, timeout; - API_FUNC(1, "hook_process", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_process", API_RETURN_EMPTY); if (objc < 5) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -2609,17 +2443,14 @@ weechat_tcl_api_hook_process (ClientData clientData, Tcl_Interp *interp, API_RETURN_STRING_FREE(result); } -static int -weechat_tcl_api_hook_process_hashtable (ClientData clientData, - Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(hook_process_hashtable) { Tcl_Obj *objp; char *command, *function, *data, *result; struct t_hashtable *options; int i, timeout; - API_FUNC(1, "hook_process_hashtable", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_process_hashtable", API_RETURN_EMPTY); if (objc < 6) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -2694,15 +2525,13 @@ weechat_tcl_api_hook_connect_cb (void *data, int status, int gnutls_rc, return WEECHAT_RC_ERROR; } -static int -weechat_tcl_api_hook_connect (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(hook_connect) { Tcl_Obj *objp; char *proxy, *address, *local_hostname, *function, *data, *result; int i, port, ipv6, retry; - API_FUNC(1, "hook_connect", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_connect", API_RETURN_EMPTY); if (objc < 9) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -2792,15 +2621,13 @@ weechat_tcl_api_hook_print_cb (void *data, struct t_gui_buffer *buffer, return WEECHAT_RC_ERROR; } -static int -weechat_tcl_api_hook_print (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(hook_print) { Tcl_Obj *objp; char *result, *buffer, *tags, *message, *function, *data; int i, strip_colors; - API_FUNC(1, "hook_print", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_print", API_RETURN_EMPTY); if (objc < 7) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -2886,15 +2713,13 @@ weechat_tcl_api_hook_signal_cb (void *data, const char *signal, const char *type return WEECHAT_RC_ERROR; } -static int -weechat_tcl_api_hook_signal (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(hook_signal) { Tcl_Obj *objp; char *result, *signal, *function, *data; int i; - API_FUNC(1, "hook_signal", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_signal", API_RETURN_EMPTY); if (objc < 4) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -2912,15 +2737,13 @@ weechat_tcl_api_hook_signal (ClientData clientData, Tcl_Interp *interp, API_RETURN_STRING_FREE(result); } -static int -weechat_tcl_api_hook_signal_send (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(hook_signal_send) { Tcl_Obj *objp; char *signal, *type_data; int number, i, rc; - API_FUNC(1, "hook_signal_send", API_RETURN_INT(WEECHAT_RC_ERROR)); + API_INIT_FUNC(1, "hook_signal_send", API_RETURN_INT(WEECHAT_RC_ERROR)); if (objc < 4) API_WRONG_ARGS(API_RETURN_INT(WEECHAT_RC_ERROR)); @@ -2991,15 +2814,13 @@ weechat_tcl_api_hook_hsignal_cb (void *data, const char *signal, return WEECHAT_RC_ERROR; } -static int -weechat_tcl_api_hook_hsignal (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(hook_hsignal) { Tcl_Obj *objp; char *result, *signal, *function, *data; int i; - API_FUNC(1, "hook_hsignal", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_hsignal", API_RETURN_EMPTY); if (objc < 4) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3017,16 +2838,14 @@ weechat_tcl_api_hook_hsignal (ClientData clientData, Tcl_Interp *interp, API_RETURN_STRING_FREE(result); } -static int -weechat_tcl_api_hook_hsignal_send (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(hook_hsignal_send) { Tcl_Obj *objp; char *signal; struct t_hashtable *hashtable; int i, rc; - API_FUNC(1, "hook_hsignal_send", API_RETURN_INT(WEECHAT_RC_ERROR)); + API_INIT_FUNC(1, "hook_hsignal_send", API_RETURN_INT(WEECHAT_RC_ERROR)); if (objc < 3) API_WRONG_ARGS(API_RETURN_INT(WEECHAT_RC_ERROR)); @@ -3079,15 +2898,13 @@ weechat_tcl_api_hook_config_cb (void *data, const char *option, const char *valu return WEECHAT_RC_ERROR; } -static int -weechat_tcl_api_hook_config (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(hook_config) { Tcl_Obj *objp; char *result, *option, *function, *data; int i; - API_FUNC(1, "hook_config", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_config", API_RETURN_EMPTY); if (objc < 4) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3147,15 +2964,13 @@ weechat_tcl_api_hook_completion_cb (void *data, const char *completion_item, return WEECHAT_RC_ERROR; } -static int -weechat_tcl_api_hook_completion (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(hook_completion) { Tcl_Obj *objp; char *result, *completion, *description, *function, *data; int i; - API_FUNC(1, "hook_completion", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_completion", API_RETURN_EMPTY); if (objc < 5) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3175,15 +2990,13 @@ weechat_tcl_api_hook_completion (ClientData clientData, Tcl_Interp *interp, API_RETURN_STRING_FREE(result); } -static int -weechat_tcl_api_hook_completion_list_add (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(hook_completion_list_add) { Tcl_Obj *objp; char *completion, *word, *where; int i, nick_completion; - API_FUNC(1, "hook_completion_list_add", API_RETURN_ERROR); + API_INIT_FUNC(1, "hook_completion_list_add", API_RETURN_ERROR); if (objc < 5) API_WRONG_ARGS(API_RETURN_ERROR); @@ -3228,15 +3041,13 @@ weechat_tcl_api_hook_modifier_cb (void *data, const char *modifier, return NULL; } -static int -weechat_tcl_api_hook_modifier (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(hook_modifier) { Tcl_Obj *objp; char *result, *modifier, *function, *data; int i; - API_FUNC(1, "hook_modifier", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_modifier", API_RETURN_EMPTY); if (objc < 4) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3254,15 +3065,13 @@ weechat_tcl_api_hook_modifier (ClientData clientData, Tcl_Interp *interp, API_RETURN_STRING_FREE(result); } -static int -weechat_tcl_api_hook_modifier_exec (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(hook_modifier_exec) { Tcl_Obj *objp; char *result, *modifier, *modifier_data, *string; int i; - API_FUNC(1, "hook_modifier_exec", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_modifier_exec", API_RETURN_EMPTY); if (objc < 4) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3300,15 +3109,13 @@ weechat_tcl_api_hook_info_cb (void *data, const char *info_name, return NULL; } -static int -weechat_tcl_api_hook_info (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(hook_info) { Tcl_Obj *objp; char *result, *info_name, *description, *args_description, *function, *data; int i; - API_FUNC(1, "hook_info", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_info", API_RETURN_EMPTY); if (objc < 6) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3355,16 +3162,14 @@ weechat_tcl_api_hook_info_hashtable_cb (void *data, const char *info_name, return NULL; } -static int -weechat_tcl_api_hook_info_hashtable (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(hook_info_hashtable) { Tcl_Obj *objp; char *result, *info_name, *description, *args_description; char *output_description, *function, *data; int i; - API_FUNC(1, "hook_info_hashtable", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_info_hashtable", API_RETURN_EMPTY); if (objc < 7) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3420,16 +3225,14 @@ weechat_tcl_api_hook_infolist_cb (void *data, const char *infolist_name, return NULL; } -static int -weechat_tcl_api_hook_infolist (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(hook_infolist) { Tcl_Obj *objp; char *result, *infolist_name, *description, *pointer_description; char *args_description, *function, *data; int i; - API_FUNC(1, "hook_infolist", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_infolist", API_RETURN_EMPTY); if (objc < 7) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3477,15 +3280,13 @@ weechat_tcl_api_hook_focus_cb (void *data, return NULL; } -static int -weechat_tcl_api_hook_focus (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(hook_focus) { Tcl_Obj *objp; char *result, *area, *function, *data; int i; - API_FUNC(1, "hook_focus", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hook_focus", API_RETURN_EMPTY); if (objc < 4) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3503,15 +3304,13 @@ weechat_tcl_api_hook_focus (ClientData clientData, Tcl_Interp *interp, API_RETURN_STRING_FREE(result); } -static int -weechat_tcl_api_hook_set (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(hook_set) { Tcl_Obj *objp; char *hook, *property, *value; int i; - API_FUNC(1, "hook_set", API_RETURN_ERROR); + API_INIT_FUNC(1, "hook_set", API_RETURN_ERROR); if (objc < 4) API_WRONG_ARGS(API_RETURN_ERROR); @@ -3524,14 +3323,12 @@ weechat_tcl_api_hook_set (ClientData clientData, Tcl_Interp *interp, API_RETURN_OK; } -static int -weechat_tcl_api_unhook (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(unhook) { Tcl_Obj *objp; int i; - API_FUNC(1, "unhook", API_RETURN_ERROR); + API_INIT_FUNC(1, "unhook", API_RETURN_ERROR); if (objc < 2) API_WRONG_ARGS(API_RETURN_ERROR); @@ -3542,9 +3339,7 @@ weechat_tcl_api_unhook (ClientData clientData, Tcl_Interp *interp, API_RETURN_OK; } -static int -weechat_tcl_api_unhook_all (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(unhook_all) { Tcl_Obj *objp; @@ -3553,7 +3348,7 @@ weechat_tcl_api_unhook_all (ClientData clientData, Tcl_Interp *interp, (void) objc; (void) objv; - API_FUNC(1, "unhook_all", API_RETURN_ERROR); + API_INIT_FUNC(1, "unhook_all", API_RETURN_ERROR); plugin_script_api_unhook_all (weechat_tcl_plugin, tcl_current_script); @@ -3632,16 +3427,14 @@ weechat_tcl_api_buffer_close_cb (void *data, struct t_gui_buffer *buffer) return WEECHAT_RC_ERROR; } -static int -weechat_tcl_api_buffer_new (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(buffer_new) { Tcl_Obj *objp; char *result, *name, *function_input, *data_input, *function_close; char *data_close; int i; - API_FUNC(1, "buffer_new", API_RETURN_EMPTY); + API_INIT_FUNC(1, "buffer_new", API_RETURN_EMPTY); if (objc < 6) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3664,15 +3457,13 @@ weechat_tcl_api_buffer_new (ClientData clientData, Tcl_Interp *interp, API_RETURN_STRING_FREE(result); } -static int -weechat_tcl_api_buffer_search (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(buffer_search) { Tcl_Obj *objp; char *result, *plugin, *name; int i; - API_FUNC(1, "buffer_search", API_RETURN_EMPTY); + API_INIT_FUNC(1, "buffer_search", API_RETURN_EMPTY); if (objc < 3) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3684,9 +3475,7 @@ weechat_tcl_api_buffer_search (ClientData clientData, Tcl_Interp *interp, API_RETURN_STRING_FREE(result); } -static int -weechat_tcl_api_buffer_search_main (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(buffer_search_main) { Tcl_Obj *objp; char *result; @@ -3696,16 +3485,14 @@ weechat_tcl_api_buffer_search_main (ClientData clientData, Tcl_Interp *interp, (void) objc; (void) objv; - API_FUNC(1, "buffer_search_main", API_RETURN_EMPTY); + API_INIT_FUNC(1, "buffer_search_main", API_RETURN_EMPTY); result = API_PTR2STR(weechat_buffer_search_main ()); API_RETURN_STRING_FREE(result); } -static int -weechat_tcl_api_current_buffer (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(current_buffer) { Tcl_Obj *objp; char *result; @@ -3715,21 +3502,19 @@ weechat_tcl_api_current_buffer (ClientData clientData, Tcl_Interp *interp, (void) objc; (void) objv; - API_FUNC(1, "current_buffer", API_RETURN_EMPTY); + API_INIT_FUNC(1, "current_buffer", API_RETURN_EMPTY); result = API_PTR2STR(weechat_current_buffer ()); API_RETURN_STRING_FREE(result); } -static int -weechat_tcl_api_buffer_clear (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(buffer_clear) { Tcl_Obj *objp; int i; - API_FUNC(1, "buffer_clear", API_RETURN_ERROR); + API_INIT_FUNC(1, "buffer_clear", API_RETURN_ERROR); if (objc < 2) API_WRONG_ARGS(API_RETURN_ERROR); @@ -3738,14 +3523,12 @@ weechat_tcl_api_buffer_clear (ClientData clientData, Tcl_Interp *interp, API_RETURN_OK; } -static int -weechat_tcl_api_buffer_close (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(buffer_close) { Tcl_Obj *objp; int i; - API_FUNC(1, "buffer_close", API_RETURN_ERROR); + API_INIT_FUNC(1, "buffer_close", API_RETURN_ERROR); if (objc < 2) API_WRONG_ARGS(API_RETURN_ERROR); @@ -3756,14 +3539,12 @@ weechat_tcl_api_buffer_close (ClientData clientData, Tcl_Interp *interp, API_RETURN_OK; } -static int -weechat_tcl_api_buffer_merge (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(buffer_merge) { Tcl_Obj *objp; int i; - API_FUNC(1, "buffer_merge", API_RETURN_ERROR); + API_INIT_FUNC(1, "buffer_merge", API_RETURN_ERROR); if (objc < 3) API_WRONG_ARGS(API_RETURN_ERROR); @@ -3773,14 +3554,12 @@ weechat_tcl_api_buffer_merge (ClientData clientData, Tcl_Interp *interp, API_RETURN_OK; } -static int -weechat_tcl_api_buffer_unmerge (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(buffer_unmerge) { Tcl_Obj *objp; int i, number; - API_FUNC(1, "buffer_unmerge", API_RETURN_ERROR); + API_INIT_FUNC(1, "buffer_unmerge", API_RETURN_ERROR); if (objc < 3) API_WRONG_ARGS(API_RETURN_ERROR); @@ -3793,16 +3572,14 @@ weechat_tcl_api_buffer_unmerge (ClientData clientData, Tcl_Interp *interp, API_RETURN_OK; } -static int -weechat_tcl_api_buffer_get_integer (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(buffer_get_integer) { Tcl_Obj *objp; char *buffer, *property; int result; int i; - API_FUNC(1, "buffer_get_integer", API_RETURN_INT(-1)); + API_INIT_FUNC(1, "buffer_get_integer", API_RETURN_INT(-1)); if (objc < 3) API_WRONG_ARGS(API_RETURN_INT(-1)); @@ -3814,16 +3591,14 @@ weechat_tcl_api_buffer_get_integer (ClientData clientData, Tcl_Interp *interp, API_RETURN_INT(result); } -static int -weechat_tcl_api_buffer_get_string (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(buffer_get_string) { Tcl_Obj *objp; char *buffer, *property; const char *result; int i; - API_FUNC(1, "buffer_get_string", API_RETURN_EMPTY); + API_INIT_FUNC(1, "buffer_get_string", API_RETURN_EMPTY); if (objc < 3) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3835,15 +3610,13 @@ weechat_tcl_api_buffer_get_string (ClientData clientData, Tcl_Interp *interp, API_RETURN_STRING(result); } -static int -weechat_tcl_api_buffer_get_pointer (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(buffer_get_pointer) { Tcl_Obj *objp; char *buffer, *property, *result; int i; - API_FUNC(1, "buffer_get_pointer", API_RETURN_EMPTY); + API_INIT_FUNC(1, "buffer_get_pointer", API_RETURN_EMPTY); if (objc < 3) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3856,15 +3629,13 @@ weechat_tcl_api_buffer_get_pointer (ClientData clientData, Tcl_Interp *interp, API_RETURN_STRING_FREE(result); } -static int -weechat_tcl_api_buffer_set (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(buffer_set) { Tcl_Obj *objp; char *buffer, *property, *value; int i; - API_FUNC(1, "buffer_set", API_RETURN_ERROR); + API_INIT_FUNC(1, "buffer_set", API_RETURN_ERROR); if (objc < 4) API_WRONG_ARGS(API_RETURN_ERROR); @@ -3877,15 +3648,13 @@ weechat_tcl_api_buffer_set (ClientData clientData, Tcl_Interp *interp, API_RETURN_OK; } -static int -weechat_tcl_api_buffer_string_replace_local_var (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(buffer_string_replace_local_var) { Tcl_Obj *objp; char *buffer, *string, *result; int i; - API_FUNC(1, "buffer_string_replace_local_var", API_RETURN_ERROR); + API_INIT_FUNC(1, "buffer_string_replace_local_var", API_RETURN_ERROR); if (objc < 3) API_WRONG_ARGS(API_RETURN_ERROR); @@ -3897,16 +3666,14 @@ weechat_tcl_api_buffer_string_replace_local_var (ClientData clientData, Tcl_Inte API_RETURN_STRING_FREE(result); } -static int -weechat_tcl_api_buffer_match_list (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(buffer_match_list) { Tcl_Obj *objp; char *buffer, *string; int result; int i; - API_FUNC(1, "buffer_match_list", API_RETURN_INT(0)); + API_INIT_FUNC(1, "buffer_match_list", API_RETURN_INT(0)); if (objc < 3) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -3918,9 +3685,7 @@ weechat_tcl_api_buffer_match_list (ClientData clientData, Tcl_Interp *interp, API_RETURN_INT(result); } -static int -weechat_tcl_api_current_window (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(current_window) { Tcl_Obj *objp; char *result; @@ -3930,22 +3695,20 @@ weechat_tcl_api_current_window (ClientData clientData, Tcl_Interp *interp, (void) objc; (void) objv; - API_FUNC(1, "current_window", API_RETURN_EMPTY); + API_INIT_FUNC(1, "current_window", API_RETURN_EMPTY); result = API_PTR2STR(weechat_current_window ()); API_RETURN_STRING_FREE(result); } -static int -weechat_tcl_api_window_search_with_buffer (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(window_search_with_buffer) { Tcl_Obj *objp; char *buffer, *result; int i; - API_FUNC(1, "window_search_with_buffer", API_RETURN_EMPTY); + API_INIT_FUNC(1, "window_search_with_buffer", API_RETURN_EMPTY); if (objc < 2) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3956,16 +3719,14 @@ weechat_tcl_api_window_search_with_buffer (ClientData clientData, Tcl_Interp *in API_RETURN_STRING_FREE(result); } -static int -weechat_tcl_api_window_get_integer (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(window_get_integer) { Tcl_Obj *objp; char *window, *property; int result; int i; - API_FUNC(1, "window_get_integer", API_RETURN_INT(-1)); + API_INIT_FUNC(1, "window_get_integer", API_RETURN_INT(-1)); if (objc < 3) API_WRONG_ARGS(API_RETURN_INT(-1)); @@ -3977,16 +3738,14 @@ weechat_tcl_api_window_get_integer (ClientData clientData, Tcl_Interp *interp, API_RETURN_INT(result); } -static int -weechat_tcl_api_window_get_string (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(window_get_string) { Tcl_Obj *objp; char *window, *property; const char *result; int i; - API_FUNC(1, "window_get_string", API_RETURN_EMPTY); + API_INIT_FUNC(1, "window_get_string", API_RETURN_EMPTY); if (objc < 3) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -3998,15 +3757,13 @@ weechat_tcl_api_window_get_string (ClientData clientData, Tcl_Interp *interp, API_RETURN_STRING(result); } -static int -weechat_tcl_api_window_get_pointer (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(window_get_pointer) { Tcl_Obj *objp; char *window, *property, *result; int i; - API_FUNC(1, "window_get_pointer", API_RETURN_EMPTY); + API_INIT_FUNC(1, "window_get_pointer", API_RETURN_EMPTY); if (objc < 3) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4019,15 +3776,13 @@ weechat_tcl_api_window_get_pointer (ClientData clientData, Tcl_Interp *interp, API_RETURN_STRING_FREE(result); } -static int -weechat_tcl_api_window_set_title (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(window_set_title) { Tcl_Obj *objp; char *title; int i; - API_FUNC(1, "window_set_title", API_RETURN_ERROR); + API_INIT_FUNC(1, "window_set_title", API_RETURN_ERROR); if (objc < 2) API_WRONG_ARGS(API_RETURN_ERROR); @@ -4038,15 +3793,13 @@ weechat_tcl_api_window_set_title (ClientData clientData, Tcl_Interp *interp, API_RETURN_OK; } -static int -weechat_tcl_api_nicklist_add_group (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(nicklist_add_group) { Tcl_Obj *objp; char *result, *buffer, *parent_group, *name, *color; int i, visible; - API_FUNC(1, "nicklist_add_group", API_RETURN_EMPTY); + API_INIT_FUNC(1, "nicklist_add_group", API_RETURN_EMPTY); if (objc < 6) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4067,15 +3820,13 @@ weechat_tcl_api_nicklist_add_group (ClientData clientData, Tcl_Interp *interp, API_RETURN_STRING_FREE(result); } -static int -weechat_tcl_api_nicklist_search_group (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(nicklist_search_group) { Tcl_Obj *objp; char *result, *buffer, *from_group, *name; int i; - API_FUNC(1, "nicklist_search_group", API_RETURN_EMPTY); + API_INIT_FUNC(1, "nicklist_search_group", API_RETURN_EMPTY); if (objc < 4) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4090,15 +3841,13 @@ weechat_tcl_api_nicklist_search_group (ClientData clientData, Tcl_Interp *interp API_RETURN_STRING_FREE(result); } -static int -weechat_tcl_api_nicklist_add_nick (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(nicklist_add_nick) { Tcl_Obj *objp; char *result, *buffer, *group, *name, *color, *prefix, *prefix_color; int i, visible; - API_FUNC(1, "nicklist_add_nick", API_RETURN_EMPTY); + API_INIT_FUNC(1, "nicklist_add_nick", API_RETURN_EMPTY); if (objc < 8) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4123,15 +3872,13 @@ weechat_tcl_api_nicklist_add_nick (ClientData clientData, Tcl_Interp *interp, API_RETURN_STRING_FREE(result); } -static int -weechat_tcl_api_nicklist_search_nick (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(nicklist_search_nick) { Tcl_Obj *objp; char *result, *buffer, *from_group, *name; int i; - API_FUNC(1, "nicklist_search_nick", API_RETURN_EMPTY); + API_INIT_FUNC(1, "nicklist_search_nick", API_RETURN_EMPTY); if (objc < 4) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4146,15 +3893,13 @@ weechat_tcl_api_nicklist_search_nick (ClientData clientData, Tcl_Interp *interp, API_RETURN_STRING_FREE(result); } -static int -weechat_tcl_api_nicklist_remove_group (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(nicklist_remove_group) { Tcl_Obj *objp; char *buffer, *group; int i; - API_FUNC(1, "nicklist_remove_group", API_RETURN_ERROR); + API_INIT_FUNC(1, "nicklist_remove_group", API_RETURN_ERROR); if (objc < 3) API_WRONG_ARGS(API_RETURN_ERROR); @@ -4167,15 +3912,13 @@ weechat_tcl_api_nicklist_remove_group (ClientData clientData, Tcl_Interp *interp API_RETURN_OK; } -static int -weechat_tcl_api_nicklist_remove_nick (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(nicklist_remove_nick) { Tcl_Obj *objp; char *buffer, *nick; int i; - API_FUNC(1, "nicklist_remove_nick", API_RETURN_ERROR); + API_INIT_FUNC(1, "nicklist_remove_nick", API_RETURN_ERROR); if (objc < 3) API_WRONG_ARGS(API_RETURN_ERROR); @@ -4188,14 +3931,12 @@ weechat_tcl_api_nicklist_remove_nick (ClientData clientData, Tcl_Interp *interp, API_RETURN_OK; } -static int -weechat_tcl_api_nicklist_remove_all (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(nicklist_remove_all) { Tcl_Obj *objp; int i; - API_FUNC(1, "nicklist_remove_all", API_RETURN_ERROR); + API_INIT_FUNC(1, "nicklist_remove_all", API_RETURN_ERROR); if (objc < 2) API_WRONG_ARGS(API_RETURN_ERROR); @@ -4204,17 +3945,14 @@ weechat_tcl_api_nicklist_remove_all (ClientData clientData, Tcl_Interp *interp, API_RETURN_OK; } -static int -weechat_tcl_api_nicklist_group_get_integer (ClientData clientData, - Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(nicklist_group_get_integer) { Tcl_Obj *objp; char *buffer, *group, *property; int result; int i; - API_FUNC(1, "nicklist_group_get_integer", API_RETURN_INT(-1)); + API_INIT_FUNC(1, "nicklist_group_get_integer", API_RETURN_INT(-1)); if (objc < 4) API_WRONG_ARGS(API_RETURN_INT(-1)); @@ -4229,17 +3967,14 @@ weechat_tcl_api_nicklist_group_get_integer (ClientData clientData, API_RETURN_INT(result); } -static int -weechat_tcl_api_nicklist_group_get_string (ClientData clientData, - Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(nicklist_group_get_string) { Tcl_Obj *objp; char *buffer, *group, *property; const char *result; int i; - API_FUNC(1, "nicklist_group_get_string", API_RETURN_EMPTY); + API_INIT_FUNC(1, "nicklist_group_get_string", API_RETURN_EMPTY); if (objc < 4) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4254,16 +3989,13 @@ weechat_tcl_api_nicklist_group_get_string (ClientData clientData, API_RETURN_STRING(result); } -static int -weechat_tcl_api_nicklist_group_get_pointer (ClientData clientData, - Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(nicklist_group_get_pointer) { Tcl_Obj *objp; char *buffer, *group, *property, *result; int i; - API_FUNC(1, "nicklist_group_get_pointer", API_RETURN_EMPTY); + API_INIT_FUNC(1, "nicklist_group_get_pointer", API_RETURN_EMPTY); if (objc < 4) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4278,15 +4010,13 @@ weechat_tcl_api_nicklist_group_get_pointer (ClientData clientData, API_RETURN_STRING_FREE(result); } -static int -weechat_tcl_api_nicklist_group_set (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(nicklist_group_set) { Tcl_Obj *objp; char *buffer, *group, *property, *value; int i; - API_FUNC(1, "nicklist_group_set", API_RETURN_ERROR); + API_INIT_FUNC(1, "nicklist_group_set", API_RETURN_ERROR); if (objc < 5) API_WRONG_ARGS(API_RETURN_ERROR); @@ -4303,17 +4033,14 @@ weechat_tcl_api_nicklist_group_set (ClientData clientData, Tcl_Interp *interp, API_RETURN_OK; } -static int -weechat_tcl_api_nicklist_nick_get_integer (ClientData clientData, - Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(nicklist_nick_get_integer) { Tcl_Obj *objp; char *buffer, *nick, *property; int result; int i; - API_FUNC(1, "nicklist_nick_get_integer", API_RETURN_INT(-1)); + API_INIT_FUNC(1, "nicklist_nick_get_integer", API_RETURN_INT(-1)); if (objc < 4) API_WRONG_ARGS(API_RETURN_INT(-1)); @@ -4328,17 +4055,14 @@ weechat_tcl_api_nicklist_nick_get_integer (ClientData clientData, API_RETURN_INT(result); } -static int -weechat_tcl_api_nicklist_nick_get_string (ClientData clientData, - Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(nicklist_nick_get_string) { Tcl_Obj *objp; char *buffer, *nick, *property; const char *result; int i; - API_FUNC(1, "nicklist_nick_get_string", API_RETURN_EMPTY); + API_INIT_FUNC(1, "nicklist_nick_get_string", API_RETURN_EMPTY); if (objc < 4) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4353,16 +4077,13 @@ weechat_tcl_api_nicklist_nick_get_string (ClientData clientData, API_RETURN_STRING(result); } -static int -weechat_tcl_api_nicklist_nick_get_pointer (ClientData clientData, - Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(nicklist_nick_get_pointer) { Tcl_Obj *objp; char *buffer, *nick, *property, *result; int i; - API_FUNC(1, "nicklist_nick_get_pointer", API_RETURN_EMPTY); + API_INIT_FUNC(1, "nicklist_nick_get_pointer", API_RETURN_EMPTY); if (objc < 4) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4377,15 +4098,13 @@ weechat_tcl_api_nicklist_nick_get_pointer (ClientData clientData, API_RETURN_STRING_FREE(result); } -static int -weechat_tcl_api_nicklist_nick_set (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(nicklist_nick_set) { Tcl_Obj *objp; char *buffer, *nick, *property, *value; int i; - API_FUNC(1, "nicklist_nick_set", API_RETURN_ERROR); + API_INIT_FUNC(1, "nicklist_nick_set", API_RETURN_ERROR); if (objc < 5) API_WRONG_ARGS(API_RETURN_ERROR); @@ -4402,15 +4121,13 @@ weechat_tcl_api_nicklist_nick_set (ClientData clientData, Tcl_Interp *interp, API_RETURN_OK; } -static int -weechat_tcl_api_bar_item_search (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(bar_item_search) { Tcl_Obj *objp; char *result; int i; - API_FUNC(1, "bar_item_search", API_RETURN_EMPTY); + API_INIT_FUNC(1, "bar_item_search", API_RETURN_EMPTY); if (objc < 2) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4478,15 +4195,13 @@ weechat_tcl_api_bar_item_build_cb (void *data, struct t_gui_bar_item *item, return NULL; } -static int -weechat_tcl_api_bar_item_new (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(bar_item_new) { Tcl_Obj *objp; char *result, *name, *function, *data; int i; - API_FUNC(1, "bar_item_new", API_RETURN_EMPTY); + API_INIT_FUNC(1, "bar_item_new", API_RETURN_EMPTY); if (objc < 4) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4504,14 +4219,12 @@ weechat_tcl_api_bar_item_new (ClientData clientData, Tcl_Interp *interp, API_RETURN_STRING_FREE(result); } -static int -weechat_tcl_api_bar_item_update (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(bar_item_update) { Tcl_Obj *objp; int i; - API_FUNC(1, "bar_item_update", API_RETURN_ERROR); + API_INIT_FUNC(1, "bar_item_update", API_RETURN_ERROR); if (objc < 2) API_WRONG_ARGS(API_RETURN_ERROR); @@ -4520,14 +4233,12 @@ weechat_tcl_api_bar_item_update (ClientData clientData, Tcl_Interp *interp, API_RETURN_OK; } -static int -weechat_tcl_api_bar_item_remove (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(bar_item_remove) { Tcl_Obj *objp; int i; - API_FUNC(1, "bar_item_remove", API_RETURN_ERROR); + API_INIT_FUNC(1, "bar_item_remove", API_RETURN_ERROR); if (objc < 2) API_WRONG_ARGS(API_RETURN_ERROR); @@ -4538,15 +4249,13 @@ weechat_tcl_api_bar_item_remove (ClientData clientData, Tcl_Interp *interp, API_RETURN_OK; } -static int -weechat_tcl_api_bar_search (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(bar_search) { Tcl_Obj *objp; char *result; int i; - API_FUNC(1, "bar_search", API_RETURN_EMPTY); + API_INIT_FUNC(1, "bar_search", API_RETURN_EMPTY); if (objc < 2) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4555,9 +4264,7 @@ weechat_tcl_api_bar_search (ClientData clientData, Tcl_Interp *interp, API_RETURN_STRING_FREE(result); } -static int -weechat_tcl_api_bar_new (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(bar_new) { Tcl_Obj *objp; char *result, *name, *hidden, *priority, *type, *conditions, *position; @@ -4565,7 +4272,7 @@ weechat_tcl_api_bar_new (ClientData clientData, Tcl_Interp *interp, char *color_delim, *color_bg, *separator, *bar_items; int i; - API_FUNC(1, "bar_new", API_RETURN_EMPTY); + API_INIT_FUNC(1, "bar_new", API_RETURN_EMPTY); if (objc < 16) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4604,15 +4311,13 @@ weechat_tcl_api_bar_new (ClientData clientData, Tcl_Interp *interp, API_RETURN_STRING_FREE(result); } -static int -weechat_tcl_api_bar_set (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(bar_set) { Tcl_Obj *objp; char *bar, *property, *value; int i; - API_FUNC(1, "bar_set", API_RETURN_ERROR); + API_INIT_FUNC(1, "bar_set", API_RETURN_ERROR); if (objc < 4) API_WRONG_ARGS(API_RETURN_ERROR); @@ -4625,14 +4330,12 @@ weechat_tcl_api_bar_set (ClientData clientData, Tcl_Interp *interp, API_RETURN_OK; } -static int -weechat_tcl_api_bar_update (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(bar_update) { Tcl_Obj *objp; int i; - API_FUNC(1, "bar_update", API_RETURN_ERROR); + API_INIT_FUNC(1, "bar_update", API_RETURN_ERROR); if (objc < 2) API_WRONG_ARGS(API_RETURN_ERROR); @@ -4641,14 +4344,12 @@ weechat_tcl_api_bar_update (ClientData clientData, Tcl_Interp *interp, API_RETURN_OK; } -static int -weechat_tcl_api_bar_remove (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(bar_remove) { Tcl_Obj *objp; int i; - API_FUNC(1, "bar_remove", API_RETURN_ERROR); + API_INIT_FUNC(1, "bar_remove", API_RETURN_ERROR); if (objc < 2) API_WRONG_ARGS(API_RETURN_ERROR); @@ -4657,15 +4358,13 @@ weechat_tcl_api_bar_remove (ClientData clientData, Tcl_Interp *interp, API_RETURN_OK; } -static int -weechat_tcl_api_command (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(command) { Tcl_Obj *objp; char *buffer, *command; int i, rc; - API_FUNC(1, "command", API_RETURN_ERROR); + API_INIT_FUNC(1, "command", API_RETURN_ERROR); if (objc < 3) API_WRONG_ARGS(API_RETURN_ERROR); @@ -4680,15 +4379,13 @@ weechat_tcl_api_command (ClientData clientData, Tcl_Interp *interp, API_RETURN_INT(rc); } -static int -weechat_tcl_api_info_get (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(info_get) { Tcl_Obj *objp; const char *result; int i; - API_FUNC(1, "info_get", API_RETURN_EMPTY); + API_INIT_FUNC(1, "info_get", API_RETURN_EMPTY); if (objc < 3) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4698,15 +4395,13 @@ weechat_tcl_api_info_get (ClientData clientData, Tcl_Interp *interp, API_RETURN_STRING(result); } -static int -weechat_tcl_api_info_get_hashtable (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(info_get_hashtable) { Tcl_Obj *objp, *result_dict; struct t_hashtable *hashtable, *result_hashtable; int i; - API_FUNC(1, "info_get_hashtable", API_RETURN_EMPTY); + API_INIT_FUNC(1, "info_get_hashtable", API_RETURN_EMPTY); if (objc < 3) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4727,9 +4422,7 @@ weechat_tcl_api_info_get_hashtable (ClientData clientData, Tcl_Interp *interp, API_RETURN_OBJ(result_dict); } -static int -weechat_tcl_api_infolist_new (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(infolist_new) { Tcl_Obj *objp; char *result; @@ -4739,22 +4432,20 @@ weechat_tcl_api_infolist_new (ClientData clientData, Tcl_Interp *interp, (void) objc; (void) objv; - API_FUNC(1, "infolist_new", API_RETURN_EMPTY); + API_INIT_FUNC(1, "infolist_new", API_RETURN_EMPTY); result = API_PTR2STR(weechat_infolist_new ()); API_RETURN_STRING_FREE(result); } -static int -weechat_tcl_api_infolist_new_item (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(infolist_new_item) { Tcl_Obj *objp; char *result; int i; - API_FUNC(1, "infolist_new_item", API_RETURN_INT(0)); + API_INIT_FUNC(1, "infolist_new_item", API_RETURN_INT(0)); if (objc < 2) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -4763,15 +4454,13 @@ weechat_tcl_api_infolist_new_item (ClientData clientData, Tcl_Interp *interp, API_RETURN_STRING_FREE(result); } -static int -weechat_tcl_api_infolist_new_var_integer (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(infolist_new_var_integer) { Tcl_Obj *objp; char *result; int i, value; - API_FUNC(1, "infolist_new_var_integer", API_RETURN_INT(0)); + API_INIT_FUNC(1, "infolist_new_var_integer", API_RETURN_INT(0)); if (objc < 4) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -4785,15 +4474,13 @@ weechat_tcl_api_infolist_new_var_integer (ClientData clientData, Tcl_Interp *int API_RETURN_STRING_FREE(result); } -static int -weechat_tcl_api_infolist_new_var_string (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(infolist_new_var_string) { Tcl_Obj *objp; char *result; int i; - API_FUNC(1, "infolist_new_var_string", API_RETURN_INT(0)); + API_INIT_FUNC(1, "infolist_new_var_string", API_RETURN_INT(0)); if (objc < 4) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -4804,15 +4491,13 @@ weechat_tcl_api_infolist_new_var_string (ClientData clientData, Tcl_Interp *inte API_RETURN_STRING_FREE(result); } -static int -weechat_tcl_api_infolist_new_var_pointer (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(infolist_new_var_pointer) { Tcl_Obj *objp; char *result; int i; - API_FUNC(1, "infolist_new_var_pointer", API_RETURN_INT(0)); + API_INIT_FUNC(1, "infolist_new_var_pointer", API_RETURN_INT(0)); if (objc < 4) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -4823,15 +4508,13 @@ weechat_tcl_api_infolist_new_var_pointer (ClientData clientData, Tcl_Interp *int API_RETURN_STRING_FREE(result); } -static int -weechat_tcl_api_infolist_new_var_time (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(infolist_new_var_time) { Tcl_Obj *objp; char *result; int i, value; - API_FUNC(1, "infolist_new_var_time", API_RETURN_INT(0)); + API_INIT_FUNC(1, "infolist_new_var_time", API_RETURN_INT(0)); if (objc < 4) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -4845,15 +4528,13 @@ weechat_tcl_api_infolist_new_var_time (ClientData clientData, Tcl_Interp *interp API_RETURN_STRING_FREE(result); } -static int -weechat_tcl_api_infolist_get (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(infolist_get) { Tcl_Obj *objp; char *result, *name, *pointer, *arguments; int i; - API_FUNC(1, "infolist_get", API_RETURN_EMPTY); + API_INIT_FUNC(1, "infolist_get", API_RETURN_EMPTY); if (objc < 4) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4868,14 +4549,12 @@ weechat_tcl_api_infolist_get (ClientData clientData, Tcl_Interp *interp, API_RETURN_STRING_FREE(result); } -static int -weechat_tcl_api_infolist_next (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(infolist_next) { Tcl_Obj *objp; int result, i; - API_FUNC(1, "infolist_next", API_RETURN_INT(0)); + API_INIT_FUNC(1, "infolist_next", API_RETURN_INT(0)); if (objc < 2) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -4884,14 +4563,12 @@ weechat_tcl_api_infolist_next (ClientData clientData, Tcl_Interp *interp, API_RETURN_INT(result); } -static int -weechat_tcl_api_infolist_prev (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(infolist_prev) { Tcl_Obj *objp; int result, i; - API_FUNC(1, "infolist_prev", API_RETURN_INT(0)); + API_INIT_FUNC(1, "infolist_prev", API_RETURN_INT(0)); if (objc < 2) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -4900,15 +4577,12 @@ weechat_tcl_api_infolist_prev (ClientData clientData, Tcl_Interp *interp, API_RETURN_INT(result); } -static int -weechat_tcl_api_infolist_reset_item_cursor (ClientData clientData, - Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(infolist_reset_item_cursor) { Tcl_Obj *objp; int i; - API_FUNC(1, "infolist_reset_item_cursor", API_RETURN_ERROR); + API_INIT_FUNC(1, "infolist_reset_item_cursor", API_RETURN_ERROR); if (objc < 2) API_WRONG_ARGS(API_RETURN_ERROR); @@ -4917,15 +4591,13 @@ weechat_tcl_api_infolist_reset_item_cursor (ClientData clientData, API_RETURN_OK; } -static int -weechat_tcl_api_infolist_fields (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(infolist_fields) { Tcl_Obj *objp; const char *result; int i; - API_FUNC(1, "infolist_fields", API_RETURN_EMPTY); + API_INIT_FUNC(1, "infolist_fields", API_RETURN_EMPTY); if (objc < 2) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4934,15 +4606,13 @@ weechat_tcl_api_infolist_fields (ClientData clientData, Tcl_Interp *interp, API_RETURN_STRING(result); } -static int -weechat_tcl_api_infolist_integer (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(infolist_integer) { Tcl_Obj *objp; char *infolist, *variable; int result, i; - API_FUNC(1, "infolist_integer", API_RETURN_INT(0)); + API_INIT_FUNC(1, "infolist_integer", API_RETURN_INT(0)); if (objc < 3) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -4954,16 +4624,14 @@ weechat_tcl_api_infolist_integer (ClientData clientData, Tcl_Interp *interp, API_RETURN_INT(result); } -static int -weechat_tcl_api_infolist_string (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(infolist_string) { Tcl_Obj *objp; char *infolist, *variable; const char *result; int i; - API_FUNC(1, "infolist_string", API_RETURN_EMPTY); + API_INIT_FUNC(1, "infolist_string", API_RETURN_EMPTY); if (objc < 3) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4975,15 +4643,13 @@ weechat_tcl_api_infolist_string (ClientData clientData, Tcl_Interp *interp, API_RETURN_STRING(result); } -static int -weechat_tcl_api_infolist_pointer (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(infolist_pointer) { Tcl_Obj *objp; char *infolist, *variable, *result; int i; - API_FUNC(1, "infolist_pointer", API_RETURN_EMPTY); + API_INIT_FUNC(1, "infolist_pointer", API_RETURN_EMPTY); if (objc < 3) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -4995,9 +4661,7 @@ weechat_tcl_api_infolist_pointer (ClientData clientData, Tcl_Interp *interp, API_RETURN_STRING_FREE(result); } -static int -weechat_tcl_api_infolist_time (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(infolist_time) { Tcl_Obj *objp; time_t time; @@ -5005,7 +4669,7 @@ weechat_tcl_api_infolist_time (ClientData clientData, Tcl_Interp *interp, char timebuffer[64], *result, *infolist, *variable; int i; - API_FUNC(1, "infolist_time", API_RETURN_EMPTY); + API_INIT_FUNC(1, "infolist_time", API_RETURN_EMPTY); if (objc < 3) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -5022,14 +4686,12 @@ weechat_tcl_api_infolist_time (ClientData clientData, Tcl_Interp *interp, API_RETURN_STRING_FREE(result); } -static int -weechat_tcl_api_infolist_free (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(infolist_free) { Tcl_Obj *objp; int i; - API_FUNC(1, "infolist_free", API_RETURN_ERROR); + API_INIT_FUNC(1, "infolist_free", API_RETURN_ERROR); if (objc < 2) API_WRONG_ARGS(API_RETURN_ERROR); @@ -5038,15 +4700,13 @@ weechat_tcl_api_infolist_free (ClientData clientData, Tcl_Interp *interp, API_RETURN_OK; } -static int -weechat_tcl_api_hdata_get (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(hdata_get) { Tcl_Obj *objp; char *result, *name; int i; - API_FUNC(1, "hdata_get", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hdata_get", API_RETURN_EMPTY); if (objc < 2) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -5057,15 +4717,13 @@ weechat_tcl_api_hdata_get (ClientData clientData, Tcl_Interp *interp, API_RETURN_STRING_FREE(result); } -static int -weechat_tcl_api_hdata_get_var_offset (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(hdata_get_var_offset) { Tcl_Obj *objp; char *hdata, *name; int result, i; - API_FUNC(1, "hdata_get_var_offset", API_RETURN_INT(0)); + API_INIT_FUNC(1, "hdata_get_var_offset", API_RETURN_INT(0)); if (objc < 3) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -5077,17 +4735,14 @@ weechat_tcl_api_hdata_get_var_offset (ClientData clientData, Tcl_Interp *interp, API_RETURN_INT(result); } -static int -weechat_tcl_api_hdata_get_var_type_string (ClientData clientData, - Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(hdata_get_var_type_string) { Tcl_Obj *objp; char *hdata, *name; const char *result; int i; - API_FUNC(1, "hdata_get_var_type_string", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hdata_get_var_type_string", API_RETURN_EMPTY); if (objc < 3) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -5099,16 +4754,13 @@ weechat_tcl_api_hdata_get_var_type_string (ClientData clientData, API_RETURN_STRING(result); } -static int -weechat_tcl_api_hdata_get_var_array_size (ClientData clientData, - Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(hdata_get_var_array_size) { Tcl_Obj *objp; char *hdata, *pointer, *name; int result, i; - API_FUNC(1, "hdata_get_var_array_size", API_RETURN_INT(-1)); + API_INIT_FUNC(1, "hdata_get_var_array_size", API_RETURN_INT(-1)); if (objc < 4) API_WRONG_ARGS(API_RETURN_INT(-1)); @@ -5123,17 +4775,14 @@ weechat_tcl_api_hdata_get_var_array_size (ClientData clientData, API_RETURN_INT(result); } -static int -weechat_tcl_api_hdata_get_var_array_size_string (ClientData clientData, - Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(hdata_get_var_array_size_string) { Tcl_Obj *objp; char *hdata, *pointer, *name; const char *result; int i; - API_FUNC(1, "hdata_get_var_array_size_string", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hdata_get_var_array_size_string", API_RETURN_EMPTY); if (objc < 4) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -5148,16 +4797,14 @@ weechat_tcl_api_hdata_get_var_array_size_string (ClientData clientData, API_RETURN_STRING(result); } -static int -weechat_tcl_api_hdata_get_var_hdata (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(hdata_get_var_hdata) { Tcl_Obj *objp; char *hdata, *name; const char *result; int i; - API_FUNC(1, "hdata_get_var_hdata", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hdata_get_var_hdata", API_RETURN_EMPTY); if (objc < 3) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -5169,15 +4816,13 @@ weechat_tcl_api_hdata_get_var_hdata (ClientData clientData, Tcl_Interp *interp, API_RETURN_STRING(result); } -static int -weechat_tcl_api_hdata_get_list (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(hdata_get_list) { Tcl_Obj *objp; char *hdata, *name, *result; int i; - API_FUNC(1, "hdata_get_list", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hdata_get_list", API_RETURN_EMPTY); if (objc < 3) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -5190,15 +4835,13 @@ weechat_tcl_api_hdata_get_list (ClientData clientData, Tcl_Interp *interp, API_RETURN_STRING_FREE(result); } -static int -weechat_tcl_api_hdata_check_pointer (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(hdata_check_pointer) { Tcl_Obj *objp; char *hdata, *list, *pointer; int result, i; - API_FUNC(1, "hdata_check_pointer", API_RETURN_INT(0)); + API_INIT_FUNC(1, "hdata_check_pointer", API_RETURN_INT(0)); if (objc < 4) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -5213,15 +4856,13 @@ weechat_tcl_api_hdata_check_pointer (ClientData clientData, Tcl_Interp *interp, API_RETURN_INT(result); } -static int -weechat_tcl_api_hdata_move (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(hdata_move) { Tcl_Obj *objp; char *hdata, *pointer, *result; int i, count; - API_FUNC(1, "hdata_move", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hdata_move", API_RETURN_EMPTY); if (objc < 4) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -5238,15 +4879,13 @@ weechat_tcl_api_hdata_move (ClientData clientData, Tcl_Interp *interp, API_RETURN_STRING_FREE(result); } -static int -weechat_tcl_api_hdata_search (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(hdata_search) { Tcl_Obj *objp; char *hdata, *pointer, *search, *result; int i, move; - API_FUNC(1, "hdata_search", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hdata_search", API_RETURN_EMPTY); if (objc < 5) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -5265,15 +4904,13 @@ weechat_tcl_api_hdata_search (ClientData clientData, Tcl_Interp *interp, API_RETURN_STRING_FREE(result); } -static int -weechat_tcl_api_hdata_char (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(hdata_char) { Tcl_Obj *objp; char *hdata, *pointer, *name; int result, i; - API_FUNC(1, "hdata_char", API_RETURN_INT(0)); + API_INIT_FUNC(1, "hdata_char", API_RETURN_INT(0)); if (objc < 4) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -5288,15 +4925,13 @@ weechat_tcl_api_hdata_char (ClientData clientData, Tcl_Interp *interp, API_RETURN_INT(result); } -static int -weechat_tcl_api_hdata_integer (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(hdata_integer) { Tcl_Obj *objp; char *hdata, *pointer, *name; int result, i; - API_FUNC(1, "hdata_integer", API_RETURN_INT(0)); + API_INIT_FUNC(1, "hdata_integer", API_RETURN_INT(0)); if (objc < 4) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -5311,15 +4946,13 @@ weechat_tcl_api_hdata_integer (ClientData clientData, Tcl_Interp *interp, API_RETURN_INT(result); } -static int -weechat_tcl_api_hdata_long (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(hdata_long) { Tcl_Obj *objp; char *hdata, *pointer, *name; int result, i; - API_FUNC(1, "hdata_long", API_RETURN_LONG(0)); + API_INIT_FUNC(1, "hdata_long", API_RETURN_LONG(0)); if (objc < 4) API_WRONG_ARGS(API_RETURN_LONG(0)); @@ -5334,16 +4967,14 @@ weechat_tcl_api_hdata_long (ClientData clientData, Tcl_Interp *interp, API_RETURN_LONG(result); } -static int -weechat_tcl_api_hdata_string (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(hdata_string) { Tcl_Obj *objp; char *hdata, *pointer, *name; const char *result; int i; - API_FUNC(1, "hdata_string", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hdata_string", API_RETURN_EMPTY); if (objc < 4) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -5358,15 +4989,13 @@ weechat_tcl_api_hdata_string (ClientData clientData, Tcl_Interp *interp, API_RETURN_STRING(result); } -static int -weechat_tcl_api_hdata_pointer (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(hdata_pointer) { Tcl_Obj *objp; char *hdata, *pointer, *name, *result; int i; - API_FUNC(1, "hdata_pointer", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hdata_pointer", API_RETURN_EMPTY); if (objc < 4) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -5381,16 +5010,14 @@ weechat_tcl_api_hdata_pointer (ClientData clientData, Tcl_Interp *interp, API_RETURN_STRING_FREE(result); } -static int -weechat_tcl_api_hdata_time (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(hdata_time) { Tcl_Obj *objp; time_t time; char timebuffer[64], *result, *hdata, *pointer, *name; int i; - API_FUNC(1, "hdata_time", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hdata_time", API_RETURN_EMPTY); if (objc < 4) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -5408,15 +5035,13 @@ weechat_tcl_api_hdata_time (ClientData clientData, Tcl_Interp *interp, API_RETURN_STRING_FREE(result); } -static int -weechat_tcl_api_hdata_hashtable (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(hdata_hashtable) { Tcl_Obj *objp, *result_dict; char *hdata, *pointer, *name; int i; - API_FUNC(1, "hdata_hashtable", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hdata_hashtable", API_RETURN_EMPTY); if (objc < 4) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -5433,16 +5058,14 @@ weechat_tcl_api_hdata_hashtable (ClientData clientData, Tcl_Interp *interp, API_RETURN_OBJ(result_dict); } -static int -weechat_tcl_api_hdata_update (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(hdata_update) { Tcl_Obj *objp; char *hdata, *pointer; struct t_hashtable *hashtable; int i, value; - API_FUNC(1, "hdata_update", API_RETURN_INT(0)); + API_INIT_FUNC(1, "hdata_update", API_RETURN_INT(0)); if (objc < 4) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -5463,16 +5086,14 @@ weechat_tcl_api_hdata_update (ClientData clientData, Tcl_Interp *interp, API_RETURN_INT(value); } -static int -weechat_tcl_api_hdata_get_string (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(hdata_get_string) { Tcl_Obj *objp; char *hdata, *property; const char *result; int i; - API_FUNC(1, "hdata_get_string", API_RETURN_EMPTY); + API_INIT_FUNC(1, "hdata_get_string", API_RETURN_EMPTY); if (objc < 3) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -5484,15 +5105,13 @@ weechat_tcl_api_hdata_get_string (ClientData clientData, Tcl_Interp *interp, API_RETURN_STRING(result); } -static int -weechat_tcl_api_upgrade_new (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(upgrade_new) { Tcl_Obj *objp; char *result, *filename; int i, write; - API_FUNC(1, "upgrade_new", API_RETURN_EMPTY); + API_INIT_FUNC(1, "upgrade_new", API_RETURN_EMPTY); if (objc < 3) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -5506,15 +5125,13 @@ weechat_tcl_api_upgrade_new (ClientData clientData, Tcl_Interp *interp, API_RETURN_STRING_FREE(result); } -static int -weechat_tcl_api_upgrade_write_object (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(upgrade_write_object) { Tcl_Obj *objp; char *upgrade_file, *infolist; int rc, i, object_id; - API_FUNC(1, "upgrade_write_object", API_RETURN_INT(0)); + API_INIT_FUNC(1, "upgrade_write_object", API_RETURN_INT(0)); if (objc < 4) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -5576,15 +5193,13 @@ weechat_tcl_api_upgrade_read_cb (void *data, return WEECHAT_RC_ERROR; } -static int -weechat_tcl_api_upgrade_read (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(upgrade_read) { Tcl_Obj *objp; char *upgrade_file, *function, *data; int i, rc; - API_FUNC(1, "upgrade_read", API_RETURN_EMPTY); + API_INIT_FUNC(1, "upgrade_read", API_RETURN_EMPTY); if (objc < 4) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -5602,15 +5217,13 @@ weechat_tcl_api_upgrade_read (ClientData clientData, Tcl_Interp *interp, API_RETURN_INT(rc); } -static int -weechat_tcl_api_upgrade_close (ClientData clientData, Tcl_Interp *interp, - int objc, Tcl_Obj *CONST objv[]) +API_FUNC(upgrade_close) { Tcl_Obj *objp; char *upgrade_file; int i; - API_FUNC(1, "upgrade_close", API_RETURN_ERROR); + API_INIT_FUNC(1, "upgrade_close", API_RETURN_ERROR); if (objc < 2) API_WRONG_ARGS(API_RETURN_INT(0)); |