diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2024-02-26 07:33:12 +0100 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2024-03-12 20:37:11 +0100 |
commit | 9e0dd1815278e189b6fd84046fc78e883cf85704 (patch) | |
tree | a7d8c6ed636ca02227cd140889d2bcc45aa2676e /src/plugins/lua/weechat-lua-api.c | |
parent | c85b57b8b399b980c5d6725fc33bef83d9727bfb (diff) | |
download | weechat-9e0dd1815278e189b6fd84046fc78e883cf85704.zip |
api: add function "hdata_longlong" (issue #2081)
Diffstat (limited to 'src/plugins/lua/weechat-lua-api.c')
-rw-r--r-- | src/plugins/lua/weechat-lua-api.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/plugins/lua/weechat-lua-api.c b/src/plugins/lua/weechat-lua-api.c index fcc0f09a3..c13fdb38e 100644 --- a/src/plugins/lua/weechat-lua-api.c +++ b/src/plugins/lua/weechat-lua-api.c @@ -5475,6 +5475,26 @@ API_FUNC(hdata_long) API_RETURN_LONG(value); } +API_FUNC(hdata_longlong) +{ + const char *hdata, *pointer, *name; + long long value; + + API_INIT_FUNC(1, "hdata_longlong", API_RETURN_LONG(0)); + if (lua_gettop (L) < 3) + API_WRONG_ARGS(API_RETURN_LONG(0)); + + hdata = lua_tostring (L, -3); + pointer = lua_tostring (L, -2); + name = lua_tostring (L, -1); + + value = weechat_hdata_longlong (API_STR2PTR(hdata), + API_STR2PTR(pointer), + name); + + API_RETURN_LONG(value); +} + API_FUNC(hdata_string) { const char *hdata, *pointer, *name, *result; @@ -5951,6 +5971,7 @@ const struct luaL_Reg weechat_lua_api_funcs[] = { API_DEF_FUNC(hdata_char), API_DEF_FUNC(hdata_integer), API_DEF_FUNC(hdata_long), + API_DEF_FUNC(hdata_longlong), API_DEF_FUNC(hdata_string), API_DEF_FUNC(hdata_pointer), API_DEF_FUNC(hdata_time), |