summaryrefslogtreecommitdiff
path: root/src/plugins/php
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/php')
-rw-r--r--src/plugins/php/weechat-php-api.c15
-rw-r--r--src/plugins/php/weechat-php-api.h1
-rw-r--r--src/plugins/php/weechat-php.c1
3 files changed, 17 insertions, 0 deletions
diff --git a/src/plugins/php/weechat-php-api.c b/src/plugins/php/weechat-php-api.c
index 38f53911a..19012db25 100644
--- a/src/plugins/php/weechat-php-api.c
+++ b/src/plugins/php/weechat-php-api.c
@@ -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;
diff --git a/src/plugins/php/weechat-php-api.h b/src/plugins/php/weechat-php-api.h
index c894185ed..eb0e5db69 100644
--- a/src/plugins/php/weechat-php-api.h
+++ b/src/plugins/php/weechat-php-api.h
@@ -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);
diff --git a/src/plugins/php/weechat-php.c b/src/plugins/php/weechat-php.c
index 58c34403d..720d8bd1d 100644
--- a/src/plugins/php/weechat-php.c
+++ b/src/plugins/php/weechat-php.c
@@ -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)