summaryrefslogtreecommitdiff
path: root/src/plugins/tcl/weechat-tcl-api.c
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2020-08-22 08:55:16 +0200
committerSébastien Helleu <flashcode@flashtux.org>2020-08-22 08:55:16 +0200
commit268aa631c6b464c0d97dce5dbe76f145a6cc5f68 (patch)
tree00ef2b36db0fc64e2723442f1750934aec030901 /src/plugins/tcl/weechat-tcl-api.c
parent7dd5abd6252d108858f31a717a127f86d5c206c1 (diff)
downloadweechat-268aa631c6b464c0d97dce5dbe76f145a6cc5f68.zip
api: add function string_color_code_size (issue #1547)
Diffstat (limited to 'src/plugins/tcl/weechat-tcl-api.c')
-rw-r--r--src/plugins/tcl/weechat-tcl-api.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/plugins/tcl/weechat-tcl-api.c b/src/plugins/tcl/weechat-tcl-api.c
index 528e501dc..475f746e4 100644
--- a/src/plugins/tcl/weechat-tcl-api.c
+++ b/src/plugins/tcl/weechat-tcl-api.c
@@ -530,6 +530,20 @@ API_FUNC(string_format_size)
API_RETURN_STRING_FREE(result);
}
+API_FUNC(string_color_code_size)
+{
+ Tcl_Obj *objp;
+ int result, i;
+
+ 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 */
+
+ API_RETURN_INT(result);
+}
+
API_FUNC(string_remove_color)
{
Tcl_Obj *objp;
@@ -5739,6 +5753,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_color_code_size);
API_DEF_FUNC(string_remove_color);
API_DEF_FUNC(string_is_command_char);
API_DEF_FUNC(string_input_for_buffer);