summaryrefslogtreecommitdiff
path: root/src/plugins/ruby/weechat-ruby-api.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/ruby/weechat-ruby-api.c')
-rw-r--r--src/plugins/ruby/weechat-ruby-api.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/plugins/ruby/weechat-ruby-api.c b/src/plugins/ruby/weechat-ruby-api.c
index 80acd781d..a1a8edf05 100644
--- a/src/plugins/ruby/weechat-ruby-api.c
+++ b/src/plugins/ruby/weechat-ruby-api.c
@@ -449,6 +449,25 @@ weechat_ruby_api_string_format_size (VALUE class, VALUE size)
}
static VALUE
+weechat_ruby_api_string_parse_size (VALUE class, VALUE size)
+{
+ char *c_size;
+ unsigned long long value;
+
+ API_INIT_FUNC(1, "string_parse_size", API_RETURN_LONG(0));
+ if (NIL_P (size))
+ API_WRONG_ARGS(API_RETURN_LONG(0));
+
+ Check_Type (size, T_STRING);
+
+ c_size = StringValuePtr (size);
+
+ value = weechat_string_parse_size (c_size);
+
+ API_RETURN_LONG(value);
+}
+
+static VALUE
weechat_ruby_api_string_color_code_size (VALUE class, VALUE string)
{
char *c_string;
@@ -6562,6 +6581,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_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);