mirror of
https://github.com/weechat/weechat.git
synced 2026-06-27 05:16:38 +02:00
api: add function string_color_code_size (issue #1547)
This commit is contained in:
@@ -497,6 +497,23 @@ API_FUNC(string_format_size)
|
||||
API_RETURN_STRING_FREE(result);
|
||||
}
|
||||
|
||||
API_FUNC(string_color_code_size)
|
||||
{
|
||||
zend_string *z_string;
|
||||
char *string;
|
||||
int result;
|
||||
|
||||
API_INIT_FUNC(1, "string_color_code_size", API_RETURN_INT(0));
|
||||
if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_string) == FAILURE)
|
||||
API_WRONG_ARGS(API_RETURN_INT(0));
|
||||
|
||||
string = ZSTR_VAL(z_string);
|
||||
|
||||
result = weechat_string_color_code_size ((const char *)string);
|
||||
|
||||
API_RETURN_INT(result);
|
||||
}
|
||||
|
||||
API_FUNC(string_remove_color)
|
||||
{
|
||||
zend_string *z_string, *z_replacement;
|
||||
|
||||
@@ -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_color_code_size);
|
||||
PHP_FUNCTION(weechat_string_remove_color);
|
||||
PHP_FUNCTION(weechat_string_is_command_char);
|
||||
PHP_FUNCTION(weechat_string_input_for_buffer);
|
||||
|
||||
@@ -112,6 +112,7 @@ const zend_function_entry weechat_functions[] = {
|
||||
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_color_code_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)
|
||||
|
||||
Reference in New Issue
Block a user