summaryrefslogtreecommitdiff
path: root/src/plugins/lua
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2015-08-13 20:50:15 +0200
committerSébastien Helleu <flashcode@flashtux.org>2015-08-13 20:50:15 +0200
commit4716e81d4e0f94cfed9a3e2b4dc103bf4bf83459 (patch)
treed63fc8c81d11c442bcfcccff1cfac09bafa53d2f /src/plugins/lua
parent7033fdd0cbb5e066f5e5e9a1d6784196b5211fae (diff)
downloadweechat-4716e81d4e0f94cfed9a3e2b4dc103bf4bf83459.zip
api: add missing function infolist_search_var() in script API (issue #484)
Diffstat (limited to 'src/plugins/lua')
-rw-r--r--src/plugins/lua/weechat-lua-api.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/plugins/lua/weechat-lua-api.c b/src/plugins/lua/weechat-lua-api.c
index 55cc1771a..cfbe45f9c 100644
--- a/src/plugins/lua/weechat-lua-api.c
+++ b/src/plugins/lua/weechat-lua-api.c
@@ -4326,6 +4326,24 @@ API_FUNC(infolist_new_var_time)
API_RETURN_STRING_FREE(result);
}
+API_FUNC(infolist_search_var)
+{
+ const char *infolist, *name;
+ char *result;
+
+ API_INIT_FUNC(1, "infolist_search_var", API_RETURN_EMPTY);
+ if (lua_gettop (L) < 2)
+ API_WRONG_ARGS(API_RETURN_EMPTY);
+
+ infolist = lua_tostring (L, -2);
+ name = lua_tostring (L, -1);
+
+ result = API_PTR2STR(weechat_infolist_search_var (API_STR2PTR(infolist),
+ name));
+
+ API_RETURN_STRING_FREE(result);
+}
+
API_FUNC(infolist_get)
{
const char *name, *pointer, *arguments;
@@ -5152,6 +5170,7 @@ const struct luaL_Reg weechat_lua_api_funcs[] = {
API_DEF_FUNC(infolist_new_var_string),
API_DEF_FUNC(infolist_new_var_pointer),
API_DEF_FUNC(infolist_new_var_time),
+ API_DEF_FUNC(infolist_search_var),
API_DEF_FUNC(infolist_get),
API_DEF_FUNC(infolist_next),
API_DEF_FUNC(infolist_prev),