From b7d75cf45518cb497bf5450ad40eee9dc961c345 Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Sat, 24 Mar 2012 13:11:50 +0100 Subject: tcl: add missing function "hdata_char" in API --- src/plugins/scripts/tcl/weechat-tcl-api.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'src/plugins/scripts/tcl') diff --git a/src/plugins/scripts/tcl/weechat-tcl-api.c b/src/plugins/scripts/tcl/weechat-tcl-api.c index 941cc9785..682437932 100644 --- a/src/plugins/scripts/tcl/weechat-tcl-api.c +++ b/src/plugins/scripts/tcl/weechat-tcl-api.c @@ -5881,6 +5881,34 @@ weechat_tcl_api_hdata_move (ClientData clientData, Tcl_Interp *interp, API_RETURN_STRING_FREE(result); } +/* + * weechat_tcl_api_hdata_char: get char value of a variable in structure + * using hdata + */ + +static int +weechat_tcl_api_hdata_char (ClientData clientData, Tcl_Interp *interp, + int objc, Tcl_Obj *CONST objv[]) +{ + Tcl_Obj *objp; + char *hdata, *pointer, *name; + int result, i; + + API_FUNC(1, "hdata_char", API_RETURN_INT(0)); + if (objc < 4) + API_WRONG_ARGS(API_RETURN_INT(0)); + + hdata = Tcl_GetStringFromObj (objv[1], &i); + pointer = Tcl_GetStringFromObj (objv[2], &i); + name = Tcl_GetStringFromObj (objv[3], &i); + + result = (int)weechat_hdata_char (API_STR2PTR(hdata), + API_STR2PTR(pointer), + name); + + API_RETURN_INT(result); +} + /* * weechat_tcl_api_hdata_integer: get integer value of a variable in structure * using hdata @@ -6517,6 +6545,7 @@ void weechat_tcl_api_init (Tcl_Interp *interp) API_DEF_FUNC(hdata_get_list); API_DEF_FUNC(hdata_check_pointer); API_DEF_FUNC(hdata_move); + API_DEF_FUNC(hdata_char); API_DEF_FUNC(hdata_integer); API_DEF_FUNC(hdata_long); API_DEF_FUNC(hdata_string); -- cgit v1.2.3