mirror of
https://github.com/weechat/weechat.git
synced 2026-06-30 14:56:39 +02:00
api: add new function hdata_search
This commit is contained in:
@@ -4711,6 +4711,30 @@ weechat_lua_api_hdata_move (lua_State *L)
|
||||
API_RETURN_STRING_FREE(result);
|
||||
}
|
||||
|
||||
static int
|
||||
weechat_lua_api_hdata_search (lua_State *L)
|
||||
{
|
||||
const char *hdata, *pointer, *search;
|
||||
char *result;
|
||||
int move;
|
||||
|
||||
API_FUNC(1, "hdata_search", API_RETURN_EMPTY);
|
||||
if (lua_gettop (lua_current_interpreter) < 4)
|
||||
API_WRONG_ARGS(API_RETURN_EMPTY);
|
||||
|
||||
hdata = lua_tostring (lua_current_interpreter, -4);
|
||||
pointer = lua_tostring (lua_current_interpreter, -3);
|
||||
search = lua_tostring (lua_current_interpreter, -2);
|
||||
move = lua_tonumber (lua_current_interpreter, -1);
|
||||
|
||||
result = API_PTR2STR(weechat_hdata_search (API_STR2PTR(hdata),
|
||||
API_STR2PTR(pointer),
|
||||
search,
|
||||
move));
|
||||
|
||||
API_RETURN_STRING_FREE(result);
|
||||
}
|
||||
|
||||
static int
|
||||
weechat_lua_api_hdata_char (lua_State *L)
|
||||
{
|
||||
@@ -5208,6 +5232,7 @@ const struct luaL_Reg weechat_lua_api_funcs[] = {
|
||||
API_DEF_FUNC(hdata_get_list),
|
||||
API_DEF_FUNC(hdata_check_pointer),
|
||||
API_DEF_FUNC(hdata_move),
|
||||
API_DEF_FUNC(hdata_search),
|
||||
API_DEF_FUNC(hdata_char),
|
||||
API_DEF_FUNC(hdata_integer),
|
||||
API_DEF_FUNC(hdata_long),
|
||||
|
||||
Reference in New Issue
Block a user