diff options
Diffstat (limited to 'src/plugins/scripts/guile')
-rw-r--r-- | src/plugins/scripts/guile/weechat-guile-api.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/plugins/scripts/guile/weechat-guile-api.c b/src/plugins/scripts/guile/weechat-guile-api.c index b0211c143..7467dec7b 100644 --- a/src/plugins/scripts/guile/weechat-guile-api.c +++ b/src/plugins/scripts/guile/weechat-guile-api.c @@ -4856,6 +4856,28 @@ weechat_guile_api_hdata_move (SCM hdata, SCM pointer, SCM count) } /* + * weechat_guile_api_hdata_char: get char value of a variable in structure + * using hdata + */ + +SCM +weechat_guile_api_hdata_char (SCM hdata, SCM pointer, SCM name) +{ + int value; + + API_FUNC(1, "hdata_char", API_RETURN_INT(0)); + if (!scm_is_string (hdata) || !scm_is_string (pointer) + || !scm_is_string (name)) + API_WRONG_ARGS(API_RETURN_INT(0)); + + value = (int)weechat_hdata_char (script_str2ptr (scm_i_string_chars (hdata)), + script_str2ptr (scm_i_string_chars (pointer)), + scm_i_string_chars (name)); + + API_RETURN_INT(value); +} + +/* * weechat_guile_api_hdata_integer: get integer value of a variable in structure * using hdata */ @@ -5312,6 +5334,7 @@ weechat_guile_api_module_init (void *data) scm_c_define_gsubr ("weechat:hdata_get_var_hdata", 2, 0, 0, &weechat_guile_api_hdata_get_var_hdata); scm_c_define_gsubr ("weechat:hdata_get_list", 2, 0, 0, &weechat_guile_api_hdata_get_list); scm_c_define_gsubr ("weechat:hdata_move", 3, 0, 0, &weechat_guile_api_hdata_move); + scm_c_define_gsubr ("weechat:hdata_char", 3, 0, 0, &weechat_guile_api_hdata_char); scm_c_define_gsubr ("weechat:hdata_integer", 3, 0, 0, &weechat_guile_api_hdata_integer); scm_c_define_gsubr ("weechat:hdata_long", 3, 0, 0, &weechat_guile_api_hdata_long); scm_c_define_gsubr ("weechat:hdata_string", 3, 0, 0, &weechat_guile_api_hdata_string); |