1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-08 10:43:13 +02:00

scripts: add functions config_enum and config_enum_default in scripting API (issue #1973)

This commit is contained in:
Sébastien Helleu
2023-09-09 08:54:33 +02:00
parent 9fada89f96
commit d9555cc567
14 changed files with 280 additions and 2 deletions
+30
View File
@@ -1659,6 +1659,34 @@ weechat_guile_api_config_color_default (SCM option)
API_RETURN_STRING(result);
}
SCM
weechat_guile_api_config_enum (SCM option)
{
int value;
API_INIT_FUNC(1, "config_enum", API_RETURN_INT(0));
if (!scm_is_string (option))
API_WRONG_ARGS(API_RETURN_INT(0));
value = weechat_config_enum (API_STR2PTR(API_SCM_TO_STRING(option)));
API_RETURN_INT(value);
}
SCM
weechat_guile_api_config_enum_default (SCM option)
{
int value;
API_INIT_FUNC(1, "config_enum_default", API_RETURN_INT(0));
if (!scm_is_string (option))
API_WRONG_ARGS(API_RETURN_INT(0));
value = weechat_config_enum_default (API_STR2PTR(API_SCM_TO_STRING(option)));
API_RETURN_INT(value);
}
SCM
weechat_guile_api_config_write_option (SCM config_file, SCM option)
{
@@ -5227,6 +5255,8 @@ weechat_guile_api_module_init (void *data)
API_DEF_FUNC(config_string_default, 1);
API_DEF_FUNC(config_color, 1);
API_DEF_FUNC(config_color_default, 1);
API_DEF_FUNC(config_enum, 1);
API_DEF_FUNC(config_enum_default, 1);
API_DEF_FUNC(config_write_option, 2);
API_DEF_FUNC(config_write_line, 3);
API_DEF_FUNC(config_write, 1);