1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-25 20:36:38 +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
+34
View File
@@ -1740,6 +1740,40 @@ API_FUNC(config_color_default)
API_RETURN_STRING(result);
}
API_FUNC(config_enum)
{
zend_string *z_option;
struct t_config_option *option;
int result;
API_INIT_FUNC(1, "config_enum", 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 (option);
API_RETURN_INT(result);
}
API_FUNC(config_enum_default)
{
zend_string *z_option;
struct t_config_option *option;
int result;
API_INIT_FUNC(1, "config_enum_default", 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_default (option);
API_RETURN_INT(result);
}
API_FUNC(config_write_option)
{
zend_string *z_config_file, *z_option;
+2
View File
@@ -106,6 +106,8 @@ PHP_FUNCTION(weechat_config_string);
PHP_FUNCTION(weechat_config_string_default);
PHP_FUNCTION(weechat_config_color);
PHP_FUNCTION(weechat_config_color_default);
PHP_FUNCTION(weechat_config_enum);
PHP_FUNCTION(weechat_config_enum_default);
PHP_FUNCTION(weechat_config_write_option);
PHP_FUNCTION(weechat_config_write_line);
PHP_FUNCTION(weechat_config_write);
+2
View File
@@ -164,6 +164,8 @@ const zend_function_entry weechat_functions[] = {
PHP_FE(weechat_config_string_default, arginfo_weechat_config_string_default)
PHP_FE(weechat_config_color, arginfo_weechat_config_color)
PHP_FE(weechat_config_color_default, arginfo_weechat_config_color_default)
PHP_FE(weechat_config_enum, arginfo_weechat_config_enum)
PHP_FE(weechat_config_enum_default, arginfo_weechat_config_enum_default)
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)
+2
View File
@@ -72,6 +72,8 @@ function weechat_config_string(string $p0): string {}
function weechat_config_string_default(string $p0): string {}
function weechat_config_color(string $p0): string {}
function weechat_config_color_default(string $p0): string {}
function weechat_config_enum(string $p0): int {}
function weechat_config_enum_default(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 {}
+5 -1
View File
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: 5c460494eac0e2ed6729ab210df6679f990070d6 */
* Stub hash: d9a98a051023d3904f6e6f94b776386b3b67a5f6 */
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)
@@ -181,6 +181,10 @@ ZEND_END_ARG_INFO()
#define arginfo_weechat_config_color_default 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_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)
+5 -1
View File
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: 5c460494eac0e2ed6729ab210df6679f990070d6 */
* Stub hash: d9a98a051023d3904f6e6f94b776386b3b67a5f6 */
ZEND_BEGIN_ARG_INFO_EX(arginfo_weechat_register, 0, 0, 7)
ZEND_ARG_INFO(0, p0)
@@ -146,6 +146,10 @@ ZEND_END_ARG_INFO()
#define arginfo_weechat_config_color_default 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_write_option arginfo_weechat_iconv_to_internal
#define arginfo_weechat_config_write_line arginfo_weechat_ngettext