1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-24 20:06:38 +02:00

api: add functions config_{boolean|integer|string|color|enum}_inherited in scripting API

This commit is contained in:
Sébastien Helleu
2024-03-04 18:42:41 +01:00
parent 8f0b3ab9c7
commit 361d55d9d7
33 changed files with 2328 additions and 24 deletions
+75
View File
@@ -1514,6 +1514,20 @@ API_FUNC(config_boolean_default)
API_RETURN_INT(value);
}
API_FUNC(config_boolean_inherited)
{
int value;
API_INIT_FUNC(1, "config_boolean_inherited", "s", API_RETURN_INT(0));
v8::String::Utf8Value option(args[0]);
value = weechat_config_boolean_inherited (
(struct t_config_option *)API_STR2PTR(*option));
API_RETURN_INT(value);
}
API_FUNC(config_integer)
{
int value;
@@ -1542,6 +1556,20 @@ API_FUNC(config_integer_default)
API_RETURN_INT(value);
}
API_FUNC(config_integer_inherited)
{
int value;
API_INIT_FUNC(1, "config_integer_inherited", "s", API_RETURN_INT(0));
v8::String::Utf8Value option(args[0]);
value = weechat_config_integer_inherited (
(struct t_config_option *)API_STR2PTR(*option));
API_RETURN_INT(value);
}
API_FUNC(config_string)
{
const char *result;
@@ -1570,6 +1598,20 @@ API_FUNC(config_string_default)
API_RETURN_STRING(result);
}
API_FUNC(config_string_inherited)
{
const char *result;
API_INIT_FUNC(1, "config_string_inherited", "s", API_RETURN_EMPTY);
v8::String::Utf8Value option(args[0]);
result = weechat_config_string_inherited (
(struct t_config_option *)API_STR2PTR(*option));
API_RETURN_STRING(result);
}
API_FUNC(config_color)
{
const char *result;
@@ -1598,6 +1640,20 @@ API_FUNC(config_color_default)
API_RETURN_STRING(result);
}
API_FUNC(config_color_inherited)
{
const char *result;
API_INIT_FUNC(1, "config_color_inherited", "s", API_RETURN_EMPTY);
v8::String::Utf8Value option(args[0]);
result = weechat_config_color_inherited (
(struct t_config_option *)API_STR2PTR(*option));
API_RETURN_STRING(result);
}
API_FUNC(config_enum)
{
int value;
@@ -1626,6 +1682,20 @@ API_FUNC(config_enum_default)
API_RETURN_INT(value);
}
API_FUNC(config_enum_inherited)
{
int value;
API_INIT_FUNC(1, "config_enum_inherited", "s", API_RETURN_INT(0));
v8::String::Utf8Value option(args[0]);
value = weechat_config_enum_inherited (
(struct t_config_option *)API_STR2PTR(*option));
API_RETURN_INT(value);
}
API_FUNC(config_write_option)
{
API_INIT_FUNC(1, "config_write_option", "ss", API_RETURN_ERROR);
@@ -5358,14 +5428,19 @@ WeechatJsV8::loadLibs()
API_DEF_FUNC(config_option_default_is_null);
API_DEF_FUNC(config_boolean);
API_DEF_FUNC(config_boolean_default);
API_DEF_FUNC(config_boolean_inherited);
API_DEF_FUNC(config_integer);
API_DEF_FUNC(config_integer_default);
API_DEF_FUNC(config_integer_inherited);
API_DEF_FUNC(config_string);
API_DEF_FUNC(config_string_default);
API_DEF_FUNC(config_string_inherited);
API_DEF_FUNC(config_color);
API_DEF_FUNC(config_color_default);
API_DEF_FUNC(config_color_inherited);
API_DEF_FUNC(config_enum);
API_DEF_FUNC(config_enum_default);
API_DEF_FUNC(config_enum_inherited);
API_DEF_FUNC(config_write_option);
API_DEF_FUNC(config_write_line);
API_DEF_FUNC(config_write);