diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2013-04-21 11:26:52 +0200 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2013-04-21 11:26:52 +0200 |
commit | 509a58b1d54420c62b1d9069e91512983f7ca44a (patch) | |
tree | 892345b0e8787e2fe8f1d6c45e81ef6079942b78 /src/plugins/ruby | |
parent | fcd71d14bc23a908f33224f1de91ab740dd40ff0 (diff) | |
download | weechat-509a58b1d54420c62b1d9069e91512983f7ca44a.zip |
api: add new function hdata_search
Diffstat (limited to 'src/plugins/ruby')
-rw-r--r-- | src/plugins/ruby/weechat-ruby-api.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/plugins/ruby/weechat-ruby-api.c b/src/plugins/ruby/weechat-ruby-api.c index aaefeaaf1..9888e5a93 100644 --- a/src/plugins/ruby/weechat-ruby-api.c +++ b/src/plugins/ruby/weechat-ruby-api.c @@ -5445,6 +5445,36 @@ weechat_ruby_api_hdata_move (VALUE class, VALUE hdata, VALUE pointer, } static VALUE +weechat_ruby_api_hdata_search (VALUE class, VALUE hdata, VALUE pointer, + VALUE search, VALUE move) +{ + char *c_hdata, *c_pointer, *c_search, *result; + int c_move; + VALUE return_value; + + API_FUNC(1, "hdata_search", API_RETURN_EMPTY); + if (NIL_P (hdata) || NIL_P (pointer) || NIL_P (search) || NIL_P (move)) + API_WRONG_ARGS(API_RETURN_EMPTY); + + Check_Type (hdata, T_STRING); + Check_Type (pointer, T_STRING); + Check_Type (search, T_STRING); + Check_Type (move, T_FIXNUM); + + c_hdata = StringValuePtr (hdata); + c_pointer = StringValuePtr (pointer); + c_search = StringValuePtr (search); + c_move = FIX2INT (move); + + result = API_PTR2STR(weechat_hdata_search (API_STR2PTR(c_hdata), + API_STR2PTR(c_pointer), + c_search, + c_move)); + + API_RETURN_STRING_FREE(result); +} + +static VALUE weechat_ruby_api_hdata_char (VALUE class, VALUE hdata, VALUE pointer, VALUE name) { @@ -6053,6 +6083,7 @@ weechat_ruby_api_init (VALUE ruby_mWeechat) API_DEF_FUNC(hdata_get_list, 2); API_DEF_FUNC(hdata_check_pointer, 3); API_DEF_FUNC(hdata_move, 3); + API_DEF_FUNC(hdata_search, 4); API_DEF_FUNC(hdata_char, 3); API_DEF_FUNC(hdata_integer, 3); API_DEF_FUNC(hdata_long, 3); |