diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2020-08-22 08:55:16 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2020-08-22 08:55:16 +0200 |
commit | 268aa631c6b464c0d97dce5dbe76f145a6cc5f68 (patch) | |
tree | 00ef2b36db0fc64e2723442f1750934aec030901 /src/plugins/guile | |
parent | 7dd5abd6252d108858f31a717a127f86d5c206c1 (diff) | |
download | weechat-268aa631c6b464c0d97dce5dbe76f145a6cc5f68.zip |
api: add function string_color_code_size (issue #1547)
Diffstat (limited to 'src/plugins/guile')
-rw-r--r-- | src/plugins/guile/weechat-guile-api.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/plugins/guile/weechat-guile-api.c b/src/plugins/guile/weechat-guile-api.c index 8355c441c..09b514b83 100644 --- a/src/plugins/guile/weechat-guile-api.c +++ b/src/plugins/guile/weechat-guile-api.c @@ -429,6 +429,20 @@ weechat_guile_api_string_format_size (SCM size) } SCM +weechat_guile_api_string_color_code_size (SCM string) +{ + int size; + + API_INIT_FUNC(1, "string_color_code_size", API_RETURN_INT(0)); + if (!scm_is_string (string)) + API_WRONG_ARGS(API_RETURN_INT(0)); + + size = weechat_string_color_code_size (API_SCM_TO_STRING(string)); + + API_RETURN_INT(size); +} + +SCM weechat_guile_api_string_remove_color (SCM string, SCM replacement) { char *result; @@ -5012,6 +5026,7 @@ weechat_guile_api_module_init (void *data) API_DEF_FUNC(string_has_highlight_regex, 2); API_DEF_FUNC(string_mask_to_regex, 1); API_DEF_FUNC(string_format_size, 1); + API_DEF_FUNC(string_color_code_size, 1); API_DEF_FUNC(string_remove_color, 2); API_DEF_FUNC(string_is_command_char, 1); API_DEF_FUNC(string_input_for_buffer, 1); |