diff options
Diffstat (limited to 'src/plugins/tcl/weechat-tcl-api.c')
-rw-r--r-- | src/plugins/tcl/weechat-tcl-api.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/plugins/tcl/weechat-tcl-api.c b/src/plugins/tcl/weechat-tcl-api.c index 24cfc64e5..c7494aa67 100644 --- a/src/plugins/tcl/weechat-tcl-api.c +++ b/src/plugins/tcl/weechat-tcl-api.c @@ -538,6 +538,24 @@ API_FUNC(string_format_size) API_RETURN_STRING_FREE(result); } +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); + + value = weechat_string_parse_size (size); + + API_RETURN_LONG(value); +} + API_FUNC(string_color_code_size) { Tcl_Obj *objp; @@ -5867,6 +5885,7 @@ void weechat_tcl_api_init (Tcl_Interp *interp) API_DEF_FUNC(string_has_highlight_regex); API_DEF_FUNC(string_mask_to_regex); API_DEF_FUNC(string_format_size); + API_DEF_FUNC(string_parse_size); API_DEF_FUNC(string_color_code_size); API_DEF_FUNC(string_remove_color); API_DEF_FUNC(string_is_command_char); |