diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2022-09-25 10:53:37 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2022-09-27 15:50:43 +0200 |
commit | 4d74a89cfcdce4d9207f51c786a2a1fc278c5a11 (patch) | |
tree | 57dad8d63de8a0bf1b5f5e6e13d57982da431601 /src/plugins/guile/weechat-guile-api.c | |
parent | be6a29a596b5da3be4c00943cd5bdceabd5159c5 (diff) | |
download | weechat-4d74a89cfcdce4d9207f51c786a2a1fc278c5a11.zip |
api: add function string_parse_size
Diffstat (limited to 'src/plugins/guile/weechat-guile-api.c')
-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 490d4f8ad..ce0d8c75a 100644 --- a/src/plugins/guile/weechat-guile-api.c +++ b/src/plugins/guile/weechat-guile-api.c @@ -432,6 +432,20 @@ weechat_guile_api_string_format_size (SCM size) } SCM +weechat_guile_api_string_parse_size (SCM size) +{ + unsigned long long value; + + API_INIT_FUNC(1, "string_parse_size", API_RETURN_LONG(0)); + if (!scm_is_string (size)) + API_WRONG_ARGS(API_RETURN_LONG(0)); + + value = weechat_string_parse_size (API_SCM_TO_STRING(size)); + + API_RETURN_LONG(value); +} + +SCM weechat_guile_api_string_color_code_size (SCM string) { int size; @@ -5118,6 +5132,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_parse_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); |