summaryrefslogtreecommitdiff
path: root/src/plugins/tcl
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2014-01-11 09:12:04 +0100
committerSebastien Helleu <flashcode@flashtux.org>2014-01-11 09:12:04 +0100
commit48837c35bc24cbab1bd518e260b0173d0ae787e1 (patch)
tree86bb90cf5ff895e1083562d88d4a90d8ee556f2f /src/plugins/tcl
parente5b0b827ef230044eb039c9ce58f41515b03f0e0 (diff)
downloadweechat-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/tcl')
-rw-r--r--src/plugins/tcl/weechat-tcl-api.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/plugins/tcl/weechat-tcl-api.c b/src/plugins/tcl/weechat-tcl-api.c
index 0730cac48..bcaecb999 100644
--- a/src/plugins/tcl/weechat-tcl-api.c
+++ b/src/plugins/tcl/weechat-tcl-api.c
@@ -3505,6 +3505,27 @@ weechat_tcl_api_hook_focus (ClientData clientData, Tcl_Interp *interp,
}
static int
+weechat_tcl_api_hook_set (ClientData clientData, Tcl_Interp *interp,
+ int objc, Tcl_Obj *CONST objv[])
+{
+ Tcl_Obj *objp;
+ char *hook, *property, *value;
+ int i;
+
+ API_FUNC(1, "hook_set", API_RETURN_ERROR);
+ if (objc < 4)
+ API_WRONG_ARGS(API_RETURN_ERROR);
+
+ hook = Tcl_GetStringFromObj (objv[1], &i);
+ property = Tcl_GetStringFromObj (objv[2], &i);
+ value = Tcl_GetStringFromObj (objv[3], &i);
+
+ weechat_hook_set (API_STR2PTR(hook), property, value);
+
+ API_RETURN_OK;
+}
+
+static int
weechat_tcl_api_unhook (ClientData clientData, Tcl_Interp *interp,
int objc, Tcl_Obj *CONST objv[])
{
@@ -5809,6 +5830,7 @@ void weechat_tcl_api_init (Tcl_Interp *interp)
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);