summaryrefslogtreecommitdiff
path: root/src/plugins/lua
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2017-05-30 20:26:19 +0200
committerSébastien Helleu <flashcode@flashtux.org>2017-05-30 20:29:17 +0200
commit7621939a7a40a0e535b5b2ef67c2cb60e12208e3 (patch)
treee6a62315f4dd7addb5fd93d912242da0d2360a8a /src/plugins/lua
parentf6a8c28d2dcf4d4ed6f87e7e94574b331455b40a (diff)
downloadweechat-7621939a7a40a0e535b5b2ef67c2cb60e12208e3.zip
api: add function hdata_compare
Diffstat (limited to 'src/plugins/lua')
-rw-r--r--src/plugins/lua/weechat-lua-api.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/plugins/lua/weechat-lua-api.c b/src/plugins/lua/weechat-lua-api.c
index 372f01905..c09f09676 100644
--- a/src/plugins/lua/weechat-lua-api.c
+++ b/src/plugins/lua/weechat-lua-api.c
@@ -4933,6 +4933,30 @@ API_FUNC(hdata_hashtable)
return 1;
}
+API_FUNC(hdata_compare)
+{
+ const char *hdata, *pointer1, *pointer2, *name;
+ int case_sensitive, rc;
+
+ API_INIT_FUNC(1, "hdata_compare", API_RETURN_INT(0));
+ if (lua_gettop (L) < 5)
+ API_WRONG_ARGS(API_RETURN_INT(0));
+
+ hdata = lua_tostring (L, -5);
+ pointer1 = lua_tostring (L, -4);
+ pointer2 = lua_tostring (L, -3);
+ name = lua_tostring (L, -2);
+ case_sensitive = lua_tonumber (L, -1);
+
+ rc = weechat_hdata_compare (API_STR2PTR(hdata),
+ API_STR2PTR(pointer1),
+ API_STR2PTR(pointer2),
+ name,
+ case_sensitive);
+
+ API_RETURN_INT(rc);
+}
+
API_FUNC(hdata_update)
{
const char *hdata, *pointer;
@@ -5289,6 +5313,7 @@ const struct luaL_Reg weechat_lua_api_funcs[] = {
API_DEF_FUNC(hdata_pointer),
API_DEF_FUNC(hdata_time),
API_DEF_FUNC(hdata_hashtable),
+ API_DEF_FUNC(hdata_compare),
API_DEF_FUNC(hdata_update),
API_DEF_FUNC(hdata_get_string),
API_DEF_FUNC(upgrade_new),