diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2018-04-07 13:20:58 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2018-04-07 13:20:58 +0200 |
commit | 6de98179bc87df4f2da38e36d64a03a1c0f9f623 (patch) | |
tree | ac3505c42a0297cf32fa966fc67f86a7825d8520 /src/plugins/perl | |
parent | ea365cccbffb245285b33e5beeebac06743f7056 (diff) | |
download | weechat-6de98179bc87df4f2da38e36d64a03a1c0f9f623.zip |
api: add function string_format_size in scripting API
Diffstat (limited to 'src/plugins/perl')
-rw-r--r-- | src/plugins/perl/weechat-perl-api.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/plugins/perl/weechat-perl-api.c b/src/plugins/perl/weechat-perl-api.c index c16d58578..5196794a8 100644 --- a/src/plugins/perl/weechat-perl-api.c +++ b/src/plugins/perl/weechat-perl-api.c @@ -351,6 +351,20 @@ API_FUNC(string_mask_to_regex) API_RETURN_STRING_FREE(result); } +API_FUNC(string_format_size) +{ + char *result; + dXSARGS; + + API_INIT_FUNC(1, "string_format_size", API_RETURN_EMPTY); + if (items < 1) + API_WRONG_ARGS(API_RETURN_EMPTY); + + result = weechat_string_format_size (SvUV (ST (0))); + + API_RETURN_STRING_FREE(result); +} + API_FUNC(string_remove_color) { char *result, *string, *replacement; @@ -5075,6 +5089,7 @@ weechat_perl_api_init (pTHX) API_DEF_FUNC(string_has_highlight); API_DEF_FUNC(string_has_highlight_regex); API_DEF_FUNC(string_mask_to_regex); + API_DEF_FUNC(string_format_size); API_DEF_FUNC(string_remove_color); API_DEF_FUNC(string_is_command_char); API_DEF_FUNC(string_input_for_buffer); |