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

api: add function string_parse_size

This commit is contained in:
Sébastien Helleu
2022-09-25 10:53:37 +02:00
parent be6a29a596
commit 4d74a89cfc
32 changed files with 566 additions and 1 deletions
+17
View File
@@ -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;