1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-10 11:43:13 +02:00

api: add missing function hook_completion_get_string() in script API (issue #484)

This commit is contained in:
Sébastien Helleu
2015-08-13 20:45:33 +02:00
parent 6b75516702
commit 7033fdd0cb
8 changed files with 137 additions and 0 deletions
+24
View File
@@ -3330,6 +3330,29 @@ weechat_ruby_api_hook_completion (VALUE class, VALUE completion,
API_RETURN_STRING_FREE(result);
}
static VALUE
weechat_ruby_api_hook_completion_get_string (VALUE class, VALUE completion,
VALUE property)
{
char *c_completion, *c_property;
const char *result;
API_INIT_FUNC(1, "hook_completion_get_string", API_RETURN_EMPTY);
if (NIL_P (completion) || NIL_P (property))
API_WRONG_ARGS(API_RETURN_EMPTY);
Check_Type (completion, T_STRING);
Check_Type (property, T_STRING);
c_completion = StringValuePtr (completion);
c_property = StringValuePtr (property);
result = weechat_hook_completion_get_string (API_STR2PTR(c_completion),
c_property);
API_RETURN_STRING(result);
}
static VALUE
weechat_ruby_api_hook_completion_list_add (VALUE class, VALUE completion,
VALUE word, VALUE nick_completion,
@@ -6131,6 +6154,7 @@ weechat_ruby_api_init (VALUE ruby_mWeechat)
API_DEF_FUNC(hook_hsignal_send, 2);
API_DEF_FUNC(hook_config, 3);
API_DEF_FUNC(hook_completion, 4);
API_DEF_FUNC(hook_completion_get_string, 2);
API_DEF_FUNC(hook_completion_list_add, 4);
API_DEF_FUNC(hook_modifier, 3);
API_DEF_FUNC(hook_modifier_exec, 3);