mirror of
https://github.com/weechat/weechat.git
synced 2026-06-27 13:26:38 +02:00
api: add function string_parse_size
This commit is contained in:
@@ -496,6 +496,23 @@ API_FUNC(string_format_size)
|
||||
API_RETURN_STRING_FREE(result);
|
||||
}
|
||||
|
||||
API_FUNC(string_parse_size)
|
||||
{
|
||||
zend_string *z_size;
|
||||
char *size;
|
||||
unsigned long long value;
|
||||
|
||||
API_INIT_FUNC(1, "string_parse_size", API_RETURN_LONG(0));
|
||||
if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_size) == FAILURE)
|
||||
API_WRONG_ARGS(API_RETURN_LONG(0));
|
||||
|
||||
size = ZSTR_VAL(z_size);
|
||||
|
||||
value = weechat_string_parse_size ((const char *)size);
|
||||
|
||||
API_RETURN_LONG(value);
|
||||
}
|
||||
|
||||
API_FUNC(string_color_code_size)
|
||||
{
|
||||
zend_string *z_string;
|
||||
|
||||
@@ -59,6 +59,7 @@ PHP_FUNCTION(weechat_string_has_highlight);
|
||||
PHP_FUNCTION(weechat_string_has_highlight_regex);
|
||||
PHP_FUNCTION(weechat_string_mask_to_regex);
|
||||
PHP_FUNCTION(weechat_string_format_size);
|
||||
PHP_FUNCTION(weechat_string_parse_size);
|
||||
PHP_FUNCTION(weechat_string_color_code_size);
|
||||
PHP_FUNCTION(weechat_string_remove_color);
|
||||
PHP_FUNCTION(weechat_string_is_command_char);
|
||||
|
||||
@@ -117,6 +117,7 @@ const zend_function_entry weechat_functions[] = {
|
||||
PHP_FE(weechat_string_has_highlight_regex, arginfo_weechat_string_has_highlight_regex)
|
||||
PHP_FE(weechat_string_mask_to_regex, arginfo_weechat_string_mask_to_regex)
|
||||
PHP_FE(weechat_string_format_size, arginfo_weechat_string_format_size)
|
||||
PHP_FE(weechat_string_parse_size, arginfo_weechat_string_parse_size)
|
||||
PHP_FE(weechat_string_color_code_size, arginfo_weechat_string_color_code_size)
|
||||
PHP_FE(weechat_string_remove_color, arginfo_weechat_string_remove_color)
|
||||
PHP_FE(weechat_string_is_command_char, arginfo_weechat_string_is_command_char)
|
||||
|
||||
@@ -25,6 +25,7 @@ function weechat_string_has_highlight(string $p0, string $p1): int {}
|
||||
function weechat_string_has_highlight_regex(string $p0, string $p1): int {}
|
||||
function weechat_string_mask_to_regex(string $p0): string {}
|
||||
function weechat_string_format_size(int $p0): string {}
|
||||
function weechat_string_parse_size(string $p0): int {}
|
||||
function weechat_string_color_code_size(string $p0): int {}
|
||||
function weechat_string_remove_color(string $p0, string $p1): string {}
|
||||
function weechat_string_is_command_char(string $p0): int {}
|
||||
|
||||
@@ -57,6 +57,8 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_weechat_string_format_size, 0, 1
|
||||
ZEND_ARG_TYPE_INFO(0, p0, IS_LONG, 0)
|
||||
ZEND_END_ARG_INFO()
|
||||
|
||||
#define arginfo_weechat_string_parse_size arginfo_weechat_charset_set
|
||||
|
||||
#define arginfo_weechat_string_color_code_size arginfo_weechat_charset_set
|
||||
|
||||
#define arginfo_weechat_string_remove_color arginfo_weechat_iconv_to_internal
|
||||
|
||||
Reference in New Issue
Block a user