diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/tcl/weechat-tcl-api.c | 1293 | ||||
-rw-r--r-- | src/plugins/tcl/weechat-tcl.c | 18 |
2 files changed, 585 insertions, 726 deletions
diff --git a/src/plugins/tcl/weechat-tcl-api.c b/src/plugins/tcl/weechat-tcl-api.c index a9ba2fad0..3f58141bd 100644 --- a/src/plugins/tcl/weechat-tcl-api.c +++ b/src/plugins/tcl/weechat-tcl-api.c @@ -34,7 +34,6 @@ #include "../plugin-script-api.h" #include "weechat-tcl.h" - /* Magic value to indicate NULL since Tcl only has string types. The value is * \uFFFF\uFFFF\uFFFFWEECHAT_NULL\uFFFF\uFFFF\uFFFF. \uFFFF is used because * it's reserved in Unicode as not a character, so this string is very unlikely @@ -53,7 +52,7 @@ weechat_tcl_api_##__name (ClientData clientData, \ Tcl_Interp *interp, \ int objc, \ - Tcl_Obj *CONST objv[]) + Tcl_Obj *const objv[]) #define API_INIT_FUNC(__init, __name, __ret) \ char *tcl_function_name = __name; \ (void) clientData; \ @@ -227,7 +226,6 @@ API_FUNC(register) Tcl_Obj *objp; char *name, *author, *version, *license, *description, *shutdown_func; char *charset; - int i; API_INIT_FUNC(0, "register", API_RETURN_ERROR); if (tcl_registered_script) @@ -246,13 +244,13 @@ API_FUNC(register) if (objc < 8) API_WRONG_ARGS(API_RETURN_ERROR); - name = Tcl_GetStringFromObj (objv[1], &i); - author = Tcl_GetStringFromObj (objv[2], &i); - version = Tcl_GetStringFromObj (objv[3], &i); - license = Tcl_GetStringFromObj (objv[4], &i); - description = Tcl_GetStringFromObj (objv[5], &i); - shutdown_func = Tcl_GetStringFromObj (objv[6], &i); - charset = Tcl_GetStringFromObj (objv[7], &i); + name = Tcl_GetString (objv[1]); + author = Tcl_GetString (objv[2]); + version = Tcl_GetString (objv[3]); + license = Tcl_GetString (objv[4]); + description = Tcl_GetString (objv[5]); + shutdown_func = Tcl_GetString (objv[6]); + charset = Tcl_GetString (objv[7]); if (plugin_script_search (tcl_scripts, name)) { @@ -304,13 +302,12 @@ API_FUNC(plugin_get_name) Tcl_Obj *objp; char *plugin; const char *result; - int i; API_INIT_FUNC(1, "plugin_get_name", API_RETURN_EMPTY); if (objc < 2) API_WRONG_ARGS(API_RETURN_EMPTY); - plugin = Tcl_GetStringFromObj (objv[1], &i); + plugin = Tcl_GetString (objv[1]); result = weechat_plugin_get_name (API_STR2PTR(plugin)); @@ -320,14 +317,13 @@ API_FUNC(plugin_get_name) API_FUNC(charset_set) { Tcl_Obj *objp; - int i; API_INIT_FUNC(1, "charset_set", API_RETURN_ERROR); if (objc < 2) API_WRONG_ARGS(API_RETURN_ERROR); plugin_script_api_charset_set (tcl_current_script, - Tcl_GetStringFromObj (objv[1], &i)); /* charset */ + Tcl_GetString (objv[1])); /* charset */ API_RETURN_OK; } @@ -336,14 +332,13 @@ API_FUNC(iconv_to_internal) { Tcl_Obj *objp; char *result, *charset, *string; - int i; API_INIT_FUNC(1, "iconv_to_internal", API_RETURN_EMPTY); if (objc < 3) API_WRONG_ARGS(API_RETURN_EMPTY); - charset = Tcl_GetStringFromObj (objv[1], &i); - string = Tcl_GetStringFromObj (objv[2], &i); + charset = Tcl_GetString (objv[1]); + string = Tcl_GetString (objv[2]); result = weechat_iconv_to_internal (charset, string); @@ -354,14 +349,13 @@ API_FUNC(iconv_from_internal) { Tcl_Obj *objp; char *result, *charset, *string; - int i; API_INIT_FUNC(1, "iconv_from_internal", API_RETURN_EMPTY); if (objc < 3) API_WRONG_ARGS(API_RETURN_EMPTY); - charset = Tcl_GetStringFromObj (objv[1], &i); - string = Tcl_GetStringFromObj (objv[2], &i); + charset = Tcl_GetString (objv[1]); + string = Tcl_GetString (objv[2]); result = weechat_iconv_from_internal (charset, string); @@ -372,13 +366,12 @@ API_FUNC(gettext) { Tcl_Obj *objp; const char *result; - int i; API_INIT_FUNC(1, "gettext", API_RETURN_EMPTY); if (objc < 2) API_WRONG_ARGS(API_RETURN_EMPTY); - result = weechat_gettext (Tcl_GetStringFromObj (objv[1], &i)); /* string */ + result = weechat_gettext (Tcl_GetString (objv[1])); /* string */ API_RETURN_STRING(result); } @@ -388,14 +381,14 @@ API_FUNC(ngettext) Tcl_Obj *objp; char *single, *plural; const char *result; - int i, count; + int count; API_INIT_FUNC(1, "ngettext", API_RETURN_EMPTY); if (objc < 4) API_WRONG_ARGS(API_RETURN_EMPTY); - single = Tcl_GetStringFromObj (objv[1], &i); - plural = Tcl_GetStringFromObj (objv[2], &i); + single = Tcl_GetString (objv[1]); + plural = Tcl_GetString (objv[2]); if (Tcl_GetIntFromObj (interp, objv[3], &count) != TCL_OK) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -409,13 +402,13 @@ API_FUNC(strlen_screen) { Tcl_Obj *objp; char *string; - int result, i; + int result; API_INIT_FUNC(1, "strlen_screen", API_RETURN_INT(0)); if (objc < 2) API_WRONG_ARGS(API_RETURN_INT(0)); - string = Tcl_GetStringFromObj (objv[1], &i); + string = Tcl_GetString (objv[1]); result = weechat_strlen_screen (string); @@ -426,14 +419,14 @@ API_FUNC(string_match) { Tcl_Obj *objp; char *string, *mask; - int case_sensitive, result, i; + int case_sensitive, result; API_INIT_FUNC(1, "string_match", API_RETURN_INT(0)); if (objc < 4) API_WRONG_ARGS(API_RETURN_INT(0)); - string = Tcl_GetStringFromObj (objv[1], &i); - mask = Tcl_GetStringFromObj (objv[2], &i); + string = Tcl_GetString (objv[1]); + mask = Tcl_GetString (objv[2]); if (Tcl_GetIntFromObj (interp, objv[3], &case_sensitive) != TCL_OK) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -447,14 +440,14 @@ API_FUNC(string_match_list) { Tcl_Obj *objp; char *string, *masks; - int case_sensitive, result, i; + int case_sensitive, result; API_INIT_FUNC(1, "string_match_list", API_RETURN_INT(0)); if (objc < 4) API_WRONG_ARGS(API_RETURN_INT(0)); - string = Tcl_GetStringFromObj (objv[1], &i); - masks = Tcl_GetStringFromObj (objv[2], &i); + string = Tcl_GetString (objv[1]); + masks = Tcl_GetString (objv[2]); if (Tcl_GetIntFromObj (interp, objv[3], &case_sensitive) != TCL_OK) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -471,14 +464,14 @@ API_FUNC(string_has_highlight) { Tcl_Obj *objp; char *string, *highlight_words; - int result, i; + int result; API_INIT_FUNC(1, "string_has_highlight", API_RETURN_INT(0)); if (objc < 3) API_WRONG_ARGS(API_RETURN_INT(0)); - string = Tcl_GetStringFromObj (objv[1], &i); - highlight_words = Tcl_GetStringFromObj (objv[2], &i); + string = Tcl_GetString (objv[1]); + highlight_words = Tcl_GetString (objv[2]); result = weechat_string_has_highlight (string, highlight_words); @@ -489,14 +482,14 @@ API_FUNC(string_has_highlight_regex) { Tcl_Obj *objp; char *string, *regex; - int result, i; + int result; API_INIT_FUNC(1, "string_has_highlight_regex", API_RETURN_INT(0)); if (objc < 3) API_WRONG_ARGS(API_RETURN_INT(0)); - string = Tcl_GetStringFromObj (objv[1], &i); - regex = Tcl_GetStringFromObj (objv[2], &i); + string = Tcl_GetString (objv[1]); + regex = Tcl_GetString (objv[2]); result = weechat_string_has_highlight_regex (string, regex); @@ -507,13 +500,12 @@ API_FUNC(string_mask_to_regex) { Tcl_Obj *objp; char *result, *mask; - int i; API_INIT_FUNC(1, "string_mask_to_regex", API_RETURN_EMPTY); if (objc < 2) API_WRONG_ARGS(API_RETURN_EMPTY); - mask = Tcl_GetStringFromObj (objv[1], &i); + mask = Tcl_GetString (objv[1]); result = weechat_string_mask_to_regex (mask); @@ -543,13 +535,12 @@ API_FUNC(string_parse_size) Tcl_Obj *objp; char *size; unsigned long long value; - int i; API_INIT_FUNC(1, "string_parse_size", API_RETURN_LONG(0)); if (objc < 2) API_WRONG_ARGS(API_RETURN_LONG(0)); - size = Tcl_GetStringFromObj (objv[1], &i); + size = Tcl_GetString (objv[1]); value = weechat_string_parse_size (size); @@ -559,13 +550,13 @@ API_FUNC(string_parse_size) API_FUNC(string_color_code_size) { Tcl_Obj *objp; - int result, i; + int result; API_INIT_FUNC(1, "string_color_code_size", API_RETURN_INT(0)); if (objc < 2) API_WRONG_ARGS(API_RETURN_INT(0)); - result = weechat_string_color_code_size (Tcl_GetStringFromObj (objv[1], &i)); /* string */ + result = weechat_string_color_code_size (Tcl_GetString (objv[1])); /* string */ API_RETURN_INT(result); } @@ -574,14 +565,13 @@ API_FUNC(string_remove_color) { Tcl_Obj *objp; char *result, *replacement, *string; - int i; API_INIT_FUNC(1, "string_remove_color", API_RETURN_EMPTY); if (objc < 3) API_WRONG_ARGS(API_RETURN_EMPTY); - string = Tcl_GetStringFromObj (objv[1], &i); - replacement = Tcl_GetStringFromObj (objv[2], &i); + string = Tcl_GetString (objv[1]); + replacement = Tcl_GetString (objv[2]); result = weechat_string_remove_color (string, replacement); @@ -591,13 +581,13 @@ API_FUNC(string_remove_color) API_FUNC(string_is_command_char) { Tcl_Obj *objp; - int result, i; + int result; API_INIT_FUNC(1, "string_is_command_char", API_RETURN_INT(0)); if (objc < 2) API_WRONG_ARGS(API_RETURN_INT(0)); - result = weechat_string_is_command_char (Tcl_GetStringFromObj (objv[1], &i)); /* string */ + result = weechat_string_is_command_char (Tcl_GetString (objv[1])); /* string */ API_RETURN_INT(result); } @@ -606,13 +596,12 @@ API_FUNC(string_input_for_buffer) { Tcl_Obj *objp; const char *result; - int i; API_INIT_FUNC(1, "string_input_for_buffer", API_RETURN_EMPTY); if (objc < 2) API_WRONG_ARGS(API_RETURN_EMPTY); - result = weechat_string_input_for_buffer (Tcl_GetStringFromObj (objv[1], &i)); + result = weechat_string_input_for_buffer (Tcl_GetString (objv[1])); API_RETURN_STRING(result); } @@ -622,13 +611,12 @@ API_FUNC(string_eval_expression) Tcl_Obj *objp; char *expr, *result; struct t_hashtable *pointers, *extra_vars, *options; - int i; API_INIT_FUNC(1, "string_eval_expression", API_RETURN_EMPTY); if (objc < 5) API_WRONG_ARGS(API_RETURN_EMPTY); - expr = Tcl_GetStringFromObj (objv[1], &i); + expr = Tcl_GetString (objv[1]); pointers = weechat_tcl_dict_to_hashtable (interp, objv[2], WEECHAT_SCRIPT_HASHTABLE_DEFAULT_SIZE, WEECHAT_HASHTABLE_STRING, @@ -660,13 +648,12 @@ API_FUNC(string_eval_path_home) Tcl_Obj *objp; char *path, *result; struct t_hashtable *pointers, *extra_vars, *options; - int i; API_INIT_FUNC(1, "string_eval_path_home", API_RETURN_EMPTY); if (objc < 5) API_WRONG_ARGS(API_RETURN_EMPTY); - path = Tcl_GetStringFromObj (objv[1], &i); + path = Tcl_GetString (objv[1]); pointers = weechat_tcl_dict_to_hashtable ( interp, objv[2], WEECHAT_SCRIPT_HASHTABLE_DEFAULT_SIZE, @@ -699,7 +686,7 @@ API_FUNC(string_eval_path_home) API_FUNC(mkdir_home) { Tcl_Obj *objp; - int i, mode; + int mode; API_INIT_FUNC(1, "mkdir_home", API_RETURN_ERROR); if (objc < 3) @@ -708,7 +695,7 @@ API_FUNC(mkdir_home) if (Tcl_GetIntFromObj (interp, objv[2], &mode) != TCL_OK) API_WRONG_ARGS(API_RETURN_ERROR); - if (weechat_mkdir_home (Tcl_GetStringFromObj (objv[1], &i), /* directory */ + if (weechat_mkdir_home (Tcl_GetString (objv[1]), /* directory */ mode)) API_RETURN_OK; @@ -718,7 +705,7 @@ API_FUNC(mkdir_home) API_FUNC(mkdir) { Tcl_Obj *objp; - int i, mode; + int mode; API_INIT_FUNC(1, "mkdir", API_RETURN_ERROR); if (objc < 3) @@ -727,7 +714,7 @@ API_FUNC(mkdir) if (Tcl_GetIntFromObj (interp, objv[2], &mode) != TCL_OK) API_WRONG_ARGS(API_RETURN_ERROR); - if (weechat_mkdir (Tcl_GetStringFromObj (objv[1], &i), /* directory */ + if (weechat_mkdir (Tcl_GetString (objv[1]), /* directory */ mode)) API_RETURN_OK; @@ -737,7 +724,7 @@ API_FUNC(mkdir) API_FUNC(mkdir_parents) { Tcl_Obj *objp; - int i, mode; + int mode; API_INIT_FUNC(1, "mkdir_parents", API_RETURN_ERROR); if (objc < 3) @@ -746,7 +733,7 @@ API_FUNC(mkdir_parents) if (Tcl_GetIntFromObj (interp, objv[2], &mode) != TCL_OK) API_WRONG_ARGS(API_RETURN_ERROR); - if (weechat_mkdir_parents (Tcl_GetStringFromObj (objv[1], &i), /* directory */ + if (weechat_mkdir_parents (Tcl_GetString (objv[1]), /* directory */ mode)) API_RETURN_OK; @@ -775,17 +762,16 @@ API_FUNC(list_add) Tcl_Obj *objp; char *weelist, *data, *where, *user_data; const char *result; - int i; API_INIT_FUNC(1, "list_add", API_RETURN_EMPTY); if (objc < 5) API_WRONG_ARGS(API_RETURN_EMPTY); - weelist = Tcl_GetStringFromObj (objv[1], &i); - data = Tcl_GetStringFromObj (objv[2], &i); - where = Tcl_GetStringFromObj (objv[3], &i); - user_data = Tcl_GetStringFromObj (objv[4], &i); + weelist = Tcl_GetString (objv[1]); + data = Tcl_GetString (objv[2]); + where = Tcl_GetString (objv[3]); + user_data = Tcl_GetString (objv[4]); result = API_PTR2STR(weechat_list_add (API_STR2PTR(weelist), data, @@ -800,14 +786,13 @@ API_FUNC(list_search) Tcl_Obj *objp; char *weelist, *data; const char *result; - int i; API_INIT_FUNC(1, "list_search", API_RETURN_EMPTY); if (objc < 3) API_WRONG_ARGS(API_RETURN_EMPTY); - weelist = Tcl_GetStringFromObj (objv[1], &i); - data = Tcl_GetStringFromObj (objv[2], &i); + weelist = Tcl_GetString (objv[1]); + data = Tcl_GetString (objv[2]); result = API_PTR2STR(weechat_list_search (API_STR2PTR(weelist), data)); @@ -819,14 +804,14 @@ API_FUNC(list_search_pos) { Tcl_Obj *objp; char *weelist, *data; - int i, pos; + int pos; API_INIT_FUNC(1, "list_search_pos", API_RETURN_INT(-1)); if (objc < 3) API_WRONG_ARGS(API_RETURN_INT(-1)); - weelist = Tcl_GetStringFromObj (objv[1], &i); - data = Tcl_GetStringFromObj (objv[2], &i); + weelist = Tcl_GetString (objv[1]); + data = Tcl_GetString (objv[2]); pos = weechat_list_search_pos (API_STR2PTR(weelist), data); @@ -838,14 +823,13 @@ API_FUNC(list_casesearch) Tcl_Obj *objp; char *weelist, *data; const char *result; - int i; API_INIT_FUNC(1, "list_casesearch", API_RETURN_EMPTY); if (objc < 3) API_WRONG_ARGS(API_RETURN_EMPTY); - weelist = Tcl_GetStringFromObj (objv[1], &i); - data = Tcl_GetStringFromObj (objv[2], &i); + weelist = Tcl_GetString (objv[1]); + data = Tcl_GetString (objv[2]); result = API_PTR2STR(weechat_list_casesearch (API_STR2PTR(weelist), data)); @@ -857,14 +841,14 @@ API_FUNC(list_casesearch_pos) { Tcl_Obj *objp; char *weelist, *data; - int i, pos; + int pos; API_INIT_FUNC(1, "list_casesearch_pos", API_RETURN_INT(-1)); if (objc < 3) API_WRONG_ARGS(API_RETURN_INT(-1)); - weelist = Tcl_GetStringFromObj (objv[1], &i); - data = Tcl_GetStringFromObj (objv[2], &i); + weelist = Tcl_GetString (objv[1]); + data = Tcl_GetString (objv[2]); pos = weechat_list_casesearch_pos (API_STR2PTR(weelist), data); @@ -875,7 +859,7 @@ API_FUNC(list_get) { Tcl_Obj *objp; const char *result; - int i, position; + int position; API_INIT_FUNC(1, "list_get", API_RETURN_EMPTY); if (objc < 3) @@ -884,7 +868,7 @@ API_FUNC(list_get) if (Tcl_GetIntFromObj (interp, objv[2], &position) != TCL_OK) API_WRONG_ARGS(API_RETURN_EMPTY); - result = API_PTR2STR(weechat_list_get (API_STR2PTR(Tcl_GetStringFromObj (objv[1], &i)), /* weelist */ + result = API_PTR2STR(weechat_list_get (API_STR2PTR(Tcl_GetString (objv[1])), /* weelist */ position)); API_RETURN_STRING(result); @@ -894,14 +878,13 @@ API_FUNC(list_set) { Tcl_Obj *objp; char *item, *new_value; - int i; API_INIT_FUNC(1, "list_set", API_RETURN_ERROR); if (objc < 3) API_WRONG_ARGS(API_RETURN_ERROR); - item = Tcl_GetStringFromObj (objv[1], &i); - new_value = Tcl_GetStringFromObj (objv[2], &i); + item = Tcl_GetString (objv[1]); + new_value = Tcl_GetString (objv[2]); weechat_list_set (API_STR2PTR(item), new_value); @@ -912,13 +895,12 @@ API_FUNC(list_next) { Tcl_Obj *objp; const char *result; - int i; API_INIT_FUNC(1, "list_next", API_RETURN_EMPTY); if (objc < 2) API_WRONG_ARGS(API_RETURN_EMPTY); - result = API_PTR2STR(weechat_list_next (API_STR2PTR(Tcl_GetStringFromObj (objv[1], &i)))); /* item */ + result = API_PTR2STR(weechat_list_next (API_STR2PTR(Tcl_GetString (objv[1])))); /* item */ API_RETURN_STRING(result); } @@ -927,13 +909,12 @@ API_FUNC(list_prev) { Tcl_Obj *objp; const char *result; - int i; API_INIT_FUNC(1, "list_prev", API_RETURN_EMPTY); if (objc < 2) API_WRONG_ARGS(API_RETURN_EMPTY); - result = API_PTR2STR(weechat_list_prev (API_STR2PTR(Tcl_GetStringFromObj (objv[1], &i)))); /* item */ + result = API_PTR2STR(weechat_list_prev (API_STR2PTR(Tcl_GetString (objv[1])))); /* item */ API_RETURN_STRING(result); } @@ -942,13 +923,12 @@ API_FUNC(list_string) { Tcl_Obj *objp; const char *result; - int i; API_INIT_FUNC(1, "list_string", API_RETURN_EMPTY); if (objc < 2) API_WRONG_ARGS(API_RETURN_EMPTY); - result = weechat_list_string (API_STR2PTR(Tcl_GetStringFromObj (objv[1], &i))); /* item */ + result = weechat_list_string (API_STR2PTR(Tcl_GetString (objv[1]))); /* item */ API_RETURN_STRING(result); } @@ -957,13 +937,12 @@ API_FUNC(list_size) { Tcl_Obj *objp; int size; - int i; API_INIT_FUNC(1, "list_size", API_RETURN_INT(0)); if (objc < 2) API_WRONG_ARGS(API_RETURN_INT(0)); - size = weechat_list_size (API_STR2PTR(Tcl_GetStringFromObj (objv[1], &i))); /* weelist */ + size = weechat_list_size (API_STR2PTR(Tcl_GetString (objv[1]))); /* weelist */ API_RETURN_INT(size); } @@ -972,14 +951,13 @@ API_FUNC(list_remove) { Tcl_Obj *objp; char *weelist, *item; - int i; API_INIT_FUNC(1, "list_remove", API_RETURN_ERROR); if (objc < 3) API_WRONG_ARGS(API_RETURN_ERROR); - weelist = Tcl_GetStringFromObj (objv[1], &i); - item = Tcl_GetStringFromObj (objv[2], &i); + weelist = Tcl_GetString (objv[1]); + item = Tcl_GetString (objv[2]); weechat_list_remove (API_STR2PTR(weelist), API_STR2PTR(item)); @@ -990,7 +968,6 @@ API_FUNC(list_remove) API_FUNC(list_remove_all) { Tcl_Obj *objp; - int i; (void) clientData; @@ -998,7 +975,7 @@ API_FUNC(list_remove_all) if (objc < 2) API_WRONG_ARGS(API_RETURN_ERROR); - weechat_list_remove_all (API_STR2PTR(Tcl_GetStringFromObj (objv[1], &i))); /* weelist */ + weechat_list_remove_all (API_STR2PTR(Tcl_GetString (objv[1]))); /* weelist */ API_RETURN_OK; } @@ -1006,13 +983,12 @@ API_FUNC(list_remove_all) API_FUNC(list_free) { Tcl_Obj *objp; - int i; API_INIT_FUNC(1, "list_free", API_RETURN_ERROR); if (objc < 2) API_WRONG_ARGS(API_RETURN_ERROR); - weechat_list_free (API_STR2PTR(Tcl_GetStringFromObj (objv[1], &i))); /* weelist */ + weechat_list_free (API_STR2PTR(Tcl_GetString (objv[1]))); /* weelist */ API_RETURN_OK; } @@ -1060,15 +1036,14 @@ API_FUNC(config_new) Tcl_Obj *objp; char *name, *function, *data; const char *result; - int i; API_INIT_FUNC(1, "config_new", API_RETURN_EMPTY); if (objc < 4) API_WRONG_ARGS(API_RETURN_EMPTY); - name = Tcl_GetStringFromObj (objv[1], &i); - function = Tcl_GetStringFromObj (objv[2], &i); - data = Tcl_GetStringFromObj (objv[3], &i); + name = Tcl_GetString (objv[1]); + function = Tcl_GetString (objv[2]); + data = Tcl_GetString (objv[3]); result = API_PTR2STR(plugin_script_api_config_new (weechat_tcl_plugin, tcl_current_script, @@ -1118,7 +1093,7 @@ API_FUNC(config_set_version) { Tcl_Obj *objp; char *config_file, *function, *data; - int i, rc, version; + int rc, version; API_INIT_FUNC(1, "config_set_version", API_RETURN_INT(0)); if (objc < 5) @@ -1127,9 +1102,9 @@ API_FUNC(config_set_version) if (Tcl_GetIntFromObj (interp, objv[2], &version) != TCL_OK) API_WRONG_ARGS(API_RETURN_EMPTY); - config_file = Tcl_GetStringFromObj (objv[1], &i); - function = Tcl_GetStringFromObj (objv[3], &i); - data = Tcl_GetStringFromObj (objv[4], &i); + config_file = Tcl_GetString (objv[1]); + function = Tcl_GetString (objv[3]); + data = Tcl_GetString (objv[4]); rc = plugin_script_api_config_set_version ( weechat_tcl_plugin, @@ -1355,7 +1330,7 @@ API_FUNC(config_new_section) char *data_write_default, *function_create_option, *data_create_option; char *function_delete_option, *data_delete_option; const char *result; - int i, can_add, can_delete; + int can_add, can_delete; /* make C compiler happy */ (void) clientData; @@ -1368,18 +1343,18 @@ API_FUNC(config_new_section) || (Tcl_GetIntFromObj (interp, objv[4], &can_delete) != TCL_OK)) API_WRONG_ARGS(API_RETURN_EMPTY); - config_file = Tcl_GetStringFromObj (objv[1], &i); - name = Tcl_GetStringFromObj (objv[2], &i); - function_read = Tcl_GetStringFromObj (objv[5], &i); - data_read = Tcl_GetStringFromObj (objv[6], &i); - function_write = Tcl_GetStringFromObj (objv[7], &i); - data_write = Tcl_GetStringFromObj (objv[8], &i); - function_write_default = Tcl_GetStringFromObj (objv[9], &i); - data_write_default = Tcl_GetStringFromObj (objv[10], &i); - function_create_option = Tcl_GetStringFromObj (objv[11], &i); - data_create_option = Tcl_GetStringFromObj (objv[12], &i); - function_delete_option = Tcl_GetStringFromObj (objv[13], &i); - data_delete_option = Tcl_GetStringFromObj (objv[14], &i); + config_file = Tcl_GetString (objv[1]); + name = Tcl_GetString (objv[2]); + function_read = Tcl_GetString (objv[5]); + data_read = Tcl_GetString (objv[6]); + function_write = Tcl_GetString (objv[7]); + data_write = Tcl_GetString (objv[8]); + function_write_default = Tcl_GetString (objv[9]); + data_write_default = Tcl_GetString (objv[10]); + function_create_option = Tcl_GetString (objv[11]); + data_create_option = Tcl_GetString (objv[12]); + function_delete_option = Tcl_GetString (objv[13]); + data_delete_option = Tcl_GetString (objv[14]); result = API_PTR2STR( plugin_script_api_config_new_section ( @@ -1413,14 +1388,13 @@ API_FUNC(config_search_section) Tcl_Obj *objp; char *config_file, *section_name; const char *result; - int i; API_INIT_FUNC(1, "config_search_section", API_RETURN_EMPTY); if (objc < 3) API_WRONG_ARGS(API_RETURN_EMPTY); - config_file = Tcl_GetStringFromObj (objv[1], &i); - section_name = Tcl_GetStringFromObj (objv[2], &i); + config_file = Tcl_GetString (objv[1]); + section_name = Tcl_GetString (objv[2]); result = API_PTR2STR(weechat_config_search_section (API_STR2PTR(config_file), section_name)); @@ -1530,7 +1504,7 @@ API_FUNC(config_new_option) char *function_check_value, *data_check_value, *function_change; char *data_change, *function_delete, *data_delete; const char *result; - int i, min, max, null_value_allowed; + int min, max, null_value_allowed; API_INIT_FUNC(1, "config_new_option", API_RETURN_EMPTY); if (objc < 18) @@ -1541,24 +1515,24 @@ API_FUNC(config_new_option) || (Tcl_GetIntFromObj (interp, objv[11], &null_value_allowed) != TCL_OK)) API_WRONG_ARGS(API_RETURN_EMPTY); - config_file = Tcl_GetStringFromObj (objv[1], &i); - section = Tcl_GetStringFromObj (objv[2], &i); - name = Tcl_GetStringFromObj (objv[3], &i); - type = Tcl_GetStringFromObj (objv[4], &i); - description = Tcl_GetStringFromObj (objv[5], &i); - string_values = Tcl_GetStringFromObj (objv[6], &i); - default_value = Tcl_GetStringFromObj (objv[9], &i); + config_file = Tcl_GetString (objv[1]); + section = Tcl_GetString (objv[2]); + name = Tcl_GetString (objv[3]); + type = Tcl_GetString (objv[4]); + description = Tcl_GetString (objv[5]); + string_values = Tcl_GetString (objv[6]); + default_value = Tcl_GetString (objv[9]); if (strcmp (default_value, WEECHAT_NULL_STRING) == 0) default_value = NULL; - value = Tcl_GetStringFromObj (objv[10], &i); + value = Tcl_GetString (objv[10]); if (strcmp (value, WEECHAT_NULL_STRING) == 0) value = NULL; - function_check_value = Tcl_GetStringFromObj (objv[12], &i); - data_check_value = Tcl_GetStringFromObj (objv[13], &i); - function_change = Tcl_GetStringFromObj (objv[14], &i); - data_change = Tcl_GetStringFromObj (objv[15], &i); - function_delete = Tcl_GetStringFromObj (objv[16], &i); - data_delete = Tcl_GetStringFromObj (objv[17], &i); + function_check_value = Tcl_GetString (objv[12]); + data_check_value = Tcl_GetString (objv[13]); + function_change = Tcl_GetString (objv[14]); + data_change = Tcl_GetString (objv[15]); + function_delete = Tcl_GetString (objv[16]); + data_delete = Tcl_GetString (objv[17]); result = API_PTR2STR(plugin_script_api_config_new_option (weechat_tcl_plugin, tcl_current_script, @@ -1591,15 +1565,14 @@ API_FUNC(config_search_option) Tcl_Obj *objp; char *config_file, *section, *option_name; const char *result; - int i; API_INIT_FUNC(1, "config_search_option", API_RETURN_EMPTY); if (objc < 4) API_WRONG_ARGS(API_RETURN_EMPTY); - config_file = Tcl_GetStringFromObj (objv[1], &i); - section = Tcl_GetStringFromObj (objv[2], &i); - option_name = Tcl_GetStringFromObj (objv[3], &i); + config_file = Tcl_GetString (objv[1]); + section = Tcl_GetString (objv[2]); + option_name = Tcl_GetString (objv[3]); result = API_PTR2STR(weechat_config_search_option (API_STR2PTR(config_file), API_STR2PTR(section), @@ -1611,13 +1584,13 @@ API_FUNC(config_search_option) API_FUNC(config_string_to_boolean) { Tcl_Obj *objp; - int result, i; + int result; API_INIT_FUNC(1, "config_string_to_boolean", API_RETURN_INT(0)); if (objc < 2) API_WRONG_ARGS(API_RETURN_INT(0)); - result = weechat_config_string_to_boolean (Tcl_GetStringFromObj (objv[1], &i)); /* text */ + result = weechat_config_string_to_boolean (Tcl_GetString (objv[1])); /* text */ API_RETURN_INT(result); } @@ -1627,7 +1600,7 @@ API_FUNC(config_option_reset) Tcl_Obj *objp; int rc; char *option; - int i, run_callback; + int run_callback; API_INIT_FUNC(1, "config_option_reset", API_RETURN_INT(WEECHAT_CONFIG_OPTION_SET_ERROR)); if (objc < 3) @@ -1636,7 +1609,7 @@ API_FUNC(config_option_reset) if (Tcl_GetIntFromObj (interp, objv[2], &run_callback) != TCL_OK) API_WRONG_ARGS(API_RETURN_INT(WEECHAT_CONFIG_OPTION_SET_ERROR)); - option = Tcl_GetStringFromObj (objv[1], &i); + option = Tcl_GetString (objv[1]); rc = weechat_config_option_reset (API_STR2PTR(option), run_callback); @@ -1649,7 +1622,7 @@ API_FUNC(config_option_set) Tcl_Obj *objp; int rc; char *option, *new_value; - int i, run_callback; + int run_callback; API_INIT_FUNC(1, "config_option_set", API_RETURN_INT(WEECHAT_CONFIG_OPTION_SET_ERROR)); if (objc < 4) @@ -1658,8 +1631,8 @@ API_FUNC(config_option_set) if (Tcl_GetIntFromObj (interp, objv[3], &run_callback) != TCL_OK) API_WRONG_ARGS(API_RETURN_INT(WEECHAT_CONFIG_OPTION_SET_ERROR)); - option = Tcl_GetStringFromObj (objv[1], &i); - new_value = Tcl_GetStringFromObj (objv[2], &i); + option = Tcl_GetString (objv[1]); + new_value = Tcl_GetString (objv[2]); rc = weechat_config_option_set (API_STR2PTR(option), new_value, @@ -1673,7 +1646,7 @@ API_FUNC(config_option_set_null) Tcl_Obj *objp; int rc; char *option; - int i, run_callback; + int run_callback; API_INIT_FUNC(1, "config_option_set_null", API_RETURN_INT(WEECHAT_CONFIG_OPTION_SET_ERROR)); if (objc < 3) @@ -1682,7 +1655,7 @@ API_FUNC(config_option_set_null) if (Tcl_GetIntFromObj (interp, objv[2], &run_callback) != TCL_OK) API_WRONG_ARGS(API_RETURN_INT(WEECHAT_CONFIG_OPTION_SET_ERROR)); - option = Tcl_GetStringFromObj (objv[1], &i); + option = Tcl_GetString (objv[1]); rc = weechat_config_option_set_null (API_STR2PTR(option), run_callback); @@ -1695,13 +1668,12 @@ API_FUNC(config_option_unset) Tcl_Obj *objp; int rc; char *option; - int i; 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)); - option = Tcl_GetStringFromObj (objv[1], &i); + option = Tcl_GetString (objv[1]); rc = weechat_config_option_unset (API_STR2PTR(option)); @@ -1712,14 +1684,13 @@ API_FUNC(config_option_rename) { Tcl_Obj *objp; char *option, *new_name; - int i; API_INIT_FUNC(1, "config_option_rename", API_RETURN_ERROR); if (objc < 3) API_WRONG_ARGS(API_RETURN_ERROR); - option = Tcl_GetStringFromObj (objv[1], &i); - new_name = Tcl_GetStringFromObj (objv[2], &i); + option = Tcl_GetString (objv[1]); + new_name = Tcl_GetString (objv[2]); weechat_config_option_rename (API_STR2PTR(option), new_name); @@ -1730,13 +1701,13 @@ API_FUNC(config_option_rename) API_FUNC(config_option_is_null) { Tcl_Obj *objp; - int result, i; + int result; API_INIT_FUNC(1, "config_option_is_null", API_RETURN_INT(1)); if (objc < 2) API_WRONG_ARGS(API_RETURN_INT(1)); - result = weechat_config_option_is_null (API_STR2PTR(Tcl_GetStringFromObj (objv[1], &i))); /* option */ + result = weechat_config_option_is_null (API_STR2PTR(Tcl_GetString (objv[1]))); /* option */ API_RETURN_INT(result); } @@ -1744,13 +1715,13 @@ API_FUNC(config_option_is_null) API_FUNC(config_option_default_is_null) { Tcl_Obj *objp; - int result, i; + int result; API_INIT_FUNC(1, "config_option_default_is_null", API_RETURN_INT(1)); if (objc < 2) API_WRONG_ARGS(API_RETURN_INT(1)); - result = weechat_config_option_default_is_null (API_STR2PTR(Tcl_GetStringFromObj (objv[1], &i))); /* option */ + result = weechat_config_option_default_is_null (API_STR2PTR(Tcl_GetString (objv[1]))); /* option */ API_RETURN_INT(result); } @@ -1758,13 +1729,13 @@ API_FUNC(config_option_default_is_null) API_FUNC(config_boolean) { Tcl_Obj *objp; - int result, i; + int result; API_INIT_FUNC(1, "config_boolean", API_RETURN_INT(0)); if (objc < 2) API_WRONG_ARGS(API_RETURN_INT(0)); - result = weechat_config_boolean (API_STR2PTR(Tcl_GetStringFromObj (objv[1], &i))); /* option */ + result = weechat_config_boolean (API_STR2PTR(Tcl_GetString (objv[1]))); /* option */ API_RETURN_INT(result); } @@ -1772,13 +1743,13 @@ API_FUNC(config_boolean) API_FUNC(config_boolean_default) { Tcl_Obj *objp; - int result, i; + int result; API_INIT_FUNC(1, "config_boolean_default", API_RETURN_INT(0)); if (objc < 2) API_WRONG_ARGS(API_RETURN_INT(0)); - result = weechat_config_boolean_default (API_STR2PTR(Tcl_GetStringFromObj (objv[1], &i))); /* option */ + result = weechat_config_boolean_default (API_STR2PTR(Tcl_GetString (objv[1]))); /* option */ API_RETURN_INT(result); } @@ -1786,13 +1757,13 @@ API_FUNC(config_boolean_default) API_FUNC(config_integer) { Tcl_Obj *objp; - int result, i; + int result; API_INIT_FUNC(1, "config_integer", API_RETURN_INT(0)); if (objc < 2) API_WRONG_ARGS(API_RETURN_INT(0)); - result = weechat_config_integer (API_STR2PTR(Tcl_GetStringFromObj (objv[1], &i))); /* option */ + result = weechat_config_integer (API_STR2PTR(Tcl_GetString (objv[1]))); /* option */ API_RETURN_INT(result); } @@ -1800,13 +1771,13 @@ API_FUNC(config_integer) API_FUNC(config_integer_default) { Tcl_Obj *objp; - int result, i; + int result; API_INIT_FUNC(1, "config_integer_default", API_RETURN_INT(0)); if (objc < 2) API_WRONG_ARGS(API_RETURN_INT(0)); - result = weechat_config_integer_default (API_STR2PTR(Tcl_GetStringFromObj (objv[1], &i))); /* option */ + result = weechat_config_integer_default (API_STR2PTR(Tcl_GetString (objv[1]))); /* option */ API_RETURN_INT(result); } @@ -1815,13 +1786,12 @@ API_FUNC(config_string) { Tcl_Obj *objp; const char *result; - int i; API_INIT_FUNC(1, "config_string", API_RETURN_EMPTY); if (objc < 2) API_WRONG_ARGS(API_RETURN_EMPTY); - result = weechat_config_string (API_STR2PTR(Tcl_GetStringFromObj (objv[1], &i))); /* option */ + result = weechat_config_string (API_STR2PTR(Tcl_GetString (objv[1]))); /* option */ API_RETURN_STRING(result); } @@ -1830,13 +1800,12 @@ API_FUNC(config_string_default) { Tcl_Obj *objp; const char *result; - int i; API_INIT_FUNC(1, "config_string_default", API_RETURN_EMPTY); if (objc < 2) API_WRONG_ARGS(API_RETURN_EMPTY); - result = weechat_config_string_default (API_STR2PTR(Tcl_GetStringFromObj (objv[1], &i))); /* option */ + result = weechat_config_string_default (API_STR2PTR(Tcl_GetString (objv[1]))); /* option */ API_RETURN_STRING(result); } @@ -1845,13 +1814,12 @@ API_FUNC(config_color) { Tcl_Obj *objp; const char *result; - int i; API_INIT_FUNC(1, "config_color", API_RETURN_EMPTY); if (objc < 2) API_WRONG_ARGS(API_RETURN_EMPTY); - result = weechat_config_color (API_STR2PTR(Tcl_GetStringFromObj (objv[1], &i))); /* option */ + result = weechat_config_color (API_STR2PTR(Tcl_GetString (objv[1]))); /* option */ API_RETURN_STRING(result); } @@ -1860,13 +1828,12 @@ API_FUNC(config_color_default) { Tcl_Obj *objp; const char *result; - int i; API_INIT_FUNC(1, "config_color_default", API_RETURN_EMPTY); if (objc < 2) API_WRONG_ARGS(API_RETURN_EMPTY); - result = weechat_config_color_default (API_STR2PTR(Tcl_GetStringFromObj (objv[1], &i))); /* option */ + result = weechat_config_color_default (API_STR2PTR(Tcl_GetString (objv[1]))); /* option */ API_RETURN_STRING(result); } @@ -1874,13 +1841,13 @@ API_FUNC(config_color_default) API_FUNC(config_enum) { Tcl_Obj *objp; - int result, i; + int result; API_INIT_FUNC(1, "config_enum", API_RETURN_INT(0)); if (objc < 2) API_WRONG_ARGS(API_RETURN_INT(0)); - result = weechat_config_enum (API_STR2PTR(Tcl_GetStringFromObj (objv[1], &i))); /* option */ + result = weechat_config_enum (API_STR2PTR(Tcl_GetString (objv[1]))); /* option */ API_RETURN_INT(result); } @@ -1888,13 +1855,13 @@ API_FUNC(config_enum) API_FUNC(config_enum_default) { Tcl_Obj *objp; - int result, i; + int result; API_INIT_FUNC(1, "config_enum_default", API_RETURN_INT(0)); if (objc < 2) API_WRONG_ARGS(API_RETURN_INT(0)); - result = weechat_config_enum_default (API_STR2PTR(Tcl_GetStringFromObj (objv[1], &i))); /* option */ + result = weechat_config_enum_default (API_STR2PTR(Tcl_GetString (objv[1]))); /* option */ API_RETURN_INT(result); } @@ -1903,14 +1870,13 @@ API_FUNC(config_write_option) { Tcl_Obj *objp; char *config_file, *option; - int i; API_INIT_FUNC(1, "config_write_option", API_RETURN_ERROR); if (objc < 3) API_WRONG_ARGS(API_RETURN_ERROR); - config_file = Tcl_GetStringFromObj (objv[1], &i); - option = Tcl_GetStringFromObj (objv[2], &i); + config_file = Tcl_GetString (objv[1]); + option = Tcl_GetString (objv[2]); weechat_config_write_option (API_STR2PTR(config_file), API_STR2PTR(option)); @@ -1922,15 +1888,14 @@ API_FUNC(config_write_line) { Tcl_Obj *objp; char *config_file, *option_name, *value; - int i; API_INIT_FUNC(1, "config_write_line", API_RETURN_ERROR); if (objc < 4) API_WRONG_ARGS(API_RETURN_ERROR); - config_file = Tcl_GetStringFromObj (objv[1], &i); - option_name = Tcl_GetStringFromObj (objv[2], &i); - value = Tcl_GetStringFromObj (objv[3], &i); + config_file = Tcl_GetString (objv[1]); + option_name = Tcl_GetString (objv[2]); + value = Tcl_GetString (objv[3]); weechat_config_write_line (API_STR2PTR(config_file), option_name, "%s", value); @@ -1942,13 +1907,12 @@ API_FUNC(config_write) { Tcl_Obj *objp; int rc; - int i; API_INIT_FUNC(1, "config_write", API_RETURN_INT(WEECHAT_CONFIG_WRITE_ERROR)); if (objc < 2) API_WRONG_ARGS(API_RETURN_INT(WEECHAT_CONFIG_WRITE_ERROR)); - rc = weechat_config_write (API_STR2PTR(Tcl_GetStringFromObj (objv[1], &i))); /* config_file */ + rc = weechat_config_write (API_STR2PTR(Tcl_GetString (objv[1]))); /* config_file */ API_RETURN_INT(rc); } @@ -1957,13 +1921,12 @@ API_FUNC(config_read) { Tcl_Obj *objp; int rc; - int i; API_INIT_FUNC(1, "config_read", API_RETURN_INT(WEECHAT_CONFIG_READ_FILE_NOT_FOUND)); if (objc < 2) API_WRONG_ARGS(API_RETURN_INT(WEECHAT_CONFIG_READ_FILE_NOT_FOUND)); - rc = weechat_config_read (API_STR2PTR(Tcl_GetStringFromObj (objv[1], &i))); /* config_file */ + rc = weechat_config_read (API_STR2PTR(Tcl_GetString (objv[1]))); /* config_file */ API_RETURN_INT(rc); } @@ -1972,13 +1935,12 @@ API_FUNC(config_reload) { Tcl_Obj *objp; int rc; - int i; API_INIT_FUNC(1, "config_reload", API_RETURN_INT(WEECHAT_CONFIG_READ_FILE_NOT_FOUND)); if (objc < 2) API_WRONG_ARGS(API_RETURN_INT(WEECHAT_CONFIG_READ_FILE_NOT_FOUND)); - rc = weechat_config_reload (API_STR2PTR(Tcl_GetStringFromObj (objv[1], &i))); /* config_file */ + rc = weechat_config_reload (API_STR2PTR(Tcl_GetString (objv[1]))); /* config_file */ API_RETURN_INT(rc); } @@ -1986,14 +1948,13 @@ API_FUNC(config_reload) API_FUNC(config_option_free) { Tcl_Obj *objp; - int i; API_INIT_FUNC(1, "config_option_free", API_RETURN_ERROR); if (objc < 2) API_WRONG_ARGS(API_RETURN_ERROR); weechat_config_option_free ( - API_STR2PTR(Tcl_GetStringFromObj (objv[1], &i))); /* option */ + API_STR2PTR(Tcl_GetString (objv[1]))); /* option */ API_RETURN_OK; } @@ -2001,14 +1962,13 @@ API_FUNC(config_option_free) API_FUNC(config_section_free_options) { Tcl_Obj *objp; - int i; API_INIT_FUNC(1, "config_section_free_options", API_RETURN_ERROR); if (objc < 2) API_WRONG_ARGS(API_RETURN_ERROR); weechat_config_section_free_options ( - API_STR2PTR(Tcl_GetStringFromObj (objv[1], &i))); /* section */ + API_STR2PTR(Tcl_GetString (objv[1]))); /* section */ API_RETURN_OK; } @@ -2016,14 +1976,13 @@ API_FUNC(config_section_free_options) API_FUNC(config_section_free) { Tcl_Obj *objp; - int i; API_INIT_FUNC(1, "config_section_free", API_RETURN_ERROR); if (objc < 2) API_WRONG_ARGS(API_RETURN_ERROR); weechat_config_section_free ( - API_STR2PTR(Tcl_GetStringFromObj (objv[1], &i))); /* section */ + API_STR2PTR(Tcl_GetString (objv[1]))); /* section */ API_RETURN_OK; } @@ -2031,14 +1990,13 @@ API_FUNC(config_section_free) API_FUNC(config_free) { Tcl_Obj *objp; - int i; API_INIT_FUNC(1, "config_free", API_RETURN_ERROR); if (objc < 2) API_WRONG_ARGS(API_RETURN_ERROR); weechat_config_free ( - API_STR2PTR(Tcl_GetStringFromObj (objv[1], &i))); /* config_file */ + API_STR2PTR(Tcl_GetString (objv[1]))); /* config_file */ API_RETURN_OK; } @@ -2047,13 +2005,12 @@ API_FUNC(config_get) { Tcl_Obj *objp; const char *result; - int i; API_INIT_FUNC(1, "config_get", API_RETURN_EMPTY); if (objc < 2) API_WRONG_ARGS(API_RETURN_EMPTY); - result = API_PTR2STR(weechat_config_get (Tcl_GetStringFromObj (objv[1], &i))); + result = API_PTR2STR(weechat_config_get (Tcl_GetString (objv[1]))); API_RETURN_STRING(result); } @@ -2062,7 +2019,6 @@ API_FUNC(config_get_plugin) { Tcl_Obj *objp; const char *result; - int i; API_INIT_FUNC(1, "config_get_plugin", API_RETURN_EMPTY); if (objc < 2) @@ -2070,7 +2026,7 @@ API_FUNC(config_get_plugin) result = plugin_script_api_config_get_plugin (weechat_tcl_plugin, tcl_current_script, - Tcl_GetStringFromObj (objv[1], &i)); + Tcl_GetString (objv[1])); API_RETURN_STRING(result); } @@ -2079,13 +2035,13 @@ API_FUNC(config_is_set_plugin) { Tcl_Obj *objp; char *option; - int i, rc; + int rc; API_INIT_FUNC(1, "config_is_set_plugin", API_RETURN_INT(0)); if (objc < 2) API_WRONG_ARGS(API_RETURN_INT(0)); - option = Tcl_GetStringFromObj (objv[1], &i); + option = Tcl_GetString (objv[1]); rc = plugin_script_api_config_is_set_plugin (weechat_tcl_plugin, tcl_current_script, @@ -2098,14 +2054,14 @@ API_FUNC(config_set_plugin) { Tcl_Obj *objp; char *option, *value; - int i, rc; + int rc; 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)); - option = Tcl_GetStringFromObj (objv[1], &i); - value = Tcl_GetStringFromObj (objv[2], &i); + option = Tcl_GetString (objv[1]); + value = Tcl_GetString (objv[2]); rc = plugin_script_api_config_set_plugin (weechat_tcl_plugin, tcl_current_script, @@ -2119,14 +2075,13 @@ API_FUNC(config_set_desc_plugin) { Tcl_Obj *objp; char *option, *description; - int i; API_INIT_FUNC(1, "config_set_desc_plugin", API_RETURN_ERROR); if (objc < 3) API_WRONG_ARGS(API_RETURN_ERROR); - option = Tcl_GetStringFromObj (objv[1], &i); - description = Tcl_GetStringFromObj (objv[2], &i); + option = Tcl_GetString (objv[1]); + description = Tcl_GetString (objv[2]); plugin_script_api_config_set_desc_plugin (weechat_tcl_plugin, tcl_current_script, @@ -2140,13 +2095,13 @@ API_FUNC(config_unset_plugin) { Tcl_Obj *objp; char *option; - int i, rc; + int rc; 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)); - option = Tcl_GetStringFromObj (objv[1], &i); + option = Tcl_GetString (objv[1]); rc = plugin_script_api_config_unset_plugin (weechat_tcl_plugin, tcl_current_script, @@ -2160,13 +2115,13 @@ API_FUNC(key_bind) Tcl_Obj *objp; char *context; struct t_hashtable *hashtable; - int i, num_keys; + int num_keys; API_INIT_FUNC(1, "key_bind", API_RETURN_INT(0)); if (objc < 3) API_WRONG_ARGS(API_RETURN_INT(0)); - context = Tcl_GetStringFromObj (objv[1], &i); + context = Tcl_GetString (objv[1]); hashtable = weechat_tcl_dict_to_hashtable (interp, objv[2], WEECHAT_SCRIPT_HASHTABLE_DEFAULT_SIZE, WEECHAT_HASHTABLE_STRING, @@ -2184,14 +2139,14 @@ API_FUNC(key_unbind) { Tcl_Obj *objp; char *context, *key; - int i, num_keys; + int num_keys; API_INIT_FUNC(1, "key_unbind", API_RETURN_INT(0)); if (objc < 3) API_WRONG_ARGS(API_RETURN_INT(0)); - context = Tcl_GetStringFromObj (objv[1], &i); - key = Tcl_GetStringFromObj (objv[2], &i); + context = Tcl_GetString (objv[1]); + key = Tcl_GetString (objv[2]); num_keys = weechat_key_unbind (context, key); @@ -2202,13 +2157,12 @@ API_FUNC(prefix) { Tcl_Obj *objp; const char *result; - int i; API_INIT_FUNC(0, "prefix", API_RETURN_EMPTY); if (objc < 2) API_WRONG_ARGS(API_RETURN_EMPTY); - result = weechat_prefix (Tcl_GetStringFromObj (objv[1], &i)); /* prefix */ + result = weechat_prefix (Tcl_GetString (objv[1])); /* prefix */ API_RETURN_STRING(result); } @@ -2217,13 +2171,12 @@ API_FUNC(color) { Tcl_Obj *objp; const char *result; - int i; API_INIT_FUNC(0, "color", API_RETURN_EMPTY); if (objc < 2) API_WRONG_ARGS(API_RETURN_EMPTY); - result = weechat_color (Tcl_GetStringFromObj (objv[1], &i)); /* color */ + result = weechat_color (Tcl_GetString (objv[1])); /* color */ API_RETURN_STRING(result); } @@ -2232,14 +2185,13 @@ API_FUNC(print) { Tcl_Obj *objp; char *buffer, *message; - int i; API_INIT_FUNC(0, "print", API_RETURN_ERROR); if (objc < 3) API_WRONG_ARGS(API_RETURN_ERROR); - buffer = Tcl_GetStringFromObj (objv[1], &i); - message = Tcl_GetStringFromObj (objv[2], &i); + buffer = Tcl_GetString (objv[1]); + message = Tcl_GetString (objv[2]); plugin_script_api_printf (weechat_tcl_plugin, tcl_current_script, @@ -2253,7 +2205,6 @@ API_FUNC(print_date_tags) { Tcl_Obj *objp; char *buffer, *tags, *message; - int i; long date; API_INIT_FUNC(1, "print_date_tags", API_RETURN_ERROR); @@ -2263,9 +2214,9 @@ API_FUNC(print_date_tags) if (Tcl_GetLongFromObj (interp, objv[2], &date) != TCL_OK) API_WRONG_ARGS(API_RETURN_ERROR); - buffer = Tcl_GetStringFromObj (objv[1], &i); - tags = Tcl_GetStringFromObj (objv[3], &i); - message = Tcl_GetStringFromObj (objv[4], &i); + buffer = Tcl_GetString (objv[1]); + tags = Tcl_GetString (objv[3]); + message = Tcl_GetString (objv[4]); plugin_script_api_printf_date_tags (weechat_tcl_plugin, tcl_current_script, @@ -2281,7 +2232,7 @@ API_FUNC(print_datetime_tags) { Tcl_Obj *objp; char *buffer, *tags, *message; - int i, date_usec; + int date_usec; long date; API_INIT_FUNC(1, "print_datetime_tags", API_RETURN_ERROR); @@ -2294,9 +2245,9 @@ API_FUNC(print_datetime_tags) if (Tcl_GetIntFromObj (interp, objv[3], &date_usec) != TCL_OK) API_WRONG_ARGS(API_RETURN_ERROR); - buffer = Tcl_GetStringFromObj (objv[1], &i); - tags = Tcl_GetStringFromObj (objv[4], &i); - message = Tcl_GetStringFromObj (objv[5], &i); + buffer = Tcl_GetString (objv[1]); + tags = Tcl_GetString (objv[4]); + message = Tcl_GetString (objv[5]); plugin_script_api_printf_datetime_tags (weechat_tcl_plugin, tcl_current_script, @@ -2313,7 +2264,7 @@ API_FUNC(print_y) { Tcl_Obj *objp; char *buffer, *message; - int i, y; + int y; API_INIT_FUNC(1, "print_y", API_RETURN_ERROR); if (objc < 4) @@ -2322,8 +2273,8 @@ API_FUNC(print_y) if (Tcl_GetIntFromObj (interp, objv[2], &y) != TCL_OK) API_WRONG_ARGS(API_RETURN_ERROR); - buffer = Tcl_GetStringFromObj (objv[1], &i); - message = Tcl_GetStringFromObj (objv[3], &i); + buffer = Tcl_GetString (objv[1]); + message = Tcl_GetString (objv[3]); plugin_script_api_printf_y (weechat_tcl_plugin, tcl_current_script, @@ -2338,7 +2289,7 @@ API_FUNC(print_y_date_tags) { Tcl_Obj *objp; char *buffer, *tags, *message; - int i, y; + int y; long date; API_INIT_FUNC(1, "print_y_date_tags", API_RETURN_ERROR); @@ -2351,9 +2302,9 @@ API_FUNC(print_y_date_tags) if (Tcl_GetLongFromObj (interp, objv[3], &date) != TCL_OK) API_WRONG_ARGS(API_RETURN_ERROR); - buffer = Tcl_GetStringFromObj (objv[1], &i); - tags = Tcl_GetStringFromObj (objv[4], &i); - message = Tcl_GetStringFromObj (objv[5], &i); + buffer = Tcl_GetString (objv[1]); + tags = Tcl_GetString (objv[4]); + message = Tcl_GetString (objv[5]); plugin_script_api_printf_y_date_tags (weechat_tcl_plugin, tcl_current_script, @@ -2370,7 +2321,7 @@ API_FUNC(print_y_datetime_tags) { Tcl_Obj *objp; char *buffer, *tags, *message; - int i, y, date_usec; + int y, date_usec; long date; API_INIT_FUNC(1, "print_y_datetime_tags", API_RETURN_ERROR); @@ -2386,9 +2337,9 @@ API_FUNC(print_y_datetime_tags) if (Tcl_GetIntFromObj (interp, objv[4], &date_usec) != TCL_OK) API_WRONG_ARGS(API_RETURN_ERROR); - buffer = Tcl_GetStringFromObj (objv[1], &i); - tags = Tcl_GetStringFromObj (objv[5], &i); - message = Tcl_GetStringFromObj (objv[6], &i); + buffer = Tcl_GetString (objv[1]); + tags = Tcl_GetString (objv[5]); + message = Tcl_GetString (objv[6]); plugin_script_api_printf_y_datetime_tags (weechat_tcl_plugin, tcl_current_script, @@ -2405,7 +2356,6 @@ API_FUNC(print_y_datetime_tags) API_FUNC(log_print) { Tcl_Obj *objp; - int i; /* make C compiler happy */ (void) clientData; @@ -2417,7 +2367,7 @@ API_FUNC(log_print) plugin_script_api_log_printf (weechat_tcl_plugin, tcl_current_script, - "%s", Tcl_GetStringFromObj (objv[1], &i)); /* message */ + "%s", Tcl_GetString (objv[1])); /* message */ API_RETURN_OK; } @@ -2470,19 +2420,18 @@ API_FUNC(hook_command) char *command, *description, *args, *args_description; char *completion, *function, *data; const char *result; - int i; API_INIT_FUNC(1, "hook_command", API_RETURN_EMPTY); if (objc < 8) API_WRONG_ARGS(API_RETURN_EMPTY); - command = Tcl_GetStringFromObj (objv[1], &i); - description = Tcl_GetStringFromObj (objv[2], &i); - args = Tcl_GetStringFromObj (objv[3], &i); - args_description = Tcl_GetStringFromObj (objv[4], &i); - completion = Tcl_GetStringFromObj (objv[5], &i); - function = Tcl_GetStringFromObj (objv[6], &i); - data = Tcl_GetStringFromObj (objv[7], &i); + command = Tcl_GetString (objv[1]); + description = Tcl_GetString (objv[2]); + args = Tcl_GetString (objv[3]); + args_description = Tcl_GetString (objv[4]); + completion = Tcl_GetString (objv[5]); + function = Tcl_GetString (objv[6]); + data = Tcl_GetString (objv[7]); result = API_PTR2STR(plugin_script_api_hook_command (weechat_tcl_plugin, tcl_current_script, @@ -2544,16 +2493,15 @@ API_FUNC(hook_completion) Tcl_Obj *objp; char *completion, *description, *function, *data; const char *result; - int i; API_INIT_FUNC(1, "hook_completion", API_RETURN_EMPTY); if (objc < 5) API_WRONG_ARGS(API_RETURN_EMPTY); - completion = Tcl_GetStringFromObj (objv[1], &i); - description = Tcl_GetStringFromObj (objv[2], &i); - function = Tcl_GetStringFromObj (objv[3], &i); - data = Tcl_GetStringFromObj (objv[4], &i); + completion = Tcl_GetString (objv[1]); + description = Tcl_GetString (objv[2]); + function = Tcl_GetString (objv[3]); + data = Tcl_GetString (objv[4]); result = API_PTR2STR(plugin_script_api_hook_completion (weechat_tcl_plugin, tcl_current_script, @@ -2576,14 +2524,13 @@ API_FUNC(hook_completion_get_string) Tcl_Obj *objp; char *completion, *property; const char *result; - int i; API_INIT_FUNC(1, "hook_completion_get_string", API_RETURN_EMPTY); if (objc < 3) API_WRONG_ARGS(API_RETURN_EMPTY); - completion = Tcl_GetStringFromObj (objv[1], &i); - property = Tcl_GetStringFromObj (objv[2], &i); + completion = Tcl_GetString (objv[1]); + property = Tcl_GetString (objv[2]); result = weechat_hook_completion_get_string (API_STR2PTR(completion), property); @@ -2600,7 +2547,7 @@ API_FUNC(hook_completion_list_add) { Tcl_Obj *objp; char *completion, *word, *where; - int i, nick_completion; + int nick_completion; API_INIT_FUNC(1, "hook_completion_list_add", API_RETURN_ERROR); if (objc < 5) @@ -2609,9 +2556,9 @@ API_FUNC(hook_completion_list_add) if (Tcl_GetIntFromObj (interp, objv[3], &nick_completion) != TCL_OK) API_WRONG_ARGS(API_RETURN_ERROR); - completion = Tcl_GetStringFromObj (objv[1], &i); - word = Tcl_GetStringFromObj (objv[2], &i); - where = Tcl_GetStringFromObj (objv[4], &i); + completion = Tcl_GetString (objv[1]); + word = Tcl_GetString (objv[2]); + where = Tcl_GetString (objv[4]); weechat_hook_completion_list_add (API_STR2PTR(completion), word, @@ -2665,15 +2612,14 @@ API_FUNC(hook_command_run) Tcl_Obj *objp; char *command, *function, *data; const char *result; - int i; API_INIT_FUNC(1, "hook_command_run", API_RETURN_EMPTY); if (objc < 4) API_WRONG_ARGS(API_RETURN_EMPTY); - command = Tcl_GetStringFromObj (objv[1], &i); - function = Tcl_GetStringFromObj (objv[2], &i); - data = Tcl_GetStringFromObj (objv[3], &i); + command = Tcl_GetString (objv[1]); + function = Tcl_GetString (objv[2]); + data = Tcl_GetString (objv[3]); result = API_PTR2STR(plugin_script_api_hook_command_run (weechat_tcl_plugin, tcl_current_script, @@ -2727,7 +2673,7 @@ API_FUNC(hook_timer) Tcl_Obj *objp; const char *result; long interval; - int i, align_second, max_calls; + int align_second, max_calls; API_INIT_FUNC(1, "hook_timer", API_RETURN_EMPTY); if (objc < 6) @@ -2745,8 +2691,8 @@ API_FUNC(hook_timer) align_second, /* align_second */ max_calls, /* max_calls */ &weechat_tcl_api_hook_timer_cb, - Tcl_GetStringFromObj (objv[4], &i), /* tcl function */ - Tcl_GetStringFromObj (objv[5], &i))); /* data */ + Tcl_GetString (objv[4]), /* tcl function */ + Tcl_GetString (objv[5]))); /* data */ API_RETURN_STRING(result); } @@ -2791,7 +2737,7 @@ API_FUNC(hook_fd) { Tcl_Obj *objp; const char *result; - int i, fd, read, write, exception; + int fd, read, write, exception; API_INIT_FUNC(1, "hook_fd", API_RETURN_EMPTY); if (objc < 7) @@ -2810,8 +2756,8 @@ API_FUNC(hook_fd) write, /* write */ exception, /* exception */ &weechat_tcl_api_hook_fd_cb, - Tcl_GetStringFromObj (objv[5], &i), /* tcl function */ - Tcl_GetStringFromObj (objv[6], &i))); /* data */ + Tcl_GetString (objv[5]), /* tcl function */ + Tcl_GetString (objv[6]))); /* data */ API_RETURN_STRING(result); } @@ -2881,7 +2827,7 @@ API_FUNC(hook_process) Tcl_Obj *objp; char *command, *function, *data; const char *result; - int i, timeout; + int timeout; API_INIT_FUNC(1, "hook_process", API_RETURN_EMPTY); if (objc < 5) @@ -2890,9 +2836,9 @@ API_FUNC(hook_process) if ((Tcl_GetIntFromObj (interp, objv[2], &timeout) != TCL_OK)) API_WRONG_ARGS(API_RETURN_EMPTY); - command = Tcl_GetStringFromObj (objv[1], &i); - function = Tcl_GetStringFromObj (objv[3], &i); - data = Tcl_GetStringFromObj (objv[4], &i); + command = Tcl_GetString (objv[1]); + function = Tcl_GetString (objv[3]); + data = Tcl_GetString (objv[4]); result = API_PTR2STR(plugin_script_api_hook_process (weechat_tcl_plugin, tcl_current_script, @@ -2911,7 +2857,7 @@ API_FUNC(hook_process_hashtable) char *command, *function, *data; const char *result; struct t_hashtable *options; - int i, timeout; + int timeout; API_INIT_FUNC(1, "hook_process_hashtable", API_RETURN_EMPTY); if (objc < 6) @@ -2920,13 +2866,13 @@ API_FUNC(hook_process_hashtable) if ((Tcl_GetIntFromObj (interp, objv[3], &timeout) != TCL_OK)) API_WRONG_ARGS(API_RETURN_EMPTY); - command = Tcl_GetStringFromObj (objv[1], &i); + command = Tcl_GetString (objv[1]); options = weechat_tcl_dict_to_hashtable (interp, objv[2], WEECHAT_SCRIPT_HASHTABLE_DEFAULT_SIZE, WEECHAT_HASHTABLE_STRING, WEECHAT_HASHTABLE_STRING); - function = Tcl_GetStringFromObj (objv[4], &i); - data = Tcl_GetStringFromObj (objv[5], &i); + function = Tcl_GetString (objv[4]); + data = Tcl_GetString (objv[5]); result = API_PTR2STR(plugin_script_api_hook_process_hashtable (weechat_tcl_plugin, tcl_current_script, @@ -2990,7 +2936,7 @@ API_FUNC(hook_url) char *url, *function, *data; const char *result; struct t_hashtable *options; - int i, timeout; + int timeout; API_INIT_FUNC(1, "hook_url", API_RETURN_EMPTY); if (objc < 6) @@ -2999,13 +2945,13 @@ API_FUNC(hook_url) if ((Tcl_GetIntFromObj (interp, objv[3], &timeout) != TCL_OK)) API_WRONG_ARGS(API_RETURN_EMPTY); - url = Tcl_GetStringFromObj (objv[1], &i); + url = Tcl_GetString (objv[1]); options = weechat_tcl_dict_to_hashtable (interp, objv[2], WEECHAT_SCRIPT_HASHTABLE_DEFAULT_SIZE, WEECHAT_HASHTABLE_STRING, WEECHAT_HASHTABLE_STRING); - function = Tcl_GetStringFromObj (objv[4], &i); - data = Tcl_GetStringFromObj (objv[5], &i); + function = Tcl_GetString (objv[4]); + data = Tcl_GetString (objv[5]); result = API_PTR2STR(plugin_script_api_hook_url (weechat_tcl_plugin, tcl_current_script, @@ -3070,7 +3016,7 @@ API_FUNC(hook_connect) Tcl_Obj *objp; char *proxy, *address, *local_hostname, *function, *data; const char *result; - int i, port, ipv6, retry; + int port, ipv6, retry; API_INIT_FUNC(1, "hook_connect", API_RETURN_EMPTY); if (objc < 9) @@ -3081,11 +3027,11 @@ API_FUNC(hook_connect) || (Tcl_GetIntFromObj (interp, objv[5], &retry) != TCL_OK)) API_WRONG_ARGS(API_RETURN_EMPTY); - proxy = Tcl_GetStringFromObj (objv[1], &i); - address = Tcl_GetStringFromObj (objv[2], &i); - local_hostname = Tcl_GetStringFromObj (objv[6], &i); - function = Tcl_GetStringFromObj (objv[7], &i); - data = Tcl_GetStringFromObj (objv[8], &i); + proxy = Tcl_GetString (objv[1]); + address = Tcl_GetString (objv[2]); + local_hostname = Tcl_GetString (objv[6]); + function = Tcl_GetString (objv[7]); + data = Tcl_GetString (objv[8]); result = API_PTR2STR(plugin_script_api_hook_connect (weechat_tcl_plugin, tcl_current_script, @@ -3138,17 +3084,16 @@ API_FUNC(hook_line) Tcl_Obj *objp; char *buffer_type, *buffer_name, *tags, *function, *data; const char *result; - int i; API_INIT_FUNC(1, "hook_line", API_RETURN_EMPTY); if (objc < 6) API_WRONG_ARGS(API_RETURN_EMPTY); - buffer_type = Tcl_GetStringFromObj (objv[1], &i); - buffer_name = Tcl_GetStringFromObj (objv[2], &i); - tags = Tcl_GetStringFromObj (objv[3], &i); - function = Tcl_GetStringFromObj (objv[4], &i); - data = Tcl_GetStringFromObj (objv[5], &i); + buffer_type = Tcl_GetString (objv[1]); + buffer_name = Tcl_GetString (objv[2]); + tags = Tcl_GetString (objv[3]); + function = Tcl_GetString (objv[4]); + data = Tcl_GetString (objv[5]); result = API_PTR2STR(plugin_script_api_hook_line (weechat_tcl_plugin, tcl_current_script, @@ -3225,7 +3170,7 @@ API_FUNC(hook_print) Tcl_Obj *objp; char *buffer, *tags, *message, *function, *data; const char *result; - int i, strip_colors; + int strip_colors; API_INIT_FUNC(1, "hook_print", API_RETURN_EMPTY); if (objc < 7) @@ -3234,11 +3179,11 @@ API_FUNC(hook_print) if (Tcl_GetIntFromObj (interp, objv[4], &strip_colors) != TCL_OK) API_WRONG_ARGS(API_RETURN_EMPTY); - buffer = Tcl_GetStringFromObj (objv[1], &i); - tags = Tcl_GetStringFromObj (objv[2], &i); - message = Tcl_GetStringFromObj (objv[3], &i); - function = Tcl_GetStringFromObj (objv[5], &i); - data = Tcl_GetStringFromObj (objv[6], &i); + buffer = Tcl_GetString (objv[1]); + tags = Tcl_GetString (objv[2]); + message = Tcl_GetString (objv[3]); + function = Tcl_GetString (objv[5]); + data = Tcl_GetString (objv[6]); result = API_PTR2STR(plugin_script_api_hook_print (weechat_tcl_plugin, tcl_current_script, @@ -3317,15 +3262,14 @@ API_FUNC(hook_signal) Tcl_Obj *objp; char *signal, *function, *data; const char *result; - int i; API_INIT_FUNC(1, "hook_signal", API_RETURN_EMPTY); if (objc < 4) API_WRONG_ARGS(API_RETURN_EMPTY); - signal = Tcl_GetStringFromObj (objv[1], &i); - function = Tcl_GetStringFromObj (objv[2], &i); - data = Tcl_GetStringFromObj (objv[3], &i); + signal = Tcl_GetString (objv[1]); + function = Tcl_GetString (objv[2]); + data = Tcl_GetString (objv[3]); result = API_PTR2STR(plugin_script_api_hook_signal (weechat_tcl_plugin, tcl_current_script, @@ -3341,19 +3285,19 @@ API_FUNC(hook_signal_send) { Tcl_Obj *objp; char *signal, *type_data; - int number, i, rc; + int number, rc; 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)); - signal = Tcl_GetStringFromObj (objv[1], &i); - type_data = Tcl_GetStringFromObj (objv[2], &i); + signal = Tcl_GetString (objv[1]); + type_data = Tcl_GetString (objv[2]); if (strcmp (type_data, WEECHAT_HOOK_SIGNAL_STRING) == 0) { rc = weechat_hook_signal_send (signal, type_data, - Tcl_GetStringFromObj (objv[3], &i)); /* signal_data */ + Tcl_GetString (objv[3])); /* signal_data */ API_RETURN_INT(rc); } else if (strcmp (type_data, WEECHAT_HOOK_SIGNAL_INT) == 0) @@ -3371,7 +3315,7 @@ API_FUNC(hook_signal_send) { rc = weechat_hook_signal_send (signal, type_data, - API_STR2PTR(Tcl_GetStringFromObj (objv[3], &i))); /* signal_data */ + API_STR2PTR(Tcl_GetString (objv[3]))); /* signal_data */ API_RETURN_INT(rc); } @@ -3422,15 +3366,14 @@ API_FUNC(hook_hsignal) Tcl_Obj *objp; char *signal, *function, *data; const char *result; - int i; API_INIT_FUNC(1, "hook_hsignal", API_RETURN_EMPTY); if (objc < 4) API_WRONG_ARGS(API_RETURN_EMPTY); - signal = Tcl_GetStringFromObj (objv[1], &i); - function = Tcl_GetStringFromObj (objv[2], &i); - data = Tcl_GetStringFromObj (objv[3], &i); + signal = Tcl_GetString (objv[1]); + function = Tcl_GetString (objv[2]); + data = Tcl_GetString (objv[3]); result = API_PTR2STR(plugin_script_api_hook_hsignal (weechat_tcl_plugin, tcl_current_script, @@ -3447,13 +3390,13 @@ API_FUNC(hook_hsignal_send) Tcl_Obj *objp; char *signal; struct t_hashtable *hashtable; - int i, rc; + int rc; 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)); - signal = Tcl_GetStringFromObj (objv[1], &i); + signal = Tcl_GetString (objv[1]); hashtable = weechat_tcl_dict_to_hashtable (interp, objv[2], WEECHAT_SCRIPT_HASHTABLE_DEFAULT_SIZE, WEECHAT_HASHTABLE_STRING, @@ -3510,15 +3453,14 @@ API_FUNC(hook_config) Tcl_Obj *objp; char *option, *function, *data; const char *result; - int i; API_INIT_FUNC(1, "hook_config", API_RETURN_EMPTY); if (objc < 4) API_WRONG_ARGS(API_RETURN_EMPTY); - option = Tcl_GetStringFromObj (objv[1], &i); - function = Tcl_GetStringFromObj (objv[2], &i); - data = Tcl_GetStringFromObj (objv[3], &i); + option = Tcl_GetString (objv[1]); + function = Tcl_GetString (objv[2]); + data = Tcl_GetString (objv[3]); result = API_PTR2STR(plugin_script_api_hook_config (weechat_tcl_plugin, tcl_current_script, @@ -3565,15 +3507,14 @@ API_FUNC(hook_modifier) Tcl_Obj *objp; char *modifier, *function, *data; const char *result; - int i; API_INIT_FUNC(1, "hook_modifier", API_RETURN_EMPTY); if (objc < 4) API_WRONG_ARGS(API_RETURN_EMPTY); - modifier = Tcl_GetStringFromObj (objv[1], &i); - function = Tcl_GetStringFromObj (objv[2], &i); - data = Tcl_GetStringFromObj (objv[3], &i); + modifier = Tcl_GetString (objv[1]); + function = Tcl_GetString (objv[2]); + data = Tcl_GetString (objv[3]); result = API_PTR2STR(plugin_script_api_hook_modifier (weechat_tcl_plugin, tcl_current_script, @@ -3589,15 +3530,14 @@ API_FUNC(hook_modifier_exec) { Tcl_Obj *objp; char *result, *modifier, *modifier_data, *string; - int i; API_INIT_FUNC(1, "hook_modifier_exec", API_RETURN_EMPTY); if (objc < 4) API_WRONG_ARGS(API_RETURN_EMPTY); - modifier = Tcl_GetStringFromObj (objv[1], &i); - modifier_data = Tcl_GetStringFromObj (objv[2], &i); - string = Tcl_GetStringFromObj (objv[3], &i); + modifier = Tcl_GetString (objv[1]); + modifier_data = Tcl_GetString (objv[2]); + string = Tcl_GetString (objv[3]); result = weechat_hook_modifier_exec (modifier, modifier_data, string); @@ -3637,17 +3577,16 @@ API_FUNC(hook_info) Tcl_Obj *objp; char *info_name, *description, *args_description, *function, *data; const char *result; - int i; API_INIT_FUNC(1, "hook_info", API_RETURN_EMPTY); if (objc < 6) API_WRONG_ARGS(API_RETURN_EMPTY); - info_name = Tcl_GetStringFromObj (objv[1], &i); - description = Tcl_GetStringFromObj (objv[2], &i); - args_description = Tcl_GetStringFromObj (objv[3], &i); - function = Tcl_GetStringFromObj (objv[4], &i); - data = Tcl_GetStringFromObj (objv[5], &i); + info_name = Tcl_GetString (objv[1]); + description = Tcl_GetString (objv[2]); + args_description = Tcl_GetString (objv[3]); + function = Tcl_GetString (objv[4]); + data = Tcl_GetString (objv[5]); result = API_PTR2STR(plugin_script_api_hook_info (weechat_tcl_plugin, tcl_current_script, @@ -3696,18 +3635,17 @@ API_FUNC(hook_info_hashtable) char *info_name, *description, *args_description; char *output_description, *function, *data; const char *result; - int i; API_INIT_FUNC(1, "hook_info_hashtable", API_RETURN_EMPTY); if (objc < 7) API_WRONG_ARGS(API_RETURN_EMPTY); - info_name = Tcl_GetStringFromObj (objv[1], &i); - description = Tcl_GetStringFromObj (objv[2], &i); - args_description = Tcl_GetStringFromObj (objv[3], &i); - output_description = Tcl_GetStringFromObj (objv[4], &i); - function = Tcl_GetStringFromObj (objv[5], &i); - data = Tcl_GetStringFromObj (objv[6], &i); + info_name = Tcl_GetString (objv[1]); + description = Tcl_GetString (objv[2]); + args_description = Tcl_GetString (objv[3]); + output_description = Tcl_GetString (objv[4]); + function = Tcl_GetString (objv[5]); + data = Tcl_GetString (objv[6]); result = API_PTR2STR(plugin_script_api_hook_info_hashtable (weechat_tcl_plugin, tcl_current_script, @@ -3761,18 +3699,17 @@ API_FUNC(hook_infolist) char *infolist_name, *description, *pointer_description; char *args_description, *function, *data; const char *result; - int i; API_INIT_FUNC(1, "hook_infolist", API_RETURN_EMPTY); if (objc < 7) API_WRONG_ARGS(API_RETURN_EMPTY); - infolist_name = Tcl_GetStringFromObj (objv[1], &i); - description = Tcl_GetStringFromObj (objv[2], &i); - pointer_description = Tcl_GetStringFromObj (objv[3], &i); - args_description = Tcl_GetStringFromObj (objv[4], &i); - function = Tcl_GetStringFromObj (objv[5], &i); - data = Tcl_GetStringFromObj (objv[6], &i); + infolist_name = Tcl_GetString (objv[1]); + description = Tcl_GetString (objv[2]); + pointer_description = Tcl_GetString (objv[3]); + args_description = Tcl_GetString (objv[4]); + function = Tcl_GetString (objv[5]); + data = Tcl_GetString (objv[6]); result = API_PTR2STR(plugin_script_api_hook_infolist (weechat_tcl_plugin, tcl_current_script, @@ -3819,15 +3756,14 @@ API_FUNC(hook_focus) Tcl_Obj *objp; char *area, *function, *data; const char *result; - int i; API_INIT_FUNC(1, "hook_focus", API_RETURN_EMPTY); if (objc < 4) API_WRONG_ARGS(API_RETURN_EMPTY); - area = Tcl_GetStringFromObj (objv[1], &i); - function = Tcl_GetStringFromObj (objv[2], &i); - data = Tcl_GetStringFromObj (objv[3], &i); + area = Tcl_GetString (objv[1]); + function = Tcl_GetString (objv[2]); + data = Tcl_GetString (objv[3]); result = API_PTR2STR(plugin_script_api_hook_focus (weechat_tcl_plugin, tcl_current_script, @@ -3843,15 +3779,14 @@ API_FUNC(hook_set) { Tcl_Obj *objp; char *hook, *property, *value; - int i; API_INIT_FUNC(1, "hook_set", API_RETURN_ERROR); if (objc < 4) API_WRONG_ARGS(API_RETURN_ERROR); - hook = Tcl_GetStringFromObj (objv[1], &i); - property = Tcl_GetStringFromObj (objv[2], &i); - value = Tcl_GetStringFromObj (objv[3], &i); + hook = Tcl_GetString (objv[1]); + property = Tcl_GetString (objv[2]); + value = Tcl_GetString (objv[3]); weechat_hook_set (API_STR2PTR(hook), property, value); @@ -3861,14 +3796,13 @@ API_FUNC(hook_set) API_FUNC(unhook) { Tcl_Obj *objp; - int i; API_INIT_FUNC(1, "unhook", API_RETURN_ERROR); if (objc < 2) API_WRONG_ARGS(API_RETURN_ERROR); weechat_unhook ( - API_STR2PTR(Tcl_GetStringFromObj (objv[1], &i))); /* hook */ + API_STR2PTR(Tcl_GetString (objv[1]))); /* hook */ API_RETURN_OK; } @@ -3968,17 +3902,16 @@ API_FUNC(buffer_new) Tcl_Obj *objp; char *name, *function_input, *data_input, *function_close, *data_close; const char *result; - int i; API_INIT_FUNC(1, "buffer_new", API_RETURN_EMPTY); if (objc < 6) API_WRONG_ARGS(API_RETURN_EMPTY); - name = Tcl_GetStringFromObj (objv[1], &i); - function_input = Tcl_GetStringFromObj (objv[2], &i); - data_input = Tcl_GetStringFromObj (objv[3], &i); - function_close = Tcl_GetStringFromObj (objv[4], &i); - data_close = Tcl_GetStringFromObj (objv[5], &i); + name = Tcl_GetString (objv[1]); + function_input = Tcl_GetString (objv[2]); + data_input = Tcl_GetString (objv[3]); + function_close = Tcl_GetString (objv[4]); + data_close = Tcl_GetString (objv[5]); result = API_PTR2STR(plugin_script_api_buffer_new (weechat_tcl_plugin, tcl_current_script, @@ -3999,21 +3932,20 @@ API_FUNC(buffer_new_props) char *name, *function_input, *data_input, *function_close, *data_close; struct t_hashtable *properties; const char *result; - int i; API_INIT_FUNC(1, "buffer_new_props", API_RETURN_EMPTY); if (objc < 7) API_WRONG_ARGS(API_RETURN_EMPTY); - name = Tcl_GetStringFromObj (objv[1], &i); + name = Tcl_GetString (objv[1]); properties = weechat_tcl_dict_to_hashtable (interp, objv[2], WEECHAT_SCRIPT_HASHTABLE_DEFAULT_SIZE, WEECHAT_HASHTABLE_STRING, WEECHAT_HASHTABLE_STRING); - function_input = Tcl_GetStringFromObj (objv[3], &i); - data_input = Tcl_GetStringFromObj (objv[4], &i); - function_close = Tcl_GetStringFromObj (objv[5], &i); - data_close = Tcl_GetStringFromObj (objv[6], &i); + function_input = Tcl_GetString (objv[3]); + data_input = Tcl_GetString (objv[4]); + function_close = Tcl_GetString (objv[5]); + data_close = Tcl_GetString (objv[6]); result = API_PTR2STR( plugin_script_api_buffer_new_props ( @@ -4039,14 +3971,13 @@ API_FUNC(buffer_search) Tcl_Obj *objp; char *plugin, *name; const char *result; - int i; API_INIT_FUNC(1, "buffer_search", API_RETURN_EMPTY); if (objc < 3) API_WRONG_ARGS(API_RETURN_EMPTY); - plugin = Tcl_GetStringFromObj (objv[1], &i); - name = Tcl_GetStringFromObj (objv[2], &i); + plugin = Tcl_GetString (objv[1]); + name = Tcl_GetString (objv[2]); result = API_PTR2STR(weechat_buffer_search (plugin, name)); @@ -4090,13 +4021,12 @@ API_FUNC(current_buffer) API_FUNC(buffer_clear) { Tcl_Obj *objp; - int i; API_INIT_FUNC(1, "buffer_clear", API_RETURN_ERROR); if (objc < 2) API_WRONG_ARGS(API_RETURN_ERROR); - weechat_buffer_clear (API_STR2PTR(Tcl_GetStringFromObj (objv[1], &i))); /* buffer */ + weechat_buffer_clear (API_STR2PTR(Tcl_GetString (objv[1]))); /* buffer */ API_RETURN_OK; } @@ -4104,14 +4034,13 @@ API_FUNC(buffer_clear) API_FUNC(buffer_close) { Tcl_Obj *objp; - int i; API_INIT_FUNC(1, "buffer_close", API_RETURN_ERROR); if (objc < 2) API_WRONG_ARGS(API_RETURN_ERROR); weechat_buffer_close ( - API_STR2PTR(Tcl_GetStringFromObj (objv[1], &i))); /* buffer */ + API_STR2PTR(Tcl_GetString (objv[1]))); /* buffer */ API_RETURN_OK; } @@ -4119,14 +4048,13 @@ API_FUNC(buffer_close) API_FUNC(buffer_merge) { Tcl_Obj *objp; - int i; API_INIT_FUNC(1, "buffer_merge", API_RETURN_ERROR); if (objc < 3) API_WRONG_ARGS(API_RETURN_ERROR); - weechat_buffer_merge (API_STR2PTR(Tcl_GetStringFromObj (objv[1], &i)), /* buffer */ - API_STR2PTR(Tcl_GetStringFromObj (objv[2], &i))); /* target_buffer */ + weechat_buffer_merge (API_STR2PTR(Tcl_GetString (objv[1])), /* buffer */ + API_STR2PTR(Tcl_GetString (objv[2]))); /* target_buffer */ API_RETURN_OK; } @@ -4134,7 +4062,7 @@ API_FUNC(buffer_merge) API_FUNC(buffer_unmerge) { Tcl_Obj *objp; - int i, number; + int number; API_INIT_FUNC(1, "buffer_unmerge", API_RETURN_ERROR); if (objc < 3) @@ -4143,7 +4071,7 @@ API_FUNC(buffer_unmerge) if (Tcl_GetIntFromObj (interp, objv[2], &number) != TCL_OK) API_WRONG_ARGS(API_RETURN_ERROR); - weechat_buffer_unmerge (API_STR2PTR(Tcl_GetStringFromObj (objv[1], &i)), + weechat_buffer_unmerge (API_STR2PTR(Tcl_GetString (objv[1])), number); API_RETURN_OK; @@ -4154,14 +4082,13 @@ API_FUNC(buffer_get_integer) Tcl_Obj *objp; char *buffer, *property; int result; - int i; API_INIT_FUNC(1, "buffer_get_integer", API_RETURN_INT(-1)); if (objc < 3) API_WRONG_ARGS(API_RETURN_INT(-1)); - buffer = Tcl_GetStringFromObj (objv[1], &i); - property = Tcl_GetStringFromObj (objv[2], &i); + buffer = Tcl_GetString (objv[1]); + property = Tcl_GetString (objv[2]); result = weechat_buffer_get_integer (API_STR2PTR(buffer), property); @@ -4173,14 +4100,13 @@ API_FUNC(buffer_get_string) Tcl_Obj *objp; char *buffer, *property; const char *result; - int i; API_INIT_FUNC(1, "buffer_get_string", API_RETURN_EMPTY); if (objc < 3) API_WRONG_ARGS(API_RETURN_EMPTY); - buffer = Tcl_GetStringFromObj (objv[1], &i); - property = Tcl_GetStringFromObj (objv[2], &i); + buffer = Tcl_GetString (objv[1]); + property = Tcl_GetString (objv[2]); result = weechat_buffer_get_string (API_STR2PTR(buffer), property); @@ -4192,14 +4118,13 @@ API_FUNC(buffer_get_pointer) Tcl_Obj *objp; char *buffer, *property; const char *result; - int i; API_INIT_FUNC(1, "buffer_get_pointer", API_RETURN_EMPTY); if (objc < 3) API_WRONG_ARGS(API_RETURN_EMPTY); - buffer = Tcl_GetStringFromObj (objv[1], &i); - property = Tcl_GetStringFromObj (objv[2], &i); + buffer = Tcl_GetString (objv[1]); + property = Tcl_GetString (objv[2]); result = API_PTR2STR(weechat_buffer_get_pointer (API_STR2PTR(buffer), property)); @@ -4211,15 +4136,14 @@ API_FUNC(buffer_set) { Tcl_Obj *objp; char *buffer, *property, *value; - int i; API_INIT_FUNC(1, "buffer_set", API_RETURN_ERROR); if (objc < 4) API_WRONG_ARGS(API_RETURN_ERROR); - buffer = Tcl_GetStringFromObj (objv[1], &i); - property = Tcl_GetStringFromObj (objv[2], &i); - value = Tcl_GetStringFromObj (objv[3], &i); + buffer = Tcl_GetString (objv[1]); + property = Tcl_GetString (objv[2]); + value = Tcl_GetString (objv[3]); weechat_buffer_set (API_STR2PTR(buffer), property, value); @@ -4230,14 +4154,13 @@ API_FUNC(buffer_string_replace_local_var) { Tcl_Obj *objp; char *buffer, *string, *result; - int i; API_INIT_FUNC(1, "buffer_string_replace_local_var", API_RETURN_EMPTY); if (objc < 3) API_WRONG_ARGS(API_RETURN_EMPTY); - buffer = Tcl_GetStringFromObj (objv[1], &i); - string = Tcl_GetStringFromObj (objv[2], &i); + buffer = Tcl_GetString (objv[1]); + string = Tcl_GetString (objv[2]); result = weechat_buffer_string_replace_local_var (API_STR2PTR(buffer), string); @@ -4249,14 +4172,13 @@ API_FUNC(buffer_match_list) Tcl_Obj *objp; char *buffer, *string; int result; - int i; API_INIT_FUNC(1, "buffer_match_list", API_RETURN_INT(0)); if (objc < 3) API_WRONG_ARGS(API_RETURN_INT(0)); - buffer = Tcl_GetStringFromObj (objv[1], &i); - string = Tcl_GetStringFromObj (objv[2], &i); + buffer = Tcl_GetString (objv[1]); + string = Tcl_GetString (objv[2]); result = weechat_buffer_match_list (API_STR2PTR(buffer), string); @@ -4285,13 +4207,12 @@ API_FUNC(window_search_with_buffer) Tcl_Obj *objp; char *buffer; const char *result; - int i; API_INIT_FUNC(1, "window_search_with_buffer", API_RETURN_EMPTY); if (objc < 2) API_WRONG_ARGS(API_RETURN_EMPTY); - buffer = Tcl_GetStringFromObj (objv[1], &i); + buffer = Tcl_GetString (objv[1]); result = API_PTR2STR(weechat_window_search_with_buffer (API_STR2PTR(buffer))); @@ -4303,14 +4224,13 @@ API_FUNC(window_get_integer) Tcl_Obj *objp; char *window, *property; int result; - int i; API_INIT_FUNC(1, "window_get_integer", API_RETURN_INT(-1)); if (objc < 3) API_WRONG_ARGS(API_RETURN_INT(-1)); - window = Tcl_GetStringFromObj (objv[1], &i); - property = Tcl_GetStringFromObj (objv[2], &i); + window = Tcl_GetString (objv[1]); + property = Tcl_GetString (objv[2]); result = weechat_window_get_integer (API_STR2PTR(window), property); @@ -4322,14 +4242,13 @@ API_FUNC(window_get_string) Tcl_Obj *objp; char *window, *property; const char *result; - int i; API_INIT_FUNC(1, "window_get_string", API_RETURN_EMPTY); if (objc < 3) API_WRONG_ARGS(API_RETURN_EMPTY); - window = Tcl_GetStringFromObj (objv[1], &i); - property = Tcl_GetStringFromObj (objv[2], &i); + window = Tcl_GetString (objv[1]); + property = Tcl_GetString (objv[2]); result = weechat_window_get_string (API_STR2PTR(window), property); @@ -4341,14 +4260,13 @@ API_FUNC(window_get_pointer) Tcl_Obj *objp; char *window, *property; const char *result; - int i; API_INIT_FUNC(1, "window_get_pointer", API_RETURN_EMPTY); if (objc < 3) API_WRONG_ARGS(API_RETURN_EMPTY); - window = Tcl_GetStringFromObj (objv[1], &i); - property = Tcl_GetStringFromObj (objv[2], &i); + window = Tcl_GetString (objv[1]); + property = Tcl_GetString (objv[2]); result = API_PTR2STR(weechat_window_get_pointer (API_STR2PTR(window), property)); @@ -4360,13 +4278,12 @@ API_FUNC(window_set_title) { Tcl_Obj *objp; char *title; - int i; API_INIT_FUNC(1, "window_set_title", API_RETURN_ERROR); if (objc < 2) API_WRONG_ARGS(API_RETURN_ERROR); - title = Tcl_GetStringFromObj (objv[1], &i); + title = Tcl_GetString (objv[1]); weechat_window_set_title (title); @@ -4378,7 +4295,7 @@ API_FUNC(nicklist_add_group) Tcl_Obj *objp; char *buffer, *parent_group, *name, *color; const char *result; - int i, visible; + int visible; API_INIT_FUNC(1, "nicklist_add_group", API_RETURN_EMPTY); if (objc < 6) @@ -4387,10 +4304,10 @@ API_FUNC(nicklist_add_group) if (Tcl_GetIntFromObj (interp, objv[5], &visible) != TCL_OK) API_WRONG_ARGS(API_RETURN_EMPTY); - buffer = Tcl_GetStringFromObj (objv[1], &i); - parent_group = Tcl_GetStringFromObj (objv[2], &i); - name = Tcl_GetStringFromObj (objv[3], &i); - color = Tcl_GetStringFromObj (objv[4], &i); + buffer = Tcl_GetString (objv[1]); + parent_group = Tcl_GetString (objv[2]); + name = Tcl_GetString (objv[3]); + color = Tcl_GetString (objv[4]); result = API_PTR2STR(weechat_nicklist_add_group (API_STR2PTR(buffer), API_STR2PTR(parent_group), @@ -4406,15 +4323,14 @@ API_FUNC(nicklist_search_group) Tcl_Obj *objp; char *buffer, *from_group, *name; const char *result; - int i; API_INIT_FUNC(1, "nicklist_search_group", API_RETURN_EMPTY); if (objc < 4) API_WRONG_ARGS(API_RETURN_EMPTY); - buffer = Tcl_GetStringFromObj (objv[1], &i); - from_group = Tcl_GetStringFromObj (objv[2], &i); - name = Tcl_GetStringFromObj (objv[3], &i); + buffer = Tcl_GetString (objv[1]); + from_group = Tcl_GetString (objv[2]); + name = Tcl_GetString (objv[3]); result = API_PTR2STR(weechat_nicklist_search_group (API_STR2PTR(buffer), API_STR2PTR(from_group), @@ -4428,7 +4344,7 @@ API_FUNC(nicklist_add_nick) Tcl_Obj *objp; char *buffer, *group, *name, *color, *prefix, *prefix_color; const char *result; - int i, visible; + int visible; API_INIT_FUNC(1, "nicklist_add_nick", API_RETURN_EMPTY); if (objc < 8) @@ -4437,12 +4353,12 @@ API_FUNC(nicklist_add_nick) if (Tcl_GetIntFromObj (interp, objv[7], &visible) != TCL_OK) API_WRONG_ARGS(API_RETURN_EMPTY); - buffer = Tcl_GetStringFromObj (objv[1], &i); - group = Tcl_GetStringFromObj (objv[2], &i); - name = Tcl_GetStringFromObj (objv[3], &i); - color = Tcl_GetStringFromObj (objv[4], &i); - prefix = Tcl_GetStringFromObj (objv[5], &i); - prefix_color = Tcl_GetStringFromObj (objv[6], &i); + buffer = Tcl_GetString (objv[1]); + group = Tcl_GetString (objv[2]); + name = Tcl_GetString (objv[3]); + color = Tcl_GetString (objv[4]); + prefix = Tcl_GetString (objv[5]); + prefix_color = Tcl_GetString (objv[6]); result = API_PTR2STR(weechat_nicklist_add_nick (API_STR2PTR(buffer), API_STR2PTR(group), @@ -4460,15 +4376,14 @@ API_FUNC(nicklist_search_nick) Tcl_Obj *objp; char *buffer, *from_group, *name; const char *result; - int i; API_INIT_FUNC(1, "nicklist_search_nick", API_RETURN_EMPTY); if (objc < 4) API_WRONG_ARGS(API_RETURN_EMPTY); - buffer = Tcl_GetStringFromObj (objv[1], &i); - from_group = Tcl_GetStringFromObj (objv[2], &i); - name = Tcl_GetStringFromObj (objv[3], &i); + buffer = Tcl_GetString (objv[1]); + from_group = Tcl_GetString (objv[2]); + name = Tcl_GetString (objv[3]); result = API_PTR2STR(weechat_nicklist_search_nick (API_STR2PTR(buffer), API_STR2PTR(from_group), @@ -4481,14 +4396,13 @@ API_FUNC(nicklist_remove_group) { Tcl_Obj *objp; char *buffer, *group; - int i; API_INIT_FUNC(1, "nicklist_remove_group", API_RETURN_ERROR); if (objc < 3) API_WRONG_ARGS(API_RETURN_ERROR); - buffer = Tcl_GetStringFromObj (objv[1], &i); - group = Tcl_GetStringFromObj (objv[2], &i); + buffer = Tcl_GetString (objv[1]); + group = Tcl_GetString (objv[2]); weechat_nicklist_remove_group (API_STR2PTR(buffer), API_STR2PTR(group)); @@ -4500,14 +4414,13 @@ API_FUNC(nicklist_remove_nick) { Tcl_Obj *objp; char *buffer, *nick; - int i; API_INIT_FUNC(1, "nicklist_remove_nick", API_RETURN_ERROR); if (objc < 3) API_WRONG_ARGS(API_RETURN_ERROR); - buffer = Tcl_GetStringFromObj (objv[1], &i); - nick = Tcl_GetStringFromObj (objv[2], &i); + buffer = Tcl_GetString (objv[1]); + nick = Tcl_GetString (objv[2]); weechat_nicklist_remove_nick (API_STR2PTR(buffer), API_STR2PTR(nick)); @@ -4518,13 +4431,12 @@ API_FUNC(nicklist_remove_nick) API_FUNC(nicklist_remove_all) { Tcl_Obj *objp; - int i; API_INIT_FUNC(1, "nicklist_remove_all", API_RETURN_ERROR); if (objc < 2) API_WRONG_ARGS(API_RETURN_ERROR); - weechat_nicklist_remove_all (API_STR2PTR(Tcl_GetStringFromObj (objv[1], &i))); /* buffer */ + weechat_nicklist_remove_all (API_STR2PTR(Tcl_GetString (objv[1]))); /* buffer */ API_RETURN_OK; } @@ -4534,15 +4446,14 @@ API_FUNC(nicklist_group_get_integer) Tcl_Obj *objp; char *buffer, *group, *property; int result; - int i; API_INIT_FUNC(1, "nicklist_group_get_integer", API_RETURN_INT(-1)); if (objc < 4) API_WRONG_ARGS(API_RETURN_INT(-1)); - buffer = Tcl_GetStringFromObj (objv[1], &i); - group = Tcl_GetStringFromObj (objv[2], &i); - property = Tcl_GetStringFromObj (objv[3], &i); + buffer = Tcl_GetString (objv[1]); + group = Tcl_GetString (objv[2]); + property = Tcl_GetString (objv[3]); result = weechat_nicklist_group_get_integer (API_STR2PTR(buffer), API_STR2PTR(group), @@ -4556,15 +4467,14 @@ API_FUNC(nicklist_group_get_string) Tcl_Obj *objp; char *buffer, *group, *property; const char *result; - int i; API_INIT_FUNC(1, "nicklist_group_get_string", API_RETURN_EMPTY); if (objc < 4) API_WRONG_ARGS(API_RETURN_EMPTY); - buffer = Tcl_GetStringFromObj (objv[1], &i); - group = Tcl_GetStringFromObj (objv[2], &i); - property = Tcl_GetStringFromObj (objv[3], &i); + buffer = Tcl_GetString (objv[1]); + group = Tcl_GetString (objv[2]); + property = Tcl_GetString (objv[3]); result = weechat_nicklist_group_get_string (API_STR2PTR(buffer), API_STR2PTR(group), @@ -4578,15 +4488,14 @@ API_FUNC(nicklist_group_get_pointer) Tcl_Obj *objp; char *buffer, *group, *property; const char *result; - int i; API_INIT_FUNC(1, "nicklist_group_get_pointer", API_RETURN_EMPTY); if (objc < 4) API_WRONG_ARGS(API_RETURN_EMPTY); - buffer = Tcl_GetStringFromObj (objv[1], &i); - group = Tcl_GetStringFromObj (objv[2], &i); - property = Tcl_GetStringFromObj (objv[3], &i); + buffer = Tcl_GetString (objv[1]); + group = Tcl_GetString (objv[2]); + property = Tcl_GetString (objv[3]); result = API_PTR2STR(weechat_nicklist_group_get_pointer (API_STR2PTR(buffer), API_STR2PTR(group), @@ -4599,16 +4508,15 @@ API_FUNC(nicklist_group_set) { Tcl_Obj *objp; char *buffer, *group, *property, *value; - int i; API_INIT_FUNC(1, "nicklist_group_set", API_RETURN_ERROR); if (objc < 5) API_WRONG_ARGS(API_RETURN_ERROR); - buffer = Tcl_GetStringFromObj (objv[1], &i); - group = Tcl_GetStringFromObj (objv[2], &i); - property = Tcl_GetStringFromObj (objv[3], &i); - value = Tcl_GetStringFromObj (objv[4], &i); + buffer = Tcl_GetString (objv[1]); + group = Tcl_GetString (objv[2]); + property = Tcl_GetString (objv[3]); + value = Tcl_GetString (objv[4]); weechat_nicklist_group_set (API_STR2PTR(buffer), API_STR2PTR(group), @@ -4623,15 +4531,14 @@ API_FUNC(nicklist_nick_get_integer) Tcl_Obj *objp; char *buffer, *nick, *property; int result; - int i; API_INIT_FUNC(1, "nicklist_nick_get_integer", API_RETURN_INT(-1)); if (objc < 4) API_WRONG_ARGS(API_RETURN_INT(-1)); - buffer = Tcl_GetStringFromObj (objv[1], &i); - nick = Tcl_GetStringFromObj (objv[2], &i); - property = Tcl_GetStringFromObj (objv[3], &i); + buffer = Tcl_GetString (objv[1]); + nick = Tcl_GetString (objv[2]); + property = Tcl_GetString (objv[3]); result = weechat_nicklist_nick_get_integer (API_STR2PTR(buffer), API_STR2PTR(nick), @@ -4645,15 +4552,14 @@ API_FUNC(nicklist_nick_get_string) Tcl_Obj *objp; char *buffer, *nick, *property; const char *result; - int i; API_INIT_FUNC(1, "nicklist_nick_get_string", API_RETURN_EMPTY); if (objc < 4) API_WRONG_ARGS(API_RETURN_EMPTY); - buffer = Tcl_GetStringFromObj (objv[1], &i); - nick = Tcl_GetStringFromObj (objv[2], &i); - property = Tcl_GetStringFromObj (objv[3], &i); + buffer = Tcl_GetString (objv[1]); + nick = Tcl_GetString (objv[2]); + property = Tcl_GetString (objv[3]); result = weechat_nicklist_nick_get_string (API_STR2PTR(buffer), API_STR2PTR(nick), @@ -4667,15 +4573,14 @@ API_FUNC(nicklist_nick_get_pointer) Tcl_Obj *objp; char *buffer, *nick, *property; const char *result; - int i; API_INIT_FUNC(1, "nicklist_nick_get_pointer", API_RETURN_EMPTY); if (objc < 4) API_WRONG_ARGS(API_RETURN_EMPTY); - buffer = Tcl_GetStringFromObj (objv[1], &i); - nick = Tcl_GetStringFromObj (objv[2], &i); - property = Tcl_GetStringFromObj (objv[3], &i); + buffer = Tcl_GetString (objv[1]); + nick = Tcl_GetString (objv[2]); + property = Tcl_GetString (objv[3]); result = API_PTR2STR(weechat_nicklist_nick_get_pointer (API_STR2PTR(buffer), API_STR2PTR(nick), @@ -4688,16 +4593,15 @@ API_FUNC(nicklist_nick_set) { Tcl_Obj *objp; char *buffer, *nick, *property, *value; - int i; API_INIT_FUNC(1, "nicklist_nick_set", API_RETURN_ERROR); if (objc < 5) API_WRONG_ARGS(API_RETURN_ERROR); - buffer = Tcl_GetStringFromObj (objv[1], &i); - nick = Tcl_GetStringFromObj (objv[2], &i); - property = Tcl_GetStringFromObj (objv[3], &i); - value = Tcl_GetStringFromObj (objv[4], &i); + buffer = Tcl_GetString (objv[1]); + nick = Tcl_GetString (objv[2]); + property = Tcl_GetString (objv[3]); + value = Tcl_GetString (objv[4]); weechat_nicklist_nick_set (API_STR2PTR(buffer), API_STR2PTR(nick), @@ -4711,13 +4615,12 @@ API_FUNC(bar_item_search) { Tcl_Obj *objp; const char *result; - int i; API_INIT_FUNC(1, "bar_item_search", API_RETURN_EMPTY); if (objc < 2) API_WRONG_ARGS(API_RETURN_EMPTY); - result = API_PTR2STR(weechat_bar_item_search (Tcl_GetStringFromObj (objv[1], &i))); /* name */ + result = API_PTR2STR(weechat_bar_item_search (Tcl_GetString (objv[1]))); /* name */ API_RETURN_STRING(result); } @@ -4777,15 +4680,14 @@ API_FUNC(bar_item_new) Tcl_Obj *objp; char *name, *function, *data; const char *result; - int i; API_INIT_FUNC(1, "bar_item_new", API_RETURN_EMPTY); if (objc < 4) API_WRONG_ARGS(API_RETURN_EMPTY); - name = Tcl_GetStringFromObj (objv[1], &i); - function = Tcl_GetStringFromObj (objv[2], &i); - data = Tcl_GetStringFromObj (objv[3], &i); + name = Tcl_GetString (objv[1]); + function = Tcl_GetString (objv[2]); + data = Tcl_GetString (objv[3]); result = API_PTR2STR(plugin_script_api_bar_item_new (weechat_tcl_plugin, tcl_current_script, @@ -4800,13 +4702,12 @@ API_FUNC(bar_item_new) API_FUNC(bar_item_update) { Tcl_Obj *objp; - int i; API_INIT_FUNC(1, "bar_item_update", API_RETURN_ERROR); if (objc < 2) API_WRONG_ARGS(API_RETURN_ERROR); - weechat_bar_item_update (Tcl_GetStringFromObj (objv[1], &i)); /* name */ + weechat_bar_item_update (Tcl_GetString (objv[1])); /* name */ API_RETURN_OK; } @@ -4814,14 +4715,13 @@ API_FUNC(bar_item_update) API_FUNC(bar_item_remove) { Tcl_Obj *objp; - int i; API_INIT_FUNC(1, "bar_item_remove", API_RETURN_ERROR); if (objc < 2) API_WRONG_ARGS(API_RETURN_ERROR); weechat_bar_item_remove ( - API_STR2PTR(Tcl_GetStringFromObj (objv[1], &i))); /* item */ + API_STR2PTR(Tcl_GetString (objv[1]))); /* item */ API_RETURN_OK; } @@ -4830,13 +4730,12 @@ API_FUNC(bar_search) { Tcl_Obj *objp; const char *result; - int i; API_INIT_FUNC(1, "bar_search", API_RETURN_EMPTY); if (objc < 2) API_WRONG_ARGS(API_RETURN_EMPTY); - result = API_PTR2STR(weechat_bar_search (Tcl_GetStringFromObj (objv[1], &i))); /* name */ + result = API_PTR2STR(weechat_bar_search (Tcl_GetString (objv[1]))); /* name */ API_RETURN_STRING(result); } @@ -4848,28 +4747,27 @@ API_FUNC(bar_new) char *filling_top_bottom, *filling_left_right, *size, *size_max, *color_fg; char *color_delim, *color_bg, *color_bg_inactive, *separator, *bar_items; const char *result; - int i; API_INIT_FUNC(1, "bar_new", API_RETURN_EMPTY); if (objc < 17) API_WRONG_ARGS(API_RETURN_EMPTY); - name = Tcl_GetStringFromObj (objv[1], &i); - hidden = Tcl_GetStringFromObj (objv[2], &i); - priority = Tcl_GetStringFromObj (objv[3], &i); - type = Tcl_GetStringFromObj (objv[4], &i); - conditions = Tcl_GetStringFromObj (objv[5], &i); - position = Tcl_GetStringFromObj (objv[6], &i); - filling_top_bottom = Tcl_GetStringFromObj (objv[7], &i); - filling_left_right = Tcl_GetStringFromObj (objv[8], &i); - size = Tcl_GetStringFromObj (objv[9], &i); - size_max = Tcl_GetStringFromObj (objv[10], &i); - color_fg = Tcl_GetStringFromObj (objv[11], &i); - color_delim = Tcl_GetStringFromObj (objv[12], &i); - color_bg = Tcl_GetStringFromObj (objv[13], &i); - color_bg_inactive = Tcl_GetStringFromObj (objv[14], &i); - separator = Tcl_GetStringFromObj (objv[15], &i); - bar_items = Tcl_GetStringFromObj (objv[16], &i); + name = Tcl_GetString (objv[1]); + hidden = Tcl_GetString (objv[2]); + priority = Tcl_GetString (objv[3]); + type = Tcl_GetString (objv[4]); + conditions = Tcl_GetString (objv[5]); + position = Tcl_GetString (objv[6]); + filling_top_bottom = Tcl_GetString (objv[7]); + filling_left_right = Tcl_GetString (objv[8]); + size = Tcl_GetString (objv[9]); + size_max = Tcl_GetString (objv[10]); + color_fg = Tcl_GetString (objv[11]); + color_delim = Tcl_GetString (objv[12]); + color_bg = Tcl_GetString (objv[13]); + color_bg_inactive = Tcl_GetString (objv[14]); + separator = Tcl_GetString (objv[15]); + bar_items = Tcl_GetString (objv[16]); result = API_PTR2STR(weechat_bar_new (name, hidden, @@ -4895,15 +4793,15 @@ API_FUNC(bar_set) { Tcl_Obj *objp; char *bar, *property, *value; - int i, rc; + int rc; API_INIT_FUNC(1, "bar_set", API_RETURN_INT(0)); if (objc < 4) API_WRONG_ARGS(API_RETURN_INT(0)); - bar = Tcl_GetStringFromObj (objv[1], &i); - property = Tcl_GetStringFromObj (objv[2], &i); - value = Tcl_GetStringFromObj (objv[3], &i); + bar = Tcl_GetString (objv[1]); + property = Tcl_GetString (objv[2]); + value = Tcl_GetString (objv[3]); rc = weechat_bar_set (API_STR2PTR(bar), property, value); @@ -4913,13 +4811,12 @@ API_FUNC(bar_set) API_FUNC(bar_update) { Tcl_Obj *objp; - int i; API_INIT_FUNC(1, "bar_update", API_RETURN_ERROR); if (objc < 2) API_WRONG_ARGS(API_RETURN_ERROR); - weechat_bar_update (Tcl_GetStringFromObj (objv[1], &i)); /* name */ + weechat_bar_update (Tcl_GetString (objv[1])); /* name */ API_RETURN_OK; } @@ -4927,13 +4824,12 @@ API_FUNC(bar_update) API_FUNC(bar_remove) { Tcl_Obj *objp; - int i; API_INIT_FUNC(1, "bar_remove", API_RETURN_ERROR); if (objc < 2) API_WRONG_ARGS(API_RETURN_ERROR); - weechat_bar_remove (API_STR2PTR(Tcl_GetStringFromObj (objv[1], &i))); /* bar */ + weechat_bar_remove (API_STR2PTR(Tcl_GetString (objv[1]))); /* bar */ API_RETURN_OK; } @@ -4942,14 +4838,14 @@ API_FUNC(command) { Tcl_Obj *objp; char *buffer, *command; - int i, rc; + int rc; API_INIT_FUNC(1, "command", API_RETURN_INT(WEECHAT_RC_ERROR)); if (objc < 3) API_WRONG_ARGS(API_RETURN_INT(WEECHAT_RC_ERROR)); - buffer = Tcl_GetStringFromObj (objv[1], &i); - command = Tcl_GetStringFromObj (objv[2], &i); + buffer = Tcl_GetString (objv[1]); + command = Tcl_GetString (objv[2]); rc = plugin_script_api_command (weechat_tcl_plugin, tcl_current_script, @@ -4964,14 +4860,14 @@ API_FUNC(command_options) Tcl_Obj *objp; char *buffer, *command; struct t_hashtable *options; - int i, rc; + int rc; API_INIT_FUNC(1, "command_options", API_RETURN_INT(WEECHAT_RC_ERROR)); if (objc < 4) API_WRONG_ARGS(API_RETURN_INT(WEECHAT_RC_ERROR)); - buffer = Tcl_GetStringFromObj (objv[1], &i); - command = Tcl_GetStringFromObj (objv[2], &i); + buffer = Tcl_GetString (objv[1]); + command = Tcl_GetString (objv[2]); options = weechat_tcl_dict_to_hashtable (interp, objv[3], WEECHAT_SCRIPT_HASHTABLE_DEFAULT_SIZE, WEECHAT_HASHTABLE_STRING, @@ -4994,13 +4890,12 @@ API_FUNC(completion_new) Tcl_Obj *objp; char *buffer; const char *result; - int i; API_INIT_FUNC(1, "completion_new", API_RETURN_EMPTY); if (objc < 2) API_WRONG_ARGS(API_RETURN_EMPTY); - buffer = Tcl_GetStringFromObj (objv[1], &i); + buffer = Tcl_GetString (objv[1]); result = API_PTR2STR(weechat_completion_new (API_STR2PTR(buffer))); @@ -5011,14 +4906,14 @@ API_FUNC(completion_search) { Tcl_Obj *objp; char *completion, *data; - int i, position, direction, rc; + int position, direction, rc; API_INIT_FUNC(1, "completion_search", API_RETURN_INT(0)); if (objc < 5) API_WRONG_ARGS(API_RETURN_INT(0)); - completion = Tcl_GetStringFromObj (objv[1], &i); - data = Tcl_GetStringFromObj (objv[2], &i); + completion = Tcl_GetString (objv[1]); + data = Tcl_GetString (objv[2]); if ((Tcl_GetIntFromObj (interp, objv[3], &position) != TCL_OK) || (Tcl_GetIntFromObj (interp, objv[4], &direction) != TCL_OK)) @@ -5035,14 +4930,13 @@ API_FUNC(completion_get_string) Tcl_Obj *objp; char *completion, *property; const char *result; - int i; API_INIT_FUNC(1, "completion_get_string", API_RETURN_EMPTY); if (objc < 3) API_WRONG_ARGS(API_RETURN_EMPTY); - completion = Tcl_GetStringFromObj (objv[1], &i); - property = Tcl_GetStringFromObj (objv[2], &i); + completion = Tcl_GetString (objv[1]); + property = Tcl_GetString (objv[2]); result = weechat_completion_get_string (API_STR2PTR(completion), property); @@ -5054,7 +4948,7 @@ API_FUNC(completion_list_add) { Tcl_Obj *objp; char *completion, *word, *where; - int i, nick_completion; + int nick_completion; API_INIT_FUNC(1, "completion_list_add", API_RETURN_ERROR); if (objc < 5) @@ -5063,9 +4957,9 @@ API_FUNC(completion_list_add) if (Tcl_GetIntFromObj (interp, objv[3], &nick_completion) != TCL_OK) API_WRONG_ARGS(API_RETURN_ERROR); - completion = Tcl_GetStringFromObj (objv[1], &i); - word = Tcl_GetStringFromObj (objv[2], &i); - where = Tcl_GetStringFromObj (objv[4], &i); + completion = Tcl_GetString (objv[1]); + word = Tcl_GetString (objv[2]); + where = Tcl_GetString (objv[4]); weechat_completion_list_add (API_STR2PTR(completion), word, @@ -5079,14 +4973,13 @@ API_FUNC(info_get) { Tcl_Obj *objp; char *result; - int i; API_INIT_FUNC(1, "info_get", API_RETURN_EMPTY); if (objc < 3) API_WRONG_ARGS(API_RETURN_EMPTY); - result = weechat_info_get (Tcl_GetStringFromObj (objv[1], &i), - Tcl_GetStringFromObj (objv[2], &i)); + result = weechat_info_get (Tcl_GetString (objv[1]), + Tcl_GetString (objv[2])); API_RETURN_STRING_FREE(result); } @@ -5095,7 +4988,6 @@ API_FUNC(info_get_hashtable) { Tcl_Obj *objp, *result_dict; struct t_hashtable *hashtable, *result_hashtable; - int i; API_INIT_FUNC(1, "info_get_hashtable", API_RETURN_EMPTY); if (objc < 3) @@ -5106,7 +4998,7 @@ API_FUNC(info_get_hashtable) WEECHAT_HASHTABLE_STRING, WEECHAT_HASHTABLE_STRING); - result_hashtable = weechat_info_get_hashtable (Tcl_GetStringFromObj (objv[1], &i), + result_hashtable = weechat_info_get_hashtable (Tcl_GetString (objv[1]), hashtable); result_dict = weechat_tcl_hashtable_to_dict (interp, result_hashtable); @@ -5139,13 +5031,12 @@ API_FUNC(infolist_new_item) { Tcl_Obj *objp; const char *result; - int i; API_INIT_FUNC(1, "infolist_new_item", API_RETURN_EMPTY); if (objc < 2) API_WRONG_ARGS(API_RETURN_EMPTY); - result = API_PTR2STR(weechat_infolist_new_item (API_STR2PTR(Tcl_GetStringFromObj (objv[1], &i)))); /* infolist */ + result = API_PTR2STR(weechat_infolist_new_item (API_STR2PTR(Tcl_GetString (objv[1])))); /* infolist */ API_RETURN_STRING(result); } @@ -5154,7 +5045,7 @@ API_FUNC(infolist_new_var_integer) { Tcl_Obj *objp; const char *result; - int i, value; + int value; API_INIT_FUNC(1, "infolist_new_var_integer", API_RETURN_EMPTY); if (objc < 4) @@ -5163,8 +5054,8 @@ API_FUNC(infolist_new_var_integer) if (Tcl_GetIntFromObj (interp, objv[3], &value) != TCL_OK) API_WRONG_ARGS(API_RETURN_EMPTY); - result = API_PTR2STR(weechat_infolist_new_var_integer (API_STR2PTR(Tcl_GetStringFromObj (objv[1], &i)), /* item */ - Tcl_GetStringFromObj (objv[2], &i), /* name */ + result = API_PTR2STR(weechat_infolist_new_var_integer (API_STR2PTR(Tcl_GetString (objv[1])), /* item */ + Tcl_GetString (objv[2]), /* name */ value)); API_RETURN_STRING(result); @@ -5174,15 +5065,14 @@ API_FUNC(infolist_new_var_string) { Tcl_Obj *objp; const char *result; - int i; API_INIT_FUNC(1, "infolist_new_var_string", API_RETURN_EMPTY); if (objc < 4) API_WRONG_ARGS(API_RETURN_EMPTY); - result = API_PTR2STR(weechat_infolist_new_var_string (API_STR2PTR(Tcl_GetStringFromObj (objv[1], &i)), /* item */ - Tcl_GetStringFromObj (objv[2], &i), /* name */ - Tcl_GetStringFromObj (objv[3], &i))); /* value */ + result = API_PTR2STR(weechat_infolist_new_var_string (API_STR2PTR(Tcl_GetString (objv[1])), /* item */ + Tcl_GetString (objv[2]), /* name */ + Tcl_GetString (objv[3]))); /* value */ API_RETURN_STRING(result); } @@ -5191,15 +5081,14 @@ API_FUNC(infolist_new_var_pointer) { Tcl_Obj *objp; const char *result; - int i; API_INIT_FUNC(1, "infolist_new_var_pointer", API_RETURN_EMPTY); if (objc < 4) API_WRONG_ARGS(API_RETURN_EMPTY); - result = API_PTR2STR(weechat_infolist_new_var_pointer (API_STR2PTR(Tcl_GetStringFromObj (objv[1], &i)), /* item */ - Tcl_GetStringFromObj (objv[2], &i), /* name */ - API_STR2PTR(Tcl_GetStringFromObj (objv[3], &i)))); /* value */ + result = API_PTR2STR(weechat_infolist_new_var_pointer (API_STR2PTR(Tcl_GetString (objv[1])), /* item */ + Tcl_GetString (objv[2]), /* name */ + API_STR2PTR(Tcl_GetString (objv[3])))); /* value */ API_RETURN_STRING(result); } @@ -5208,7 +5097,6 @@ API_FUNC(infolist_new_var_time) { Tcl_Obj *objp; const char *result; - int i; long value; API_INIT_FUNC(1, "infolist_new_var_time", API_RETURN_EMPTY); @@ -5218,8 +5106,8 @@ API_FUNC(infolist_new_var_time) if (Tcl_GetLongFromObj (interp, objv[3], &value) != TCL_OK) API_WRONG_ARGS(API_RETURN_EMPTY); - result = API_PTR2STR(weechat_infolist_new_var_time (API_STR2PTR(Tcl_GetStringFromObj (objv[1], &i)), /* item */ - Tcl_GetStringFromObj (objv[2], &i), /* name */ + result = API_PTR2STR(weechat_infolist_new_var_time (API_STR2PTR(Tcl_GetString (objv[1])), /* item */ + Tcl_GetString (objv[2]), /* name */ (time_t)value)); API_RETURN_STRING(result); @@ -5229,14 +5117,13 @@ API_FUNC(infolist_search_var) { Tcl_Obj *objp; const char *result; - int i; API_INIT_FUNC(1, "infolist_search_var", API_RETURN_EMPTY); if (objc < 3) API_WRONG_ARGS(API_RETURN_EMPTY); - result = API_PTR2STR(weechat_infolist_search_var (API_STR2PTR(Tcl_GetStringFromObj (objv[1], &i)), /* infolist */ - Tcl_GetStringFromObj (objv[2], &i))); /* name */ + result = API_PTR2STR(weechat_infolist_search_var (API_STR2PTR(Tcl_GetString (objv[1])), /* infolist */ + Tcl_GetString (objv[2]))); /* name */ API_RETURN_STRING(result); } @@ -5246,15 +5133,14 @@ API_FUNC(infolist_get) Tcl_Obj *objp; char *name, *pointer, *arguments; const char *result; - int i; API_INIT_FUNC(1, "infolist_get", API_RETURN_EMPTY); if (objc < 4) API_WRONG_ARGS(API_RETURN_EMPTY); - name = Tcl_GetStringFromObj (objv[1], &i); - pointer = Tcl_GetStringFromObj (objv[2], &i); - arguments = Tcl_GetStringFromObj (objv[3], &i); + name = Tcl_GetString (objv[1]); + pointer = Tcl_GetString (objv[2]); + arguments = Tcl_GetString (objv[3]); result = API_PTR2STR(weechat_infolist_get (name, API_STR2PTR(pointer), @@ -5266,13 +5152,13 @@ API_FUNC(infolist_get) API_FUNC(infolist_next) { Tcl_Obj *objp; - int result, i; + int result; API_INIT_FUNC(1, "infolist_next", API_RETURN_INT(0)); if (objc < 2) API_WRONG_ARGS(API_RETURN_INT(0)); - result = weechat_infolist_next (API_STR2PTR(Tcl_GetStringFromObj (objv[1], &i))); /* infolist */ + result = weechat_infolist_next (API_STR2PTR(Tcl_GetString (objv[1]))); /* infolist */ API_RETURN_INT(result); } @@ -5280,13 +5166,13 @@ API_FUNC(infolist_next) API_FUNC(infolist_prev) { Tcl_Obj *objp; - int result, i; + int result; API_INIT_FUNC(1, "infolist_prev", API_RETURN_INT(0)); if (objc < 2) API_WRONG_ARGS(API_RETURN_INT(0)); - result = weechat_infolist_prev (API_STR2PTR(Tcl_GetStringFromObj (objv[1], &i))); /* infolist */ + result = weechat_infolist_prev (API_STR2PTR(Tcl_GetString (objv[1]))); /* infolist */ API_RETURN_INT(result); } @@ -5294,13 +5180,12 @@ API_FUNC(infolist_prev) API_FUNC(infolist_reset_item_cursor) { Tcl_Obj *objp; - int i; API_INIT_FUNC(1, "infolist_reset_item_cursor", API_RETURN_ERROR); if (objc < 2) API_WRONG_ARGS(API_RETURN_ERROR); - weechat_infolist_reset_item_cursor (API_STR2PTR(Tcl_GetStringFromObj (objv[1], &i))); /* infolist */ + weechat_infolist_reset_item_cursor (API_STR2PTR(Tcl_GetString (objv[1]))); /* infolist */ API_RETURN_OK; } @@ -5309,13 +5194,12 @@ API_FUNC(infolist_fields) { Tcl_Obj *objp; const char *result; - int i; API_INIT_FUNC(1, "infolist_fields", API_RETURN_EMPTY); if (objc < 2) API_WRONG_ARGS(API_RETURN_EMPTY); - result = weechat_infolist_fields (API_STR2PTR(Tcl_GetStringFromObj (objv[1], &i))); /* infolist */ + result = weechat_infolist_fields (API_STR2PTR(Tcl_GetString (objv[1]))); /* infolist */ API_RETURN_STRING(result); } @@ -5324,14 +5208,14 @@ API_FUNC(infolist_integer) { Tcl_Obj *objp; char *infolist, *variable; - int result, i; + int result; API_INIT_FUNC(1, "infolist_integer", API_RETURN_INT(0)); if (objc < 3) API_WRONG_ARGS(API_RETURN_INT(0)); - infolist = Tcl_GetStringFromObj (objv[1], &i); - variable = Tcl_GetStringFromObj (objv[2], &i); + infolist = Tcl_GetString (objv[1]); + variable = Tcl_GetString (objv[2]); result = weechat_infolist_integer (API_STR2PTR(infolist), variable); @@ -5343,14 +5227,13 @@ API_FUNC(infolist_string) Tcl_Obj *objp; char *infolist, *variable; const char *result; - int i; API_INIT_FUNC(1, "infolist_string", API_RETURN_EMPTY); if (objc < 3) API_WRONG_ARGS(API_RETURN_EMPTY); - infolist = Tcl_GetStringFromObj (objv[1], &i); - variable = Tcl_GetStringFromObj (objv[2], &i); + infolist = Tcl_GetString (objv[1]); + variable = Tcl_GetString (objv[2]); result = weechat_infolist_string (API_STR2PTR(infolist), variable); @@ -5362,14 +5245,13 @@ API_FUNC(infolist_pointer) Tcl_Obj *objp; char *infolist, *variable; const char *result; - int i; API_INIT_FUNC(1, "infolist_pointer", API_RETURN_EMPTY); if (objc < 3) API_WRONG_ARGS(API_RETURN_EMPTY); - infolist = Tcl_GetStringFromObj (objv[1], &i); - variable = Tcl_GetStringFromObj (objv[2], &i); + infolist = Tcl_GetString (objv[1]); + variable = Tcl_GetString (objv[2]); result = API_PTR2STR(weechat_infolist_pointer (API_STR2PTR(infolist), variable)); @@ -5381,14 +5263,13 @@ API_FUNC(infolist_time) Tcl_Obj *objp; time_t time; char *infolist, *variable; - int i; API_INIT_FUNC(1, "infolist_time", API_RETURN_LONG(0)); if (objc < 3) API_WRONG_ARGS(API_RETURN_LONG(0)); - infolist = Tcl_GetStringFromObj (objv[1], &i); - variable = Tcl_GetStringFromObj (objv[2], &i); + infolist = Tcl_GetString (objv[1]); + variable = Tcl_GetString (objv[2]); time = weechat_infolist_time (API_STR2PTR(infolist), variable); @@ -5398,13 +5279,12 @@ API_FUNC(infolist_time) API_FUNC(infolist_free) { Tcl_Obj *objp; - int i; API_INIT_FUNC(1, "infolist_free", API_RETURN_ERROR); if (objc < 2) API_WRONG_ARGS(API_RETURN_ERROR); - weechat_infolist_free (API_STR2PTR(Tcl_GetStringFromObj (objv[1], &i))); /* infolist */ + weechat_infolist_free (API_STR2PTR(Tcl_GetString (objv[1]))); /* infolist */ API_RETURN_OK; } @@ -5414,13 +5294,12 @@ API_FUNC(hdata_get) Tcl_Obj *objp; char *name; const char *result; - int i; API_INIT_FUNC(1, "hdata_get", API_RETURN_EMPTY); if (objc < 2) API_WRONG_ARGS(API_RETURN_EMPTY); - name = Tcl_GetStringFromObj (objv[1], &i); + name = Tcl_GetString (objv[1]); result = API_PTR2STR(weechat_hdata_get (name)); @@ -5431,14 +5310,14 @@ API_FUNC(hdata_get_var_offset) { Tcl_Obj *objp; char *hdata, *name; - int result, i; + int result; API_INIT_FUNC(1, "hdata_get_var_offset", API_RETURN_INT(0)); if (objc < 3) API_WRONG_ARGS(API_RETURN_INT(0)); - hdata = Tcl_GetStringFromObj (objv[1], &i); - name = Tcl_GetStringFromObj (objv[2], &i); + hdata = Tcl_GetString (objv[1]); + name = Tcl_GetString (objv[2]); result = weechat_hdata_get_var_offset (API_STR2PTR(hdata), name); @@ -5450,14 +5329,13 @@ API_FUNC(hdata_get_var_type_string) Tcl_Obj *objp; char *hdata, *name; const char *result; - int i; API_INIT_FUNC(1, "hdata_get_var_type_string", API_RETURN_EMPTY); if (objc < 3) API_WRONG_ARGS(API_RETURN_EMPTY); - hdata = Tcl_GetStringFromObj (objv[1], &i); - name = Tcl_GetStringFromObj (objv[2], &i); + hdata = Tcl_GetString (objv[1]); + name = Tcl_GetString (objv[2]); result = weechat_hdata_get_var_type_string (API_STR2PTR(hdata), name); @@ -5468,15 +5346,15 @@ API_FUNC(hdata_get_var_array_size) { Tcl_Obj *objp; char *hdata, *pointer, *name; - int result, i; + int result; API_INIT_FUNC(1, "hdata_get_var_array_size", API_RETURN_INT(-1)); if (objc < 4) API_WRONG_ARGS(API_RETURN_INT(-1)); - hdata = Tcl_GetStringFromObj (objv[1], &i); - pointer = Tcl_GetStringFromObj (objv[2], &i); - name = Tcl_GetStringFromObj (objv[3], &i); + hdata = Tcl_GetString (objv[1]); + pointer = Tcl_GetString (objv[2]); + name = Tcl_GetString (objv[3]); result = weechat_hdata_get_var_array_size (API_STR2PTR(hdata), API_STR2PTR(pointer), @@ -5490,15 +5368,14 @@ API_FUNC(hdata_get_var_array_size_string) Tcl_Obj *objp; char *hdata, *pointer, *name; const char *result; - int i; API_INIT_FUNC(1, "hdata_get_var_array_size_string", API_RETURN_EMPTY); if (objc < 4) API_WRONG_ARGS(API_RETURN_EMPTY); - hdata = Tcl_GetStringFromObj (objv[1], &i); - pointer = Tcl_GetStringFromObj (objv[2], &i); - name = Tcl_GetStringFromObj (objv[3], &i); + hdata = Tcl_GetString (objv[1]); + pointer = Tcl_GetString (objv[2]); + name = Tcl_GetString (objv[3]); result = weechat_hdata_get_var_array_size_string (API_STR2PTR(hdata), API_STR2PTR(pointer), @@ -5512,14 +5389,13 @@ API_FUNC(hdata_get_var_hdata) Tcl_Obj *objp; char *hdata, *name; const char *result; - int i; API_INIT_FUNC(1, "hdata_get_var_hdata", API_RETURN_EMPTY); if (objc < 3) API_WRONG_ARGS(API_RETURN_EMPTY); - hdata = Tcl_GetStringFromObj (objv[1], &i); - name = Tcl_GetStringFromObj (objv[2], &i); + hdata = Tcl_GetString (objv[1]); + name = Tcl_GetString (objv[2]); result = weechat_hdata_get_var_hdata (API_STR2PTR(hdata), name); @@ -5531,14 +5407,13 @@ API_FUNC(hdata_get_list) Tcl_Obj *objp; char *hdata, *name; const char *result; - int i; API_INIT_FUNC(1, "hdata_get_list", API_RETURN_EMPTY); if (objc < 3) API_WRONG_ARGS(API_RETURN_EMPTY); - hdata = Tcl_GetStringFromObj (objv[1], &i); - name = Tcl_GetStringFromObj (objv[2], &i); + hdata = Tcl_GetString (objv[1]); + name = Tcl_GetString (objv[2]); result = API_PTR2STR(weechat_hdata_get_list (API_STR2PTR(hdata), name)); @@ -5550,15 +5425,15 @@ API_FUNC(hdata_check_pointer) { Tcl_Obj *objp; char *hdata, *list, *pointer; - int result, i; + int result; API_INIT_FUNC(1, "hdata_check_pointer", API_RETURN_INT(0)); if (objc < 4) API_WRONG_ARGS(API_RETURN_INT(0)); - hdata = Tcl_GetStringFromObj (objv[1], &i); - list = Tcl_GetStringFromObj (objv[2], &i); - pointer = Tcl_GetStringFromObj (objv[3], &i); + hdata = Tcl_GetString (objv[1]); + list = Tcl_GetString (objv[2]); + pointer = Tcl_GetString (objv[3]); result = weechat_hdata_check_pointer (API_STR2PTR(hdata), API_STR2PTR(list), @@ -5572,14 +5447,14 @@ API_FUNC(hdata_move) Tcl_Obj *objp; char *hdata, *pointer; const char *result; - int i, count; + int count; API_INIT_FUNC(1, "hdata_move", API_RETURN_EMPTY); if (objc < 4) API_WRONG_ARGS(API_RETURN_EMPTY); - hdata = Tcl_GetStringFromObj (objv[1], &i); - pointer = Tcl_GetStringFromObj (objv[2], &i); + hdata = Tcl_GetString (objv[1]); + pointer = Tcl_GetString (objv[2]); if (Tcl_GetIntFromObj (interp, objv[3], &count) != TCL_OK) API_WRONG_ARGS(API_RETURN_EMPTY); @@ -5597,15 +5472,15 @@ API_FUNC(hdata_search) char *hdata, *pointer, *search; const char *result; struct t_hashtable *pointers, *extra_vars, *options; - int i, move; + int move; API_INIT_FUNC(1, "hdata_search", API_RETURN_EMPTY); if (objc < 8) API_WRONG_ARGS(API_RETURN_EMPTY); - hdata = Tcl_GetStringFromObj (objv[1], &i); - pointer = Tcl_GetStringFromObj (objv[2], &i); - search = Tcl_GetStringFromObj (objv[3], &i); + hdata = Tcl_GetString (objv[1]); + pointer = Tcl_GetString (objv[2]); + search = Tcl_GetString (objv[3]); pointers = weechat_tcl_dict_to_hashtable (interp, objv[4], WEECHAT_SCRIPT_HASHTABLE_DEFAULT_SIZE, WEECHAT_HASHTABLE_STRING, @@ -5644,15 +5519,15 @@ API_FUNC(hdata_char) { Tcl_Obj *objp; char *hdata, *pointer, *name; - int result, i; + int result; API_INIT_FUNC(1, "hdata_char", API_RETURN_INT(0)); if (objc < 4) API_WRONG_ARGS(API_RETURN_INT(0)); - hdata = Tcl_GetStringFromObj (objv[1], &i); - pointer = Tcl_GetStringFromObj (objv[2], &i); - name = Tcl_GetStringFromObj (objv[3], &i); + hdata = Tcl_GetString (objv[1]); + pointer = Tcl_GetString (objv[2]); + name = Tcl_GetString (objv[3]); result = (int)weechat_hdata_char (API_STR2PTR(hdata), API_STR2PTR(pointer), @@ -5665,15 +5540,15 @@ API_FUNC(hdata_integer) { Tcl_Obj *objp; char *hdata, *pointer, *name; - int result, i; + int result; API_INIT_FUNC(1, "hdata_integer", API_RETURN_INT(0)); if (objc < 4) API_WRONG_ARGS(API_RETURN_INT(0)); - hdata = Tcl_GetStringFromObj (objv[1], &i); - pointer = Tcl_GetStringFromObj (objv[2], &i); - name = Tcl_GetStringFromObj (objv[3], &i); + hdata = Tcl_GetString (objv[1]); + pointer = Tcl_GetString (objv[2]); + name = Tcl_GetString (objv[3]); result = weechat_hdata_integer (API_STR2PTR(hdata), API_STR2PTR(pointer), @@ -5686,15 +5561,15 @@ API_FUNC(hdata_long) { Tcl_Obj *objp; char *hdata, *pointer, *name; - int result, i; + int result; API_INIT_FUNC(1, "hdata_long", API_RETURN_LONG(0)); if (objc < 4) API_WRONG_ARGS(API_RETURN_LONG(0)); - hdata = Tcl_GetStringFromObj (objv[1], &i); - pointer = Tcl_GetStringFromObj (objv[2], &i); - name = Tcl_GetStringFromObj (objv[3], &i); + hdata = Tcl_GetString (objv[1]); + pointer = Tcl_GetString (objv[2]); + name = Tcl_GetString (objv[3]); result = weechat_hdata_long (API_STR2PTR(hdata), API_STR2PTR(pointer), @@ -5708,15 +5583,14 @@ API_FUNC(hdata_string) Tcl_Obj *objp; char *hdata, *pointer, *name; const char *result; - int i; API_INIT_FUNC(1, "hdata_string", API_RETURN_EMPTY); if (objc < 4) API_WRONG_ARGS(API_RETURN_EMPTY); - hdata = Tcl_GetStringFromObj (objv[1], &i); - pointer = Tcl_GetStringFromObj (objv[2], &i); - name = Tcl_GetStringFromObj (objv[3], &i); + hdata = Tcl_GetString (objv[1]); + pointer = Tcl_GetString (objv[2]); + name = Tcl_GetString (objv[3]); result = weechat_hdata_string (API_STR2PTR(hdata), API_STR2PTR(pointer), @@ -5730,15 +5604,14 @@ API_FUNC(hdata_pointer) Tcl_Obj *objp; char *hdata, *pointer, *name; const char *result; - int i; API_INIT_FUNC(1, "hdata_pointer", API_RETURN_EMPTY); if (objc < 4) API_WRONG_ARGS(API_RETURN_EMPTY); - hdata = Tcl_GetStringFromObj (objv[1], &i); - pointer = Tcl_GetStringFromObj (objv[2], &i); - name = Tcl_GetStringFromObj (objv[3], &i); + hdata = Tcl_GetString (objv[1]); + pointer = Tcl_GetString (objv[2]); + name = Tcl_GetString (objv[3]); result = API_PTR2STR(weechat_hdata_pointer (API_STR2PTR(hdata), API_STR2PTR(pointer), @@ -5752,15 +5625,14 @@ API_FUNC(hdata_time) Tcl_Obj *objp; time_t time; char *hdata, *pointer, *name; - int i; API_INIT_FUNC(1, "hdata_time", API_RETURN_LONG(0)); if (objc < 4) API_WRONG_ARGS(API_RETURN_LONG(0)); - hdata = Tcl_GetStringFromObj (objv[1], &i); - pointer = Tcl_GetStringFromObj (objv[2], &i); - name = Tcl_GetStringFromObj (objv[3], &i); + hdata = Tcl_GetString (objv[1]); + pointer = Tcl_GetString (objv[2]); + name = Tcl_GetString (objv[3]); time = weechat_hdata_time (API_STR2PTR(hdata), API_STR2PTR(pointer), @@ -5773,15 +5645,14 @@ API_FUNC(hdata_hashtable) { Tcl_Obj *objp, *result_dict; char *hdata, *pointer, *name; - int i; API_INIT_FUNC(1, "hdata_hashtable", API_RETURN_EMPTY); if (objc < 4) API_WRONG_ARGS(API_RETURN_EMPTY); - hdata = Tcl_GetStringFromObj (objv[1], &i); - pointer = Tcl_GetStringFromObj (objv[2], &i); - name = Tcl_GetStringFromObj (objv[3], &i); + hdata = Tcl_GetString (objv[1]); + pointer = Tcl_GetString (objv[2]); + name = Tcl_GetString (objv[3]); result_dict = weechat_tcl_hashtable_to_dict ( interp, @@ -5796,16 +5667,16 @@ API_FUNC(hdata_compare) { Tcl_Obj *objp; char *hdata, *pointer1, *pointer2, *name; - int case_sensitive, rc, i; + int case_sensitive, rc; API_INIT_FUNC(1, "hdata_compare", API_RETURN_INT(0)); if (objc < 6) API_WRONG_ARGS(API_RETURN_INT(0)); - hdata = Tcl_GetStringFromObj (objv[1], &i); - pointer1 = Tcl_GetStringFromObj (objv[2], &i); - pointer2 = Tcl_GetStringFromObj (objv[3], &i); - name = Tcl_GetStringFromObj (objv[4], &i); + hdata = Tcl_GetString (objv[1]); + pointer1 = Tcl_GetString (objv[2]); + pointer2 = Tcl_GetString (objv[3]); + name = Tcl_GetString (objv[4]); if (Tcl_GetIntFromObj (interp, objv[5], &case_sensitive) != TCL_OK) API_WRONG_ARGS(API_RETURN_INT(0)); @@ -5824,14 +5695,14 @@ API_FUNC(hdata_update) Tcl_Obj *objp; char *hdata, *pointer; struct t_hashtable *hashtable; - int i, value; + int value; API_INIT_FUNC(1, "hdata_update", API_RETURN_INT(0)); if (objc < 4) API_WRONG_ARGS(API_RETURN_INT(0)); - hdata = Tcl_GetStringFromObj (objv[1], &i); - pointer = Tcl_GetStringFromObj (objv[2], &i); + hdata = Tcl_GetString (objv[1]); + pointer = Tcl_GetString (objv[2]); hashtable = weechat_tcl_dict_to_hashtable (interp, objv[3], WEECHAT_SCRIPT_HASHTABLE_DEFAULT_SIZE, WEECHAT_HASHTABLE_STRING, @@ -5852,14 +5723,13 @@ API_FUNC(hdata_get_string) Tcl_Obj *objp; char *hdata, *property; const char *result; - int i; API_INIT_FUNC(1, "hdata_get_string", API_RETURN_EMPTY); if (objc < 3) API_WRONG_ARGS(API_RETURN_EMPTY); - hdata = Tcl_GetStringFromObj (objv[1], &i); - property = Tcl_GetStringFromObj (objv[2], &i); + hdata = Tcl_GetString (objv[1]); + property = Tcl_GetString (objv[2]); result = weechat_hdata_get_string (API_STR2PTR(hdata), property); @@ -5912,15 +5782,14 @@ API_FUNC(upgrade_new) Tcl_Obj *objp; char *filename, *function, *data; const char *result; - int i; API_INIT_FUNC(1, "upgrade_new", API_RETURN_EMPTY); if (objc < 4) API_WRONG_ARGS(API_RETURN_EMPTY); - filename = Tcl_GetStringFromObj (objv[1], &i); - function = Tcl_GetStringFromObj (objv[2], &i); - data = Tcl_GetStringFromObj (objv[3], &i); + filename = Tcl_GetString (objv[1]); + function = Tcl_GetString (objv[2]); + data = Tcl_GetString (objv[3]); result = API_PTR2STR( plugin_script_api_upgrade_new ( @@ -5938,7 +5807,7 @@ API_FUNC(upgrade_write_object) { Tcl_Obj *objp; char *upgrade_file, *infolist; - int rc, i, object_id; + int rc, object_id; API_INIT_FUNC(1, "upgrade_write_object", API_RETURN_INT(0)); if (objc < 4) @@ -5947,8 +5816,8 @@ API_FUNC(upgrade_write_object) if (Tcl_GetIntFromObj (interp, objv[2], &object_id) != TCL_OK) API_WRONG_ARGS(API_RETURN_INT(0)); - upgrade_file = Tcl_GetStringFromObj (objv[1], &i); - infolist = Tcl_GetStringFromObj (objv[3], &i); + upgrade_file = Tcl_GetString (objv[1]); + infolist = Tcl_GetString (objv[3]); rc = weechat_upgrade_write_object (API_STR2PTR(upgrade_file), object_id, @@ -5961,13 +5830,13 @@ API_FUNC(upgrade_read) { Tcl_Obj *objp; char *upgrade_file; - int i, rc; + int rc; API_INIT_FUNC(1, "upgrade_read", API_RETURN_INT(0)); if (objc < 2) API_WRONG_ARGS(API_RETURN_INT(0)); - upgrade_file = Tcl_GetStringFromObj (objv[1], &i); + upgrade_file = Tcl_GetString (objv[1]); rc = weechat_upgrade_read (API_STR2PTR(upgrade_file)); @@ -5978,13 +5847,12 @@ API_FUNC(upgrade_close) { Tcl_Obj *objp; char *upgrade_file; - int i; API_INIT_FUNC(1, "upgrade_close", API_RETURN_ERROR); if (objc < 2) API_WRONG_ARGS(API_RETURN_ERROR); - upgrade_file = Tcl_GetStringFromObj (objv[1], &i); + upgrade_file = Tcl_GetString (objv[1]); weechat_upgrade_close (API_STR2PTR(upgrade_file)); @@ -5997,7 +5865,6 @@ API_FUNC(upgrade_close) void weechat_tcl_api_init (Tcl_Interp *interp) { - int i; Tcl_Obj *objp; /* standard initializer */ @@ -6011,94 +5878,94 @@ void weechat_tcl_api_init (Tcl_Interp *interp) objp = Tcl_NewIntObj (WEECHAT_RC_OK); Tcl_IncrRefCount (objp); - Tcl_SetVar (interp, "weechat::WEECHAT_RC_OK", Tcl_GetStringFromObj (objp, &i), 0); + Tcl_SetVar (interp, "weechat::WEECHAT_RC_OK", Tcl_GetString (objp), 0); Tcl_SetIntObj (objp, WEECHAT_RC_OK_EAT); - Tcl_SetVar (interp, "weechat::WEECHAT_RC_OK_EAT", Tcl_GetStringFromObj (objp, &i), 0); + Tcl_SetVar (interp, "weechat::WEECHAT_RC_OK_EAT", Tcl_GetString (objp), 0); Tcl_SetIntObj (objp, WEECHAT_RC_ERROR); - Tcl_SetVar (interp, "weechat::WEECHAT_RC_ERROR", Tcl_GetStringFromObj (objp, &i), 0); + Tcl_SetVar (interp, "weechat::WEECHAT_RC_ERROR", Tcl_GetString (objp), 0); Tcl_SetStringObj (objp, WEECHAT_NULL_STRING, -1); - Tcl_SetVar (interp, "weechat::WEECHAT_NULL", Tcl_GetStringFromObj (objp, &i), 0); + Tcl_SetVar (interp, "weechat::WEECHAT_NULL", Tcl_GetString (objp), 0); Tcl_SetIntObj (objp, WEECHAT_CONFIG_READ_OK); - Tcl_SetVar (interp, "weechat::WEECHAT_CONFIG_READ_OK", Tcl_GetStringFromObj (objp, &i), 0); + Tcl_SetVar (interp, "weechat::WEECHAT_CONFIG_READ_OK", Tcl_GetString (objp), 0); Tcl_SetIntObj (objp, WEECHAT_CONFIG_READ_MEMORY_ERROR); - Tcl_SetVar (interp, "weechat::WEECHAT_CONFIG_READ_MEMORY_ERROR", Tcl_GetStringFromObj (objp, &i), 0); + Tcl_SetVar (interp, "weechat::WEECHAT_CONFIG_READ_MEMORY_ERROR", Tcl_GetString (objp), 0); Tcl_SetIntObj (objp, WEECHAT_CONFIG_READ_FILE_NOT_FOUND); - Tcl_SetVar (interp, "weechat::WEECHAT_CONFIG_READ_FILE_NOT_FOUND", Tcl_GetStringFromObj (objp, &i), 0); + Tcl_SetVar (interp, "weechat::WEECHAT_CONFIG_READ_FILE_NOT_FOUND", Tcl_GetString (objp), 0); Tcl_SetIntObj (objp, WEECHAT_CONFIG_WRITE_OK); - Tcl_SetVar (interp, "weechat::WEECHAT_CONFIG_WRITE_OK", Tcl_GetStringFromObj (objp, &i), 0); + Tcl_SetVar (interp, "weechat::WEECHAT_CONFIG_WRITE_OK", Tcl_GetString (objp), 0); Tcl_SetIntObj (objp, WEECHAT_CONFIG_WRITE_ERROR); - Tcl_SetVar (interp, "weechat::WEECHAT_CONFIG_WRITE_ERROR", Tcl_GetStringFromObj (objp, &i), 0); + Tcl_SetVar (interp, "weechat::WEECHAT_CONFIG_WRITE_ERROR", Tcl_GetString (objp), 0); Tcl_SetIntObj (objp, WEECHAT_CONFIG_WRITE_MEMORY_ERROR); - Tcl_SetVar (interp, "weechat::WEECHAT_CONFIG_WRITE_MEMORY_ERROR", Tcl_GetStringFromObj (objp, &i), 0); + Tcl_SetVar (interp, "weechat::WEECHAT_CONFIG_WRITE_MEMORY_ERROR", Tcl_GetString (objp), 0); Tcl_SetIntObj (objp, WEECHAT_CONFIG_OPTION_SET_OK_CHANGED); - Tcl_SetVar (interp, "weechat::WEECHAT_CONFIG_OPTION_SET_OK_CHANGED", Tcl_GetStringFromObj (objp, &i), 0); + Tcl_SetVar (interp, "weechat::WEECHAT_CONFIG_OPTION_SET_OK_CHANGED", Tcl_GetString (objp), 0); Tcl_SetIntObj (objp, WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE); - Tcl_SetVar (interp, "weechat::WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE", Tcl_GetStringFromObj (objp, &i), 0); + Tcl_SetVar (interp, "weechat::WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE", Tcl_GetString (objp), 0); Tcl_SetIntObj (objp, WEECHAT_CONFIG_OPTION_SET_ERROR); - Tcl_SetVar (interp, "weechat::WEECHAT_CONFIG_OPTION_SET_ERROR", Tcl_GetStringFromObj (objp, &i), 0); + Tcl_SetVar (interp, "weechat::WEECHAT_CONFIG_OPTION_SET_ERROR", Tcl_GetString (objp), 0); Tcl_SetIntObj (objp, WEECHAT_CONFIG_OPTION_SET_OPTION_NOT_FOUND); - Tcl_SetVar (interp, "weechat::WEECHAT_CONFIG_OPTION_SET_OPTION_NOT_FOUND", Tcl_GetStringFromObj (objp, &i), 0); + Tcl_SetVar (interp, "weechat::WEECHAT_CONFIG_OPTION_SET_OPTION_NOT_FOUND", Tcl_GetString (objp), 0); Tcl_SetIntObj (objp, WEECHAT_CONFIG_OPTION_UNSET_OK_NO_RESET); - Tcl_SetVar (interp, "weechat::WEECHAT_CONFIG_OPTION_UNSET_OK_NO_RESET", Tcl_GetStringFromObj (objp, &i), 0); + Tcl_SetVar (interp, "weechat::WEECHAT_CONFIG_OPTION_UNSET_OK_NO_RESET", Tcl_GetString (objp), 0); Tcl_SetIntObj (objp, WEECHAT_CONFIG_OPTION_UNSET_OK_RESET); - Tcl_SetVar (interp, "weechat::WEECHAT_CONFIG_OPTION_UNSET_OK_RESET", Tcl_GetStringFromObj (objp, &i), 0); + Tcl_SetVar (interp, "weechat::WEECHAT_CONFIG_OPTION_UNSET_OK_RESET", Tcl_GetString (objp), 0); Tcl_SetIntObj (objp, WEECHAT_CONFIG_OPTION_UNSET_OK_REMOVED); - Tcl_SetVar (interp, "weechat::WEECHAT_CONFIG_OPTION_UNSET_OK_REMOVED", Tcl_GetStringFromObj (objp, &i), 0); + Tcl_SetVar (interp, "weechat::WEECHAT_CONFIG_OPTION_UNSET_OK_REMOVED", Tcl_GetString (objp), 0); Tcl_SetIntObj (objp, WEECHAT_CONFIG_OPTION_UNSET_ERROR); - Tcl_SetVar (interp, "weechat::WEECHAT_CONFIG_OPTION_UNSET_ERROR", Tcl_GetStringFromObj (objp, &i), 0); + Tcl_SetVar (interp, "weechat::WEECHAT_CONFIG_OPTION_UNSET_ERROR", Tcl_GetString (objp), 0); Tcl_SetStringObj (objp, WEECHAT_LIST_POS_SORT, -1); - Tcl_SetVar (interp, "weechat::WEECHAT_LIST_POS_SORT", Tcl_GetStringFromObj (objp, &i), 0); + Tcl_SetVar (interp, "weechat::WEECHAT_LIST_POS_SORT", Tcl_GetString (objp), 0); Tcl_SetStringObj (objp, WEECHAT_LIST_POS_BEGINNING, -1); - Tcl_SetVar (interp, "weechat::WEECHAT_LIST_POS_BEGINNING", Tcl_GetStringFromObj (objp, &i), 0); + Tcl_SetVar (interp, "weechat::WEECHAT_LIST_POS_BEGINNING", Tcl_GetString (objp), 0); Tcl_SetStringObj (objp, WEECHAT_LIST_POS_END, -1); - Tcl_SetVar (interp, "weechat::WEECHAT_LIST_POS_END", Tcl_GetStringFromObj (objp, &i), 0); + Tcl_SetVar (interp, "weechat::WEECHAT_LIST_POS_END", Tcl_GetString (objp), 0); Tcl_SetStringObj (objp, WEECHAT_HOTLIST_LOW, -1); - Tcl_SetVar (interp, "weechat::WEECHAT_HOTLIST_LOW", Tcl_GetStringFromObj (objp, &i), 0); + Tcl_SetVar (interp, "weechat::WEECHAT_HOTLIST_LOW", Tcl_GetString (objp), 0); Tcl_SetStringObj (objp, WEECHAT_HOTLIST_MESSAGE, -1); - Tcl_SetVar (interp, "weechat::WEECHAT_HOTLIST_MESSAGE", Tcl_GetStringFromObj (objp, &i), 0); + Tcl_SetVar (interp, "weechat::WEECHAT_HOTLIST_MESSAGE", Tcl_GetString (objp), 0); Tcl_SetStringObj (objp, WEECHAT_HOTLIST_PRIVATE, -1); - Tcl_SetVar (interp, "weechat::WEECHAT_HOTLIST_PRIVATE", Tcl_GetStringFromObj (objp, &i), 0); + Tcl_SetVar (interp, "weechat::WEECHAT_HOTLIST_PRIVATE", Tcl_GetString (objp), 0); Tcl_SetStringObj (objp, WEECHAT_HOTLIST_HIGHLIGHT, -1); - Tcl_SetVar (interp, "weechat::WEECHAT_HOTLIST_HIGHLIGHT", Tcl_GetStringFromObj (objp, &i), 0); + Tcl_SetVar (interp, "weechat::WEECHAT_HOTLIST_HIGHLIGHT", Tcl_GetString (objp), 0); Tcl_SetIntObj (objp, WEECHAT_HOOK_PROCESS_RUNNING); - Tcl_SetVar (interp, "weechat::WEECHAT_HOOK_PROCESS_RUNNING", Tcl_GetStringFromObj (objp, &i), 0); + Tcl_SetVar (interp, "weechat::WEECHAT_HOOK_PROCESS_RUNNING", Tcl_GetString (objp), 0); Tcl_SetIntObj (objp, WEECHAT_HOOK_PROCESS_ERROR); - Tcl_SetVar (interp, "weechat::WEECHAT_HOOK_PROCESS_ERROR", Tcl_GetStringFromObj (objp, &i), 0); + Tcl_SetVar (interp, "weechat::WEECHAT_HOOK_PROCESS_ERROR", Tcl_GetString (objp), 0); Tcl_SetIntObj (objp, WEECHAT_HOOK_CONNECT_OK); - Tcl_SetVar (interp, "weechat::WEECHAT_HOOK_CONNECT_OK", Tcl_GetStringFromObj (objp, &i), 0); + Tcl_SetVar (interp, "weechat::WEECHAT_HOOK_CONNECT_OK", Tcl_GetString (objp), 0); Tcl_SetIntObj (objp, WEECHAT_HOOK_CONNECT_ADDRESS_NOT_FOUND); - Tcl_SetVar (interp, "weechat::WEECHAT_HOOK_CONNECT_ADDRESS_NOT_FOUND", Tcl_GetStringFromObj (objp, &i), 0); + Tcl_SetVar (interp, "weechat::WEECHAT_HOOK_CONNECT_ADDRESS_NOT_FOUND", Tcl_GetString (objp), 0); Tcl_SetIntObj (objp, WEECHAT_HOOK_CONNECT_IP_ADDRESS_NOT_FOUND); - Tcl_SetVar (interp, "weechat::WEECHAT_HOOK_CONNECT_IP_ADDRESS_NOT_FOUND", Tcl_GetStringFromObj (objp, &i), 0); + Tcl_SetVar (interp, "weechat::WEECHAT_HOOK_CONNECT_IP_ADDRESS_NOT_FOUND", Tcl_GetString (objp), 0); Tcl_SetIntObj (objp, WEECHAT_HOOK_CONNECT_CONNECTION_REFUSED); - Tcl_SetVar (interp, "weechat::WEECHAT_HOOK_CONNECT_CONNECTION_REFUSED", Tcl_GetStringFromObj (objp, &i), 0); + Tcl_SetVar (interp, "weechat::WEECHAT_HOOK_CONNECT_CONNECTION_REFUSED", Tcl_GetString (objp), 0); Tcl_SetIntObj (objp, WEECHAT_HOOK_CONNECT_PROXY_ERROR); - Tcl_SetVar (interp, "weechat::WEECHAT_HOOK_CONNECT_PROXY_ERROR", Tcl_GetStringFromObj (objp, &i), 0); + Tcl_SetVar (interp, "weechat::WEECHAT_HOOK_CONNECT_PROXY_ERROR", Tcl_GetString (objp), 0); Tcl_SetIntObj (objp, WEECHAT_HOOK_CONNECT_LOCAL_HOSTNAME_ERROR); - Tcl_SetVar (interp, "weechat::WEECHAT_HOOK_CONNECT_LOCAL_HOSTNAME_ERROR", Tcl_GetStringFromObj (objp, &i), 0); + Tcl_SetVar (interp, "weechat::WEECHAT_HOOK_CONNECT_LOCAL_HOSTNAME_ERROR", Tcl_GetString (objp), 0); Tcl_SetIntObj (objp, WEECHAT_HOOK_CONNECT_GNUTLS_INIT_ERROR); - Tcl_SetVar (interp, "weechat::WEECHAT_HOOK_CONNECT_GNUTLS_INIT_ERROR", Tcl_GetStringFromObj (objp, &i), 0); + Tcl_SetVar (interp, "weechat::WEECHAT_HOOK_CONNECT_GNUTLS_INIT_ERROR", Tcl_GetString (objp), 0); Tcl_SetIntObj (objp, WEECHAT_HOOK_CONNECT_GNUTLS_HANDSHAKE_ERROR); - Tcl_SetVar (interp, "weechat::WEECHAT_HOOK_CONNECT_GNUTLS_HANDSHAKE_ERROR", Tcl_GetStringFromObj (objp, &i), 0); + Tcl_SetVar (interp, "weechat::WEECHAT_HOOK_CONNECT_GNUTLS_HANDSHAKE_ERROR", Tcl_GetString (objp), 0); Tcl_SetIntObj (objp, WEECHAT_HOOK_CONNECT_MEMORY_ERROR); - Tcl_SetVar (interp, "weechat::WEECHAT_HOOK_CONNECT_MEMORY_ERROR", Tcl_GetStringFromObj (objp, &i), 0); + Tcl_SetVar (interp, "weechat::WEECHAT_HOOK_CONNECT_MEMORY_ERROR", Tcl_GetString (objp), 0); Tcl_SetIntObj (objp, WEECHAT_HOOK_CONNECT_TIMEOUT); - Tcl_SetVar (interp, "weechat::WEECHAT_HOOK_CONNECT_TIMEOUT", Tcl_GetStringFromObj (objp, &i), 0); + Tcl_SetVar (interp, "weechat::WEECHAT_HOOK_CONNECT_TIMEOUT", Tcl_GetString (objp), 0); Tcl_SetIntObj (objp, WEECHAT_HOOK_CONNECT_SOCKET_ERROR); - Tcl_SetVar (interp, "weechat::WEECHAT_HOOK_CONNECT_SOCKET_ERROR", Tcl_GetStringFromObj (objp, &i), 0); + Tcl_SetVar (interp, "weechat::WEECHAT_HOOK_CONNECT_SOCKET_ERROR", Tcl_GetString (objp), 0); Tcl_SetStringObj (objp, WEECHAT_HOOK_SIGNAL_STRING, -1); - Tcl_SetVar (interp, "weechat::WEECHAT_HOOK_SIGNAL_STRING", Tcl_GetStringFromObj (objp, &i), 0); + Tcl_SetVar (interp, "weechat::WEECHAT_HOOK_SIGNAL_STRING", Tcl_GetString (objp), 0); Tcl_SetStringObj (objp, WEECHAT_HOOK_SIGNAL_INT, -1); - Tcl_SetVar (interp, "weechat::WEECHAT_HOOK_SIGNAL_INT", Tcl_GetStringFromObj (objp, &i), 0); + Tcl_SetVar (interp, "weechat::WEECHAT_HOOK_SIGNAL_INT", Tcl_GetString (objp), 0); Tcl_SetStringObj (objp, WEECHAT_HOOK_SIGNAL_POINTER, -1); - Tcl_SetVar (interp, "weechat::WEECHAT_HOOK_SIGNAL_POINTER", Tcl_GetStringFromObj (objp, &i), 0); + Tcl_SetVar (interp, "weechat::WEECHAT_HOOK_SIGNAL_POINTER", Tcl_GetString (objp), 0); Tcl_DecrRefCount (objp); diff --git a/src/plugins/tcl/weechat-tcl.c b/src/plugins/tcl/weechat-tcl.c index feb04f20d..eee51f58b 100644 --- a/src/plugins/tcl/weechat-tcl.c +++ b/src/plugins/tcl/weechat-tcl.c @@ -197,7 +197,7 @@ weechat_tcl_exec (struct t_plugin_script *script, int ret_type, const char *function, const char *format, void **argv) { - int argc, i, llength; + int argc, i; int *ret_i; char *ret_cv; void *ret_val; @@ -244,18 +244,13 @@ weechat_tcl_exec (struct t_plugin_script *script, } } - if (Tcl_ListObjLength (interp, cmdlist, &llength) != TCL_OK) - llength = 0; - if (Tcl_EvalObjEx (interp, cmdlist, TCL_EVAL_DIRECT) == TCL_OK) { - /* remove elements, decrement their ref count */ - Tcl_ListObjReplace (interp, cmdlist, 0, llength, 0, NULL); Tcl_DecrRefCount (cmdlist); /* -1 */ ret_val = NULL; if (ret_type == WEECHAT_SCRIPT_EXEC_STRING) { - ret_cv = Tcl_GetStringFromObj (Tcl_GetObjResult (interp), &i); + ret_cv = Tcl_GetString (Tcl_GetObjResult (interp)); if (ret_cv) ret_val = (void *)strdup (ret_cv); else @@ -263,7 +258,7 @@ weechat_tcl_exec (struct t_plugin_script *script, } else if (ret_type == WEECHAT_SCRIPT_EXEC_POINTER) { - ret_cv = Tcl_GetStringFromObj (Tcl_GetObjResult (interp), &i); + ret_cv = Tcl_GetString (Tcl_GetObjResult (interp)); if (ret_cv) { ret_val = plugin_script_str2ptr (weechat_tcl_plugin, @@ -306,13 +301,11 @@ weechat_tcl_exec (struct t_plugin_script *script, return NULL; } - /* remove elements, decrement their ref count */ - Tcl_ListObjReplace (interp, cmdlist, 0, llength, 0, NULL); Tcl_DecrRefCount (cmdlist); /* -1 */ weechat_printf (NULL, weechat_gettext ("%s%s: unable to run function \"%s\": %s"), weechat_prefix ("error"), TCL_PLUGIN_NAME, function, - Tcl_GetStringFromObj (Tcl_GetObjResult (interp), &i)); + Tcl_GetString (Tcl_GetObjResult (interp))); tcl_current_script = old_tcl_script; return NULL; @@ -330,7 +323,6 @@ weechat_tcl_exec (struct t_plugin_script *script, struct t_plugin_script * weechat_tcl_load (const char *filename, const char *code) { - int i; Tcl_Interp *interp; struct stat buf; @@ -373,7 +365,7 @@ weechat_tcl_load (const char *filename, const char *code) weechat_gettext ("%s%s: error occurred while " "parsing file \"%s\": %s"), weechat_prefix ("error"), TCL_PLUGIN_NAME, filename, - Tcl_GetStringFromObj (Tcl_GetObjResult (interp), &i)); + Tcl_GetString (Tcl_GetObjResult (interp))); /* if script was registered, remove it from list */ if (tcl_current_script) |