1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-25 12:26:40 +02:00

api: add function string_format_size in scripting API

This commit is contained in:
Sébastien Helleu
2018-04-07 13:20:58 +02:00
parent ea365cccbf
commit 6de98179bc
22 changed files with 190 additions and 6 deletions
+15
View File
@@ -443,6 +443,21 @@ API_FUNC(string_mask_to_regex)
API_RETURN_STRING(retval);
}
API_FUNC(string_format_size)
{
zend_long z_size;
char *retval;
API_INIT_FUNC(1, "string_format_size", API_RETURN_EMPTY);
if (zend_parse_parameters (ZEND_NUM_ARGS(),
"l", &z_size) == FAILURE)
API_WRONG_ARGS(API_RETURN_EMPTY);
retval = weechat_string_format_size ((unsigned long long)z_size);
API_RETURN_STRING(retval);
}
API_FUNC(string_remove_color)
{
zend_string *z_string, *z_replacement;
+1
View File
@@ -57,6 +57,7 @@ PHP_FUNCTION(weechat_string_match);
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_remove_color);
PHP_FUNCTION(weechat_string_is_command_char);
PHP_FUNCTION(weechat_string_input_for_buffer);
+1
View File
@@ -111,6 +111,7 @@ const zend_function_entry weechat_functions[] = {
PHP_FE(weechat_string_has_highlight, NULL)
PHP_FE(weechat_string_has_highlight_regex, NULL)
PHP_FE(weechat_string_mask_to_regex, NULL)
PHP_FE(weechat_string_format_size, NULL)
PHP_FE(weechat_string_remove_color, NULL)
PHP_FE(weechat_string_is_command_char, NULL)
PHP_FE(weechat_string_input_for_buffer, NULL)