1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-05 17:23:15 +02:00

api: add function string_color_code_size (issue #1547)

This commit is contained in:
Sébastien Helleu
2020-08-22 08:55:16 +02:00
parent 7dd5abd625
commit 268aa631c6
27 changed files with 608 additions and 1 deletions
+20
View File
@@ -448,6 +448,25 @@ weechat_ruby_api_string_format_size (VALUE class, VALUE size)
API_RETURN_STRING_FREE(result);
}
static VALUE
weechat_ruby_api_string_color_code_size (VALUE class, VALUE string)
{
char *c_string;
int size;
API_INIT_FUNC(1, "string_color_code_size", API_RETURN_INT(0));
if (NIL_P (string))
API_WRONG_ARGS(API_RETURN_INT(0));
Check_Type (string, T_STRING);
c_string = StringValuePtr (string);
size = weechat_string_color_code_size (c_string);
API_RETURN_INT(size);
}
static VALUE
weechat_ruby_api_string_remove_color (VALUE class, VALUE string,
VALUE replacement)
@@ -6424,6 +6443,7 @@ weechat_ruby_api_init (VALUE ruby_mWeechat)
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);