1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-30 06:46: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
+77
View File
@@ -1606,6 +1606,20 @@ weechat_guile_api_config_boolean_default (SCM option)
API_RETURN_INT(value);
}
SCM
weechat_guile_api_config_boolean_inherited (SCM option)
{
int value;
API_INIT_FUNC(1, "config_boolean_inherited", API_RETURN_INT(0));
if (!scm_is_string (option))
API_WRONG_ARGS(API_RETURN_INT(0));
value = weechat_config_boolean_inherited (API_STR2PTR(API_SCM_TO_STRING(option)));
API_RETURN_INT(value);
}
SCM
weechat_guile_api_config_integer (SCM option)
{
@@ -1634,6 +1648,20 @@ weechat_guile_api_config_integer_default (SCM option)
API_RETURN_INT(value);
}
SCM
weechat_guile_api_config_integer_inherited (SCM option)
{
int value;
API_INIT_FUNC(1, "config_integer_inherited", API_RETURN_INT(0));
if (!scm_is_string (option))
API_WRONG_ARGS(API_RETURN_INT(0));
value = weechat_config_integer_inherited (API_STR2PTR(API_SCM_TO_STRING(option)));
API_RETURN_INT(value);
}
SCM
weechat_guile_api_config_string (SCM option)
{
@@ -1664,6 +1692,21 @@ weechat_guile_api_config_string_default (SCM option)
API_RETURN_STRING(result);
}
SCM
weechat_guile_api_config_string_inherited (SCM option)
{
const char *result;
SCM return_value;
API_INIT_FUNC(1, "config_string_inherited", API_RETURN_EMPTY);
if (!scm_is_string (option))
API_WRONG_ARGS(API_RETURN_EMPTY);
result = weechat_config_string_inherited (API_STR2PTR(API_SCM_TO_STRING(option)));
API_RETURN_STRING(result);
}
SCM
weechat_guile_api_config_color (SCM option)
{
@@ -1694,6 +1737,21 @@ weechat_guile_api_config_color_default (SCM option)
API_RETURN_STRING(result);
}
SCM
weechat_guile_api_config_color_inherited (SCM option)
{
const char *result;
SCM return_value;
API_INIT_FUNC(1, "config_color_inherited", API_RETURN_EMPTY);
if (!scm_is_string (option))
API_WRONG_ARGS(API_RETURN_EMPTY);
result = weechat_config_color_inherited (API_STR2PTR(API_SCM_TO_STRING(option)));
API_RETURN_STRING(result);
}
SCM
weechat_guile_api_config_enum (SCM option)
{
@@ -1722,6 +1780,20 @@ weechat_guile_api_config_enum_default (SCM option)
API_RETURN_INT(value);
}
SCM
weechat_guile_api_config_enum_inherited (SCM option)
{
int value;
API_INIT_FUNC(1, "config_enum_inherited", API_RETURN_INT(0));
if (!scm_is_string (option))
API_WRONG_ARGS(API_RETURN_INT(0));
value = weechat_config_enum_inherited (API_STR2PTR(API_SCM_TO_STRING(option)));
API_RETURN_INT(value);
}
SCM
weechat_guile_api_config_write_option (SCM config_file, SCM option)
{
@@ -5407,14 +5479,19 @@ weechat_guile_api_module_init (void *data)
API_DEF_FUNC(config_option_default_is_null, 1);
API_DEF_FUNC(config_boolean, 1);
API_DEF_FUNC(config_boolean_default, 1);
API_DEF_FUNC(config_boolean_inherited, 1);
API_DEF_FUNC(config_integer, 1);
API_DEF_FUNC(config_integer_default, 1);
API_DEF_FUNC(config_integer_inherited, 1);
API_DEF_FUNC(config_string, 1);
API_DEF_FUNC(config_string_default, 1);
API_DEF_FUNC(config_string_inherited, 1);
API_DEF_FUNC(config_color, 1);
API_DEF_FUNC(config_color_default, 1);
API_DEF_FUNC(config_color_inherited, 1);
API_DEF_FUNC(config_enum, 1);
API_DEF_FUNC(config_enum_default, 1);
API_DEF_FUNC(config_enum_inherited, 1);
API_DEF_FUNC(config_write_option, 2);
API_DEF_FUNC(config_write_line, 3);
API_DEF_FUNC(config_write, 1);
+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);
+83
View File
@@ -1651,6 +1651,22 @@ API_FUNC(config_boolean_default)
API_RETURN_INT(value);
}
API_FUNC(config_boolean_inherited)
{
const char *option;
int value;
API_INIT_FUNC(1, "config_boolean_inherited", API_RETURN_INT(0));
if (lua_gettop (L) < 1)
API_WRONG_ARGS(API_RETURN_INT(0));
option = lua_tostring (L, -1);
value = weechat_config_boolean_inherited (API_STR2PTR(option));
API_RETURN_INT(value);
}
API_FUNC(config_integer)
{
const char *option;
@@ -1683,6 +1699,22 @@ API_FUNC(config_integer_default)
API_RETURN_INT(value);
}
API_FUNC(config_integer_inherited)
{
const char *option;
int value;
API_INIT_FUNC(1, "config_integer_inherited", API_RETURN_INT(0));
if (lua_gettop (L) < 1)
API_WRONG_ARGS(API_RETURN_INT(0));
option = lua_tostring (L, -1);
value = weechat_config_integer_inherited (API_STR2PTR(option));
API_RETURN_INT(value);
}
API_FUNC(config_string)
{
const char *option, *result;
@@ -1713,6 +1745,21 @@ API_FUNC(config_string_default)
API_RETURN_STRING(result);
}
API_FUNC(config_string_inherited)
{
const char *option, *result;
API_INIT_FUNC(1, "config_string_inherited", API_RETURN_EMPTY);
if (lua_gettop (L) < 1)
API_WRONG_ARGS(API_RETURN_EMPTY);
option = lua_tostring (L, -1);
result = weechat_config_string_inherited (API_STR2PTR(option));
API_RETURN_STRING(result);
}
API_FUNC(config_color)
{
const char *option, *result;
@@ -1743,6 +1790,21 @@ API_FUNC(config_color_default)
API_RETURN_STRING(result);
}
API_FUNC(config_color_inherited)
{
const char *option, *result;
API_INIT_FUNC(1, "config_color_inherited", API_RETURN_EMPTY);
if (lua_gettop (L) < 1)
API_WRONG_ARGS(API_RETURN_EMPTY);
option = lua_tostring (L, -1);
result = weechat_config_color_inherited (API_STR2PTR(option));
API_RETURN_STRING(result);
}
API_FUNC(config_enum)
{
const char *option;
@@ -1775,6 +1837,22 @@ API_FUNC(config_enum_default)
API_RETURN_INT(value);
}
API_FUNC(config_enum_inherited)
{
const char *option;
int value;
API_INIT_FUNC(1, "config_enum_inherited", API_RETURN_INT(0));
if (lua_gettop (L) < 1)
API_WRONG_ARGS(API_RETURN_INT(0));
option = lua_tostring (L, -1);
value = weechat_config_enum_inherited (API_STR2PTR(option));
API_RETURN_INT(value);
}
API_FUNC(config_write_option)
{
const char *config_file, *option;
@@ -5727,14 +5805,19 @@ const struct luaL_Reg weechat_lua_api_funcs[] = {
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),
+75
View File
@@ -1584,6 +1584,20 @@ API_FUNC(config_boolean_default)
API_RETURN_INT(value);
}
API_FUNC(config_boolean_inherited)
{
int value;
dXSARGS;
API_INIT_FUNC(1, "config_boolean_inherited", API_RETURN_INT(0));
if (items < 1)
API_WRONG_ARGS(API_RETURN_INT(0));
value = weechat_config_boolean_inherited (API_STR2PTR(SvPV_nolen (ST (0)))); /* option */
API_RETURN_INT(value);
}
API_FUNC(config_integer)
{
int value;
@@ -1612,6 +1626,20 @@ API_FUNC(config_integer_default)
API_RETURN_INT(value);
}
API_FUNC(config_integer_inherited)
{
int value;
dXSARGS;
API_INIT_FUNC(1, "config_integer_inherited", API_RETURN_INT(0));
if (items < 1)
API_WRONG_ARGS(API_RETURN_INT(0));
value = weechat_config_integer_inherited (API_STR2PTR(SvPV_nolen (ST (0)))); /* option */
API_RETURN_INT(value);
}
API_FUNC(config_string)
{
const char *result;
@@ -1640,6 +1668,20 @@ API_FUNC(config_string_default)
API_RETURN_STRING(result);
}
API_FUNC(config_string_inherited)
{
const char *result;
dXSARGS;
API_INIT_FUNC(1, "config_string_inherited", API_RETURN_EMPTY);
if (items < 1)
API_WRONG_ARGS(API_RETURN_EMPTY);
result = weechat_config_string_inherited (API_STR2PTR(SvPV_nolen (ST (0)))); /* option */
API_RETURN_STRING(result);
}
API_FUNC(config_color)
{
const char *result;
@@ -1668,6 +1710,20 @@ API_FUNC(config_color_default)
API_RETURN_STRING(result);
}
API_FUNC(config_color_inherited)
{
const char *result;
dXSARGS;
API_INIT_FUNC(1, "config_color_inherited", API_RETURN_EMPTY);
if (items < 1)
API_WRONG_ARGS(API_RETURN_EMPTY);
result = weechat_config_color_inherited (API_STR2PTR(SvPV_nolen (ST (0)))); /* option */
API_RETURN_STRING(result);
}
API_FUNC(config_enum)
{
int value;
@@ -1696,6 +1752,20 @@ API_FUNC(config_enum_default)
API_RETURN_INT(value);
}
API_FUNC(config_enum_inherited)
{
int value;
dXSARGS;
API_INIT_FUNC(1, "config_enum_inherited", API_RETURN_INT(0));
if (items < 1)
API_WRONG_ARGS(API_RETURN_INT(0));
value = weechat_config_enum_inherited (API_STR2PTR(SvPV_nolen (ST (0)))); /* option */
API_RETURN_INT(value);
}
API_FUNC(config_write_option)
{
char *config_file, *option;
@@ -5666,14 +5736,19 @@ weechat_perl_api_init (pTHX)
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);
+85
View File
@@ -1679,6 +1679,23 @@ API_FUNC(config_boolean_default)
API_RETURN_INT(result);
}
API_FUNC(config_boolean_inherited)
{
zend_string *z_option;
struct t_config_option *option;
int result;
API_INIT_FUNC(1, "config_boolean_inherited", API_RETURN_INT(0));
if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_option) == FAILURE)
API_WRONG_ARGS(API_RETURN_INT(0));
option = (struct t_config_option *)API_STR2PTR(ZSTR_VAL(z_option));
result = weechat_config_boolean_inherited (option);
API_RETURN_INT(result);
}
API_FUNC(config_integer)
{
zend_string *z_option;
@@ -1713,6 +1730,23 @@ API_FUNC(config_integer_default)
API_RETURN_INT(result);
}
API_FUNC(config_integer_inherited)
{
zend_string *z_option;
struct t_config_option *option;
int result;
API_INIT_FUNC(1, "config_integer_inherited", API_RETURN_INT(0));
if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_option) == FAILURE)
API_WRONG_ARGS(API_RETURN_INT(0));
option = (struct t_config_option *)API_STR2PTR(ZSTR_VAL(z_option));
result = weechat_config_integer_inherited (option);
API_RETURN_INT(result);
}
API_FUNC(config_string)
{
zend_string *z_option;
@@ -1747,6 +1781,23 @@ API_FUNC(config_string_default)
API_RETURN_STRING(result);
}
API_FUNC(config_string_inherited)
{
zend_string *z_option;
struct t_config_option *option;
const char *result;
API_INIT_FUNC(1, "config_string_inherited", API_RETURN_EMPTY);
if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_option) == FAILURE)
API_WRONG_ARGS(API_RETURN_EMPTY);
option = (struct t_config_option *)API_STR2PTR(ZSTR_VAL(z_option));
result = weechat_config_string_inherited (option);
API_RETURN_STRING(result);
}
API_FUNC(config_color)
{
zend_string *z_option;
@@ -1781,6 +1832,23 @@ API_FUNC(config_color_default)
API_RETURN_STRING(result);
}
API_FUNC(config_color_inherited)
{
zend_string *z_option;
struct t_config_option *option;
const char *result;
API_INIT_FUNC(1, "config_color_inherited", API_RETURN_EMPTY);
if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_option) == FAILURE)
API_WRONG_ARGS(API_RETURN_EMPTY);
option = (struct t_config_option *)API_STR2PTR(ZSTR_VAL(z_option));
result = weechat_config_color_inherited (option);
API_RETURN_STRING(result);
}
API_FUNC(config_enum)
{
zend_string *z_option;
@@ -1815,6 +1883,23 @@ API_FUNC(config_enum_default)
API_RETURN_INT(result);
}
API_FUNC(config_enum_inherited)
{
zend_string *z_option;
struct t_config_option *option;
int result;
API_INIT_FUNC(1, "config_enum_inherited", API_RETURN_INT(0));
if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_option) == FAILURE)
API_WRONG_ARGS(API_RETURN_INT(0));
option = (struct t_config_option *)API_STR2PTR(ZSTR_VAL(z_option));
result = weechat_config_enum_inherited (option);
API_RETURN_INT(result);
}
API_FUNC(config_write_option)
{
zend_string *z_config_file, *z_option;
+5
View File
@@ -102,14 +102,19 @@ PHP_FUNCTION(weechat_config_option_is_null);
PHP_FUNCTION(weechat_config_option_default_is_null);
PHP_FUNCTION(weechat_config_boolean);
PHP_FUNCTION(weechat_config_boolean_default);
PHP_FUNCTION(weechat_config_boolean_inherited);
PHP_FUNCTION(weechat_config_integer);
PHP_FUNCTION(weechat_config_integer_default);
PHP_FUNCTION(weechat_config_integer_inherited);
PHP_FUNCTION(weechat_config_string);
PHP_FUNCTION(weechat_config_string_default);
PHP_FUNCTION(weechat_config_string_inherited);
PHP_FUNCTION(weechat_config_color);
PHP_FUNCTION(weechat_config_color_default);
PHP_FUNCTION(weechat_config_color_inherited);
PHP_FUNCTION(weechat_config_enum);
PHP_FUNCTION(weechat_config_enum_default);
PHP_FUNCTION(weechat_config_enum_inherited);
PHP_FUNCTION(weechat_config_write_option);
PHP_FUNCTION(weechat_config_write_line);
PHP_FUNCTION(weechat_config_write);
+5
View File
@@ -160,14 +160,19 @@ const zend_function_entry weechat_functions[] = {
PHP_FE(weechat_config_option_default_is_null, arginfo_weechat_config_option_default_is_null)
PHP_FE(weechat_config_boolean, arginfo_weechat_config_boolean)
PHP_FE(weechat_config_boolean_default, arginfo_weechat_config_boolean_default)
PHP_FE(weechat_config_boolean_inherited, arginfo_weechat_config_boolean_inherited)
PHP_FE(weechat_config_integer, arginfo_weechat_config_integer)
PHP_FE(weechat_config_integer_default, arginfo_weechat_config_integer_default)
PHP_FE(weechat_config_integer_inherited, arginfo_weechat_config_integer_inherited)
PHP_FE(weechat_config_string, arginfo_weechat_config_string)
PHP_FE(weechat_config_string_default, arginfo_weechat_config_string_default)
PHP_FE(weechat_config_string_inherited, arginfo_weechat_config_string_inherited)
PHP_FE(weechat_config_color, arginfo_weechat_config_color)
PHP_FE(weechat_config_color_default, arginfo_weechat_config_color_default)
PHP_FE(weechat_config_color_inherited, arginfo_weechat_config_color_inherited)
PHP_FE(weechat_config_enum, arginfo_weechat_config_enum)
PHP_FE(weechat_config_enum_default, arginfo_weechat_config_enum_default)
PHP_FE(weechat_config_enum_inherited, arginfo_weechat_config_enum_inherited)
PHP_FE(weechat_config_write_option, arginfo_weechat_config_write_option)
PHP_FE(weechat_config_write_line, arginfo_weechat_config_write_line)
PHP_FE(weechat_config_write, arginfo_weechat_config_write)
+5
View File
@@ -68,14 +68,19 @@ function weechat_config_option_is_null(string $p0): int {}
function weechat_config_option_default_is_null(string $p0): int {}
function weechat_config_boolean(string $p0): int {}
function weechat_config_boolean_default(string $p0): int {}
function weechat_config_boolean_inherited(string $p0): int {}
function weechat_config_integer(string $p0): int {}
function weechat_config_integer_default(string $p0): int {}
function weechat_config_integer_inherited(string $p0): int {}
function weechat_config_string(string $p0): string {}
function weechat_config_string_default(string $p0): string {}
function weechat_config_string_inherited(string $p0): string {}
function weechat_config_color(string $p0): string {}
function weechat_config_color_default(string $p0): string {}
function weechat_config_color_inherited(string $p0): string {}
function weechat_config_enum(string $p0): int {}
function weechat_config_enum_default(string $p0): int {}
function weechat_config_enum_inherited(string $p0): int {}
function weechat_config_write_option(string $p0, string $p1): int {}
function weechat_config_write_line(string $p0, string $p1, string $p2): int {}
function weechat_config_write(string $p0): int {}
+11 -1
View File
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: 2c52caa5a78009856a6e6ced63555d1b1e2be0fe */
* Stub hash: 59292da89eab98ef1f615c173d9722b9fdafad80 */
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_weechat_register, 0, 7, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, p0, IS_STRING, 0)
@@ -173,22 +173,32 @@ ZEND_END_ARG_INFO()
#define arginfo_weechat_config_boolean_default arginfo_weechat_charset_set
#define arginfo_weechat_config_boolean_inherited arginfo_weechat_charset_set
#define arginfo_weechat_config_integer arginfo_weechat_charset_set
#define arginfo_weechat_config_integer_default arginfo_weechat_charset_set
#define arginfo_weechat_config_integer_inherited arginfo_weechat_charset_set
#define arginfo_weechat_config_string arginfo_weechat_plugin_get_name
#define arginfo_weechat_config_string_default arginfo_weechat_plugin_get_name
#define arginfo_weechat_config_string_inherited arginfo_weechat_plugin_get_name
#define arginfo_weechat_config_color arginfo_weechat_plugin_get_name
#define arginfo_weechat_config_color_default arginfo_weechat_plugin_get_name
#define arginfo_weechat_config_color_inherited arginfo_weechat_plugin_get_name
#define arginfo_weechat_config_enum arginfo_weechat_charset_set
#define arginfo_weechat_config_enum_default arginfo_weechat_charset_set
#define arginfo_weechat_config_enum_inherited arginfo_weechat_charset_set
#define arginfo_weechat_config_write_option arginfo_weechat_string_has_highlight
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_weechat_config_write_line, 0, 3, IS_LONG, 0)
+11 -1
View File
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: 2c52caa5a78009856a6e6ced63555d1b1e2be0fe */
* Stub hash: 59292da89eab98ef1f615c173d9722b9fdafad80 */
ZEND_BEGIN_ARG_INFO_EX(arginfo_weechat_register, 0, 0, 7)
ZEND_ARG_INFO(0, p0)
@@ -138,22 +138,32 @@ ZEND_END_ARG_INFO()
#define arginfo_weechat_config_boolean_default arginfo_weechat_plugin_get_name
#define arginfo_weechat_config_boolean_inherited arginfo_weechat_plugin_get_name
#define arginfo_weechat_config_integer arginfo_weechat_plugin_get_name
#define arginfo_weechat_config_integer_default arginfo_weechat_plugin_get_name
#define arginfo_weechat_config_integer_inherited arginfo_weechat_plugin_get_name
#define arginfo_weechat_config_string arginfo_weechat_plugin_get_name
#define arginfo_weechat_config_string_default arginfo_weechat_plugin_get_name
#define arginfo_weechat_config_string_inherited arginfo_weechat_plugin_get_name
#define arginfo_weechat_config_color arginfo_weechat_plugin_get_name
#define arginfo_weechat_config_color_default arginfo_weechat_plugin_get_name
#define arginfo_weechat_config_color_inherited arginfo_weechat_plugin_get_name
#define arginfo_weechat_config_enum arginfo_weechat_plugin_get_name
#define arginfo_weechat_config_enum_default arginfo_weechat_plugin_get_name
#define arginfo_weechat_config_enum_inherited arginfo_weechat_plugin_get_name
#define arginfo_weechat_config_write_option arginfo_weechat_iconv_to_internal
#define arginfo_weechat_config_write_line arginfo_weechat_ngettext
+5
View File
@@ -761,14 +761,19 @@ plugin_load (const char *filename, int init_plugin, int argc, char **argv)
new_plugin->config_option_is_null = &config_file_option_is_null;
new_plugin->config_option_default_is_null = &config_file_option_default_is_null;
new_plugin->config_boolean = &config_file_option_boolean;
new_plugin->config_boolean_inherited = &config_file_option_boolean_inherited;
new_plugin->config_boolean_default = &config_file_option_boolean_default;
new_plugin->config_integer = &config_file_option_integer;
new_plugin->config_integer_inherited = &config_file_option_integer_inherited;
new_plugin->config_integer_default = &config_file_option_integer_default;
new_plugin->config_enum = &config_file_option_enum;
new_plugin->config_enum_inherited = &config_file_option_enum_inherited;
new_plugin->config_enum_default = &config_file_option_enum_default;
new_plugin->config_string = &config_file_option_string;
new_plugin->config_string_inherited = &config_file_option_string_inherited;
new_plugin->config_string_default = &config_file_option_string_default;
new_plugin->config_color = &config_file_option_color;
new_plugin->config_color_inherited = &config_file_option_color_inherited;
new_plugin->config_color_default = &config_file_option_color_default;
new_plugin->config_write_option = &config_file_write_option;
new_plugin->config_write_line = &config_file_write_line;
+80
View File
@@ -1573,6 +1573,21 @@ API_FUNC(config_boolean_default)
API_RETURN_INT(value);
}
API_FUNC(config_boolean_inherited)
{
char *option;
int value;
API_INIT_FUNC(1, "config_boolean_inherited", API_RETURN_INT(0));
option = NULL;
if (!PyArg_ParseTuple (args, "s", &option))
API_WRONG_ARGS(API_RETURN_INT(0));
value = weechat_config_boolean_inherited (API_STR2PTR(option));
API_RETURN_INT(value);
}
API_FUNC(config_integer)
{
char *option;
@@ -1603,6 +1618,21 @@ API_FUNC(config_integer_default)
API_RETURN_INT(value);
}
API_FUNC(config_integer_inherited)
{
char *option;
int value;
API_INIT_FUNC(1, "config_integer_inherited", API_RETURN_INT(0));
option = NULL;
if (!PyArg_ParseTuple (args, "s", &option))
API_WRONG_ARGS(API_RETURN_INT(0));
value = weechat_config_integer_inherited (API_STR2PTR(option));
API_RETURN_INT(value);
}
API_FUNC(config_string)
{
char *option;
@@ -1633,6 +1663,21 @@ API_FUNC(config_string_default)
API_RETURN_STRING(result);
}
API_FUNC(config_string_inherited)
{
char *option;
const char *result;
API_INIT_FUNC(1, "config_string_inherited", API_RETURN_EMPTY);
option = NULL;
if (!PyArg_ParseTuple (args, "s", &option))
API_WRONG_ARGS(API_RETURN_EMPTY);
result = weechat_config_string_inherited (API_STR2PTR(option));
API_RETURN_STRING(result);
}
API_FUNC(config_color)
{
char *option;
@@ -1663,6 +1708,21 @@ API_FUNC(config_color_default)
API_RETURN_STRING(result);
}
API_FUNC(config_color_inherited)
{
char *option;
const char *result;
API_INIT_FUNC(1, "config_color_inherited", API_RETURN_EMPTY);
option = NULL;
if (!PyArg_ParseTuple (args, "s", &option))
API_WRONG_ARGS(API_RETURN_EMPTY);
result = weechat_config_color_inherited (API_STR2PTR(option));
API_RETURN_STRING(result);
}
API_FUNC(config_enum)
{
char *option;
@@ -1693,6 +1753,21 @@ API_FUNC(config_enum_default)
API_RETURN_INT(value);
}
API_FUNC(config_enum_inherited)
{
char *option;
int value;
API_INIT_FUNC(1, "config_enum_inherited", API_RETURN_INT(0));
option = NULL;
if (!PyArg_ParseTuple (args, "s", &option))
API_WRONG_ARGS(API_RETURN_INT(0));
value = weechat_config_enum_inherited (API_STR2PTR(option));
API_RETURN_INT(value);
}
API_FUNC(config_write_option)
{
char *config_file, *option;
@@ -5591,14 +5666,19 @@ PyMethodDef weechat_python_funcs[] =
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),
+57 -2
View File
@@ -795,6 +795,17 @@ def config_boolean_default(option: str) -> int:
...
def config_boolean_inherited(option: str) -> int:
"""`config_boolean_inherited in WeeChat plugin API reference <https://weechat.org/doc/weechat/api/#_config_boolean_inherited>`_
::
# example
option = weechat.config_get("irc.server.libera.autoconnect")
autoconect = weechat.config_boolean_inherited(option)
"""
...
def config_integer(option: str) -> int:
"""`config_integer in WeeChat plugin API reference <https://weechat.org/doc/weechat/api/#_config_integer>`_
::
@@ -817,6 +828,17 @@ def config_integer_default(option: str) -> int:
...
def config_integer_inherited(option: str) -> int:
"""`config_integer_inherited in WeeChat plugin API reference <https://weechat.org/doc/weechat/api/#_config_integer_inherited>`_
::
# example
option = weechat.config_get("irc.server.libera.autojoin_delay")
delay = weechat.config_integer_inherited(option)
"""
...
def config_string(option: str) -> str:
"""`config_string in WeeChat plugin API reference <https://weechat.org/doc/weechat/api/#_config_string>`_
::
@@ -839,13 +861,24 @@ def config_string_default(option: str) -> str:
...
def config_string_inherited(option: str) -> str:
"""`config_string_inherited in WeeChat plugin API reference <https://weechat.org/doc/weechat/api/#_config_string_inherited>`_
::
# example
option = weechat.config_get("irc.server.libera.msg_quit")
msg_quit = weechat.config_string_inherited(option)
"""
...
def config_color(option: str) -> str:
"""`config_color in WeeChat plugin API reference <https://weechat.org/doc/weechat/api/#_config_color>`_
::
# example
option = weechat.config_get("plugin.section.option")
value = weechat.config_color(option)
color = weechat.config_color(option)
"""
...
@@ -856,7 +889,18 @@ def config_color_default(option: str) -> str:
# example
option = weechat.config_get("plugin.section.option")
value = weechat.config_color_default(option)
color = weechat.config_color_default(option)
"""
...
def config_color_inherited(option: str) -> str:
"""`config_color_inherited in WeeChat plugin API reference <https://weechat.org/doc/weechat/api/#_config_color_inherited>`_
::
# example
option = weechat.config_get("plugin.section.option")
color = weechat.config_color_inherited(option)
"""
...
@@ -883,6 +927,17 @@ def config_enum_default(option: str) -> int:
...
def config_enum_inherited(option: str) -> int:
"""`config_enum_inherited in WeeChat plugin API reference <https://weechat.org/doc/weechat/api/#_config_enum_inherited>`_
::
# example
option = weechat.config_get("irc.server.libera.sasl_fail")
sasl_fail = weechat.config_enum_inherited(option)
"""
...
def config_write_option(config_file: str, option: str) -> int:
"""`config_write_option in WeeChat plugin API reference <https://weechat.org/doc/weechat/api/#_config_write_option>`_
::
+100
View File
@@ -1932,6 +1932,25 @@ weechat_ruby_api_config_boolean_default (VALUE class, VALUE option)
API_RETURN_INT(value);
}
static VALUE
weechat_ruby_api_config_boolean_inherited (VALUE class, VALUE option)
{
char *c_option;
int value;
API_INIT_FUNC(1, "config_boolean_inherited", API_RETURN_INT(0));
if (NIL_P (option))
API_WRONG_ARGS(API_RETURN_INT(0));
Check_Type (option, T_STRING);
c_option = StringValuePtr (option);
value = weechat_config_boolean_inherited (API_STR2PTR(c_option));
API_RETURN_INT(value);
}
static VALUE
weechat_ruby_api_config_integer (VALUE class, VALUE option)
{
@@ -1970,6 +1989,25 @@ weechat_ruby_api_config_integer_default (VALUE class, VALUE option)
API_RETURN_INT(value);
}
static VALUE
weechat_ruby_api_config_integer_inherited (VALUE class, VALUE option)
{
char *c_option;
int value;
API_INIT_FUNC(1, "config_integer_inherited", API_RETURN_INT(0));
if (NIL_P (option))
API_WRONG_ARGS(API_RETURN_INT(0));
Check_Type (option, T_STRING);
c_option = StringValuePtr (option);
value = weechat_config_integer_inherited (API_STR2PTR(c_option));
API_RETURN_INT(value);
}
static VALUE
weechat_ruby_api_config_string (VALUE class, VALUE option)
{
@@ -2008,6 +2046,25 @@ weechat_ruby_api_config_string_default (VALUE class, VALUE option)
API_RETURN_STRING(result);
}
static VALUE
weechat_ruby_api_config_string_inherited (VALUE class, VALUE option)
{
char *c_option;
const char *result;
API_INIT_FUNC(1, "config_string_inherited", API_RETURN_EMPTY);
if (NIL_P (option))
API_WRONG_ARGS(API_RETURN_EMPTY);
Check_Type (option, T_STRING);
c_option = StringValuePtr (option);
result = weechat_config_string_inherited (API_STR2PTR(c_option));
API_RETURN_STRING(result);
}
static VALUE
weechat_ruby_api_config_color (VALUE class, VALUE option)
{
@@ -2046,6 +2103,25 @@ weechat_ruby_api_config_color_default (VALUE class, VALUE option)
API_RETURN_STRING(result);
}
static VALUE
weechat_ruby_api_config_color_inherited (VALUE class, VALUE option)
{
char *c_option;
const char *result;
API_INIT_FUNC(1, "config_color_inherited", API_RETURN_EMPTY);
if (NIL_P (option))
API_WRONG_ARGS(API_RETURN_EMPTY);
Check_Type (option, T_STRING);
c_option = StringValuePtr (option);
result = weechat_config_color_inherited (API_STR2PTR(c_option));
API_RETURN_STRING(result);
}
static VALUE
weechat_ruby_api_config_enum (VALUE class, VALUE option)
{
@@ -2084,6 +2160,25 @@ weechat_ruby_api_config_enum_default (VALUE class, VALUE option)
API_RETURN_INT(value);
}
static VALUE
weechat_ruby_api_config_enum_inherited (VALUE class, VALUE option)
{
char *c_option;
int value;
API_INIT_FUNC(1, "config_enum_inherited", API_RETURN_INT(0));
if (NIL_P (option))
API_WRONG_ARGS(API_RETURN_INT(0));
Check_Type (option, T_STRING);
c_option = StringValuePtr (option);
value = weechat_config_enum_inherited (API_STR2PTR(c_option));
API_RETURN_INT(value);
}
static VALUE
weechat_ruby_api_config_write_option (VALUE class, VALUE config_file,
VALUE option)
@@ -6935,13 +7030,18 @@ weechat_ruby_api_init (VALUE ruby_mWeechat)
API_DEF_FUNC(config_option_default_is_null, 1);
API_DEF_FUNC(config_boolean, 1);
API_DEF_FUNC(config_boolean_default, 1);
API_DEF_FUNC(config_boolean_inherited, 1);
API_DEF_FUNC(config_integer, 1);
API_DEF_FUNC(config_integer_default, 1);
API_DEF_FUNC(config_integer_inherited, 1);
API_DEF_FUNC(config_string, 1);
API_DEF_FUNC(config_string_default, 1);
API_DEF_FUNC(config_string_inherited, 1);
API_DEF_FUNC(config_color, 1);
API_DEF_FUNC(config_color_default, 1);
API_DEF_FUNC(config_color_inherited, 1);
API_DEF_FUNC(config_enum, 1);
API_DEF_FUNC(config_enum_inherited, 1);
API_DEF_FUNC(config_enum_default, 1);
API_DEF_FUNC(config_write_option, 2);
API_DEF_FUNC(config_write_line, 3);
+70
View File
@@ -1644,6 +1644,19 @@ API_FUNC(config_boolean_default)
API_RETURN_INT(result);
}
API_FUNC(config_boolean_inherited)
{
int result;
API_INIT_FUNC(1, "config_boolean_inherited", API_RETURN_INT(0));
if (objc < 2)
API_WRONG_ARGS(API_RETURN_INT(0));
result = weechat_config_boolean_inherited (API_STR2PTR(Tcl_GetString (objv[1]))); /* option */
API_RETURN_INT(result);
}
API_FUNC(config_integer)
{
int result;
@@ -1670,6 +1683,19 @@ API_FUNC(config_integer_default)
API_RETURN_INT(result);
}
API_FUNC(config_integer_inherited)
{
int result;
API_INIT_FUNC(1, "config_integer_inherited", API_RETURN_INT(0));
if (objc < 2)
API_WRONG_ARGS(API_RETURN_INT(0));
result = weechat_config_integer_inherited (API_STR2PTR(Tcl_GetString (objv[1]))); /* option */
API_RETURN_INT(result);
}
API_FUNC(config_string)
{
const char *result;
@@ -1696,6 +1722,19 @@ API_FUNC(config_string_default)
API_RETURN_STRING(result);
}
API_FUNC(config_string_inherited)
{
const char *result;
API_INIT_FUNC(1, "config_string_inherited", API_RETURN_EMPTY);
if (objc < 2)
API_WRONG_ARGS(API_RETURN_EMPTY);
result = weechat_config_string_inherited (API_STR2PTR(Tcl_GetString (objv[1]))); /* option */
API_RETURN_STRING(result);
}
API_FUNC(config_color)
{
const char *result;
@@ -1722,6 +1761,19 @@ API_FUNC(config_color_default)
API_RETURN_STRING(result);
}
API_FUNC(config_color_inherited)
{
const char *result;
API_INIT_FUNC(1, "config_color_inherited", API_RETURN_EMPTY);
if (objc < 2)
API_WRONG_ARGS(API_RETURN_EMPTY);
result = weechat_config_color_inherited (API_STR2PTR(Tcl_GetString (objv[1]))); /* option */
API_RETURN_STRING(result);
}
API_FUNC(config_enum)
{
int result;
@@ -1748,6 +1800,19 @@ API_FUNC(config_enum_default)
API_RETURN_INT(result);
}
API_FUNC(config_enum_inherited)
{
int result;
API_INIT_FUNC(1, "config_enum_inherited", API_RETURN_INT(0));
if (objc < 2)
API_WRONG_ARGS(API_RETURN_INT(0));
result = weechat_config_enum_inherited (API_STR2PTR(Tcl_GetString (objv[1]))); /* option */
API_RETURN_INT(result);
}
API_FUNC(config_write_option)
{
char *config_file, *option;
@@ -5700,13 +5765,18 @@ void weechat_tcl_api_init (Tcl_Interp *interp)
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_inherited);
API_DEF_FUNC(config_enum_default);
API_DEF_FUNC(config_write_option);
API_DEF_FUNC(config_write_line);
+16 -1
View File
@@ -71,7 +71,7 @@ struct timeval;
* please change the date with current one; for a second change at same
* date, increment the 01, otherwise please keep 01.
*/
#define WEECHAT_PLUGIN_API_VERSION "20240114-01"
#define WEECHAT_PLUGIN_API_VERSION "20240304-01"
/* macros for defining plugin infos */
#define WEECHAT_PLUGIN_NAME(__name) \
@@ -660,14 +660,19 @@ struct t_weechat_plugin
int (*config_option_is_null) (struct t_config_option *option);
int (*config_option_default_is_null) (struct t_config_option *option);
int (*config_boolean) (struct t_config_option *option);
int (*config_boolean_inherited) (struct t_config_option *option);
int (*config_boolean_default) (struct t_config_option *option);
int (*config_integer) (struct t_config_option *option);
int (*config_integer_inherited) (struct t_config_option *option);
int (*config_integer_default) (struct t_config_option *option);
int (*config_enum) (struct t_config_option *option);
int (*config_enum_inherited) (struct t_config_option *option);
int (*config_enum_default) (struct t_config_option *option);
const char *(*config_string) (struct t_config_option *option);
const char *(*config_string_inherited) (struct t_config_option *option);
const char *(*config_string_default) (struct t_config_option *option);
const char *(*config_color) (struct t_config_option *option);
const char *(*config_color_inherited) (struct t_config_option *option);
const char *(*config_color_default) (struct t_config_option *option);
int (*config_write_option) (struct t_config_file *config_file,
struct t_config_option *option);
@@ -1740,22 +1745,32 @@ extern int weechat_plugin_end (struct t_weechat_plugin *plugin);
(weechat_plugin->config_option_default_is_null)(__option)
#define weechat_config_boolean(__option) \
(weechat_plugin->config_boolean)(__option)
#define weechat_config_boolean_inherited(__option) \
(weechat_plugin->config_boolean_inherited)(__option)
#define weechat_config_boolean_default(__option) \
(weechat_plugin->config_boolean_default)(__option)
#define weechat_config_integer(__option) \
(weechat_plugin->config_integer)(__option)
#define weechat_config_integer_inherited(__option) \
(weechat_plugin->config_integer_inherited)(__option)
#define weechat_config_integer_default(__option) \
(weechat_plugin->config_integer_default)(__option)
#define weechat_config_enum(__option) \
(weechat_plugin->config_enum)(__option)
#define weechat_config_enum_inherited(__option) \
(weechat_plugin->config_enum_inherited)(__option)
#define weechat_config_enum_default(__option) \
(weechat_plugin->config_enum_default)(__option)
#define weechat_config_string(__option) \
(weechat_plugin->config_string)(__option)
#define weechat_config_string_inherited(__option) \
(weechat_plugin->config_string_inherited)(__option)
#define weechat_config_string_default(__option) \
(weechat_plugin->config_string_default)(__option)
#define weechat_config_color(__option) \
(weechat_plugin->config_color)(__option)
#define weechat_config_color_inherited(__option) \
(weechat_plugin->config_color_inherited)(__option)
#define weechat_config_color_default(__option) \
(weechat_plugin->config_color_default)(__option)
#define weechat_config_write_option(__config, __option) \