1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-01 23:36:37 +02:00

php: rename print functions

Rename:
- printf to print
- printf_date_tags to print_date_tags
- printf_y to print_y
- log_printf to log_print
This commit is contained in:
Sébastien Helleu
2017-09-07 21:50:20 +02:00
parent 8bd874a281
commit 1851f6472f
3 changed files with 36 additions and 36 deletions
+28 -28
View File
@@ -1902,92 +1902,92 @@ API_FUNC(color)
API_RETURN_STRING(retval);
}
API_FUNC(printf)
API_FUNC(print)
{
zend_string *z_buffer, *z_format;
zend_string *z_buffer, *z_message;
struct t_gui_buffer *buffer;
char *format;
char *message;
API_INIT_FUNC(0, "printf", API_RETURN_ERROR);
API_INIT_FUNC(0, "print", API_RETURN_ERROR);
if (zend_parse_parameters (ZEND_NUM_ARGS(),
"SS", &z_buffer, &z_format) == FAILURE)
"SS", &z_buffer, &z_message) == FAILURE)
API_WRONG_ARGS(API_RETURN_ERROR);
buffer = (struct t_gui_buffer *)API_STR2PTR(ZSTR_VAL(z_buffer));
format = ZSTR_VAL(z_format);
message = ZSTR_VAL(z_message);
plugin_script_api_printf (weechat_php_plugin, php_current_script, buffer,
"%s", format);
"%s", message);
API_RETURN_OK;
}
API_FUNC(printf_date_tags)
API_FUNC(print_date_tags)
{
zend_string *z_buffer, *z_tags, *z_format;
zend_string *z_buffer, *z_tags, *z_message;
zend_long z_date;
struct t_gui_buffer *buffer;
time_t date;
char *tags, *format;
char *tags, *message;
API_INIT_FUNC(1, "printf_date_tags", API_RETURN_ERROR);
API_INIT_FUNC(1, "print_date_tags", API_RETURN_ERROR);
if (zend_parse_parameters (ZEND_NUM_ARGS(),
"SlSS", &z_buffer, &z_date, &z_tags,
&z_format) == FAILURE)
&z_message) == FAILURE)
API_WRONG_ARGS(API_RETURN_ERROR);
buffer = (struct t_gui_buffer *)API_STR2PTR(ZSTR_VAL(z_buffer));
date = (time_t)z_date;
tags = ZSTR_VAL(z_tags);
format = ZSTR_VAL(z_format);
message = ZSTR_VAL(z_message);
plugin_script_api_printf_date_tags (weechat_php_plugin,
php_current_script,
buffer,
date,
(const char *)tags,
"%s",
format);
message);
API_RETURN_OK;
}
API_FUNC(printf_y)
API_FUNC(print_y)
{
zend_string *z_buffer, *z_format;
zend_string *z_buffer, *z_message;
zend_long z_y;
struct t_gui_buffer *buffer;
int y;
char *format;
char *message;
API_INIT_FUNC(1, "printf_y", API_RETURN_ERROR);
API_INIT_FUNC(1, "print_y", API_RETURN_ERROR);
if (zend_parse_parameters (ZEND_NUM_ARGS(),
"SlS", &z_buffer, &z_y, &z_format) == FAILURE)
"SlS", &z_buffer, &z_y, &z_message) == FAILURE)
API_WRONG_ARGS(API_RETURN_ERROR);
buffer = (struct t_gui_buffer *)API_STR2PTR(ZSTR_VAL(z_buffer));
y = (int)z_y;
format = ZSTR_VAL(z_format);
message = ZSTR_VAL(z_message);
plugin_script_api_printf_y (weechat_php_plugin,
php_current_script,
buffer,
y,
"%s",
format);
message);
API_RETURN_OK;
}
API_FUNC(log_printf)
API_FUNC(log_print)
{
zend_string *z_format;
char *format;
zend_string *z_message;
char *message;
API_INIT_FUNC(1, "log_printf", API_RETURN_ERROR);
if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_format) == FAILURE)
API_INIT_FUNC(1, "log_print", API_RETURN_ERROR);
if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_message) == FAILURE)
API_WRONG_ARGS(API_RETURN_ERROR);
format = ZSTR_VAL(z_format);
message = ZSTR_VAL(z_message);
plugin_script_api_log_printf (weechat_php_plugin, php_current_script,
"%s", format);
"%s", message);
API_RETURN_OK;
}
+4 -4
View File
@@ -107,10 +107,10 @@ PHP_FUNCTION(weechat_key_bind);
PHP_FUNCTION(weechat_key_unbind);
PHP_FUNCTION(weechat_prefix);
PHP_FUNCTION(weechat_color);
PHP_FUNCTION(weechat_printf);
PHP_FUNCTION(weechat_printf_date_tags);
PHP_FUNCTION(weechat_printf_y);
PHP_FUNCTION(weechat_log_printf);
PHP_FUNCTION(weechat_print);
PHP_FUNCTION(weechat_print_date_tags);
PHP_FUNCTION(weechat_print_y);
PHP_FUNCTION(weechat_log_print);
PHP_FUNCTION(weechat_hook_command);
PHP_FUNCTION(weechat_hook_completion);
PHP_FUNCTION(weechat_hook_completion_get_string);
+4 -4
View File
@@ -147,10 +147,10 @@ const zend_function_entry weechat_functions[] = {
PHP_FE(weechat_key_unbind, NULL)
PHP_FE(weechat_prefix, NULL)
PHP_FE(weechat_color, NULL)
PHP_FE(weechat_printf, NULL)
PHP_FE(weechat_printf_date_tags, NULL)
PHP_FE(weechat_printf_y, NULL)
PHP_FE(weechat_log_printf, NULL)
PHP_FE(weechat_print, NULL)
PHP_FE(weechat_print_date_tags, NULL)
PHP_FE(weechat_print_y, NULL)
PHP_FE(weechat_log_print, NULL)
PHP_FE(weechat_hook_command, NULL)
PHP_FE(weechat_hook_completion, NULL)
PHP_FE(weechat_hook_completion_get_string, NULL)