mirror of
https://github.com/weechat/weechat.git
synced 2026-06-30 06:46:38 +02:00
core: add support of date and tags in messages displayed in buffers with free content, add function printf_y_date_tags (closes #1746)
This commit is contained in:
@@ -2097,6 +2097,38 @@ API_FUNC(print_y)
|
||||
API_RETURN_OK;
|
||||
}
|
||||
|
||||
API_FUNC(print_y_date_tags)
|
||||
{
|
||||
zend_string *z_buffer, *z_tags, *z_message;
|
||||
zend_long z_y, z_date;
|
||||
struct t_gui_buffer *buffer;
|
||||
int y;
|
||||
time_t date;
|
||||
char *tags, *message;
|
||||
|
||||
API_INIT_FUNC(1, "print_y_date_tags", API_RETURN_ERROR);
|
||||
if (zend_parse_parameters (ZEND_NUM_ARGS(), "SllSS", &z_buffer, &z_y,
|
||||
&z_date, &z_tags, &z_message) == FAILURE)
|
||||
API_WRONG_ARGS(API_RETURN_ERROR);
|
||||
|
||||
buffer = (struct t_gui_buffer *)API_STR2PTR(ZSTR_VAL(z_buffer));
|
||||
y = (int)z_y;
|
||||
date = (time_t)z_date;
|
||||
tags = ZSTR_VAL(z_tags);
|
||||
message = ZSTR_VAL(z_message);
|
||||
|
||||
plugin_script_api_printf_y_date_tags (weechat_php_plugin,
|
||||
php_current_script,
|
||||
buffer,
|
||||
y,
|
||||
date,
|
||||
(const char *)tags,
|
||||
"%s",
|
||||
message);
|
||||
|
||||
API_RETURN_OK;
|
||||
}
|
||||
|
||||
API_FUNC(log_print)
|
||||
{
|
||||
zend_string *z_message;
|
||||
|
||||
@@ -126,6 +126,7 @@ PHP_FUNCTION(weechat_color);
|
||||
PHP_FUNCTION(weechat_print);
|
||||
PHP_FUNCTION(weechat_print_date_tags);
|
||||
PHP_FUNCTION(weechat_print_y);
|
||||
PHP_FUNCTION(weechat_print_y_date_tags);
|
||||
PHP_FUNCTION(weechat_log_print);
|
||||
PHP_FUNCTION(weechat_hook_command);
|
||||
PHP_FUNCTION(weechat_hook_completion);
|
||||
|
||||
@@ -184,6 +184,7 @@ const zend_function_entry weechat_functions[] = {
|
||||
PHP_FE(weechat_print, arginfo_weechat_print)
|
||||
PHP_FE(weechat_print_date_tags, arginfo_weechat_print_date_tags)
|
||||
PHP_FE(weechat_print_y, arginfo_weechat_print_y)
|
||||
PHP_FE(weechat_print_y_date_tags, arginfo_weechat_print_y_date_tags)
|
||||
PHP_FE(weechat_log_print, arginfo_weechat_log_print)
|
||||
PHP_FE(weechat_hook_command, arginfo_weechat_hook_command)
|
||||
PHP_FE(weechat_hook_completion, arginfo_weechat_hook_completion)
|
||||
|
||||
@@ -87,6 +87,7 @@ function weechat_color(): mixed {}
|
||||
function weechat_print(): mixed {}
|
||||
function weechat_print_date_tags(): mixed {}
|
||||
function weechat_print_y(): mixed {}
|
||||
function weechat_print_y_date_tags(): mixed {}
|
||||
function weechat_log_print(): mixed {}
|
||||
function weechat_hook_command(): mixed {}
|
||||
function weechat_hook_completion(): mixed {}
|
||||
|
||||
@@ -164,6 +164,8 @@ ZEND_END_ARG_INFO()
|
||||
|
||||
#define arginfo_weechat_print_y arginfo_weechat_register
|
||||
|
||||
#define arginfo_weechat_print_y_date_tags arginfo_weechat_register
|
||||
|
||||
#define arginfo_weechat_log_print arginfo_weechat_register
|
||||
|
||||
#define arginfo_weechat_hook_command arginfo_weechat_register
|
||||
|
||||
@@ -164,6 +164,8 @@ ZEND_END_ARG_INFO()
|
||||
|
||||
#define arginfo_weechat_print_y arginfo_weechat_register
|
||||
|
||||
#define arginfo_weechat_print_y_date_tags arginfo_weechat_register
|
||||
|
||||
#define arginfo_weechat_log_print arginfo_weechat_register
|
||||
|
||||
#define arginfo_weechat_hook_command arginfo_weechat_register
|
||||
|
||||
Reference in New Issue
Block a user