diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2014-01-11 09:12:04 +0100 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2014-01-11 09:12:04 +0100 |
commit | 48837c35bc24cbab1bd518e260b0173d0ae787e1 (patch) | |
tree | 86bb90cf5ff895e1083562d88d4a90d8ee556f2f /src/plugins/lua/weechat-lua-api.c | |
parent | e5b0b827ef230044eb039c9ce58f41515b03f0e0 (diff) | |
download | weechat-48837c35bc24cbab1bd518e260b0173d0ae787e1.zip |
api: add stdin options in functions hook_process_hashtable and hook_set (task #10847, task #13031)
The function hook_set has been added in script API.
Diffstat (limited to 'src/plugins/lua/weechat-lua-api.c')
-rw-r--r-- | src/plugins/lua/weechat-lua-api.c | 19 |
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 4c0009f44..d3e333de0 100644 --- a/src/plugins/lua/weechat-lua-api.c +++ b/src/plugins/lua/weechat-lua-api.c @@ -3202,6 +3202,24 @@ weechat_lua_api_hook_focus (lua_State *L) } static int +weechat_lua_api_hook_set (lua_State *L) +{ + const char *hook, *property, *value; + + API_FUNC(1, "hook_set", API_RETURN_ERROR); + if (lua_gettop (L) < 3) + API_WRONG_ARGS(API_RETURN_ERROR); + + hook = lua_tostring (L, -3); + property = lua_tostring (L, -2); + value = lua_tostring (L, -1); + + weechat_hook_set (API_STR2PTR(hook), property, value); + + API_RETURN_OK; +} + +static int weechat_lua_api_unhook (lua_State *L) { const char *hook; @@ -5210,6 +5228,7 @@ const struct luaL_Reg weechat_lua_api_funcs[] = { API_DEF_FUNC(hook_info_hashtable), API_DEF_FUNC(hook_infolist), API_DEF_FUNC(hook_focus), + API_DEF_FUNC(hook_set), API_DEF_FUNC(unhook), API_DEF_FUNC(unhook_all), API_DEF_FUNC(buffer_new), |