summaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2017-09-04 21:00:53 +0200
committerSébastien Helleu <flashcode@flashtux.org>2017-09-04 21:08:49 +0200
commit28811c7ebdac34b3d6ca849e87d19d21ed89eb46 (patch)
tree33473fa4df54bfaa7df80a0af8aac4d42c056bc7 /src/plugins
parente317a6856c2e704890c9d1bdfb09273ea16a70ee (diff)
downloadweechat-28811c7ebdac34b3d6ca849e87d19d21ed89eb46.zip
php: sort functions by topic, remove unused API functions, fix compiler warning
Functions removed (not in scripting API): - weechat_string_replace - weechat_hdata_get_var - weechat_hdata_get_var_type
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/php/weechat-php-api.c5850
-rw-r--r--src/plugins/php/weechat-php-api.h310
-rw-r--r--src/plugins/php/weechat-php.c321
-rw-r--r--src/plugins/php/weechat-php.h4
4 files changed, 3542 insertions, 2943 deletions
diff --git a/src/plugins/php/weechat-php-api.c b/src/plugins/php/weechat-php-api.c
index b79f36fc8..a0e9c3f55 100644
--- a/src/plugins/php/weechat-php-api.c
+++ b/src/plugins/php/weechat-php-api.c
@@ -2,6 +2,7 @@
* weechat-php-api.c - PHP API functions
*
* Copyright (C) 2006-2017 Adam Saponara <as@php.net>
+ * Copyright (C) 2017 Sébastien Helleu <flashcode@flashtux.org>
*
* This file is part of WeeChat, the extensible chat client.
*
@@ -147,14 +148,9 @@ PHP_FUNCTION(weechat_register)
RETURN_TRUE;
}
-/*
- * Wrappers for functions in scripting API.
- *
- * For more info about these functions, look at their implementation in WeeChat
- * core.
- */
-
-static void weechat_php_cb(const void *pointer, void *data, void **func_argv, const char *func_types, int func_type, void *rc)
+static void
+weechat_php_cb (const void *pointer, void *data, void **func_argv,
+ const char *func_types, int func_type, void *rc)
{
struct t_plugin_script *script;
const char *ptr_function, *ptr_data;
@@ -208,925 +204,1143 @@ weechat_php_cb_err:
}
}
-static char *weechat_php_bar_item_new_build_callback(const void *pointer, void *data, struct t_gui_bar_item *item, struct t_gui_window *window, struct t_gui_buffer *buffer, struct t_hashtable *extra_info)
-{
- char *rc;
- void *func_argv[5];
- func_argv[1] = API_PTR2STR(item);
- func_argv[2] = API_PTR2STR(window);
- func_argv[3] = API_PTR2STR(buffer);
- func_argv[4] = extra_info;
- weechat_php_cb(pointer, data, func_argv, "ssssh", WEECHAT_SCRIPT_EXEC_STRING, &rc);
- if (func_argv[1])
- free (func_argv[1]);
- if (func_argv[2])
- free (func_argv[2]);
- if (func_argv[3])
- free (func_argv[3]);
- return rc;
-}
-
-int weechat_php_buffer_new_input_callback(const void *pointer, void *data, struct t_gui_buffer *buffer, const char *input_data)
-{
- int rc;
- void *func_argv[3];
- func_argv[1] = API_PTR2STR(buffer);
- func_argv[2] = input_data ? (char *)input_data : weechat_php_empty_arg;
- weechat_php_cb(pointer, data, func_argv, "sss", WEECHAT_SCRIPT_EXEC_INT, &rc);
- if (func_argv[1])
- free (func_argv[1]);
- return rc;
-}
-
-int weechat_php_buffer_new_close_callback(const void *pointer, void *data, struct t_gui_buffer *buffer)
-{
- int rc;
- void *func_argv[2];
- func_argv[1] = API_PTR2STR(buffer);
- weechat_php_cb(pointer, data, func_argv, "ss", WEECHAT_SCRIPT_EXEC_INT, &rc);
- if (func_argv[1])
- free (func_argv[1]);
- return rc;
-}
-
-static int weechat_php_config_new_callback_reload(const void *pointer, void *data, struct t_config_file *config_file)
-{
- int rc;
- void *func_argv[2];
- func_argv[1] = API_PTR2STR(config_file);
- weechat_php_cb(pointer, data, func_argv, "ss", WEECHAT_SCRIPT_EXEC_INT, &rc);
- if (func_argv[1])
- free (func_argv[1]);
- return rc;
-}
-
-static int weechat_php_config_new_option_callback_check_value(const void *pointer, void *data, struct t_config_option *option, const char *value)
-{
- int rc;
- void *func_argv[3];
- func_argv[1] = API_PTR2STR(option);
- func_argv[2] = value ? (char *)value : weechat_php_empty_arg;
- weechat_php_cb(pointer, data, func_argv, "sss", WEECHAT_SCRIPT_EXEC_INT, &rc);
- if (func_argv[1])
- free (func_argv[1]);
- return rc;
-}
-
-static void weechat_php_config_new_option_callback_change(const void *pointer, void *data, struct t_config_option *option)
-{
- int *rc;
- void *func_argv[2];
- func_argv[1] = API_PTR2STR(option);
- weechat_php_cb(pointer, data, func_argv, "ss", WEECHAT_SCRIPT_EXEC_INT, &rc);
- if (func_argv[1])
- free (func_argv[1]);
-}
-
-static void weechat_php_config_new_option_callback_delete(const void *pointer, void *data, struct t_config_option *option)
-{
- int rc;
- void *func_argv[2];
- func_argv[1] = API_PTR2STR(option);
- weechat_php_cb(pointer, data, func_argv, "ss", WEECHAT_SCRIPT_EXEC_INT, &rc);
- if (func_argv[1])
- free (func_argv[1]);
-}
-
-static int weechat_php_config_new_section_callback_read(const void *pointer, void *data, struct t_config_file *config_file, struct t_config_section *section, const char *option_name, const char *value)
-{
- int rc;
- void *func_argv[5];
- func_argv[1] = API_PTR2STR(config_file);
- func_argv[2] = API_PTR2STR(section);
- func_argv[3] = option_name ? (char *)option_name : weechat_php_empty_arg;
- func_argv[4] = value ? (char *)value : weechat_php_empty_arg;
- weechat_php_cb(pointer, data, func_argv, "sssss", WEECHAT_SCRIPT_EXEC_INT, &rc);
- if (func_argv[1])
- free (func_argv[1]);
- if (func_argv[2])
- free (func_argv[2]);
- return rc;
-}
-
-static int weechat_php_config_new_section_callback_write(const void *pointer, void *data, struct t_config_file *config_file, const char *section_name)
-{
- int rc;
- void *func_argv[3];
- func_argv[1] = API_PTR2STR(config_file);
- func_argv[2] = section_name ? (char *)section_name : weechat_php_empty_arg;
- weechat_php_cb(pointer, data, func_argv, "sss", WEECHAT_SCRIPT_EXEC_INT, &rc);
- if (func_argv[1])
- free (func_argv[1]);
- return rc;
-}
-
-static int weechat_php_config_new_section_callback_write_default(const void *pointer, void *data, struct t_config_file *config_file, const char *section_name)
-{
- int rc;
- void *func_argv[3];
- func_argv[1] = API_PTR2STR(config_file);
- func_argv[2] = section_name ? (char *)section_name : weechat_php_empty_arg;
- weechat_php_cb(pointer, data, func_argv, "sss", WEECHAT_SCRIPT_EXEC_INT, &rc);
- if (func_argv[1])
- free (func_argv[1]);
- return rc;
-}
+/*
+ * Wrappers for functions in scripting API.
+ *
+ * For more info about these functions, look at their implementation in WeeChat
+ * core.
+ */
-static int weechat_php_config_new_section_callback_create_option(const void *pointer, void *data, struct t_config_file *config_file, struct t_config_section *section, const char *option_name, const char *value)
+PHP_FUNCTION(weechat_plugin_get_name)
{
- int rc;
- void *func_argv[5];
- func_argv[1] = API_PTR2STR(config_file);
- func_argv[2] = API_PTR2STR(section);
- func_argv[3] = option_name ? (char *)option_name : weechat_php_empty_arg;
- func_argv[4] = value ? (char *)value : weechat_php_empty_arg;
- weechat_php_cb(pointer, data, func_argv, "sssss", WEECHAT_SCRIPT_EXEC_INT, &rc);
- if (func_argv[1])
- free (func_argv[1]);
- if (func_argv[2])
- free (func_argv[2]);
- return rc;
+ API_FUNC_INIT(weechat_plugin_get_name);
+ const char *retval;
+ if (zend_parse_parameters_none () == FAILURE)
+ {
+ return;
+ }
+ retval = weechat_plugin_get_name (weechat_php_plugin);
+ SAFE_RETURN_STRING(retval);
}
-static int weechat_php_config_new_section_callback_delete_option(const void *pointer, void *data, struct t_config_file *config_file, struct t_config_section *section, struct t_config_option *option)
+PHP_FUNCTION(weechat_charset_set)
{
- int rc;
- void *func_argv[4];
- func_argv[1] = API_PTR2STR(config_file);
- func_argv[2] = API_PTR2STR(section);
- func_argv[3] = API_PTR2STR(option);
- weechat_php_cb(pointer, data, func_argv, "ssss", WEECHAT_SCRIPT_EXEC_INT, &rc);
- if (func_argv[1])
- free (func_argv[1]);
- if (func_argv[2])
- free (func_argv[2]);
- if (func_argv[3])
- free (func_argv[3]);
- return rc;
+ API_FUNC_INIT(weechat_charset_set);
+ zend_string *z_charset;
+ char *charset;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_charset) == FAILURE)
+ {
+ return;
+ }
+ charset = ZSTR_VAL(z_charset);
+ plugin_script_api_charset_set (php_current_script, (const char *)charset);
+ RETURN_NULL();
}
-static int weechat_php_hook_command_callback(const void *pointer, void *data, struct t_gui_buffer *buffer, int argc, char **argv, char **argv_eol)
+PHP_FUNCTION(weechat_iconv_to_internal)
{
- int rc;
- void *func_argv[4];
- int i;
- int *argi;
- struct t_hashtable *args;
-
- (void)argv_eol;
-
- args = weechat_hashtable_new (argc, WEECHAT_HASHTABLE_INTEGER, WEECHAT_HASHTABLE_STRING, NULL, NULL);
- argi = malloc(sizeof(int) * argc);
-
- for (i = 0; i < argc; i++)
+ API_FUNC_INIT(weechat_iconv_to_internal);
+ zend_string *z_charset;
+ zend_string *z_string;
+ char *retval;
+ char *charset;
+ char *string;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SS", &z_charset, &z_string) == FAILURE)
{
- *(argi + i) = i;
- weechat_hashtable_set (args, argi+i, argv[i]);
+ return;
}
-
- func_argv[1] = API_PTR2STR(buffer);
- func_argv[2] = &argc;
- func_argv[3] = args;
- weechat_php_cb(pointer, data, func_argv, "ssih", WEECHAT_SCRIPT_EXEC_INT, &rc);
- free (argi);
- weechat_hashtable_free (args);
- if (func_argv[1])
- free (func_argv[1]);
- return rc;
+ charset = ZSTR_VAL(z_charset);
+ string = ZSTR_VAL(z_string);
+ retval = weechat_iconv_to_internal ((const char *)charset,
+ (const char *)string);
+ SAFE_RETURN_STRING(retval);
}
-static int weechat_php_hook_command_run_callback(const void *pointer, void *data, struct t_gui_buffer *buffer, const char *command)
+PHP_FUNCTION(weechat_iconv_from_internal)
{
- int rc;
- void *func_argv[3];
- func_argv[1] = API_PTR2STR(buffer);
- func_argv[2] = command ? (char *)command : weechat_php_empty_arg;
- weechat_php_cb(pointer, data, func_argv, "sss", WEECHAT_SCRIPT_EXEC_INT, &rc);
- if (func_argv[1])
- free (func_argv[1]);
- return rc;
+ API_FUNC_INIT(weechat_iconv_from_internal);
+ zend_string *z_charset;
+ zend_string *z_string;
+ char *retval;
+ char *charset;
+ char *string;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SS", &z_charset, &z_string) == FAILURE)
+ {
+ return;
+ }
+ charset = ZSTR_VAL(z_charset);
+ string = ZSTR_VAL(z_string);
+ retval = weechat_iconv_from_internal ((const char *)charset,
+ (const char *)string);
+ SAFE_RETURN_STRING(retval);
}
-static int weechat_php_hook_completion_callback(const void *pointer, void *data, const char *completion_item, struct t_gui_buffer *buffer, struct t_gui_completion *completion)
+PHP_FUNCTION(weechat_gettext)
{
- int rc;
- void *func_argv[4];
- func_argv[1] = completion_item ? (char *)completion_item : weechat_php_empty_arg;
- func_argv[2] = API_PTR2STR(buffer);
- func_argv[3] = API_PTR2STR(completion);
- weechat_php_cb(pointer, data, func_argv, "ssss", WEECHAT_SCRIPT_EXEC_INT, &rc);
- if (func_argv[2])
- free (func_argv[2]);
- if (func_argv[3])
- free (func_argv[3]);
- return rc;
+ API_FUNC_INIT(weechat_gettext);
+ zend_string *z_string;
+ const char *retval;
+ char *string;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_string) == FAILURE)
+ {
+ return;
+ }
+ string = ZSTR_VAL(z_string);
+ retval = weechat_gettext ((const char *)string);
+ SAFE_RETURN_STRING(retval);
}
-static int weechat_php_hook_config_callback(const void *pointer, void *data, const char *option, const char *value)
+PHP_FUNCTION(weechat_ngettext)
{
- int rc;
- void *func_argv[3];
- func_argv[1] = option ? (char *)option : weechat_php_empty_arg;
- func_argv[2] = value ? (char *)value : weechat_php_empty_arg;
- weechat_php_cb(pointer, data, func_argv, "sss", WEECHAT_SCRIPT_EXEC_INT, &rc);
- return rc;
+ API_FUNC_INIT(weechat_ngettext);
+ zend_string *z_single;
+ zend_string *z_plural;
+ zend_long z_count;
+ const char *retval;
+ char *single;
+ char *plural;
+ int count;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SSl", &z_single, &z_plural,
+ &z_count) == FAILURE)
+ {
+ return;
+ }
+ single = ZSTR_VAL(z_single);
+ plural = ZSTR_VAL(z_plural);
+ count = (int)z_count;
+ retval = weechat_ngettext ((const char *)single,
+ (const char *)plural,
+ count);
+ SAFE_RETURN_STRING(retval);
}
-static int weechat_php_hook_connect_callback(const void *pointer, void *data, int status, int gnutls_rc, int sock, const char *error, const char *ip_address)
+PHP_FUNCTION(weechat_strlen_screen)
{
- int rc;
- void *func_argv[6];
- func_argv[1] = &status;
- func_argv[2] = &gnutls_rc;
- func_argv[3] = &sock;
- func_argv[4] = error ? (char *)error : weechat_php_empty_arg;
- func_argv[5] = ip_address ? (char *)ip_address : weechat_php_empty_arg;
- weechat_php_cb(pointer, data, func_argv, "siiiss", WEECHAT_SCRIPT_EXEC_INT, &rc);
- return rc;
+ API_FUNC_INIT(weechat_strlen_screen);
+ zend_string *z_string;
+ int retval;
+ char *string;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_string) == FAILURE)
+ {
+ return;
+ }
+ string = ZSTR_VAL(z_string);
+ retval = weechat_strlen_screen ((const char *)string);
+ RETURN_LONG(retval);
}
-static int weechat_php_hook_fd_callback(const void *pointer, void *data, int fd)
+PHP_FUNCTION(weechat_string_match)
{
- int rc;
- void *func_argv[2];
- func_argv[1] = &fd;
- weechat_php_cb(pointer, data, func_argv, "si", WEECHAT_SCRIPT_EXEC_INT, &rc);
- return rc;
+ API_FUNC_INIT(weechat_string_match);
+ zend_string *z_string;
+ zend_string *z_mask;
+ zend_long z_case_sensitive;
+ int retval;
+ char *string;
+ char *mask;
+ int case_sensitive;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SSl", &z_string, &z_mask,
+ &z_case_sensitive) == FAILURE)
+ {
+ return;
+ }
+ string = ZSTR_VAL(z_string);
+ mask = ZSTR_VAL(z_mask);
+ case_sensitive = (int)z_case_sensitive;
+ retval = weechat_string_match ((const char *)string,
+ (const char *)mask,
+ case_sensitive);
+ RETURN_LONG(retval);
}
-static int weechat_php_hook_hsignal_callback(const void *pointer, void *data, const char *signal, struct t_hashtable *hashtable)
+PHP_FUNCTION(weechat_string_has_highlight)
{
- int rc;
- void *func_argv[3];
- func_argv[1] = signal ? (char *)signal : weechat_php_empty_arg;
- func_argv[2] = hashtable;
- weechat_php_cb(pointer, data, func_argv, "ssh", WEECHAT_SCRIPT_EXEC_INT, &rc);
- return rc;
+ API_FUNC_INIT(weechat_string_has_highlight);
+ zend_string *z_string;
+ zend_string *z_highlight_words;
+ int retval;
+ char *string;
+ char *highlight_words;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SS", &z_string, &z_highlight_words) == FAILURE)
+ {
+ return;
+ }
+ string = ZSTR_VAL(z_string);
+ highlight_words = ZSTR_VAL(z_highlight_words);
+ retval = weechat_string_has_highlight ((const char *)string,
+ (const char *)highlight_words);
+ RETURN_LONG(retval);
}
-static const char *weechat_php_hook_info_callback(const void *pointer, void *data, const char *info_name, const char *arguments)
+PHP_FUNCTION(weechat_string_has_highlight_regex)
{
- char *rc;
- void *func_argv[3];
- func_argv[1] = info_name ? (char *)info_name : weechat_php_empty_arg;
- func_argv[2] = arguments ? (char *)arguments : weechat_php_empty_arg;
- weechat_php_cb(pointer, data, func_argv, "sss", WEECHAT_SCRIPT_EXEC_STRING, &rc);
- return rc;
+ API_FUNC_INIT(weechat_string_has_highlight_regex);
+ zend_string *z_string;
+ zend_string *z_regex;
+ int retval;
+ char *string;
+ char *regex;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SS", &z_string, &z_regex) == FAILURE)
+ {
+ return;
+ }
+ string = ZSTR_VAL(z_string);
+ regex = ZSTR_VAL(z_regex);
+ retval = weechat_string_has_highlight_regex ((const char *)string,
+ (const char *)regex);
+ RETURN_LONG(retval);
}
-static char *weechat_php_hook_modifier_callback(const void *pointer, void *data, const char *modifier, const char *modifier_data, const char *string)
+PHP_FUNCTION(weechat_string_mask_to_regex)
{
- char *rc;
- void *func_argv[4];
- func_argv[1] = modifier ? (char *)modifier : weechat_php_empty_arg;
- func_argv[2] = modifier_data ? (char *)modifier_data : weechat_php_empty_arg;
- func_argv[3] = string ? (char *)string : weechat_php_empty_arg;
- weechat_php_cb(pointer, data, func_argv, "ssss", WEECHAT_SCRIPT_EXEC_STRING, &rc);
- return rc;
+ API_FUNC_INIT(weechat_string_mask_to_regex);
+ zend_string *z_mask;
+ char *retval;
+ char *mask;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_mask) == FAILURE)
+ {
+ return;
+ }
+ mask = ZSTR_VAL(z_mask);
+ retval = weechat_string_mask_to_regex ((const char *)mask);
+ SAFE_RETURN_STRING(retval);
}
-static int weechat_php_hook_print_callback(const void *pointer, void *data, struct t_gui_buffer *buffer, time_t date, int tags_count, const char **tags, int displayed, int highlight, const char *prefix, const char *message)
+PHP_FUNCTION(weechat_string_remove_color)
{
- int rc;
- void *func_argv[9];
- func_argv[1] = API_PTR2STR(buffer);
- func_argv[2] = &date;
- func_argv[3] = &tags_count;
- func_argv[4] = tags ? (char *)tags : weechat_php_empty_arg;
- func_argv[5] = &displayed;
- func_argv[6] = &highlight;
- func_argv[7] = prefix ? (char *)prefix : weechat_php_empty_arg;
- func_argv[8] = message ? (char *)message : weechat_php_empty_arg;
- weechat_php_cb(pointer, data, func_argv, "ssiisiiss", WEECHAT_SCRIPT_EXEC_INT, &rc);
- if (func_argv[1])
- free (func_argv[1]);
- return rc;
+ API_FUNC_INIT(weechat_string_remove_color);
+ zend_string *z_string;
+ zend_string *z_replacement;
+ char *retval;
+ char *string;
+ char *replacement;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SS", &z_string, &z_replacement) == FAILURE)
+ {
+ return;
+ }
+ string = ZSTR_VAL(z_string);
+ replacement = ZSTR_VAL(z_replacement);
+ retval = weechat_string_remove_color ((const char *)string,
+ (const char *)replacement);
+ SAFE_RETURN_STRING(retval);
}
-static int weechat_php_hook_process_callback(const void *pointer, void *data, const char *command, int return_code, const char *out, const char *err)
+PHP_FUNCTION(weechat_string_is_command_char)
{
- int rc;
- void *func_argv[5];
- func_argv[1] = command ? (char *)command : weechat_php_empty_arg;
- func_argv[2] = &return_code;
- func_argv[3] = out ? (char *)out : weechat_php_empty_arg;
- func_argv[4] = err ? (char *)err : weechat_php_empty_arg;
- weechat_php_cb(pointer, data, func_argv, "ssiss", WEECHAT_SCRIPT_EXEC_INT, &rc);
- return rc;
+ API_FUNC_INIT(weechat_string_is_command_char);
+ zend_string *z_string;
+ int retval;
+ char *string;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_string) == FAILURE)
+ {
+ return;
+ }
+ string = ZSTR_VAL(z_string);
+ retval = weechat_string_is_command_char ((const char *)string);
+ RETURN_LONG(retval);
}
-static int weechat_php_hook_process_hashtable_callback(const void *pointer, void *data, const char *command, int return_code, const char *out, const char *err)
+PHP_FUNCTION(weechat_string_input_for_buffer)
{
- int rc;
- void *func_argv[5];
- func_argv[1] = command ? (char *)command : weechat_php_empty_arg;
- func_argv[2] = &return_code;
- func_argv[3] = out ? (char *)out : weechat_php_empty_arg;
- func_argv[4] = err ? (char *)err : weechat_php_empty_arg;
- weechat_php_cb(pointer, data, func_argv, "ssiss", WEECHAT_SCRIPT_EXEC_INT, &rc);
- return rc;
+ API_FUNC_INIT(weechat_string_input_for_buffer);
+ zend_string *z_string;
+ const char *retval;
+ char *string;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_string) == FAILURE)
+ {
+ return;
+ }
+ string = ZSTR_VAL(z_string);
+ retval = weechat_string_input_for_buffer ((const char *)string);
+ SAFE_RETURN_STRING(retval);
}
-static int weechat_php_hook_signal_callback(const void *pointer, void *data, const char *signal, const char *type_data, void *signal_data)
+PHP_FUNCTION(weechat_string_eval_expression)
{
- int rc;
- void *func_argv[4];
- func_argv[1] = signal ? (char *)signal : weechat_php_empty_arg;
- func_argv[2] = type_data ? (char *)type_data : weechat_php_empty_arg;
- func_argv[3] = signal_data ? (char *)signal_data : weechat_php_empty_arg;
- weechat_php_cb(pointer, data, func_argv, "ssss", WEECHAT_SCRIPT_EXEC_INT, &rc);
- return rc;
+ API_FUNC_INIT(weechat_string_eval_expression);
+ zend_string *z_expr;
+ zval *z_pointers;
+ zval *z_extra_vars;
+ zval *z_options;
+ char *retval;
+ char *expr;
+ struct t_hashtable *pointers;
+ struct t_hashtable *extra_vars;
+ struct t_hashtable *options;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "Saaa", &z_expr, &z_pointers, &z_extra_vars,
+ &z_options) == FAILURE)
+ {
+ return;
+ }
+ expr = ZSTR_VAL(z_expr);
+ pointers = weechat_php_array_to_hashtable(
+ z_pointers,
+ WEECHAT_SCRIPT_HASHTABLE_DEFAULT_SIZE,
+ WEECHAT_HASHTABLE_STRING,
+ WEECHAT_HASHTABLE_STRING);
+ extra_vars = weechat_php_array_to_hashtable(
+ z_extra_vars,
+ WEECHAT_SCRIPT_HASHTABLE_DEFAULT_SIZE,
+ WEECHAT_HASHTABLE_STRING,
+ WEECHAT_HASHTABLE_STRING);
+ options = weechat_php_array_to_hashtable(
+ z_options,
+ WEECHAT_SCRIPT_HASHTABLE_DEFAULT_SIZE,
+ WEECHAT_HASHTABLE_STRING,
+ WEECHAT_HASHTABLE_STRING);
+ retval = weechat_string_eval_expression ((const char *)expr,
+ pointers,
+ extra_vars,
+ options);
+ SAFE_RETURN_STRING(retval);
}
-static int weechat_php_hook_timer_callback(const void *pointer, void *data, int remaining_calls)
+PHP_FUNCTION(weechat_string_eval_path_home)
{
- int rc;
- void *func_argv[2];
- func_argv[1] = &remaining_calls;
- weechat_php_cb(pointer, data, func_argv, "si", WEECHAT_SCRIPT_EXEC_INT, &rc);
- return rc;
+ API_FUNC_INIT(weechat_string_eval_path_home);
+ zend_string *z_path;
+ zval *z_pointers;
+ zval *z_extra_vars;
+ zval *z_options;
+ char *retval;
+ char *path;
+ struct t_hashtable *pointers;
+ struct t_hashtable *extra_vars;
+ struct t_hashtable *options;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "Saaa", &z_path, &z_pointers, &z_extra_vars,
+ &z_options) == FAILURE)
+ {
+ return;
+ }
+ path = ZSTR_VAL(z_path);
+ pointers = weechat_php_array_to_hashtable(
+ z_pointers,
+ WEECHAT_SCRIPT_HASHTABLE_DEFAULT_SIZE,
+ WEECHAT_HASHTABLE_STRING,
+ WEECHAT_HASHTABLE_STRING);
+ extra_vars = weechat_php_array_to_hashtable(
+ z_extra_vars,
+ WEECHAT_SCRIPT_HASHTABLE_DEFAULT_SIZE,
+ WEECHAT_HASHTABLE_STRING,
+ WEECHAT_HASHTABLE_STRING);
+ options = weechat_php_array_to_hashtable(
+ z_options,
+ WEECHAT_SCRIPT_HASHTABLE_DEFAULT_SIZE,
+ WEECHAT_HASHTABLE_STRING,
+ WEECHAT_HASHTABLE_STRING);
+ retval = weechat_string_eval_path_home ((const char *)path,
+ pointers,
+ extra_vars,
+ options);
+ SAFE_RETURN_STRING(retval);
}
-static int weechat_php_upgrade_new_callback_read(const void *pointer, void *data, struct t_upgrade_file *upgrade_file, int object_id, struct t_infolist *infolist)
+PHP_FUNCTION(weechat_mkdir_home)
{
- int rc;
- void *func_argv[4];
- func_argv[1] = API_PTR2STR(upgrade_file);
- func_argv[2] = &object_id;
- func_argv[3] = API_PTR2STR(infolist);
- weechat_php_cb(pointer, data, func_argv, "ssis", WEECHAT_SCRIPT_EXEC_INT, &rc);
- if (func_argv[1])
- free (func_argv[1]);
- if (func_argv[3])
- free (func_argv[3]);
- return rc;
+ API_FUNC_INIT(weechat_mkdir_home);
+ zend_string *z_directory;
+ zend_long z_mode;
+ int retval;
+ char *directory;
+ int mode;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "Sl", &z_directory, &z_mode) == FAILURE)
+ {
+ return;
+ }
+ directory = ZSTR_VAL(z_directory);
+ mode = (int)z_mode;
+ retval = weechat_mkdir_home ((const char *)directory, mode);
+ RETURN_LONG(retval);
}
-struct t_hashtable * weechat_php_api_hook_focus_callback(const void *pointer, void *data, struct t_hashtable *info)
+PHP_FUNCTION(weechat_mkdir)
{
- struct t_hashtable *rc;
- void *func_argv[2];
- func_argv[1] = info;
- weechat_php_cb(pointer, data, func_argv, "sh", WEECHAT_SCRIPT_EXEC_HASHTABLE, &rc);
- return rc;
+ API_FUNC_INIT(weechat_mkdir);
+ zend_string *z_directory;
+ zend_long z_mode;
+ int retval;
+ char *directory;
+ int mode;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "Sl", &z_directory, &z_mode) == FAILURE)
+ {
+ return;
+ }
+ directory = ZSTR_VAL(z_directory);
+ mode = (int)z_mode;
+ retval = weechat_mkdir ((const char *)directory, mode);
+ RETURN_LONG(retval);
}
-struct t_hashtable * weechat_php_api_hook_info_hashtable_callback(const void *pointer, void *data, const char *info_name, struct t_hashtable *hashtable)
+PHP_FUNCTION(weechat_mkdir_parents)
{
- struct t_hashtable *rc;
- void *func_argv[3];
- func_argv[1] = (info_name) ? (char *)info_name : weechat_php_empty_arg;
- func_argv[2] = hashtable;
- weechat_php_cb(pointer, data, func_argv, "ssh", WEECHAT_SCRIPT_EXEC_HASHTABLE, &rc);
- return rc;
+ API_FUNC_INIT(weechat_mkdir_parents);
+ zend_string *z_directory;
+ zend_long z_mode;
+ int retval;
+ char *directory;
+ int mode;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "Sl", &z_directory, &z_mode) == FAILURE)
+ {
+ return;
+ }
+ directory = ZSTR_VAL(z_directory);
+ mode = (int)z_mode;
+ retval = weechat_mkdir_parents ((const char *)directory, mode);
+ RETURN_LONG(retval);
}
-struct t_infolist * weechat_php_api_hook_infolist_callback (const void *pointer, void *data, const char *info_name, void *obj_pointer, const char *arguments)
+PHP_FUNCTION(weechat_list_new)
{
- struct t_infolist *rc;
- void *func_argv[4];
- func_argv[1] = (info_name) ? (char *)info_name : weechat_php_empty_arg;
- func_argv[2] = API_PTR2STR(obj_pointer);
- func_argv[3] = (arguments) ? (char *)arguments : weechat_php_empty_arg;
- weechat_php_cb(pointer, data, func_argv, "ssss", WEECHAT_SCRIPT_EXEC_STRING, &rc);
- if (func_argv[2])
- free (func_argv[2]);
- return rc;
+ API_FUNC_INIT(weechat_list_new);
+ struct t_weelist *retval;
+ if (zend_parse_parameters_none () == FAILURE)
+ {
+ return;
+ }
+ retval = weechat_list_new ();
+ char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
}
-
-PHP_FUNCTION(weechat_bar_item_remove)
+PHP_FUNCTION(weechat_list_add)
{
- API_FUNC_INIT(weechat_bar_item_remove);
- zend_string *z_item;
- struct t_gui_bar_item *item;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_item) == FAILURE)
+ API_FUNC_INIT(weechat_list_add);
+ zend_string *z_weelist;
+ zend_string *z_data;
+ zend_string *z_where;
+ zend_string *z_user_data;
+ struct t_weelist_item *retval;
+ struct t_weelist *weelist;
+ char *data;
+ char *where;
+ void *user_data;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SSSS", &z_weelist, &z_data, &z_where,
+ &z_user_data) == FAILURE)
{
return;
}
- item = (struct t_gui_bar_item *)API_STR2PTR(ZSTR_VAL(z_item));
- weechat_bar_item_remove (item);
- RETURN_NULL();
+ weelist = (struct t_weelist *)API_STR2PTR(ZSTR_VAL(z_weelist));
+ data = ZSTR_VAL(z_data);
+ where = ZSTR_VAL(z_where);
+ user_data = (void *)API_STR2PTR(ZSTR_VAL(z_user_data));
+ retval = weechat_list_add (weelist,
+ (const char *)data,
+ (const char *)where,
+ user_data);
+ char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
}
-PHP_FUNCTION(weechat_bar_item_search)
+PHP_FUNCTION(weechat_list_search)
{
- API_FUNC_INIT(weechat_bar_item_search);
- zend_string *z_name;
- struct t_gui_bar_item *retval;
- char *name;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_name) == FAILURE)
+ API_FUNC_INIT(weechat_list_search);
+ zend_string *z_weelist;
+ zend_string *z_data;
+ struct t_weelist_item *retval;
+ struct t_weelist *weelist;
+ char *data;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SS", &z_weelist, &z_data) == FAILURE)
{
return;
}
- name = ZSTR_VAL(z_name);
- retval = weechat_bar_item_search ((const char *)name);
+ weelist = (struct t_weelist *)API_STR2PTR(ZSTR_VAL(z_weelist));
+ data = ZSTR_VAL(z_data);
+ retval = weechat_list_search (weelist, (const char *)data);
char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
}
-PHP_FUNCTION(weechat_bar_item_update)
+PHP_FUNCTION(weechat_list_search_pos)
{
- API_FUNC_INIT(weechat_bar_item_update);
- zend_string *z_name;
- char *name;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_name) == FAILURE)
+ API_FUNC_INIT(weechat_list_search_pos);
+ zend_string *z_weelist;
+ zend_string *z_data;
+ int retval;
+ struct t_weelist *weelist;
+ char *data;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SS", &z_weelist, &z_data) == FAILURE)
{
return;
}
- name = ZSTR_VAL(z_name);
- weechat_bar_item_update ((const char *)name);
- RETURN_NULL();
+ weelist = (struct t_weelist *)API_STR2PTR(ZSTR_VAL(z_weelist));
+ data = ZSTR_VAL(z_data);
+ retval = weechat_list_search_pos (weelist, (const char *)data);
+ RETURN_LONG(retval);
}
-PHP_FUNCTION(weechat_bar_new)
+PHP_FUNCTION(weechat_list_casesearch)
{
- API_FUNC_INIT(weechat_bar_new);
- zend_string *z_name;
- zend_string *z_hidden;
- zend_string *z_priority;
- zend_string *z_type;
- zend_string *z_condition;
- zend_string *z_position;
- zend_string *z_filling_top_bottom;
- zend_string *z_filling_left_right;
- zend_string *z_size;
- zend_string *z_size_max;
- zend_string *z_color_fg;
- zend_string *z_color_delim;
- zend_string *z_color_bg;
- zend_string *z_separator;
- zend_string *z_items;
- struct t_gui_bar *retval;
- char *name;
- char *hidden;
- char *priority;
- char *type;
- char *condition;
- char *position;
- char *filling_top_bottom;
- char *filling_left_right;
- char *size;
- char *size_max;
- char *color_fg;
- char *color_delim;
- char *color_bg;
- char *separator;
- char *items;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SSSSSSSSSSSSSSS", &z_name, &z_hidden, &z_priority, &z_type, &z_condition, &z_position, &z_filling_top_bottom, &z_filling_left_right, &z_size, &z_size_max, &z_color_fg, &z_color_delim, &z_color_bg, &z_separator, &z_items) == FAILURE)
+ API_FUNC_INIT(weechat_list_casesearch);
+ zend_string *z_weelist;
+ zend_string *z_data;
+ struct t_weelist_item *retval;
+ struct t_weelist *weelist;
+ char *data;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SS", &z_weelist, &z_data) == FAILURE)
{
return;
}
- name = ZSTR_VAL(z_name);
- hidden = ZSTR_VAL(z_hidden);
- priority = ZSTR_VAL(z_priority);
- type = ZSTR_VAL(z_type);
- condition = ZSTR_VAL(z_condition);
- position = ZSTR_VAL(z_position);
- filling_top_bottom = ZSTR_VAL(z_filling_top_bottom);
- filling_left_right = ZSTR_VAL(z_filling_left_right);
- size = ZSTR_VAL(z_size);
- size_max = ZSTR_VAL(z_size_max);
- color_fg = ZSTR_VAL(z_color_fg);
- color_delim = ZSTR_VAL(z_color_delim);
- color_bg = ZSTR_VAL(z_color_bg);
- separator = ZSTR_VAL(z_separator);
- items = ZSTR_VAL(z_items);
- retval = weechat_bar_new ((const char *)name, (const char *)hidden, (const char *)priority, (const char *)type, (const char *)condition, (const char *)position, (const char *)filling_top_bottom, (const char *)filling_left_right, (const char *)size, (const char *)size_max, (const char *)color_fg, (const char *)color_delim, (const char *)color_bg, (const char *)separator, (const char *)items);
+ weelist = (struct t_weelist *)API_STR2PTR(ZSTR_VAL(z_weelist));
+ data = ZSTR_VAL(z_data);
+ retval = weechat_list_casesearch (weelist, (const char *)data);
char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
}
-PHP_FUNCTION(weechat_bar_remove)
+PHP_FUNCTION(weechat_list_casesearch_pos)
{
- API_FUNC_INIT(weechat_bar_remove);
- zend_string *z_bar;
- struct t_gui_bar *bar;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_bar) == FAILURE)
+ API_FUNC_INIT(weechat_list_casesearch_pos);
+ zend_string *z_weelist;
+ zend_string *z_data;
+ int retval;
+ struct t_weelist *weelist;
+ char *data;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SS", &z_weelist, &z_data) == FAILURE)
{
return;
}
- bar = (struct t_gui_bar *)API_STR2PTR(ZSTR_VAL(z_bar));
- weechat_bar_remove (bar);
- RETURN_NULL();
+ weelist = (struct t_weelist *)API_STR2PTR(ZSTR_VAL(z_weelist));
+ data = ZSTR_VAL(z_data);
+ retval = weechat_list_casesearch_pos (weelist, (const char *)data);
+ RETURN_LONG(retval);
}
-PHP_FUNCTION(weechat_bar_search)
+PHP_FUNCTION(weechat_list_get)
{
- API_FUNC_INIT(weechat_bar_search);
- zend_string *z_name;
- struct t_gui_bar *retval;
- char *name;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_name) == FAILURE)
+ API_FUNC_INIT(weechat_list_get);
+ zend_string *z_weelist;
+ zend_long z_position;
+ struct t_weelist_item *retval;
+ struct t_weelist *weelist;
+ int position;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "Sl", &z_weelist, &z_position) == FAILURE)
{
return;
}
- name = ZSTR_VAL(z_name);
- retval = weechat_bar_search ((const char *)name);
+ weelist = (struct t_weelist *)API_STR2PTR(ZSTR_VAL(z_weelist));
+ position = (int)z_position;
+ retval = weechat_list_get (weelist, position);
char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
}
-PHP_FUNCTION(weechat_bar_set)
+PHP_FUNCTION(weechat_list_set)
{
- API_FUNC_INIT(weechat_bar_set);
- zend_string *z_bar;
- zend_string *z_property;
+ API_FUNC_INIT(weechat_list_set);
+ zend_string *z_item;
zend_string *z_value;
- int retval;
- struct t_gui_bar *bar;
- char *property;
+ struct t_weelist_item *item;
char *value;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SSS", &z_bar, &z_property, &z_value) == FAILURE)
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SS", &z_item, &z_value) == FAILURE)
{
return;
}
- bar = (struct t_gui_bar *)API_STR2PTR(ZSTR_VAL(z_bar));
- property = ZSTR_VAL(z_property);
+ item = (struct t_weelist_item *)API_STR2PTR(ZSTR_VAL(z_item));
value = ZSTR_VAL(z_value);
- retval = weechat_bar_set (bar, (const char *)property, (const char *)value);
- RETURN_LONG(retval);
+ weechat_list_set (item, (const char *)value);
+ RETURN_NULL();
}
-PHP_FUNCTION(weechat_bar_update)
+PHP_FUNCTION(weechat_list_next)
{
- API_FUNC_INIT(weechat_bar_update);
- zend_string *z_name;
- char *name;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_name) == FAILURE)
+ API_FUNC_INIT(weechat_list_next);
+ zend_string *z_item;
+ struct t_weelist_item *retval;
+ struct t_weelist_item *item;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_item) == FAILURE)
{
return;
}
- name = ZSTR_VAL(z_name);
- weechat_bar_update ((const char *)name);
- RETURN_NULL();
+ item = (struct t_weelist_item *)API_STR2PTR(ZSTR_VAL(z_item));
+ retval = weechat_list_next (item);
+ char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
}
-PHP_FUNCTION(weechat_buffer_clear)
+PHP_FUNCTION(weechat_list_prev)
{
- API_FUNC_INIT(weechat_buffer_clear);
- zend_string *z_buffer;
- struct t_gui_buffer *buffer;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_buffer) == FAILURE)
+ API_FUNC_INIT(weechat_list_prev);
+ zend_string *z_item;
+ struct t_weelist_item *retval;
+ struct t_weelist_item *item;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_item) == FAILURE)
{
return;
}
- buffer = (struct t_gui_buffer *)API_STR2PTR(ZSTR_VAL(z_buffer));
- weechat_buffer_clear (buffer);
- RETURN_NULL();
+ item = (struct t_weelist_item *)API_STR2PTR(ZSTR_VAL(z_item));
+ retval = weechat_list_prev (item);
+ char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
}
-PHP_FUNCTION(weechat_buffer_close)
+PHP_FUNCTION(weechat_list_string)
{
- API_FUNC_INIT(weechat_buffer_close);
- zend_string *z_buffer;
- struct t_gui_buffer *buffer;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_buffer) == FAILURE)
+ API_FUNC_INIT(weechat_list_string);
+ zend_string *z_item;
+ const char *retval;
+ struct t_weelist_item *item;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_item) == FAILURE)
{
return;
}
- buffer = (struct t_gui_buffer *)API_STR2PTR(ZSTR_VAL(z_buffer));
- weechat_buffer_close (buffer);
- RETURN_NULL();
+ item = (struct t_weelist_item *)API_STR2PTR(ZSTR_VAL(z_item));
+ retval = weechat_list_string (item);
+ SAFE_RETURN_STRING(retval);
}
-PHP_FUNCTION(weechat_buffer_get_integer)
+PHP_FUNCTION(weechat_list_size)
{
- API_FUNC_INIT(weechat_buffer_get_integer);
- zend_string *z_buffer;
- zend_string *z_property;
+ API_FUNC_INIT(weechat_list_size);
+ zend_string *z_weelist;
int retval;
- struct t_gui_buffer *buffer;
- char *property;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SS", &z_buffer, &z_property) == FAILURE)
+ struct t_weelist *weelist;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_weelist) == FAILURE)
{
return;
}
- buffer = (struct t_gui_buffer *)API_STR2PTR(ZSTR_VAL(z_buffer));
- property = ZSTR_VAL(z_property);
- retval = weechat_buffer_get_integer (buffer, (const char *)property);
+ weelist = (struct t_weelist *)API_STR2PTR(ZSTR_VAL(z_weelist));
+ retval = weechat_list_size (weelist);
RETURN_LONG(retval);
}
-PHP_FUNCTION(weechat_buffer_get_pointer)
+PHP_FUNCTION(weechat_list_remove)
{
- API_FUNC_INIT(weechat_buffer_get_pointer);
- zend_string *z_buffer;
- zend_string *z_property;
- void *retval;
- struct t_gui_buffer *buffer;
- char *property;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SS", &z_buffer, &z_property) == FAILURE)
+ API_FUNC_INIT(weechat_list_remove);
+ zend_string *z_weelist;
+ zend_string *z_item;
+ struct t_weelist *weelist;
+ struct t_weelist_item *item;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SS", &z_weelist, &z_item) == FAILURE)
{
return;
}
- buffer = (struct t_gui_buffer *)API_STR2PTR(ZSTR_VAL(z_buffer));
- property = ZSTR_VAL(z_property);
- retval = weechat_buffer_get_pointer (buffer, (const char *)property);
- char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
+ weelist = (struct t_weelist *)API_STR2PTR(ZSTR_VAL(z_weelist));
+ item = (struct t_weelist_item *)API_STR2PTR(ZSTR_VAL(z_item));
+ weechat_list_remove (weelist, item);
+ RETURN_NULL();
}
-PHP_FUNCTION(weechat_buffer_get_string)
+PHP_FUNCTION(weechat_list_remove_all)
{
- API_FUNC_INIT(weechat_buffer_get_string);
- zend_string *z_buffer;
- zend_string *z_property;
- const char *retval;
- struct t_gui_buffer *buffer;
- char *property;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SS", &z_buffer, &z_property) == FAILURE)
+ API_FUNC_INIT(weechat_list_remove_all);
+ zend_string *z_weelist;
+ struct t_weelist *weelist;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_weelist) == FAILURE)
{
return;
}
- buffer = (struct t_gui_buffer *)API_STR2PTR(ZSTR_VAL(z_buffer));
- property = ZSTR_VAL(z_property);
- retval = weechat_buffer_get_string (buffer, (const char *)property);
- SAFE_RETURN_STRING(retval);
+ weelist = (struct t_weelist *)API_STR2PTR(ZSTR_VAL(z_weelist));
+ weechat_list_remove_all (weelist);
+ RETURN_NULL();
}
-PHP_FUNCTION(weechat_buffer_match_list)
+PHP_FUNCTION(weechat_list_free)
{
- API_FUNC_INIT(weechat_buffer_match_list);
- zend_string *z_buffer;
- zend_string *z_string;
- int retval;
- struct t_gui_buffer *buffer;
- char *string;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SS", &z_buffer, &z_string) == FAILURE)
+ API_FUNC_INIT(weechat_list_free);
+ zend_string *z_weelist;
+ struct t_weelist *weelist;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_weelist) == FAILURE)
{
return;
}
- buffer = (struct t_gui_buffer *)API_STR2PTR(ZSTR_VAL(z_buffer));
- string = ZSTR_VAL(z_string);
- retval = weechat_buffer_match_list (buffer, (const char *)string);
- RETURN_LONG(retval);
+ weelist = (struct t_weelist *)API_STR2PTR(ZSTR_VAL(z_weelist));
+ weechat_list_free (weelist);
+ RETURN_NULL();
}
-PHP_FUNCTION(weechat_buffer_merge)
+static int
+weechat_php_config_new_callback_reload(const void *pointer, void *data,
+ struct t_config_file *config_file)
{
- API_FUNC_INIT(weechat_buffer_merge);
- zend_string *z_buffer;
- zend_string *z_target_buffer;
- struct t_gui_buffer *buffer;
- struct t_gui_buffer *target_buffer;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SS", &z_buffer, &z_target_buffer) == FAILURE)
- {
- return;
- }
- buffer = (struct t_gui_buffer *)API_STR2PTR(ZSTR_VAL(z_buffer));
- target_buffer = (struct t_gui_buffer *)API_STR2PTR(ZSTR_VAL(z_target_buffer));
- weechat_buffer_merge (buffer, target_buffer);
- RETURN_NULL();
+ int rc;
+ void *func_argv[2];
+ func_argv[1] = API_PTR2STR(config_file);
+ weechat_php_cb(pointer, data, func_argv, "ss",
+ WEECHAT_SCRIPT_EXEC_INT, &rc);
+ if (func_argv[1])
+ free (func_argv[1]);
+ return rc;
}
-PHP_FUNCTION(weechat_buffer_search)
+PHP_FUNCTION(weechat_config_new)
{
- API_FUNC_INIT(weechat_buffer_search);
- zend_string *z_plugin;
+ API_FUNC_INIT(weechat_config_new);
zend_string *z_name;
- struct t_gui_buffer *retval;
- char *plugin;
+ zval *z_callback_reload;
+ zend_string *z_data;
+ struct t_config_file *retval;
char *name;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SS", &z_plugin, &z_name) == FAILURE)
+ char *data;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SzS", &z_name, &z_callback_reload,
+ &z_data) == FAILURE)
{
return;
}
- plugin = ZSTR_VAL(z_plugin);
name = ZSTR_VAL(z_name);
- retval = weechat_buffer_search ((const char *)plugin, (const char *)name);
+ weechat_php_get_function_name (z_callback_reload, callback_reload_name);
+ data = ZSTR_VAL(z_data);
+ retval = plugin_script_api_config_new (
+ weechat_php_plugin,
+ php_current_script,
+ (const char *)name,
+ weechat_php_config_new_callback_reload,
+ (const char *)callback_reload_name,
+ (const char *)data);
char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
}
-PHP_FUNCTION(weechat_buffer_search_main)
+static int
+weechat_php_config_new_section_callback_read (const void *pointer, void *data,
+ struct t_config_file *config_file,
+ struct t_config_section *section,
+ const char *option_name,
+ const char *value)
{
- API_FUNC_INIT(weechat_buffer_search_main);
- struct t_gui_buffer *retval;
- if (zend_parse_parameters_none () == FAILURE)
- {
- return;
- }
- retval = weechat_buffer_search_main ();
- char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
+ int rc;
+ void *func_argv[5];
+ func_argv[1] = API_PTR2STR(config_file);
+ func_argv[2] = API_PTR2STR(section);
+ func_argv[3] = option_name ? (char *)option_name : weechat_php_empty_arg;
+ func_argv[4] = value ? (char *)value : weechat_php_empty_arg;
+ weechat_php_cb(pointer, data, func_argv, "sssss",
+ WEECHAT_SCRIPT_EXEC_INT, &rc);
+ if (func_argv[1])
+ free (func_argv[1]);
+ if (func_argv[2])
+ free (func_argv[2]);
+ return rc;
}
-PHP_FUNCTION(weechat_buffer_set)
+static int
+weechat_php_config_new_section_callback_write (const void *pointer, void *data,
+ struct t_config_file *config_file,
+ const char *section_name)
{
- API_FUNC_INIT(weechat_buffer_set);
- zend_string *z_buffer;
- zend_string *z_property;
- zend_string *z_value;
- struct t_gui_buffer *buffer;
- char *property;
- char *value;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SSS", &z_buffer, &z_property, &z_value) == FAILURE)
- {
- return;
- }
- buffer = (struct t_gui_buffer *)API_STR2PTR(ZSTR_VAL(z_buffer));
- property = ZSTR_VAL(z_property);
- value = ZSTR_VAL(z_value);
- weechat_buffer_set (buffer, (const char *)property, (const char *)value);
- RETURN_NULL();
+ int rc;
+ void *func_argv[3];
+ func_argv[1] = API_PTR2STR(config_file);
+ func_argv[2] = section_name ? (char *)section_name : weechat_php_empty_arg;
+ weechat_php_cb (pointer, data, func_argv, "sss",
+ WEECHAT_SCRIPT_EXEC_INT, &rc);
+ if (func_argv[1])
+ free (func_argv[1]);
+ return rc;
}
-PHP_FUNCTION(weechat_buffer_string_replace_local_var)
+static int
+weechat_php_config_new_section_callback_write_default (const void *pointer,
+ void *data,
+ struct t_config_file *config_file,
+ const char *section_name)
{
- API_FUNC_INIT(weechat_buffer_string_replace_local_var);
- zend_string *z_buffer;
- zend_string *z_string;
- char *retval;
- struct t_gui_buffer *buffer;
- char *string;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SS", &z_buffer, &z_string) == FAILURE)
- {
- return;
- }
- buffer = (struct t_gui_buffer *)API_STR2PTR(ZSTR_VAL(z_buffer));
- string = ZSTR_VAL(z_string);
- retval = weechat_buffer_string_replace_local_var (buffer, (const char *)string);
- SAFE_RETURN_STRING(retval);
+ int rc;
+ void *func_argv[3];
+ func_argv[1] = API_PTR2STR(config_file);
+ func_argv[2] = section_name ? (char *)section_name : weechat_php_empty_arg;
+ weechat_php_cb (pointer, data, func_argv, "sss",
+ WEECHAT_SCRIPT_EXEC_INT, &rc);
+ if (func_argv[1])
+ free (func_argv[1]);
+ return rc;
}
-PHP_FUNCTION(weechat_buffer_unmerge)
+static int
+weechat_php_config_new_section_callback_create_option (const void *pointer,
+ void *data,
+ struct t_config_file *config_file,
+ struct t_config_section *section,
+ const char *option_name,
+ const char *value)
{
- API_FUNC_INIT(weechat_buffer_unmerge);
- zend_string *z_buffer;
- zend_long z_number;
- struct t_gui_buffer *buffer;
- int number;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "Sl", &z_buffer, &z_number) == FAILURE)
- {
- return;
- }
- buffer = (struct t_gui_buffer *)API_STR2PTR(ZSTR_VAL(z_buffer));
- number = (int)z_number;
- weechat_buffer_unmerge (buffer, number);
- RETURN_NULL();
+ int rc;
+ void *func_argv[5];
+ func_argv[1] = API_PTR2STR(config_file);
+ func_argv[2] = API_PTR2STR(section);
+ func_argv[3] = option_name ? (char *)option_name : weechat_php_empty_arg;
+ func_argv[4] = value ? (char *)value : weechat_php_empty_arg;
+ weechat_php_cb (pointer, data, func_argv, "sssss",
+ WEECHAT_SCRIPT_EXEC_INT, &rc);
+ if (func_argv[1])
+ free (func_argv[1]);
+ if (func_argv[2])
+ free (func_argv[2]);
+ return rc;
}
-PHP_FUNCTION(weechat_color)
+static int
+weechat_php_config_new_section_callback_delete_option (const void *pointer,
+ void *data,
+ struct t_config_file *config_file,
+ struct t_config_section *section,
+ struct t_config_option *option)
{
- API_FUNC_INIT(weechat_color);
- zend_string *z_color_name;
- const char *retval;
- char *color_name;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_color_name) == FAILURE)
- {
- return;
- }
- color_name = ZSTR_VAL(z_color_name);
- retval = weechat_color ((const char *)color_name);
- SAFE_RETURN_STRING(retval);
+ int rc;
+ void *func_argv[4];
+ func_argv[1] = API_PTR2STR(config_file);
+ func_argv[2] = API_PTR2STR(section);
+ func_argv[3] = API_PTR2STR(option);
+ weechat_php_cb (pointer, data, func_argv, "ssss",
+ WEECHAT_SCRIPT_EXEC_INT, &rc);
+ if (func_argv[1])
+ free (func_argv[1]);
+ if (func_argv[2])
+ free (func_argv[2]);
+ if (func_argv[3])
+ free (func_argv[3]);
+ return rc;
}
-PHP_FUNCTION(weechat_config_boolean)
+PHP_FUNCTION(weechat_config_new_section)
{
- API_FUNC_INIT(weechat_config_boolean);
- zend_string *z_option;
- int retval;
- struct t_config_option *option;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_option) == FAILURE)
+ API_FUNC_INIT(weechat_config_new_section);
+ zend_string *z_config_file;
+ zend_string *z_name;
+ zend_long z_user_can_add_options;
+ zend_long z_user_can_delete_options;
+ zval *z_callback_read;
+ zend_string *z_data_read;
+ zval *z_callback_write;
+ zend_string *z_data_write;
+ zval *z_callback_write_default;
+ zend_string *z_data_write_default;
+ zval *z_callback_create_option;
+ zend_string *z_data_create_option;
+ zval *z_callback_delete_option;
+ zend_string *z_data_delete_option;
+ struct t_config_section *retval;
+ struct t_config_file *config_file;
+ char *name;
+ int user_can_add_options;
+ int user_can_delete_options;
+ char *data_read;
+ char *data_write;
+ char *data_write_default;
+ char *data_create_option;
+ char *data_delete_option;
+ if (zend_parse_parameters (
+ ZEND_NUM_ARGS(), "SSllzSzSzSzSzS", &z_config_file, &z_name,
+ &z_user_can_add_options, &z_user_can_delete_options,
+ &z_callback_read, &z_data_read, &z_callback_write, &z_data_write,
+ &z_callback_write_default, &z_data_write_default,
+ &z_callback_create_option, &z_data_create_option,
+ &z_callback_delete_option, &z_data_delete_option) == FAILURE)
{
return;
}
- option = (struct t_config_option *)API_STR2PTR(ZSTR_VAL(z_option));
- retval = weechat_config_boolean (option);
- RETURN_LONG(retval);
+ config_file = (struct t_config_file *)API_STR2PTR(ZSTR_VAL(z_config_file));
+ name = ZSTR_VAL(z_name);
+ user_can_add_options = (int)z_user_can_add_options;
+ user_can_delete_options = (int)z_user_can_delete_options;
+ weechat_php_get_function_name (z_callback_read, callback_read_name);
+ data_read = ZSTR_VAL(z_data_read);
+ weechat_php_get_function_name (z_callback_write, callback_write_name);
+ data_write = ZSTR_VAL(z_data_write);
+ weechat_php_get_function_name (z_callback_write_default,
+ callback_write_default_name);
+ data_write_default = ZSTR_VAL(z_data_write_default);
+ weechat_php_get_function_name (z_callback_create_option,
+ callback_create_option_name);
+ data_create_option = ZSTR_VAL(z_data_create_option);
+ weechat_php_get_function_name (z_callback_delete_option,
+ callback_delete_option_name);
+ data_delete_option = ZSTR_VAL(z_data_delete_option);
+ retval = plugin_script_api_config_new_section (
+ weechat_php_plugin,
+ php_current_script,
+ config_file,
+ (const char *)name,
+ user_can_add_options,
+ user_can_delete_options,
+ weechat_php_config_new_section_callback_read,
+ (const char *)callback_read_name,
+ (const char *)data_read,
+ weechat_php_config_new_section_callback_write,
+ (const char *)callback_write_name,
+ (const char *)data_write,
+ weechat_php_config_new_section_callback_write_default,
+ (const char *)callback_write_default_name,
+ (const char *)data_write_default,
+ weechat_php_config_new_section_callback_create_option,
+ (const char *)callback_create_option_name,
+ (const char *)data_create_option,
+ weechat_php_config_new_section_callback_delete_option,
+ (const char *)callback_delete_option_name,
+ (const char *)data_delete_option);
+ char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
}
-PHP_FUNCTION(weechat_config_boolean_default)
+PHP_FUNCTION(weechat_config_search_section)
{
- API_FUNC_INIT(weechat_config_boolean_default);
- zend_string *z_option;
- int retval;
- struct t_config_option *option;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_option) == FAILURE)
+ API_FUNC_INIT(weechat_config_search_section);
+ zend_string *z_config_file;
+ zend_string *z_section_name;
+ struct t_config_section *retval;
+ struct t_config_file *config_file;
+ char *section_name;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SS", &z_config_file,
+ &z_section_name) == FAILURE)
{
return;
}
- option = (struct t_config_option *)API_STR2PTR(ZSTR_VAL(z_option));
- retval = weechat_config_boolean_default (option);
- RETURN_LONG(retval);
+ config_file = (struct t_config_file *)API_STR2PTR(ZSTR_VAL(z_config_file));
+ section_name = ZSTR_VAL(z_section_name);
+ retval = weechat_config_search_section (config_file,
+ (const char *)section_name);
+ char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
}
-PHP_FUNCTION(weechat_config_color)
+static int
+weechat_php_config_new_option_callback_check_value (const void *pointer,
+ void *data,
+ struct t_config_option *option,
+ const char *value)
{
- API_FUNC_INIT(weechat_config_color);
- zend_string *z_option;
- const char *retval;
- struct t_config_option *option;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_option) == FAILURE)
- {
- return;
- }
- option = (struct t_config_option *)API_STR2PTR(ZSTR_VAL(z_option));
- retval = weechat_config_color (option);
- SAFE_RETURN_STRING(retval);
+ int rc;
+ void *func_argv[3];
+ func_argv[1] = API_PTR2STR(option);
+ func_argv[2] = value ? (char *)value : weechat_php_empty_arg;
+ weechat_php_cb (pointer, data, func_argv, "sss",
+ WEECHAT_SCRIPT_EXEC_INT, &rc);
+ if (func_argv[1])
+ free (func_argv[1]);
+ return rc;
}
-PHP_FUNCTION(weechat_config_color_default)
+static void
+weechat_php_config_new_option_callback_change (const void *pointer,
+ void *data,
+ struct t_config_option *option)
{
- API_FUNC_INIT(weechat_config_color_default);
- zend_string *z_option;
- const char *retval;
- struct t_config_option *option;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_option) == FAILURE)
- {
- return;
- }
- option = (struct t_config_option *)API_STR2PTR(ZSTR_VAL(z_option));
- retval = weechat_config_color_default (option);
- SAFE_RETURN_STRING(retval);
+ int *rc;
+ void *func_argv[2];
+ func_argv[1] = API_PTR2STR(option);
+ weechat_php_cb (pointer, data, func_argv, "ss",
+ WEECHAT_SCRIPT_EXEC_INT, &rc);
+ if (func_argv[1])
+ free (func_argv[1]);
}
-PHP_FUNCTION(weechat_config_free)
+static void
+weechat_php_config_new_option_callback_delete (const void *pointer,
+ void *data,
+ struct t_config_option *option)
{
- API_FUNC_INIT(weechat_config_free);
+ int rc;
+ void *func_argv[2];
+ func_argv[1] = API_PTR2STR(option);
+ weechat_php_cb(pointer, data, func_argv, "ss",
+ WEECHAT_SCRIPT_EXEC_INT, &rc);
+ if (func_argv[1])
+ free (func_argv[1]);
+}
+
+PHP_FUNCTION(weechat_config_new_option)
+{
+ API_FUNC_INIT(weechat_config_new_option);
zend_string *z_config_file;
+ zend_string *z_section;
+ zend_string *z_name;
+ zend_string *z_type;
+ zend_string *z_description;
+ zend_string *z_string_values;
+ zend_long z_min;
+ zend_long z_max;
+ zend_string *z_default_value;
+ zend_string *z_value;
+ zend_long z_null_value_allowed;
+ zval *z_callback_check_value;
+ zend_string *z_data_check_value;
+ zval *z_callback_change;
+ zend_string *z_data_change;
+ zval *z_callback_delete;
+ zend_string *z_data_delete;
+ struct t_config_option *retval;
struct t_config_file *config_file;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_config_file) == FAILURE)
+ struct t_config_section *section;
+ char *name;
+ char *type;
+ char *description;
+ char *string_values;
+ int min;
+ int max;
+ char *default_value;
+ char *value;
+ int null_value_allowed;
+ char *data_check_value;
+ char *data_change;
+ char *data_delete;
+ if (zend_parse_parameters (
+ ZEND_NUM_ARGS(), "SSSSSSllSSlzSzSzS", &z_config_file, &z_section,
+ &z_name, &z_type, &z_description, &z_string_values, &z_min, &z_max,
+ &z_default_value, &z_value, &z_null_value_allowed,
+ &z_callback_check_value, &z_data_check_value, &z_callback_change,
+ &z_data_change, &z_callback_delete, &z_data_delete) == FAILURE)
{
return;
}
config_file = (struct t_config_file *)API_STR2PTR(ZSTR_VAL(z_config_file));
- weechat_config_free (config_file);
- RETURN_NULL();
+ section = (struct t_config_section *)API_STR2PTR(ZSTR_VAL(z_section));
+ name = ZSTR_VAL(z_name);
+ type = ZSTR_VAL(z_type);
+ description = ZSTR_VAL(z_description);
+ string_values = ZSTR_VAL(z_string_values);
+ min = (int)z_min;
+ max = (int)z_max;
+ default_value = ZSTR_VAL(z_default_value);
+ value = ZSTR_VAL(z_value);
+ null_value_allowed = (int)z_null_value_allowed;
+ weechat_php_get_function_name (z_callback_check_value,
+ callback_check_value_name);
+ data_check_value = ZSTR_VAL(z_data_check_value);
+ weechat_php_get_function_name (z_callback_change, callback_change_name);
+ data_change = ZSTR_VAL(z_data_change);
+ weechat_php_get_function_name (z_callback_delete, callback_delete_name);
+ data_delete = ZSTR_VAL(z_data_delete);
+ retval = plugin_script_api_config_new_option (
+ weechat_php_plugin,
+ php_current_script,
+ config_file,
+ section,
+ (const char *)name,
+ (const char *)type,
+ (const char *)description,
+ (const char *)string_values,
+ min,
+ max,
+ (const char *)default_value,
+ (const char *)value,
+ null_value_allowed,
+ weechat_php_config_new_option_callback_check_value,
+ (const char *)callback_check_value_name,
+ (const char *)data_check_value,
+ weechat_php_config_new_option_callback_change,
+ (const char *)callback_change_name,
+ (const char *)data_change,
+ weechat_php_config_new_option_callback_delete,
+ (const char *)callback_delete_name,
+ (const char *)data_delete);
+ char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
}
-PHP_FUNCTION(weechat_config_get)
+PHP_FUNCTION(weechat_config_search_option)
{
- API_FUNC_INIT(weechat_config_get);
+ API_FUNC_INIT(weechat_config_search_option);
+ zend_string *z_config_file;
+ zend_string *z_section;
zend_string *z_option_name;
struct t_config_option *retval;
+ struct t_config_file *config_file;
+ struct t_config_section *section;
char *option_name;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_option_name) == FAILURE)
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SSS", &z_config_file, &z_section,
+ &z_option_name) == FAILURE)
{
return;
}
+ config_file = (struct t_config_file *)API_STR2PTR(ZSTR_VAL(z_config_file));
+ section = (struct t_config_section *)API_STR2PTR(ZSTR_VAL(z_section));
option_name = ZSTR_VAL(z_option_name);
- retval = weechat_config_get ((const char *)option_name);
+ retval = weechat_config_search_option (config_file, section,
+ (const char *)option_name);
char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
}
-PHP_FUNCTION(weechat_config_integer)
+PHP_FUNCTION(weechat_config_string_to_boolean)
{
- API_FUNC_INIT(weechat_config_integer);
- zend_string *z_option;
+ API_FUNC_INIT(weechat_config_string_to_boolean);
+ zend_string *z_text;
int retval;
- struct t_config_option *option;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_option) == FAILURE)
+ char *text;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_text) == FAILURE)
{
return;
}
- option = (struct t_config_option *)API_STR2PTR(ZSTR_VAL(z_option));
- retval = weechat_config_integer (option);
+ text = ZSTR_VAL(z_text);
+ retval = weechat_config_string_to_boolean ((const char *)text);
RETURN_LONG(retval);
}
-PHP_FUNCTION(weechat_config_integer_default)
+PHP_FUNCTION(weechat_config_option_reset)
{
- API_FUNC_INIT(weechat_config_integer_default);
+ API_FUNC_INIT(weechat_config_option_reset);
zend_string *z_option;
+ zend_long z_run_callback;
int retval;
struct t_config_option *option;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_option) == FAILURE)
+ int run_callback;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "Sl", &z_option, &z_run_callback) == FAILURE)
{
return;
}
option = (struct t_config_option *)API_STR2PTR(ZSTR_VAL(z_option));
- retval = weechat_config_integer_default (option);
+ run_callback = (int)z_run_callback;
+ retval = weechat_config_option_reset (option, run_callback);
RETURN_LONG(retval);
}
-PHP_FUNCTION(weechat_config_option_default_is_null)
+PHP_FUNCTION(weechat_config_option_set)
{
- API_FUNC_INIT(weechat_config_option_default_is_null);
+ API_FUNC_INIT(weechat_config_option_set);
zend_string *z_option;
+ zend_string *z_value;
+ zend_long z_run_callback;
int retval;
struct t_config_option *option;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_option) == FAILURE)
+ char *value;
+ int run_callback;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SSl", &z_option, &z_value,
+ &z_run_callback) == FAILURE)
{
return;
}
option = (struct t_config_option *)API_STR2PTR(ZSTR_VAL(z_option));
- retval = weechat_config_option_default_is_null (option);
+ value = ZSTR_VAL(z_value);
+ run_callback = (int)z_run_callback;
+ retval = weechat_config_option_set (option, (const char *)value,
+ run_callback);
RETURN_LONG(retval);
}
-PHP_FUNCTION(weechat_config_option_free)
+PHP_FUNCTION(weechat_config_option_set_null)
{
- API_FUNC_INIT(weechat_config_option_free);
+ API_FUNC_INIT(weechat_config_option_set_null);
zend_string *z_option;
+ zend_long z_run_callback;
+ int retval;
struct t_config_option *option;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_option) == FAILURE)
+ int run_callback;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "Sl", &z_option, &z_run_callback) == FAILURE)
{
return;
}
option = (struct t_config_option *)API_STR2PTR(ZSTR_VAL(z_option));
- weechat_config_option_free (option);
- RETURN_NULL();
+ run_callback = (int)z_run_callback;
+ retval = weechat_config_option_set_null (option, run_callback);
+ RETURN_LONG(retval);
}
-PHP_FUNCTION(weechat_config_option_is_null)
+PHP_FUNCTION(weechat_config_option_unset)
{
- API_FUNC_INIT(weechat_config_option_is_null);
+ API_FUNC_INIT(weechat_config_option_unset);
zend_string *z_option;
int retval;
struct t_config_option *option;
@@ -1135,7 +1349,7 @@ PHP_FUNCTION(weechat_config_option_is_null)
return;
}
option = (struct t_config_option *)API_STR2PTR(ZSTR_VAL(z_option));
- retval = weechat_config_option_is_null (option);
+ retval = weechat_config_option_unset (option);
RETURN_LONG(retval);
}
@@ -1146,7 +1360,8 @@ PHP_FUNCTION(weechat_config_option_rename)
zend_string *z_new_name;
struct t_config_option *option;
char *new_name;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SS", &z_option, &z_new_name) == FAILURE)
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SS", &z_option, &z_new_name) == FAILURE)
{
return;
}
@@ -1156,66 +1371,54 @@ PHP_FUNCTION(weechat_config_option_rename)
RETURN_NULL();
}
-PHP_FUNCTION(weechat_config_option_reset)
+PHP_FUNCTION(weechat_config_option_is_null)
{
- API_FUNC_INIT(weechat_config_option_reset);
+ API_FUNC_INIT(weechat_config_option_is_null);
zend_string *z_option;
- zend_long z_run_callback;
int retval;
struct t_config_option *option;
- int run_callback;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "Sl", &z_option, &z_run_callback) == FAILURE)
+ if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_option) == FAILURE)
{
return;
}
option = (struct t_config_option *)API_STR2PTR(ZSTR_VAL(z_option));
- run_callback = (int)z_run_callback;
- retval = weechat_config_option_reset (option, run_callback);
+ retval = weechat_config_option_is_null (option);
RETURN_LONG(retval);
}
-PHP_FUNCTION(weechat_config_option_set)
+PHP_FUNCTION(weechat_config_option_default_is_null)
{
- API_FUNC_INIT(weechat_config_option_set);
+ API_FUNC_INIT(weechat_config_option_default_is_null);
zend_string *z_option;
- zend_string *z_value;
- zend_long z_run_callback;
int retval;
struct t_config_option *option;
- char *value;
- int run_callback;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SSl", &z_option, &z_value, &z_run_callback) == FAILURE)
+ if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_option) == FAILURE)
{
return;
}
option = (struct t_config_option *)API_STR2PTR(ZSTR_VAL(z_option));
- value = ZSTR_VAL(z_value);
- run_callback = (int)z_run_callback;
- retval = weechat_config_option_set (option, (const char *)value, run_callback);
+ retval = weechat_config_option_default_is_null (option);
RETURN_LONG(retval);
}
-PHP_FUNCTION(weechat_config_option_set_null)
+PHP_FUNCTION(weechat_config_boolean)
{
- API_FUNC_INIT(weechat_config_option_set_null);
+ API_FUNC_INIT(weechat_config_boolean);
zend_string *z_option;
- zend_long z_run_callback;
int retval;
struct t_config_option *option;
- int run_callback;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "Sl", &z_option, &z_run_callback) == FAILURE)
+ if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_option) == FAILURE)
{
return;
}
option = (struct t_config_option *)API_STR2PTR(ZSTR_VAL(z_option));
- run_callback = (int)z_run_callback;
- retval = weechat_config_option_set_null (option, run_callback);
+ retval = weechat_config_boolean (option);
RETURN_LONG(retval);
}
-PHP_FUNCTION(weechat_config_option_unset)
+PHP_FUNCTION(weechat_config_boolean_default)
{
- API_FUNC_INIT(weechat_config_option_unset);
+ API_FUNC_INIT(weechat_config_boolean_default);
zend_string *z_option;
int retval;
struct t_config_option *option;
@@ -1224,107 +1427,40 @@ PHP_FUNCTION(weechat_config_option_unset)
return;
}
option = (struct t_config_option *)API_STR2PTR(ZSTR_VAL(z_option));
- retval = weechat_config_option_unset (option);
+ retval = weechat_config_boolean_default (option);
RETURN_LONG(retval);
}
-PHP_FUNCTION(weechat_config_read)
+PHP_FUNCTION(weechat_config_integer)
{
- API_FUNC_INIT(weechat_config_read);
- zend_string *z_config_file;
+ API_FUNC_INIT(weechat_config_integer);
+ zend_string *z_option;
int retval;
- struct t_config_file *config_file;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_config_file) == FAILURE)
+ struct t_config_option *option;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_option) == FAILURE)
{
return;
}
- config_file = (struct t_config_file *)API_STR2PTR(ZSTR_VAL(z_config_file));
- retval = weechat_config_read (config_file);
+ option = (struct t_config_option *)API_STR2PTR(ZSTR_VAL(z_option));
+ retval = weechat_config_integer (option);
RETURN_LONG(retval);
}
-PHP_FUNCTION(weechat_config_reload)
+PHP_FUNCTION(weechat_config_integer_default)
{
- API_FUNC_INIT(weechat_config_reload);
- zend_string *z_config_file;
+ API_FUNC_INIT(weechat_config_integer_default);
+ zend_string *z_option;
int retval;
- struct t_config_file *config_file;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_config_file) == FAILURE)
+ struct t_config_option *option;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_option) == FAILURE)
{
return;
}
- config_file = (struct t_config_file *)API_STR2PTR(ZSTR_VAL(z_config_file));
- retval = weechat_config_reload (config_file);
+ option = (struct t_config_option *)API_STR2PTR(ZSTR_VAL(z_option));
+ retval = weechat_config_integer_default (option);
RETURN_LONG(retval);
}
-PHP_FUNCTION(weechat_config_search_option)
-{
- API_FUNC_INIT(weechat_config_search_option);
- zend_string *z_config_file;
- zend_string *z_section;
- zend_string *z_option_name;
- struct t_config_option *retval;
- struct t_config_file *config_file;
- struct t_config_section *section;
- char *option_name;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SSS", &z_config_file, &z_section, &z_option_name) == FAILURE)
- {
- return;
- }
- config_file = (struct t_config_file *)API_STR2PTR(ZSTR_VAL(z_config_file));
- section = (struct t_config_section *)API_STR2PTR(ZSTR_VAL(z_section));
- option_name = ZSTR_VAL(z_option_name);
- retval = weechat_config_search_option (config_file, section, (const char *)option_name);
- char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
-}
-
-PHP_FUNCTION(weechat_config_search_section)
-{
- API_FUNC_INIT(weechat_config_search_section);
- zend_string *z_config_file;
- zend_string *z_section_name;
- struct t_config_section *retval;
- struct t_config_file *config_file;
- char *section_name;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SS", &z_config_file, &z_section_name) == FAILURE)
- {
- return;
- }
- config_file = (struct t_config_file *)API_STR2PTR(ZSTR_VAL(z_config_file));
- section_name = ZSTR_VAL(z_section_name);
- retval = weechat_config_search_section (config_file, (const char *)section_name);
- char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
-}
-
-PHP_FUNCTION(weechat_config_section_free)
-{
- API_FUNC_INIT(weechat_config_section_free);
- zend_string *z_section;
- struct t_config_section *section;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_section) == FAILURE)
- {
- return;
- }
- section = (struct t_config_section *)API_STR2PTR(ZSTR_VAL(z_section));
- weechat_config_section_free (section);
- RETURN_NULL();
-}
-
-PHP_FUNCTION(weechat_config_section_free_options)
-{
- API_FUNC_INIT(weechat_config_section_free_options);
- zend_string *z_section;
- struct t_config_section *section;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_section) == FAILURE)
- {
- return;
- }
- section = (struct t_config_section *)API_STR2PTR(ZSTR_VAL(z_section));
- weechat_config_section_free_options (section);
- RETURN_NULL();
-}
-
PHP_FUNCTION(weechat_config_string)
{
API_FUNC_INIT(weechat_config_string);
@@ -1355,33 +1491,52 @@ PHP_FUNCTION(weechat_config_string_default)
SAFE_RETURN_STRING(retval);
}
-PHP_FUNCTION(weechat_config_string_to_boolean)
+PHP_FUNCTION(weechat_config_color)
{
- API_FUNC_INIT(weechat_config_string_to_boolean);
- zend_string *z_text;
- int retval;
- char *text;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_text) == FAILURE)
+ API_FUNC_INIT(weechat_config_color);
+ zend_string *z_option;
+ const char *retval;
+ struct t_config_option *option;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_option) == FAILURE)
{
return;
}
- text = ZSTR_VAL(z_text);
- retval = weechat_config_string_to_boolean ((const char *)text);
- RETURN_LONG(retval);
+ option = (struct t_config_option *)API_STR2PTR(ZSTR_VAL(z_option));
+ retval = weechat_config_color (option);
+ SAFE_RETURN_STRING(retval);
}
-PHP_FUNCTION(weechat_config_write)
+PHP_FUNCTION(weechat_config_color_default)
{
- API_FUNC_INIT(weechat_config_write);
+ API_FUNC_INIT(weechat_config_color_default);
+ zend_string *z_option;
+ const char *retval;
+ struct t_config_option *option;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_option) == FAILURE)
+ {
+ return;
+ }
+ option = (struct t_config_option *)API_STR2PTR(ZSTR_VAL(z_option));
+ retval = weechat_config_color_default (option);
+ SAFE_RETURN_STRING(retval);
+}
+
+PHP_FUNCTION(weechat_config_write_option)
+{
+ API_FUNC_INIT(weechat_config_write_option);
zend_string *z_config_file;
+ zend_string *z_option;
int retval;
struct t_config_file *config_file;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_config_file) == FAILURE)
+ struct t_config_option *option;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SS", &z_config_file, &z_option) == FAILURE)
{
return;
}
config_file = (struct t_config_file *)API_STR2PTR(ZSTR_VAL(z_config_file));
- retval = weechat_config_write (config_file);
+ option = (struct t_config_option *)API_STR2PTR(ZSTR_VAL(z_option));
+ retval = weechat_config_write_option (config_file, option);
RETURN_LONG(retval);
}
@@ -1395,495 +1550,529 @@ PHP_FUNCTION(weechat_config_write_line)
struct t_config_file *config_file;
char *option_name;
char *value;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SSS", &z_config_file, &z_option_name, &z_value) == FAILURE)
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SSS", &z_config_file, &z_option_name,
+ &z_value) == FAILURE)
{
return;
}
config_file = (struct t_config_file *)API_STR2PTR(ZSTR_VAL(z_config_file));
option_name = ZSTR_VAL(z_option_name);
value = ZSTR_VAL(z_value);
- retval = weechat_config_write_line (config_file, (const char *)option_name, (const char *)value);
+ retval = weechat_config_write_line (config_file,
+ (const char *)option_name,
+ (const char *)value);
RETURN_LONG(retval);
}
-PHP_FUNCTION(weechat_config_write_option)
+PHP_FUNCTION(weechat_config_write)
{
- API_FUNC_INIT(weechat_config_write_option);
+ API_FUNC_INIT(weechat_config_write);
zend_string *z_config_file;
- zend_string *z_option;
int retval;
struct t_config_file *config_file;
- struct t_config_option *option;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SS", &z_config_file, &z_option) == FAILURE)
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "S", &z_config_file) == FAILURE)
{
return;
}
config_file = (struct t_config_file *)API_STR2PTR(ZSTR_VAL(z_config_file));
- option = (struct t_config_option *)API_STR2PTR(ZSTR_VAL(z_option));
- retval = weechat_config_write_option (config_file, option);
+ retval = weechat_config_write (config_file);
RETURN_LONG(retval);
}
-PHP_FUNCTION(weechat_gettext)
+PHP_FUNCTION(weechat_config_read)
{
- API_FUNC_INIT(weechat_gettext);
- zend_string *z_string;
- const char *retval;
- char *string;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_string) == FAILURE)
+ API_FUNC_INIT(weechat_config_read);
+ zend_string *z_config_file;
+ int retval;
+ struct t_config_file *config_file;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "S", &z_config_file) == FAILURE)
{
return;
}
- string = ZSTR_VAL(z_string);
- retval = weechat_gettext ((const char *)string);
- SAFE_RETURN_STRING(retval);
+ config_file = (struct t_config_file *)API_STR2PTR(ZSTR_VAL(z_config_file));
+ retval = weechat_config_read (config_file);
+ RETURN_LONG(retval);
}
-PHP_FUNCTION(weechat_hdata_char)
+PHP_FUNCTION(weechat_config_reload)
{
- API_FUNC_INIT(weechat_hdata_char);
- zend_string *z_hdata;
- zend_string *z_pointer;
- zend_string *z_name;
- char retval;
- struct t_hdata *hdata;
- void *pointer;
- char *name;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SSS", &z_hdata, &z_pointer, &z_name) == FAILURE)
+ API_FUNC_INIT(weechat_config_reload);
+ zend_string *z_config_file;
+ int retval;
+ struct t_config_file *config_file;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "S", &z_config_file) == FAILURE)
{
return;
}
- hdata = (struct t_hdata *)API_STR2PTR(ZSTR_VAL(z_hdata));
- pointer = (void *)API_STR2PTR(ZSTR_VAL(z_pointer));
- name = ZSTR_VAL(z_name);
- retval = weechat_hdata_char (hdata, pointer, (const char *)name);
- RETURN_LONG((int)retval);
+ config_file = (struct t_config_file *)API_STR2PTR(ZSTR_VAL(z_config_file));
+ retval = weechat_config_reload (config_file);
+ RETURN_LONG(retval);
}
-PHP_FUNCTION(weechat_hdata_check_pointer)
+PHP_FUNCTION(weechat_config_option_free)
{
- API_FUNC_INIT(weechat_hdata_check_pointer);
- zend_string *z_hdata;
- zend_string *z_list;
- zend_string *z_pointer;
- int retval;
- struct t_hdata *hdata;
- void *list;
- void *pointer;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SSS", &z_hdata, &z_list, &z_pointer) == FAILURE)
+ API_FUNC_INIT(weechat_config_option_free);
+ zend_string *z_option;
+ struct t_config_option *option;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_option) == FAILURE)
{
return;
}
- hdata = (struct t_hdata *)API_STR2PTR(ZSTR_VAL(z_hdata));
- list = (void *)API_STR2PTR(ZSTR_VAL(z_list));
- pointer = (void *)API_STR2PTR(ZSTR_VAL(z_pointer));
- retval = weechat_hdata_check_pointer (hdata, list, pointer);
- RETURN_LONG(retval);
+ option = (struct t_config_option *)API_STR2PTR(ZSTR_VAL(z_option));
+ weechat_config_option_free (option);
+ RETURN_NULL();
}
-PHP_FUNCTION(weechat_hdata_compare)
+PHP_FUNCTION(weechat_config_section_free_options)
{
- API_FUNC_INIT(weechat_hdata_compare);
- zend_string *z_hdata;
- zend_string *z_pointer1;
- zend_string *z_pointer2;
- zend_string *z_name;
- zend_long z_case_sensitive;
- int retval;
- struct t_hdata *hdata;
- void *pointer1;
- void *pointer2;
- char *name;
- int case_sensitive;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SSSSl", &z_hdata, &z_pointer1, &z_pointer2, &z_name, &z_case_sensitive) == FAILURE)
+ API_FUNC_INIT(weechat_config_section_free_options);
+ zend_string *z_section;
+ struct t_config_section *section;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_section) == FAILURE)
{
return;
}
- hdata = (struct t_hdata *)API_STR2PTR(ZSTR_VAL(z_hdata));
- pointer1 = (void *)API_STR2PTR(ZSTR_VAL(z_pointer1));
- pointer2 = (void *)API_STR2PTR(ZSTR_VAL(z_pointer2));
- name = (void *)API_STR2PTR(ZSTR_VAL(z_name));
- case_sensitive = (int)z_case_sensitive;
- retval = weechat_hdata_compare (hdata, pointer1, pointer2, name, case_sensitive);
- RETURN_LONG(retval);
+ section = (struct t_config_section *)API_STR2PTR(ZSTR_VAL(z_section));
+ weechat_config_section_free_options (section);
+ RETURN_NULL();
}
-PHP_FUNCTION(weechat_hdata_get)
+PHP_FUNCTION(weechat_config_section_free)
{
- API_FUNC_INIT(weechat_hdata_get);
- zend_string *z_hdata_name;
- struct t_hdata *retval;
- char *hdata_name;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_hdata_name) == FAILURE)
+ API_FUNC_INIT(weechat_config_section_free);
+ zend_string *z_section;
+ struct t_config_section *section;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_section) == FAILURE)
{
return;
}
- hdata_name = ZSTR_VAL(z_hdata_name);
- retval = weechat_hdata_get ((const char *)hdata_name);
- char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
+ section = (struct t_config_section *)API_STR2PTR(ZSTR_VAL(z_section));
+ weechat_config_section_free (section);
+ RETURN_NULL();
}
-PHP_FUNCTION(weechat_hdata_get_list)
+PHP_FUNCTION(weechat_config_free)
{
- API_FUNC_INIT(weechat_hdata_get_list);
- zend_string *z_hdata;
- zend_string *z_name;
- void *retval;
- struct t_hdata *hdata;
- char *name;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SS", &z_hdata, &z_name) == FAILURE)
+ API_FUNC_INIT(weechat_config_free);
+ zend_string *z_config_file;
+ struct t_config_file *config_file;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "S", &z_config_file) == FAILURE)
{
return;
}
- hdata = (struct t_hdata *)API_STR2PTR(ZSTR_VAL(z_hdata));
- name = ZSTR_VAL(z_name);
- retval = weechat_hdata_get_list (hdata, (const char *)name);
+ config_file = (struct t_config_file *)API_STR2PTR(ZSTR_VAL(z_config_file));
+ weechat_config_free (config_file);
+ RETURN_NULL();
+}
+
+PHP_FUNCTION(weechat_config_get)
+{
+ API_FUNC_INIT(weechat_config_get);
+ zend_string *z_option_name;
+ struct t_config_option *retval;
+ char *option_name;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "S", &z_option_name) == FAILURE)
+ {
+ return;
+ }
+ option_name = ZSTR_VAL(z_option_name);
+ retval = weechat_config_get ((const char *)option_name);
char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
}
-PHP_FUNCTION(weechat_hdata_get_string)
+PHP_FUNCTION(weechat_config_get_plugin)
{
- API_FUNC_INIT(weechat_hdata_get_string);
- zend_string *z_hdata;
- zend_string *z_property;
+ API_FUNC_INIT(weechat_config_get_plugin);
+ zend_string *z_option;
const char *retval;
- struct t_hdata *hdata;
- char *property;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SS", &z_hdata, &z_property) == FAILURE)
+ char *option;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_option) == FAILURE)
{
return;
}
- hdata = (struct t_hdata *)API_STR2PTR(ZSTR_VAL(z_hdata));
- property = ZSTR_VAL(z_property);
- retval = weechat_hdata_get_string (hdata, (const char *)property);
+ option = ZSTR_VAL(z_option);
+ retval = plugin_script_api_config_get_plugin (weechat_php_plugin,
+ php_current_script,
+ (const char *)option);
SAFE_RETURN_STRING(retval);
}
-PHP_FUNCTION(weechat_hdata_get_var)
+PHP_FUNCTION(weechat_config_is_set_plugin)
{
- API_FUNC_INIT(weechat_hdata_get_var);
- zend_string *z_hdata;
- zend_string *z_pointer;
- zend_string *z_name;
- void *retval;
- struct t_hdata *hdata;
- void *pointer;
- char *name;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SSS", &z_hdata, &z_pointer, &z_name) == FAILURE)
+ API_FUNC_INIT(weechat_config_is_set_plugin);
+ zend_string *z_option;
+ int retval;
+ char *option;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_option) == FAILURE)
{
return;
}
- hdata = (struct t_hdata *)API_STR2PTR(ZSTR_VAL(z_hdata));
- pointer = (void *)API_STR2PTR(ZSTR_VAL(z_pointer));
- name = ZSTR_VAL(z_name);
- retval = weechat_hdata_get_var (hdata, pointer, (const char *)name);
- char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
+ option = ZSTR_VAL(z_option);
+ retval = plugin_script_api_config_is_set_plugin (weechat_php_plugin,
+ php_current_script,
+ (const char *)option);
+ RETURN_LONG(retval);
}
-PHP_FUNCTION(weechat_hdata_get_var_array_size)
+PHP_FUNCTION(weechat_config_set_plugin)
{
- API_FUNC_INIT(weechat_hdata_get_var_array_size);
- zend_string *z_hdata;
- zend_string *z_pointer;
- zend_string *z_name;
+ API_FUNC_INIT(weechat_config_set_plugin);
+ zend_string *z_option;
+ zend_string *z_value;
int retval;
- struct t_hdata *hdata;
- void *pointer;
- char *name;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SSS", &z_hdata, &z_pointer, &z_name) == FAILURE)
+ char *option;
+ char *value;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SS", &z_option, &z_value) == FAILURE)
{
return;
}
- hdata = (struct t_hdata *)API_STR2PTR(ZSTR_VAL(z_hdata));
- pointer = (void *)API_STR2PTR(ZSTR_VAL(z_pointer));
- name = ZSTR_VAL(z_name);
- retval = weechat_hdata_get_var_array_size (hdata, pointer, (const char *)name);
+ option = ZSTR_VAL(z_option);
+ value = ZSTR_VAL(z_value);
+ retval = plugin_script_api_config_set_plugin (weechat_php_plugin,
+ php_current_script,
+ (const char *)option,
+ (const char *)value);
RETURN_LONG(retval);
}
-PHP_FUNCTION(weechat_hdata_get_var_array_size_string)
+PHP_FUNCTION(weechat_config_set_desc_plugin)
{
- API_FUNC_INIT(weechat_hdata_get_var_array_size_string);
- zend_string *z_hdata;
- zend_string *z_pointer;
- zend_string *z_name;
- const char *retval;
- struct t_hdata *hdata;
- void *pointer;
- char *name;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SSS", &z_hdata, &z_pointer, &z_name) == FAILURE)
+ API_FUNC_INIT(weechat_config_set_desc_plugin);
+ zend_string *z_option;
+ zend_string *z_description;
+ char *option;
+ char *description;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SS", &z_option, &z_description) == FAILURE)
{
return;
}
- hdata = (struct t_hdata *)API_STR2PTR(ZSTR_VAL(z_hdata));
- pointer = (void *)API_STR2PTR(ZSTR_VAL(z_pointer));
- name = ZSTR_VAL(z_name);
- retval = weechat_hdata_get_var_array_size_string (hdata, pointer, (const char *)name);
- SAFE_RETURN_STRING(retval);
+ option = ZSTR_VAL(z_option);
+ description = ZSTR_VAL(z_description);
+ plugin_script_api_config_set_desc_plugin (weechat_php_plugin,
+ php_current_script,
+ (const char *)option,
+ (const char *)description);
+ RETURN_NULL();
}
-PHP_FUNCTION(weechat_hdata_get_var_hdata)
+PHP_FUNCTION(weechat_config_unset_plugin)
{
- API_FUNC_INIT(weechat_hdata_get_var_hdata);
- zend_string *z_hdata;
- zend_string *z_name;
- const char *retval;
- struct t_hdata *hdata;
- char *name;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SS", &z_hdata, &z_name) == FAILURE)
+ API_FUNC_INIT(weechat_config_unset_plugin);
+ zend_string *z_option;
+ int retval;
+ char *option;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_option) == FAILURE)
{
return;
}
- hdata = (struct t_hdata *)API_STR2PTR(ZSTR_VAL(z_hdata));
- name = ZSTR_VAL(z_name);
- retval = weechat_hdata_get_var_hdata (hdata, (const char *)name);
- SAFE_RETURN_STRING(retval);
+ option = ZSTR_VAL(z_option);
+ retval = plugin_script_api_config_unset_plugin (weechat_php_plugin,
+ php_current_script,
+ (const char *)option);
+ RETURN_LONG(retval);
}
-PHP_FUNCTION(weechat_hdata_get_var_offset)
+PHP_FUNCTION(weechat_key_bind)
{
- API_FUNC_INIT(weechat_hdata_get_var_offset);
- zend_string *z_hdata;
- zend_string *z_name;
+ API_FUNC_INIT(weechat_key_bind);
+ zend_string *z_context;
+ zval *z_keys;
int retval;
- struct t_hdata *hdata;
- char *name;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SS", &z_hdata, &z_name) == FAILURE)
+ char *context;
+ struct t_hashtable *keys;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "Sa", &z_context, &z_keys) == FAILURE)
{
return;
}
- hdata = (struct t_hdata *)API_STR2PTR(ZSTR_VAL(z_hdata));
- name = ZSTR_VAL(z_name);
- retval = weechat_hdata_get_var_offset (hdata, (const char *)name);
+ context = ZSTR_VAL(z_context);
+ keys = weechat_php_array_to_hashtable(z_keys,
+ WEECHAT_SCRIPT_HASHTABLE_DEFAULT_SIZE,
+ WEECHAT_HASHTABLE_STRING,
+ WEECHAT_HASHTABLE_STRING);
+ retval = weechat_key_bind ((const char *)context, keys);
RETURN_LONG(retval);
}
-PHP_FUNCTION(weechat_hdata_get_var_type)
+PHP_FUNCTION(weechat_key_unbind)
{
- API_FUNC_INIT(weechat_hdata_get_var_type);
- zend_string *z_hdata;
- zend_string *z_name;
+ API_FUNC_INIT(weechat_key_unbind);
+ zend_string *z_context;
+ zend_string *z_key;
int retval;
- struct t_hdata *hdata;
- char *name;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SS", &z_hdata, &z_name) == FAILURE)
+ char *context;
+ char *key;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SS", &z_context, &z_key) == FAILURE)
{
return;
}
- hdata = (struct t_hdata *)API_STR2PTR(ZSTR_VAL(z_hdata));
- name = ZSTR_VAL(z_name);
- retval = weechat_hdata_get_var_type (hdata, (const char *)name);
+ context = ZSTR_VAL(z_context);
+ key = ZSTR_VAL(z_key);
+ retval = weechat_key_unbind ((const char *)context, (const char *)key);
RETURN_LONG(retval);
}
-PHP_FUNCTION(weechat_hdata_get_var_type_string)
+PHP_FUNCTION(weechat_prefix)
{
- API_FUNC_INIT(weechat_hdata_get_var_type_string);
- zend_string *z_hdata;
- zend_string *z_name;
+ API_FUNC_INIT(weechat_prefix);
+ zend_string *z_prefix;
const char *retval;
- struct t_hdata *hdata;
- char *name;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SS", &z_hdata, &z_name) == FAILURE)
+ char *prefix;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_prefix) == FAILURE)
{
return;
}
- hdata = (struct t_hdata *)API_STR2PTR(ZSTR_VAL(z_hdata));
- name = ZSTR_VAL(z_name);
- retval = weechat_hdata_get_var_type_string (hdata, (const char *)name);
+ prefix = ZSTR_VAL(z_prefix);
+ retval = weechat_prefix ((const char *)prefix);
SAFE_RETURN_STRING(retval);
}
-PHP_FUNCTION(weechat_hdata_hashtable)
+PHP_FUNCTION(weechat_color)
{
- API_FUNC_INIT(weechat_hdata_hashtable);
- zend_string *z_hdata;
- zend_string *z_pointer;
- zend_string *z_name;
- struct t_hashtable *retval;
- struct t_hdata *hdata;
- void *pointer;
- char *name;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SSS", &z_hdata, &z_pointer, &z_name) == FAILURE)
+ API_FUNC_INIT(weechat_color);
+ zend_string *z_color_name;
+ const char *retval;
+ char *color_name;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_color_name) == FAILURE)
{
return;
}
- hdata = (struct t_hdata *)API_STR2PTR(ZSTR_VAL(z_hdata));
- pointer = (void *)API_STR2PTR(ZSTR_VAL(z_pointer));
- name = ZSTR_VAL(z_name);
- retval = weechat_hdata_hashtable (hdata, pointer, (const char *)name);
- weechat_php_hashtable_to_array(retval, return_value);
+ color_name = ZSTR_VAL(z_color_name);
+ retval = weechat_color ((const char *)color_name);
+ SAFE_RETURN_STRING(retval);
}
-PHP_FUNCTION(weechat_hdata_integer)
+PHP_FUNCTION(weechat_printf)
{
- API_FUNC_INIT(weechat_hdata_integer);
- zend_string *z_hdata;
- zend_string *z_pointer;
- zend_string *z_name;
- int retval;
- struct t_hdata *hdata;
- void *pointer;
- char *name;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SSS", &z_hdata, &z_pointer, &z_name) == FAILURE)
+ API_FUNC_INIT(weechat_printf);
+ zend_string *z_buffer;
+ zend_string *z_format;
+ struct t_gui_buffer *buffer;
+ char *format;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SS", &z_buffer, &z_format) == FAILURE)
{
return;
}
- hdata = (struct t_hdata *)API_STR2PTR(ZSTR_VAL(z_hdata));
- pointer = (void *)API_STR2PTR(ZSTR_VAL(z_pointer));
- name = ZSTR_VAL(z_name);
- retval = weechat_hdata_integer (hdata, pointer, (const char *)name);
- RETURN_LONG(retval);
+ buffer = (struct t_gui_buffer *)API_STR2PTR(ZSTR_VAL(z_buffer));
+ format = ZSTR_VAL(z_format);
+ plugin_script_api_printf (weechat_php_plugin, php_current_script, buffer,
+ "%s", format);
+ RETURN_NULL();
}
-PHP_FUNCTION(weechat_hdata_long)
+PHP_FUNCTION(weechat_printf_date_tags)
{
- API_FUNC_INIT(weechat_hdata_long);
- zend_string *z_hdata;
- zend_string *z_pointer;
- zend_string *z_name;
- long retval;
- struct t_hdata *hdata;
- void *pointer;
- char *name;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SSS", &z_hdata, &z_pointer, &z_name) == FAILURE)
+ API_FUNC_INIT(weechat_printf_date_tags);
+ zend_string *z_buffer;
+ zend_long z_date;
+ zend_string *z_tags;
+ zend_string *z_format;
+ struct t_gui_buffer *buffer;
+ time_t date;
+ char *tags;
+ char *format;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SlSS", &z_buffer, &z_date, &z_tags,
+ &z_format) == FAILURE)
{
return;
}
- hdata = (struct t_hdata *)API_STR2PTR(ZSTR_VAL(z_hdata));
- pointer = (void *)API_STR2PTR(ZSTR_VAL(z_pointer));
- name = ZSTR_VAL(z_name);
- retval = weechat_hdata_long (hdata, pointer, (const char *)name);
- RETURN_LONG(retval);
+ 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);
+ plugin_script_api_printf_date_tags (weechat_php_plugin,
+ php_current_script,
+ buffer,
+ date,
+ (const char *)tags,
+ "%s",
+ format);
+ RETURN_NULL();
}
-PHP_FUNCTION(weechat_hdata_move)
+PHP_FUNCTION(weechat_printf_y)
{
- API_FUNC_INIT(weechat_hdata_move);
- zend_string *z_hdata;
- zend_string *z_pointer;
- zend_long z_count;
- void *retval;
- struct t_hdata *hdata;
- void *pointer;
- int count;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SSl", &z_hdata, &z_pointer, &z_count) == FAILURE)
+ API_FUNC_INIT(weechat_printf_y);
+ zend_string *z_buffer;
+ zend_long z_y;
+ zend_string *z_format;
+ struct t_gui_buffer *buffer;
+ int y;
+ char *format;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SlS", &z_buffer, &z_y, &z_format) == FAILURE)
{
return;
}
- hdata = (struct t_hdata *)API_STR2PTR(ZSTR_VAL(z_hdata));
- pointer = (void *)API_STR2PTR(ZSTR_VAL(z_pointer));
- count = (int)z_count;
- retval = weechat_hdata_move (hdata, pointer, count);
- char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
+ buffer = (struct t_gui_buffer *)API_STR2PTR(ZSTR_VAL(z_buffer));
+ y = (int)z_y;
+ format = ZSTR_VAL(z_format);
+ plugin_script_api_printf_y (weechat_php_plugin,
+ php_current_script,
+ buffer,
+ y,
+ "%s",
+ format);
+ RETURN_NULL();
}
-PHP_FUNCTION(weechat_hdata_pointer)
+PHP_FUNCTION(weechat_log_printf)
{
- API_FUNC_INIT(weechat_hdata_pointer);
- zend_string *z_hdata;
- zend_string *z_pointer;
- zend_string *z_name;
- void *retval;
- struct t_hdata *hdata;
- void *pointer;
- char *name;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SSS", &z_hdata, &z_pointer, &z_name) == FAILURE)
+ API_FUNC_INIT(weechat_log_printf);
+ zend_string *z_format;
+ char *format;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_format) == FAILURE)
{
return;
}
- hdata = (struct t_hdata *)API_STR2PTR(ZSTR_VAL(z_hdata));
- pointer = (void *)API_STR2PTR(ZSTR_VAL(z_pointer));
- name = ZSTR_VAL(z_name);
- retval = weechat_hdata_pointer (hdata, pointer, (const char *)name);
- char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
+ format = ZSTR_VAL(z_format);
+ plugin_script_api_log_printf (weechat_php_plugin, php_current_script,
+ "%s", format);
+ RETURN_NULL();
}
-PHP_FUNCTION(weechat_hdata_search)
+static int
+weechat_php_hook_command_callback (const void *pointer, void *data,
+ struct t_gui_buffer *buffer,
+ int argc, char **argv, char **argv_eol)
{
- API_FUNC_INIT(weechat_hdata_search);
- zend_string *z_hdata;
- zend_string *z_pointer;
- zend_string *z_search;
- zend_long z_move;
- void *retval;
- struct t_hdata *hdata;
- void *pointer;
- char *search;
- int move;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SSSl", &z_hdata, &z_pointer, &z_search, &z_move) == FAILURE)
+ int rc;
+ void *func_argv[4];
+ int i;
+ int *argi;
+ struct t_hashtable *args;
+
+ (void)argv_eol;
+
+ args = weechat_hashtable_new (argc,
+ WEECHAT_HASHTABLE_INTEGER,
+ WEECHAT_HASHTABLE_STRING,
+ NULL,
+ NULL);
+ argi = malloc(sizeof(int) * argc);
+
+ for (i = 0; i < argc; i++)
{
- return;
+ *(argi + i) = i;
+ weechat_hashtable_set (args, argi+i, argv[i]);
}
- hdata = (struct t_hdata *)API_STR2PTR(ZSTR_VAL(z_hdata));
- pointer = (void *)API_STR2PTR(ZSTR_VAL(z_pointer));
- search = ZSTR_VAL(z_search);
- move = (int)z_move;
- retval = weechat_hdata_search (hdata, pointer, (const char *)search, move);
- char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
+
+ func_argv[1] = API_PTR2STR(buffer);
+ func_argv[2] = &argc;
+ func_argv[3] = args;
+ weechat_php_cb (pointer, data, func_argv, "ssih",
+ WEECHAT_SCRIPT_EXEC_INT, &rc);
+ free (argi);
+ weechat_hashtable_free (args);
+ if (func_argv[1])
+ free (func_argv[1]);
+ return rc;
}
-PHP_FUNCTION(weechat_hdata_string)
+PHP_FUNCTION(weechat_hook_command)
{
- API_FUNC_INIT(weechat_hdata_string);
- zend_string *z_hdata;
- zend_string *z_pointer;
- zend_string *z_name;
- const char *retval;
- struct t_hdata *hdata;
- void *pointer;
- char *name;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SSS", &z_hdata, &z_pointer, &z_name) == FAILURE)
+ API_FUNC_INIT(weechat_hook_command);
+ zend_string *z_command;
+ zend_string *z_description;
+ zend_string *z_args;
+ zend_string *z_args_description;
+ zend_string *z_completion;
+ zval *z_callback;
+ zend_string *z_data;
+ struct t_hook *retval;
+ char *command;
+ char *description;
+ char *args;
+ char *args_description;
+ char *completion;
+ char *data;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SSSSSzS", &z_command, &z_description, &z_args,
+ &z_args_description, &z_completion, &z_callback,
+ &z_data) == FAILURE)
{
return;
}
- hdata = (struct t_hdata *)API_STR2PTR(ZSTR_VAL(z_hdata));
- pointer = (void *)API_STR2PTR(ZSTR_VAL(z_pointer));
- name = ZSTR_VAL(z_name);
- retval = weechat_hdata_string (hdata, pointer, (const char *)name);
- SAFE_RETURN_STRING(retval);
+ command = ZSTR_VAL(z_command);
+ description = ZSTR_VAL(z_description);
+ args = ZSTR_VAL(z_args);
+ args_description = ZSTR_VAL(z_args_description);
+ completion = ZSTR_VAL(z_completion);
+ weechat_php_get_function_name (z_callback, callback_name);
+ data = ZSTR_VAL(z_data);
+ retval = plugin_script_api_hook_command (weechat_php_plugin,
+ php_current_script,
+ (const char *)command,
+ (const char *)description,
+ (const char *)args,
+ (const char *)args_description,
+ (const char *)completion,
+ weechat_php_hook_command_callback,
+ (const char *)callback_name,
+ (const char *)data);
+ char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
}
-PHP_FUNCTION(weechat_hdata_time)
+static int
+weechat_php_hook_completion_callback (const void *pointer, void *data,
+ const char *completion_item,
+ struct t_gui_buffer *buffer,
+ struct t_gui_completion *completion)
{
- API_FUNC_INIT(weechat_hdata_time);
- zend_string *z_hdata;
- zend_string *z_pointer;
- zend_string *z_name;
- time_t retval;
- struct t_hdata *hdata;
- void *pointer;
- char *name;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SSS", &z_hdata, &z_pointer, &z_name) == FAILURE)
- {
- return;
- }
- hdata = (struct t_hdata *)API_STR2PTR(ZSTR_VAL(z_hdata));
- pointer = (void *)API_STR2PTR(ZSTR_VAL(z_pointer));
- name = ZSTR_VAL(z_name);
- retval = weechat_hdata_time (hdata, pointer, (const char *)name);
- RETURN_LONG(retval);
+ int rc;
+ void *func_argv[4];
+ func_argv[1] = completion_item ? (char *)completion_item : weechat_php_empty_arg;
+ func_argv[2] = API_PTR2STR(buffer);
+ func_argv[3] = API_PTR2STR(completion);
+ weechat_php_cb(pointer, data, func_argv, "ssss",
+ WEECHAT_SCRIPT_EXEC_INT, &rc);
+ if (func_argv[2])
+ free (func_argv[2]);
+ if (func_argv[3])
+ free (func_argv[3]);
+ return rc;
}
-PHP_FUNCTION(weechat_hdata_update)
+PHP_FUNCTION(weechat_hook_completion)
{
- API_FUNC_INIT(weechat_hdata_update);
- zend_string *z_hdata;
- zend_string *z_pointer;
- zval *z_hashtable;
- int retval;
- struct t_hdata *hdata;
- void *pointer;
- struct t_hashtable *hashtable;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SSa", &z_hdata, &z_pointer, &z_hashtable) == FAILURE)
+ API_FUNC_INIT(weechat_hook_completion);
+ zend_string *z_completion;
+ zend_string *z_description;
+ zval *z_callback;
+ zend_string *z_data;
+ struct t_hook *retval;
+ char *completion;
+ char *description;
+ char *data;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SSzS", &z_completion, &z_description,
+ &z_callback, &z_data) == FAILURE)
{
return;
}
- hdata = (struct t_hdata *)API_STR2PTR(ZSTR_VAL(z_hdata));
- pointer = (void *)API_STR2PTR(ZSTR_VAL(z_pointer));
- hashtable = weechat_php_array_to_hashtable(z_hashtable, WEECHAT_SCRIPT_HASHTABLE_DEFAULT_SIZE, WEECHAT_HASHTABLE_STRING, WEECHAT_HASHTABLE_STRING);
- retval = weechat_hdata_update (hdata, pointer, hashtable);
- RETURN_LONG(retval);
+ completion = ZSTR_VAL(z_completion);
+ description = ZSTR_VAL(z_description);
+ weechat_php_get_function_name (z_callback, callback_name);
+ data = ZSTR_VAL(z_data);
+ retval = plugin_script_api_hook_completion (weechat_php_plugin,
+ php_current_script,
+ (const char *)completion,
+ (const char *)description,
+ weechat_php_hook_completion_callback,
+ (const char *)callback_name,
+ (const char *)data);
+ char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
}
PHP_FUNCTION(weechat_hook_completion_get_string)
@@ -1894,13 +2083,15 @@ PHP_FUNCTION(weechat_hook_completion_get_string)
const char *retval;
struct t_gui_completion *completion;
char *property;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SS", &z_completion, &z_property) == FAILURE)
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SS", &z_completion, &z_property) == FAILURE)
{
return;
}
completion = (struct t_gui_completion *)API_STR2PTR(ZSTR_VAL(z_completion));
property = ZSTR_VAL(z_property);
- retval = weechat_hook_completion_get_string (completion, (const char *)property);
+ retval = weechat_hook_completion_get_string (completion,
+ (const char *)property);
SAFE_RETURN_STRING(retval);
}
@@ -1915,7 +2106,9 @@ PHP_FUNCTION(weechat_hook_completion_list_add)
char *word;
int nick_completion;
char *where;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SSlS", &z_completion, &z_word, &z_nick_completion, &z_where) == FAILURE)
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SSlS", &z_completion, &z_word,
+ &z_nick_completion, &z_where) == FAILURE)
{
return;
}
@@ -1923,814 +2116,1242 @@ PHP_FUNCTION(weechat_hook_completion_list_add)
word = ZSTR_VAL(z_word);
nick_completion = (int)z_nick_completion;
where = ZSTR_VAL(z_where);
- weechat_hook_completion_list_add (completion, (const char *)word, nick_completion, (const char *)where);
+ weechat_hook_completion_list_add (completion,
+ (const char *)word,
+ nick_completion,
+ (const char *)where);
RETURN_NULL();
}
-PHP_FUNCTION(weechat_hook_hsignal_send)
+static int
+weechat_php_hook_command_run_callback (const void *pointer, void *data,
+ struct t_gui_buffer *buffer,
+ const char *command)
{
- API_FUNC_INIT(weechat_hook_hsignal_send);
- zend_string *z_signal;
- zval *z_hashtable;
- int retval;
- char *signal;
- struct t_hashtable *hashtable;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "Sa", &z_signal, &z_hashtable) == FAILURE)
- {
- return;
- }
- signal = ZSTR_VAL(z_signal);
- hashtable = weechat_php_array_to_hashtable(z_hashtable, WEECHAT_SCRIPT_HASHTABLE_DEFAULT_SIZE, WEECHAT_HASHTABLE_STRING, WEECHAT_HASHTABLE_STRING);
- retval = weechat_hook_hsignal_send ((const char *)signal, hashtable);
- RETURN_LONG(retval);
+ int rc;
+ void *func_argv[3];
+ func_argv[1] = API_PTR2STR(buffer);
+ func_argv[2] = command ? (char *)command : weechat_php_empty_arg;
+ weechat_php_cb(pointer, data, func_argv, "sss",
+ WEECHAT_SCRIPT_EXEC_INT, &rc);
+ if (func_argv[1])
+ free (func_argv[1]);
+ return rc;
}
-PHP_FUNCTION(weechat_hook_modifier_exec)
+PHP_FUNCTION(weechat_hook_command_run)
{
- API_FUNC_INIT(weechat_hook_modifier_exec);
- zend_string *z_modifier;
- zend_string *z_modifier_data;
- zend_string *z_string;
- char *retval;
- char *modifier;
- char *modifier_data;
- char *string;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SSS", &z_modifier, &z_modifier_data, &z_string) == FAILURE)
+ API_FUNC_INIT(weechat_hook_command_run);
+ zend_string *z_command;
+ zval *z_callback;
+ zend_string *z_data;
+ struct t_hook *retval;
+ char *command;
+ char *data;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SzS", &z_command, &z_callback,
+ &z_data) == FAILURE)
{
return;
}
- modifier = ZSTR_VAL(z_modifier);
- modifier_data = ZSTR_VAL(z_modifier_data);
- string = ZSTR_VAL(z_string);
- retval = weechat_hook_modifier_exec ((const char *)modifier, (const char *)modifier_data, (const char *)string);
- SAFE_RETURN_STRING(retval);
+ command = ZSTR_VAL(z_command);
+ weechat_php_get_function_name (z_callback, callback_name);
+ data = ZSTR_VAL(z_data);
+ retval = plugin_script_api_hook_command_run (weechat_php_plugin,
+ php_current_script,
+ (const char *)command,
+ weechat_php_hook_command_run_callback,
+ (const char *)callback_name,
+ (const char *)data);
+ char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
}
-PHP_FUNCTION(weechat_hook_set)
+static int weechat_php_hook_timer_callback(const void *pointer, void *data,
+ int remaining_calls)
{
- API_FUNC_INIT(weechat_hook_set);
- zend_string *z_hook;
- zend_string *z_property;
- zend_string *z_value;
- struct t_hook *hook;
- char *property;
- char *value;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SSS", &z_hook, &z_property, &z_value) == FAILURE)
- {
- return;
- }
- hook = (struct t_hook *)API_STR2PTR(ZSTR_VAL(z_hook));
- property = ZSTR_VAL(z_property);
- value = ZSTR_VAL(z_value);
- weechat_hook_set (hook, (const char *)property, (const char *)value);
- RETURN_NULL();
+ int rc;
+ void *func_argv[2];
+ func_argv[1] = &remaining_calls;
+ weechat_php_cb(pointer, data, func_argv, "si",
+ WEECHAT_SCRIPT_EXEC_INT, &rc);
+ return rc;
}
-PHP_FUNCTION(weechat_hook_signal_send)
+PHP_FUNCTION(weechat_hook_timer)
{
- API_FUNC_INIT(weechat_hook_signal_send);
- zend_string *z_signal;
- zend_string *z_type_data;
- zend_string *z_signal_data;
- int retval;
- char *signal;
- char *type_data;
- void *signal_data;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SSS", &z_signal, &z_type_data, &z_signal_data) == FAILURE)
+ API_FUNC_INIT(weechat_hook_timer);
+ zend_long z_interval;
+ zend_long z_align_second;
+ zend_long z_max_calls;
+ zval *z_callback;
+ zend_string *z_data;
+ struct t_hook *retval;
+ int interval;
+ int align_second;
+ int max_calls;
+ char *data;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "lllzS", &z_interval, &z_align_second,
+ &z_max_calls, &z_callback, &z_data) == FAILURE)
{
return;
}
- signal = ZSTR_VAL(z_signal);
- type_data = ZSTR_VAL(z_type_data);
- signal_data = (void *)API_STR2PTR(ZSTR_VAL(z_signal_data));
- retval = weechat_hook_signal_send ((const char *)signal, (const char *)type_data, signal_data);
- RETURN_LONG(retval);
+ interval = (int)z_interval;
+ align_second = (int)z_align_second;
+ max_calls = (int)z_max_calls;
+ weechat_php_get_function_name (z_callback, callback_name);
+ data = ZSTR_VAL(z_data);
+ retval = plugin_script_api_hook_timer (weechat_php_plugin,
+ php_current_script,
+ interval,
+ align_second,
+ max_calls,
+ weechat_php_hook_timer_callback,
+ (const char *)callback_name,
+ (const char *)data);
+ char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
}
-PHP_FUNCTION(weechat_iconv_from_internal)
+static int weechat_php_hook_fd_callback(const void *pointer, void *data,
+ int fd)
{
- API_FUNC_INIT(weechat_iconv_from_internal);
- zend_string *z_charset;
- zend_string *z_string;
- char *retval;
- char *charset;
- char *string;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SS", &z_charset, &z_string) == FAILURE)
- {
- return;
- }
- charset = ZSTR_VAL(z_charset);
- string = ZSTR_VAL(z_string);
- retval = weechat_iconv_from_internal ((const char *)charset, (const char *)string);
- SAFE_RETURN_STRING(retval);
+ int rc;
+ void *func_argv[2];
+ func_argv[1] = &fd;
+ weechat_php_cb(pointer, data, func_argv, "si",
+ WEECHAT_SCRIPT_EXEC_INT, &rc);
+ return rc;
}
-PHP_FUNCTION(weechat_iconv_to_internal)
+PHP_FUNCTION(weechat_hook_fd)
{
- API_FUNC_INIT(weechat_iconv_to_internal);
- zend_string *z_charset;
- zend_string *z_string;
- char *retval;
- char *charset;
- char *string;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SS", &z_charset, &z_string) == FAILURE)
+ API_FUNC_INIT(weechat_hook_fd);
+ zend_long z_fd;
+ zend_long z_flag_read;
+ zend_long z_flag_write;
+ zend_long z_flag_exception;
+ zval *z_callback;
+ zend_string *z_data;
+ struct t_hook *retval;
+ int fd;
+ int flag_read;
+ int flag_write;
+ int flag_exception;
+ char *data;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "llllzS", &z_fd, &z_flag_read, &z_flag_write,
+ &z_flag_exception, &z_callback,
+ &z_data) == FAILURE)
{
return;
}
- charset = ZSTR_VAL(z_charset);
- string = ZSTR_VAL(z_string);
- retval = weechat_iconv_to_internal ((const char *)charset, (const char *)string);
- SAFE_RETURN_STRING(retval);
+ fd = (int)z_fd;
+ flag_read = (int)z_flag_read;
+ flag_write = (int)z_flag_write;
+ flag_exception = (int)z_flag_exception;
+ weechat_php_get_function_name (z_callback, callback_name);
+ data = ZSTR_VAL(z_data);
+ retval = plugin_script_api_hook_fd (weechat_php_plugin,
+ php_current_script, fd,
+ flag_read,
+ flag_write,
+ flag_exception,
+ weechat_php_hook_fd_callback,
+ (const char *)callback_name,
+ (const char *)data);
+ char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
}
-PHP_FUNCTION(weechat_info_get)
+static int
+weechat_php_hook_process_callback (const void *pointer, void *data,
+ const char *command, int return_code,
+ const char *out, const char *err)
{
- API_FUNC_INIT(weechat_info_get);
- zend_string *z_info_name;
- zend_string *z_arguments;
- const char *retval;
- char *info_name;
- char *arguments;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SS", &z_info_name, &z_arguments) == FAILURE)
- {
- return;
- }
- info_name = ZSTR_VAL(z_info_name);
- arguments = ZSTR_VAL(z_arguments);
- retval = weechat_info_get ((const char *)info_name, (const char *)arguments);
- SAFE_RETURN_STRING(retval);
+ int rc;
+ void *func_argv[5];
+ func_argv[1] = command ? (char *)command : weechat_php_empty_arg;
+ func_argv[2] = &return_code;
+ func_argv[3] = out ? (char *)out : weechat_php_empty_arg;
+ func_argv[4] = err ? (char *)err : weechat_php_empty_arg;
+ weechat_php_cb(pointer, data, func_argv, "ssiss",
+ WEECHAT_SCRIPT_EXEC_INT, &rc);
+ return rc;
}
-PHP_FUNCTION(weechat_info_get_hashtable)
+PHP_FUNCTION(weechat_hook_process)
{
- API_FUNC_INIT(weechat_info_get_hashtable);
- zend_string *z_info_name;
- zval *z_hashtable;
- struct t_hashtable *retval;
- char *info_name;
- struct t_hashtable *hashtable;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "Sa", &z_info_name, &z_hashtable) == FAILURE)
+ API_FUNC_INIT(weechat_hook_process);
+ zend_string *z_command;
+ zend_long z_timeout;
+ zval *z_callback;
+ zend_string *z_data;
+ struct t_hook *retval;
+ char *command;
+ int timeout;
+ char *data;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SlzS", &z_command, &z_timeout, &z_callback,
+ &z_data) == FAILURE)
{
return;
}
- info_name = ZSTR_VAL(z_info_name);
- hashtable = weechat_php_array_to_hashtable(z_hashtable, WEECHAT_SCRIPT_HASHTABLE_DEFAULT_SIZE, WEECHAT_HASHTABLE_STRING, WEECHAT_HASHTABLE_STRING);
- retval = weechat_info_get_hashtable ((const char *)info_name, hashtable);
- weechat_php_hashtable_to_array(retval, return_value);
+ command = ZSTR_VAL(z_command);
+ timeout = (int)z_timeout;
+ weechat_php_get_function_name (z_callback, callback_name);
+ data = ZSTR_VAL(z_data);
+ retval = plugin_script_api_hook_process (weechat_php_plugin,
+ php_current_script,
+ (const char *)command,
+ timeout,
+ weechat_php_hook_process_callback,
+ (const char *)callback_name,
+ (const char *)data);
+ char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
}
-PHP_FUNCTION(weechat_infolist_fields)
+static int
+weechat_php_hook_process_hashtable_callback (const void *pointer, void *data,
+ const char *command,
+ int return_code,
+ const char *out, const char *err)
{
- API_FUNC_INIT(weechat_infolist_fields);
- zend_string *z_infolist;
- const char *retval;
- struct t_infolist *infolist;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_infolist) == FAILURE)
- {
- return;
- }
- infolist = (struct t_infolist *)API_STR2PTR(ZSTR_VAL(z_infolist));
- retval = weechat_infolist_fields (infolist);
- SAFE_RETURN_STRING(retval);
+ int rc;
+ void *func_argv[5];
+ func_argv[1] = command ? (char *)command : weechat_php_empty_arg;
+ func_argv[2] = &return_code;
+ func_argv[3] = out ? (char *)out : weechat_php_empty_arg;
+ func_argv[4] = err ? (char *)err : weechat_php_empty_arg;
+ weechat_php_cb(pointer, data, func_argv, "ssiss",
+ WEECHAT_SCRIPT_EXEC_INT, &rc);
+ return rc;
}
-PHP_FUNCTION(weechat_infolist_free)
+PHP_FUNCTION(weechat_hook_process_hashtable)
{
- API_FUNC_INIT(weechat_infolist_free);
- zend_string *z_infolist;
- struct t_infolist *infolist;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_infolist) == FAILURE)
+ API_FUNC_INIT(weechat_hook_process_hashtable);
+ zend_string *z_command;
+ zval *z_options;
+ zend_long z_timeout;
+ zval *z_callback;
+ zend_string *z_data;
+ struct t_hook *retval;
+ char *command;
+ struct t_hashtable *options;
+ int timeout;
+ char *data;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SalzS", &z_command, &z_options, &z_timeout,
+ &z_callback, &z_data) == FAILURE)
{
return;
}
- infolist = (struct t_infolist *)API_STR2PTR(ZSTR_VAL(z_infolist));
- weechat_infolist_free (infolist);
- RETURN_NULL();
+ command = ZSTR_VAL(z_command);
+ options = weechat_php_array_to_hashtable(
+ z_options,
+ WEECHAT_SCRIPT_HASHTABLE_DEFAULT_SIZE,
+ WEECHAT_HASHTABLE_STRING,
+ WEECHAT_HASHTABLE_STRING);
+ timeout = (int)z_timeout;
+ weechat_php_get_function_name (z_callback, callback_name);
+ data = ZSTR_VAL(z_data);
+ retval = plugin_script_api_hook_process_hashtable (weechat_php_plugin,
+ php_current_script,
+ (const char *)command,
+ options,
+ timeout,
+ weechat_php_hook_process_hashtable_callback,
+ (const char *)callback_name,
+ (const char *)data);
+ char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
}
-PHP_FUNCTION(weechat_infolist_get)
+static int
+weechat_php_hook_connect_callback (const void *pointer, void *data, int status,
+ int gnutls_rc, int sock, const char *error,
+ const char *ip_address)
{
- API_FUNC_INIT(weechat_infolist_get);
- zend_string *z_infolist_name;
- zend_string *z_pointer;
- zend_string *z_arguments;
- struct t_infolist *retval;
- char *infolist_name;
- void *pointer;
- char *arguments;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SSS", &z_infolist_name, &z_pointer, &z_arguments) == FAILURE)
+ int rc;
+ void *func_argv[6];
+ func_argv[1] = &status;
+ func_argv[2] = &gnutls_rc;
+ func_argv[3] = &sock;
+ func_argv[4] = error ? (char *)error : weechat_php_empty_arg;
+ func_argv[5] = ip_address ? (char *)ip_address : weechat_php_empty_arg;
+ weechat_php_cb(pointer, data, func_argv, "siiiss", WEECHAT_SCRIPT_EXEC_INT, &rc);
+ return rc;
+}
+
+PHP_FUNCTION(weechat_hook_connect)
+{
+ API_FUNC_INIT(weechat_hook_connect);
+ zend_string *z_proxy;
+ zend_string *z_address;
+ zend_long z_port;
+ zend_long z_ipv6;
+ zend_long z_retry;
+ zend_string *z_gnutls_sess;
+ zend_string *z_gnutls_cb;
+ zend_long z_gnutls_dhkey_size;
+ zend_string *z_gnutls_priorities;
+ zend_string *z_local_hostname;
+ zval *z_callback;
+ zend_string *z_data;
+ struct t_hook *retval;
+ char *proxy;
+ char *address;
+ int port;
+ int ipv6;
+ int retry;
+ void *gnutls_sess;
+ void *gnutls_cb;
+ int gnutls_dhkey_size;
+ char *gnutls_priorities;
+ char *local_hostname;
+ char *data;
+ if (zend_parse_parameters (
+ ZEND_NUM_ARGS(), "SSlllSSlSSzS", &z_proxy, &z_address, &z_port,
+ &z_ipv6, &z_retry, &z_gnutls_sess, &z_gnutls_cb,
+ &z_gnutls_dhkey_size, &z_gnutls_priorities, &z_local_hostname,
+ &z_callback, &z_data) == FAILURE)
{
return;
}
- infolist_name = ZSTR_VAL(z_infolist_name);
- pointer = (void *)API_STR2PTR(ZSTR_VAL(z_pointer));
- arguments = ZSTR_VAL(z_arguments);
- retval = weechat_infolist_get ((const char *)infolist_name, pointer, (const char *)arguments);
+ proxy = ZSTR_VAL(z_proxy);
+ address = ZSTR_VAL(z_address);
+ port = (int)z_port;
+ ipv6 = (int)z_ipv6;
+ retry = (int)z_retry;
+ gnutls_sess = (void *)API_STR2PTR(ZSTR_VAL(z_gnutls_sess));
+ gnutls_cb = (void *)API_STR2PTR(ZSTR_VAL(z_gnutls_cb));
+ gnutls_dhkey_size = (int)z_gnutls_dhkey_size;
+ gnutls_priorities = ZSTR_VAL(z_gnutls_priorities);
+ local_hostname = ZSTR_VAL(z_local_hostname);
+ weechat_php_get_function_name (z_callback, callback_name);
+ data = ZSTR_VAL(z_data);
+ retval = plugin_script_api_hook_connect (weechat_php_plugin,
+ php_current_script,
+ (const char *)proxy,
+ (const char *)address,
+ port,
+ ipv6,
+ retry,
+ gnutls_sess,
+ gnutls_cb,
+ gnutls_dhkey_size,
+ (const char *)gnutls_priorities,
+ (const char *)local_hostname,
+ weechat_php_hook_connect_callback,
+ (const char *)callback_name,
+ (const char *)data);
char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
}
-PHP_FUNCTION(weechat_infolist_integer)
+static int
+weechat_php_hook_print_callback (const void *pointer, void *data,
+ struct t_gui_buffer *buffer, time_t date,
+ int tags_count, const char **tags,
+ int displayed, int highlight,
+ const char *prefix, const char *message)
{
- API_FUNC_INIT(weechat_infolist_integer);
- zend_string *z_infolist;
- zend_string *z_var;
- int retval;
- struct t_infolist *infolist;
- char *var;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SS", &z_infolist, &z_var) == FAILURE)
- {
- return;
- }
- infolist = (struct t_infolist *)API_STR2PTR(ZSTR_VAL(z_infolist));
- var = ZSTR_VAL(z_var);
- retval = weechat_infolist_integer (infolist, (const char *)var);
- RETURN_LONG(retval);
+ int rc;
+ void *func_argv[9];
+ func_argv[1] = API_PTR2STR(buffer);
+ func_argv[2] = &date;
+ func_argv[3] = &tags_count;
+ func_argv[4] = tags ? (char *)tags : weechat_php_empty_arg;
+ func_argv[5] = &displayed;
+ func_argv[6] = &highlight;
+ func_argv[7] = prefix ? (char *)prefix : weechat_php_empty_arg;
+ func_argv[8] = message ? (char *)message : weechat_php_empty_arg;
+ weechat_php_cb(pointer, data, func_argv, "ssiisiiss",
+ WEECHAT_SCRIPT_EXEC_INT, &rc);
+ if (func_argv[1])
+ free (func_argv[1]);
+ return rc;
}
-PHP_FUNCTION(weechat_infolist_new)
+PHP_FUNCTION(weechat_hook_print)
{
- API_FUNC_INIT(weechat_infolist_new);
- struct t_infolist *retval;
- if (zend_parse_parameters_none () == FAILURE)
+ API_FUNC_INIT(weechat_hook_print);
+ zend_string *z_buffer;
+ zend_string *z_tags;
+ zend_string *z_message;
+ zend_long z_strip_colors;
+ zval *z_callback;
+ zend_string *z_data;
+ struct t_hook *retval;
+ struct t_gui_buffer *buffer;
+ char *tags;
+ char *message;
+ int strip_colors;
+ char *data;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SSSlzS", &z_buffer, &z_tags, &z_message,
+ &z_strip_colors, &z_callback,
+ &z_data) == FAILURE)
{
return;
}
- retval = weechat_infolist_new ();
+ buffer = (struct t_gui_buffer *)API_STR2PTR(ZSTR_VAL(z_buffer));
+ tags = ZSTR_VAL(z_tags);
+ message = ZSTR_VAL(z_message);
+ strip_colors = (int)z_strip_colors;
+ weechat_php_get_function_name (z_callback, callback_name);
+ data = ZSTR_VAL(z_data);
+ retval = plugin_script_api_hook_print (weechat_php_plugin,
+ php_current_script, buffer,
+ (const char *)tags,
+ (const char *)message,
+ strip_colors,
+ weechat_php_hook_print_callback,
+ (const char *)callback_name,
+ (const char *)data);
char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
}
-PHP_FUNCTION(weechat_infolist_new_item)
+static int
+weechat_php_hook_signal_callback(const void *pointer, void *data,
+ const char *signal, const char *type_data,
+ void *signal_data)
{
- API_FUNC_INIT(weechat_infolist_new_item);
- zend_string *z_infolist;
- struct t_infolist_item *retval;
- struct t_infolist *infolist;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_infolist) == FAILURE)
- {
- return;
- }
- infolist = (struct t_infolist *)API_STR2PTR(ZSTR_VAL(z_infolist));
- retval = weechat_infolist_new_item (infolist);
- char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
+ int rc;
+ void *func_argv[4];
+ func_argv[1] = signal ? (char *)signal : weechat_php_empty_arg;
+ func_argv[2] = type_data ? (char *)type_data : weechat_php_empty_arg;
+ func_argv[3] = signal_data ? (char *)signal_data : weechat_php_empty_arg;
+ weechat_php_cb(pointer, data, func_argv, "ssss",
+ WEECHAT_SCRIPT_EXEC_INT, &rc);
+ return rc;
}
-PHP_FUNCTION(weechat_infolist_new_var_integer)
+PHP_FUNCTION(weechat_hook_signal)
{
- API_FUNC_INIT(weechat_infolist_new_var_integer);
- zend_string *z_item;
- zend_string *z_name;
- zend_long z_value;
- struct t_infolist_var *retval;
- struct t_infolist_item *item;
- char *name;
- int value;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SSl", &z_item, &z_name, &z_value) == FAILURE)
+ API_FUNC_INIT(weechat_hook_signal);
+ zend_string *z_signal;
+ zval *z_callback;
+ zend_string *z_data;
+ struct t_hook *retval;
+ char *signal;
+ char *data;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SzS", &z_signal, &z_callback,
+ &z_data) == FAILURE)
{
return;
}
- item = (struct t_infolist_item *)API_STR2PTR(ZSTR_VAL(z_item));
- name = ZSTR_VAL(z_name);
- value = (int)z_value;
- retval = weechat_infolist_new_var_integer (item, (const char *)name, value);
+ signal = ZSTR_VAL(z_signal);
+ weechat_php_get_function_name (z_callback, callback_name);
+ data = ZSTR_VAL(z_data);
+ retval = plugin_script_api_hook_signal (weechat_php_plugin,
+ php_current_script,
+ (const char *)signal,
+ weechat_php_hook_signal_callback,
+ (const char *)callback_name,
+ (const char *)data);
char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
}
-PHP_FUNCTION(weechat_infolist_new_var_pointer)
+PHP_FUNCTION(weechat_hook_signal_send)
{
- API_FUNC_INIT(weechat_infolist_new_var_pointer);
- zend_string *z_item;
- zend_string *z_name;
- zend_string *z_pointer;
- struct t_infolist_var *retval;
- struct t_infolist_item *item;
- char *name;
- void *pointer;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SSS", &z_item, &z_name, &z_pointer) == FAILURE)
+ API_FUNC_INIT(weechat_hook_signal_send);
+ zend_string *z_signal;
+ zend_string *z_type_data;
+ zend_string *z_signal_data;
+ int retval;
+ char *signal;
+ char *type_data;
+ void *signal_data;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SSS", &z_signal, &z_type_data,
+ &z_signal_data) == FAILURE)
{
return;
}
- item = (struct t_infolist_item *)API_STR2PTR(ZSTR_VAL(z_item));
- name = ZSTR_VAL(z_name);
- pointer = (void *)API_STR2PTR(ZSTR_VAL(z_pointer));
- retval = weechat_infolist_new_var_pointer (item, (const char *)name, pointer);
- char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
+ signal = ZSTR_VAL(z_signal);
+ type_data = ZSTR_VAL(z_type_data);
+ signal_data = (void *)API_STR2PTR(ZSTR_VAL(z_signal_data));
+ retval = weechat_hook_signal_send ((const char *)signal,
+ (const char *)type_data, signal_data);
+ RETURN_LONG(retval);
}
-PHP_FUNCTION(weechat_infolist_new_var_string)
+static int weechat_php_hook_hsignal_callback(const void *pointer, void *data,
+ const char *signal,
+ struct t_hashtable *hashtable)
{
- API_FUNC_INIT(weechat_infolist_new_var_string);
- zend_string *z_item;
- zend_string *z_name;
- zend_string *z_value;
- struct t_infolist_var *retval;
- struct t_infolist_item *item;
- char *name;
- char *value;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SSS", &z_item, &z_name, &z_value) == FAILURE)
- {
- return;
- }
- item = (struct t_infolist_item *)API_STR2PTR(ZSTR_VAL(z_item));
- name = ZSTR_VAL(z_name);
- value = ZSTR_VAL(z_value);
- retval = weechat_infolist_new_var_string (item, (const char *)name, (const char *)value);
- char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
+ int rc;
+ void *func_argv[3];
+ func_argv[1] = signal ? (char *)signal : weechat_php_empty_arg;
+ func_argv[2] = hashtable;
+ weechat_php_cb(pointer, data, func_argv, "ssh",
+ WEECHAT_SCRIPT_EXEC_INT, &rc);
+ return rc;
}
-PHP_FUNCTION(weechat_infolist_new_var_time)
+PHP_FUNCTION(weechat_hook_hsignal)
{
- API_FUNC_INIT(weechat_infolist_new_var_time);
- zend_string *z_item;
- zend_string *z_name;
- zend_long z_time;
- struct t_infolist_var *retval;
- struct t_infolist_item *item;
- char *name;
- time_t time;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SSl", &z_item, &z_name, &z_time) == FAILURE)
+ API_FUNC_INIT(weechat_hook_hsignal);
+ zend_string *z_signal;
+ zval *z_callback;
+ zend_string *z_data;
+ struct t_hook *retval;
+ char *signal;
+ char *data;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SzS", &z_signal, &z_callback,
+ &z_data) == FAILURE)
{
return;
}
- item = (struct t_infolist_item *)API_STR2PTR(ZSTR_VAL(z_item));
- name = ZSTR_VAL(z_name);
- time = (time_t)z_time;
- retval = weechat_infolist_new_var_time (item, (const char *)name, time);
+ signal = ZSTR_VAL(z_signal);
+ weechat_php_get_function_name (z_callback, callback_name);
+ data = ZSTR_VAL(z_data);
+ retval = plugin_script_api_hook_hsignal (weechat_php_plugin,
+ php_current_script,
+ (const char *)signal,
+ weechat_php_hook_hsignal_callback,
+ (const char *)callback_name,
+ (const char *)data);
char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
}
-PHP_FUNCTION(weechat_infolist_next)
+PHP_FUNCTION(weechat_hook_hsignal_send)
{
- API_FUNC_INIT(weechat_infolist_next);
- zend_string *z_infolist;
+ API_FUNC_INIT(weechat_hook_hsignal_send);
+ zend_string *z_signal;
+ zval *z_hashtable;
int retval;
- struct t_infolist *infolist;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_infolist) == FAILURE)
+ char *signal;
+ struct t_hashtable *hashtable;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "Sa", &z_signal, &z_hashtable) == FAILURE)
{
return;
}
- infolist = (struct t_infolist *)API_STR2PTR(ZSTR_VAL(z_infolist));
- retval = weechat_infolist_next (infolist);
+ signal = ZSTR_VAL(z_signal);
+ hashtable = weechat_php_array_to_hashtable (
+ z_hashtable,
+ WEECHAT_SCRIPT_HASHTABLE_DEFAULT_SIZE,
+ WEECHAT_HASHTABLE_STRING,
+ WEECHAT_HASHTABLE_STRING);
+ retval = weechat_hook_hsignal_send ((const char *)signal, hashtable);
RETURN_LONG(retval);
}
-PHP_FUNCTION(weechat_infolist_pointer)
+static int
+weechat_php_hook_config_callback(const void *pointer, void *data,
+ const char *option, const char *value)
{
- API_FUNC_INIT(weechat_infolist_pointer);
- zend_string *z_infolist;
- zend_string *z_var;
- void *retval;
- struct t_infolist *infolist;
- char *var;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SS", &z_infolist, &z_var) == FAILURE)
- {
- return;
- }
- infolist = (struct t_infolist *)API_STR2PTR(ZSTR_VAL(z_infolist));
- var = ZSTR_VAL(z_var);
- retval = weechat_infolist_pointer (infolist, (const char *)var);
- char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
+ int rc;
+ void *func_argv[3];
+ func_argv[1] = option ? (char *)option : weechat_php_empty_arg;
+ func_argv[2] = value ? (char *)value : weechat_php_empty_arg;
+ weechat_php_cb(pointer, data, func_argv, "sss",
+ WEECHAT_SCRIPT_EXEC_INT, &rc);
+ return rc;
}
-PHP_FUNCTION(weechat_infolist_prev)
+PHP_FUNCTION(weechat_hook_config)
{
- API_FUNC_INIT(weechat_infolist_prev);
- zend_string *z_infolist;
- int retval;
- struct t_infolist *infolist;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_infolist) == FAILURE)
+ API_FUNC_INIT(weechat_hook_config);
+ zend_string *z_option;
+ zval *z_callback;
+ zend_string *z_data;
+ struct t_hook *retval;
+ char *option;
+ char *data;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SzS", &z_option, &z_callback,
+ &z_data) == FAILURE)
{
return;
}
- infolist = (struct t_infolist *)API_STR2PTR(ZSTR_VAL(z_infolist));
- retval = weechat_infolist_prev (infolist);
- RETURN_LONG(retval);
+ option = ZSTR_VAL(z_option);
+ weechat_php_get_function_name (z_callback, callback_name);
+ data = ZSTR_VAL(z_data);
+ retval = plugin_script_api_hook_config (weechat_php_plugin,
+ php_current_script,
+ (const char *)option,
+ weechat_php_hook_config_callback,
+ (const char *)callback_name,
+ (const char *)data);
+ char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
}
-PHP_FUNCTION(weechat_infolist_reset_item_cursor)
+static char *
+weechat_php_hook_modifier_callback(const void *pointer, void *data,
+ const char *modifier,
+ const char *modifier_data,
+ const char *string)
{
- API_FUNC_INIT(weechat_infolist_reset_item_cursor);
- zend_string *z_infolist;
- struct t_infolist *infolist;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_infolist) == FAILURE)
- {
- return;
- }
- infolist = (struct t_infolist *)API_STR2PTR(ZSTR_VAL(z_infolist));
- weechat_infolist_reset_item_cursor (infolist);
- RETURN_NULL();
+ char *rc;
+ void *func_argv[4];
+ func_argv[1] = modifier ? (char *)modifier : weechat_php_empty_arg;
+ func_argv[2] = modifier_data ? (char *)modifier_data : weechat_php_empty_arg;
+ func_argv[3] = string ? (char *)string : weechat_php_empty_arg;
+ weechat_php_cb(pointer, data, func_argv, "ssss",
+ WEECHAT_SCRIPT_EXEC_STRING, &rc);
+ return rc;
}
-PHP_FUNCTION(weechat_infolist_search_var)
+PHP_FUNCTION(weechat_hook_modifier)
{
- API_FUNC_INIT(weechat_infolist_search_var);
- zend_string *z_infolist;
- zend_string *z_name;
- struct t_infolist_var *retval;
- struct t_infolist *infolist;
- char *name;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SS", &z_infolist, &z_name) == FAILURE)
+ API_FUNC_INIT(weechat_hook_modifier);
+ zend_string *z_modifier;
+ zval *z_callback;
+ zend_string *z_data;
+ struct t_hook *retval;
+ char *modifier;
+ char *data;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SzS", &z_modifier, &z_callback,
+ &z_data) == FAILURE)
{
return;
}
- infolist = (struct t_infolist *)API_STR2PTR(ZSTR_VAL(z_infolist));
- name = ZSTR_VAL(z_name);
- retval = weechat_infolist_search_var (infolist, (const char *)name);
+ modifier = ZSTR_VAL(z_modifier);
+ weechat_php_get_function_name (z_callback, callback_name);
+ data = ZSTR_VAL(z_data);
+ retval = plugin_script_api_hook_modifier (weechat_php_plugin,
+ php_current_script,
+ (const char *)modifier,
+ weechat_php_hook_modifier_callback,
+ (const char *)callback_name,
+ (const char *)data);
char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
}
-PHP_FUNCTION(weechat_infolist_string)
+PHP_FUNCTION(weechat_hook_modifier_exec)
{
- API_FUNC_INIT(weechat_infolist_string);
- zend_string *z_infolist;
- zend_string *z_var;
- const char *retval;
- struct t_infolist *infolist;
- char *var;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SS", &z_infolist, &z_var) == FAILURE)
+ API_FUNC_INIT(weechat_hook_modifier_exec);
+ zend_string *z_modifier;
+ zend_string *z_modifier_data;
+ zend_string *z_string;
+ char *retval;
+ char *modifier;
+ char *modifier_data;
+ char *string;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SSS", &z_modifier, &z_modifier_data,
+ &z_string) == FAILURE)
{
return;
}
- infolist = (struct t_infolist *)API_STR2PTR(ZSTR_VAL(z_infolist));
- var = ZSTR_VAL(z_var);
- retval = weechat_infolist_string (infolist, (const char *)var);
+ modifier = ZSTR_VAL(z_modifier);
+ modifier_data = ZSTR_VAL(z_modifier_data);
+ string = ZSTR_VAL(z_string);
+ retval = weechat_hook_modifier_exec ((const char *)modifier,
+ (const char *)modifier_data,
+ (const char *)string);
SAFE_RETURN_STRING(retval);
}
-PHP_FUNCTION(weechat_infolist_time)
+static const char *weechat_php_hook_info_callback(const void *pointer, void *data, const char *info_name, const char *arguments)
{
- API_FUNC_INIT(weechat_infolist_time);
- zend_string *z_infolist;
- zend_string *z_var;
- time_t retval;
- struct t_infolist *infolist;
- char *var;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SS", &z_infolist, &z_var) == FAILURE)
- {
- return;
- }
- infolist = (struct t_infolist *)API_STR2PTR(ZSTR_VAL(z_infolist));
- var = ZSTR_VAL(z_var);
- retval = weechat_infolist_time (infolist, (const char *)var);
- RETURN_LONG(retval);
+ char *rc;
+ void *func_argv[3];
+ func_argv[1] = info_name ? (char *)info_name : weechat_php_empty_arg;
+ func_argv[2] = arguments ? (char *)arguments : weechat_php_empty_arg;
+ weechat_php_cb(pointer, data, func_argv, "sss",
+ WEECHAT_SCRIPT_EXEC_STRING, &rc);
+ return rc;
}
-PHP_FUNCTION(weechat_key_bind)
+PHP_FUNCTION(weechat_hook_info)
{
- API_FUNC_INIT(weechat_key_bind);
- zend_string *z_context;
- zval *z_keys;
- int retval;
- char *context;
- struct t_hashtable *keys;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "Sa", &z_context, &z_keys) == FAILURE)
+ API_FUNC_INIT(weechat_hook_info);
+ zend_string *z_info_name;
+ zend_string *z_description;
+ zend_string *z_args_description;
+ zval *z_callback;
+ zend_string *z_data;
+ struct t_hook *retval;
+ char *info_name;
+ char *description;
+ char *args_description;
+ char *data;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SSSzS", &z_info_name, &z_description,
+ &z_args_description, &z_callback,
+ &z_data) == FAILURE)
{
return;
}
- context = ZSTR_VAL(z_context);
- keys = weechat_php_array_to_hashtable(z_keys, WEECHAT_SCRIPT_HASHTABLE_DEFAULT_SIZE, WEECHAT_HASHTABLE_STRING, WEECHAT_HASHTABLE_STRING);
- retval = weechat_key_bind ((const char *)context, keys);
- RETURN_LONG(retval);
+ info_name = ZSTR_VAL(z_info_name);
+ description = ZSTR_VAL(z_description);
+ args_description = ZSTR_VAL(z_args_description);
+ weechat_php_get_function_name (z_callback, callback_name);
+ data = ZSTR_VAL(z_data);
+ retval = plugin_script_api_hook_info (weechat_php_plugin,
+ php_current_script,
+ (const char *)info_name,
+ (const char *)description,
+ (const char *)args_description,
+ weechat_php_hook_info_callback,
+ (const char *)callback_name,
+ (const char *)data);
+ char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
}
-PHP_FUNCTION(weechat_key_unbind)
+struct t_hashtable *
+weechat_php_api_hook_info_hashtable_callback(const void *pointer, void *data,
+ const char *info_name,
+ struct t_hashtable *hashtable)
{
- API_FUNC_INIT(weechat_key_unbind);
- zend_string *z_context;
- zend_string *z_key;
- int retval;
- char *context;
- char *key;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SS", &z_context, &z_key) == FAILURE)
- {
- return;
- }
- context = ZSTR_VAL(z_context);
- key = ZSTR_VAL(z_key);
- retval = weechat_key_unbind ((const char *)context, (const char *)key);
- RETURN_LONG(retval);
+ struct t_hashtable *rc;
+ void *func_argv[3];
+ func_argv[1] = (info_name) ? (char *)info_name : weechat_php_empty_arg;
+ func_argv[2] = hashtable;
+ weechat_php_cb(pointer, data, func_argv, "ssh", WEECHAT_SCRIPT_EXEC_HASHTABLE, &rc);
+ return rc;
}
-PHP_FUNCTION(weechat_list_add)
+PHP_FUNCTION(weechat_hook_info_hashtable)
{
- API_FUNC_INIT(weechat_list_add);
- zend_string *z_weelist;
+ API_FUNC_INIT(weechat_hook_info_hashtable);
+ zend_string *z_info_name;
+ zend_string *z_description;
+ zend_string *z_args_description;
+ zend_string *z_output_description;
+ zval *z_callback;
zend_string *z_data;
- zend_string *z_where;
- zend_string *z_user_data;
- struct t_weelist_item *retval;
- struct t_weelist *weelist;
+ struct t_hook *retval;
+ char *info_name;
+ char *description;
+ char *args_description;
+ char *output_description;
char *data;
- char *where;
- void *user_data;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SSSS", &z_weelist, &z_data, &z_where, &z_user_data) == FAILURE)
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SSSSSzS", &z_info_name, &z_description,
+ &z_args_description, &z_output_description,
+ &z_callback, &z_data) == FAILURE)
{
return;
}
- weelist = (struct t_weelist *)API_STR2PTR(ZSTR_VAL(z_weelist));
+ info_name = ZSTR_VAL(z_info_name);
+ description = ZSTR_VAL(z_description);
+ args_description = ZSTR_VAL(z_args_description);
+ output_description = ZSTR_VAL(z_output_description);
data = ZSTR_VAL(z_data);
- where = ZSTR_VAL(z_where);
- user_data = (void *)API_STR2PTR(ZSTR_VAL(z_user_data));
- retval = weechat_list_add (weelist, (const char *)data, (const char *)where, user_data);
+ weechat_php_get_function_name (z_callback, callback_name);
+ retval = plugin_script_api_hook_info_hashtable (weechat_php_plugin,
+ php_current_script,
+ info_name,
+ description,
+ args_description,
+ output_description,
+ weechat_php_api_hook_info_hashtable_callback,
+ callback_name,
+ data);
char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
}
-PHP_FUNCTION(weechat_list_casesearch)
+struct t_infolist *
+weechat_php_api_hook_infolist_callback (const void *pointer, void *data,
+ const char *info_name,
+ void *obj_pointer,
+ const char *arguments)
{
- API_FUNC_INIT(weechat_list_casesearch);
- zend_string *z_weelist;
+ struct t_infolist *rc;
+ void *func_argv[4];
+ func_argv[1] = (info_name) ? (char *)info_name : weechat_php_empty_arg;
+ func_argv[2] = API_PTR2STR(obj_pointer);
+ func_argv[3] = (arguments) ? (char *)arguments : weechat_php_empty_arg;
+ weechat_php_cb(pointer, data, func_argv, "ssss",
+ WEECHAT_SCRIPT_EXEC_STRING, &rc);
+ if (func_argv[2])
+ free (func_argv[2]);
+ return rc;
+}
+
+PHP_FUNCTION(weechat_hook_infolist)
+{
+ API_FUNC_INIT(weechat_hook_infolist);
+ zend_string *z_infolist_name;
+ zend_string *z_description;
+ zend_string *z_pointer_description;
+ zend_string *z_args_description;
+ zval *z_callback;
zend_string *z_data;
- struct t_weelist_item *retval;
- struct t_weelist *weelist;
+ struct t_hook *retval;
+ char *infolist_name;
+ char *description;
+ char *pointer_description;
+ char *args_description;
char *data;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SS", &z_weelist, &z_data) == FAILURE)
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SSSSzS", &z_infolist_name, &z_description,
+ &z_pointer_description, &z_args_description,
+ &z_callback, &z_data) == FAILURE)
{
return;
}
- weelist = (struct t_weelist *)API_STR2PTR(ZSTR_VAL(z_weelist));
+ infolist_name = ZSTR_VAL(z_infolist_name);
+ description = ZSTR_VAL(z_description);
+ pointer_description = ZSTR_VAL(z_pointer_description);
+ args_description = ZSTR_VAL(z_args_description);
data = ZSTR_VAL(z_data);
- retval = weechat_list_casesearch (weelist, (const char *)data);
+ weechat_php_get_function_name(z_callback, callback_name);
+ retval = plugin_script_api_hook_infolist (weechat_php_plugin,
+ php_current_script,
+ infolist_name,
+ description,
+ pointer_description,
+ args_description,
+ weechat_php_api_hook_infolist_callback,
+ callback_name,
+ data);
char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
}
-PHP_FUNCTION(weechat_list_casesearch_pos)
+struct t_hashtable *
+weechat_php_api_hook_focus_callback(const void *pointer, void *data,
+ struct t_hashtable *info)
{
- API_FUNC_INIT(weechat_list_casesearch_pos);
- zend_string *z_weelist;
+ struct t_hashtable *rc;
+ void *func_argv[2];
+ func_argv[1] = info;
+ weechat_php_cb(pointer, data, func_argv, "sh",
+ WEECHAT_SCRIPT_EXEC_HASHTABLE, &rc);
+ return rc;
+}
+
+PHP_FUNCTION(weechat_hook_focus)
+{
+ API_FUNC_INIT(weechat_hook_focus);
+ zend_string *z_area;
+ zval *z_callback;
zend_string *z_data;
- int retval;
- struct t_weelist *weelist;
+ struct t_hook *retval;
+ char *area;
char *data;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SS", &z_weelist, &z_data) == FAILURE)
+ if (zend_parse_parameters (ZEND_NUM_ARGS(), "SzS", &z_area, &z_callback,
+ &z_data) == FAILURE)
{
return;
}
- weelist = (struct t_weelist *)API_STR2PTR(ZSTR_VAL(z_weelist));
+ area = ZSTR_VAL(z_area);
data = ZSTR_VAL(z_data);
- retval = weechat_list_casesearch_pos (weelist, (const char *)data);
- RETURN_LONG(retval);
+ weechat_php_get_function_name (z_callback, callback_name);
+ retval = plugin_script_api_hook_focus (weechat_php_plugin,
+ php_current_script,
+ area,
+ weechat_php_api_hook_focus_callback,
+ callback_name,
+ data);
+ char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
}
-PHP_FUNCTION(weechat_list_free)
+PHP_FUNCTION(weechat_hook_set)
{
- API_FUNC_INIT(weechat_list_free);
- zend_string *z_weelist;
- struct t_weelist *weelist;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_weelist) == FAILURE)
+ API_FUNC_INIT(weechat_hook_set);
+ zend_string *z_hook;
+ zend_string *z_property;
+ zend_string *z_value;
+ struct t_hook *hook;
+ char *property;
+ char *value;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(), "SSS", &z_hook, &z_property,
+ &z_value) == FAILURE)
{
return;
}
- weelist = (struct t_weelist *)API_STR2PTR(ZSTR_VAL(z_weelist));
- weechat_list_free (weelist);
+ hook = (struct t_hook *)API_STR2PTR(ZSTR_VAL(z_hook));
+ property = ZSTR_VAL(z_property);
+ value = ZSTR_VAL(z_value);
+ weechat_hook_set (hook, (const char *)property, (const char *)value);
RETURN_NULL();
}
-PHP_FUNCTION(weechat_list_get)
+PHP_FUNCTION(weechat_unhook)
{
- API_FUNC_INIT(weechat_list_get);
- zend_string *z_weelist;
- zend_long z_position;
- struct t_weelist_item *retval;
- struct t_weelist *weelist;
- int position;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "Sl", &z_weelist, &z_position) == FAILURE)
+ API_FUNC_INIT(weechat_unhook);
+ zend_string *z_hook;
+ struct t_hook *hook;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_hook) == FAILURE)
{
return;
}
- weelist = (struct t_weelist *)API_STR2PTR(ZSTR_VAL(z_weelist));
- position = (int)z_position;
- retval = weechat_list_get (weelist, position);
- char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
+ hook = (struct t_hook *)API_STR2PTR(ZSTR_VAL(z_hook));
+ weechat_unhook (hook);
+ RETURN_NULL();
}
-PHP_FUNCTION(weechat_list_new)
+PHP_FUNCTION(weechat_unhook_all)
{
- API_FUNC_INIT(weechat_list_new);
- struct t_weelist *retval;
- if (zend_parse_parameters_none () == FAILURE)
+ API_FUNC_INIT(weechat_unhook_all);
+ zend_string *z_subplugin;
+ char *subplugin;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_subplugin) == FAILURE)
{
return;
}
- retval = weechat_list_new ();
+ subplugin = ZSTR_VAL(z_subplugin);
+ weechat_unhook_all ((const char *)subplugin);
+ RETURN_NULL();
+}
+
+int weechat_php_buffer_new_input_callback (const void *pointer, void *data,
+ struct t_gui_buffer *buffer,
+ const char *input_data)
+{
+ int rc;
+ void *func_argv[3];
+ func_argv[1] = API_PTR2STR(buffer);
+ func_argv[2] = input_data ? (char *)input_data : weechat_php_empty_arg;
+ weechat_php_cb(pointer, data, func_argv, "sss",
+ WEECHAT_SCRIPT_EXEC_INT, &rc);
+ if (func_argv[1])
+ free (func_argv[1]);
+ return rc;
+}
+
+int weechat_php_buffer_new_close_callback (const void *pointer, void *data,
+ struct t_gui_buffer *buffer)
+{
+ int rc;
+ void *func_argv[2];
+ func_argv[1] = API_PTR2STR(buffer);
+ weechat_php_cb(pointer, data, func_argv, "ss",
+ WEECHAT_SCRIPT_EXEC_INT, &rc);
+ if (func_argv[1])
+ free (func_argv[1]);
+ return rc;
+}
+
+PHP_FUNCTION(weechat_buffer_new)
+{
+ API_FUNC_INIT(weechat_buffer_new);
+ zend_string *z_name;
+ zval *z_input_callback;
+ zend_string *z_data_input;
+ zval *z_close_callback;
+ zend_string *z_data_close;
+ struct t_gui_buffer *retval;
+ char *name;
+ char *data_input;
+ char *data_close;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SzSzS", &z_name, &z_input_callback,
+ &z_data_input, &z_close_callback,
+ &z_data_close) == FAILURE)
+ {
+ return;
+ }
+ name = ZSTR_VAL(z_name);
+ weechat_php_get_function_name (z_input_callback, input_callback_name);
+ data_input = ZSTR_VAL(z_data_input);
+ weechat_php_get_function_name (z_close_callback, close_callback_name);
+ data_close = ZSTR_VAL(z_data_close);
+ retval = plugin_script_api_buffer_new (weechat_php_plugin,
+ php_current_script,
+ (const char *)name,
+ weechat_php_buffer_new_input_callback,
+ (const char *)input_callback_name,
+ (const char *)data_input,
+ weechat_php_buffer_new_close_callback,
+ (const char *)close_callback_name,
+ (const char *)data_close);
char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
}
-PHP_FUNCTION(weechat_list_next)
+PHP_FUNCTION(weechat_buffer_search)
{
- API_FUNC_INIT(weechat_list_next);
- zend_string *z_item;
- struct t_weelist_item *retval;
- struct t_weelist_item *item;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_item) == FAILURE)
+ API_FUNC_INIT(weechat_buffer_search);
+ zend_string *z_plugin;
+ zend_string *z_name;
+ struct t_gui_buffer *retval;
+ char *plugin;
+ char *name;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SS", &z_plugin, &z_name) == FAILURE)
{
return;
}
- item = (struct t_weelist_item *)API_STR2PTR(ZSTR_VAL(z_item));
- retval = weechat_list_next (item);
+ plugin = ZSTR_VAL(z_plugin);
+ name = ZSTR_VAL(z_name);
+ retval = weechat_buffer_search ((const char *)plugin, (const char *)name);
char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
}
-PHP_FUNCTION(weechat_list_prev)
+PHP_FUNCTION(weechat_buffer_search_main)
{
- API_FUNC_INIT(weechat_list_prev);
- zend_string *z_item;
- struct t_weelist_item *retval;
- struct t_weelist_item *item;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_item) == FAILURE)
+ API_FUNC_INIT(weechat_buffer_search_main);
+ struct t_gui_buffer *retval;
+ if (zend_parse_parameters_none () == FAILURE)
{
return;
}
- item = (struct t_weelist_item *)API_STR2PTR(ZSTR_VAL(z_item));
- retval = weechat_list_prev (item);
+ retval = weechat_buffer_search_main ();
char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
}
-PHP_FUNCTION(weechat_list_remove)
+PHP_FUNCTION(weechat_buffer_clear)
{
- API_FUNC_INIT(weechat_list_remove);
- zend_string *z_weelist;
- zend_string *z_item;
- struct t_weelist *weelist;
- struct t_weelist_item *item;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SS", &z_weelist, &z_item) == FAILURE)
+ API_FUNC_INIT(weechat_buffer_clear);
+ zend_string *z_buffer;
+ struct t_gui_buffer *buffer;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_buffer) == FAILURE)
{
return;
}
- weelist = (struct t_weelist *)API_STR2PTR(ZSTR_VAL(z_weelist));
- item = (struct t_weelist_item *)API_STR2PTR(ZSTR_VAL(z_item));
- weechat_list_remove (weelist, item);
+ buffer = (struct t_gui_buffer *)API_STR2PTR(ZSTR_VAL(z_buffer));
+ weechat_buffer_clear (buffer);
RETURN_NULL();
}
-PHP_FUNCTION(weechat_list_remove_all)
+PHP_FUNCTION(weechat_buffer_close)
{
- API_FUNC_INIT(weechat_list_remove_all);
- zend_string *z_weelist;
- struct t_weelist *weelist;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_weelist) == FAILURE)
+ API_FUNC_INIT(weechat_buffer_close);
+ zend_string *z_buffer;
+ struct t_gui_buffer *buffer;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_buffer) == FAILURE)
{
return;
}
- weelist = (struct t_weelist *)API_STR2PTR(ZSTR_VAL(z_weelist));
- weechat_list_remove_all (weelist);
+ buffer = (struct t_gui_buffer *)API_STR2PTR(ZSTR_VAL(z_buffer));
+ weechat_buffer_close (buffer);
RETURN_NULL();
}
-PHP_FUNCTION(weechat_list_search)
+PHP_FUNCTION(weechat_buffer_merge)
{
- API_FUNC_INIT(weechat_list_search);
- zend_string *z_weelist;
- zend_string *z_data;
- struct t_weelist_item *retval;
- struct t_weelist *weelist;
- char *data;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SS", &z_weelist, &z_data) == FAILURE)
+ API_FUNC_INIT(weechat_buffer_merge);
+ zend_string *z_buffer;
+ zend_string *z_target_buffer;
+ struct t_gui_buffer *buffer;
+ struct t_gui_buffer *target_buffer;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SS", &z_buffer, &z_target_buffer) == FAILURE)
{
return;
}
- weelist = (struct t_weelist *)API_STR2PTR(ZSTR_VAL(z_weelist));
- data = ZSTR_VAL(z_data);
- retval = weechat_list_search (weelist, (const char *)data);
- char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
+ buffer = (struct t_gui_buffer *)API_STR2PTR(ZSTR_VAL(z_buffer));
+ target_buffer = (struct t_gui_buffer *)API_STR2PTR(ZSTR_VAL(z_target_buffer));
+ weechat_buffer_merge (buffer, target_buffer);
+ RETURN_NULL();
}
-PHP_FUNCTION(weechat_list_search_pos)
+PHP_FUNCTION(weechat_buffer_unmerge)
{
- API_FUNC_INIT(weechat_list_search_pos);
- zend_string *z_weelist;
- zend_string *z_data;
+ API_FUNC_INIT(weechat_buffer_unmerge);
+ zend_string *z_buffer;
+ zend_long z_number;
+ struct t_gui_buffer *buffer;
+ int number;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "Sl", &z_buffer, &z_number) == FAILURE)
+ {
+ return;
+ }
+ buffer = (struct t_gui_buffer *)API_STR2PTR(ZSTR_VAL(z_buffer));
+ number = (int)z_number;
+ weechat_buffer_unmerge (buffer, number);
+ RETURN_NULL();
+}
+
+PHP_FUNCTION(weechat_buffer_get_integer)
+{
+ API_FUNC_INIT(weechat_buffer_get_integer);
+ zend_string *z_buffer;
+ zend_string *z_property;
int retval;
- struct t_weelist *weelist;
- char *data;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SS", &z_weelist, &z_data) == FAILURE)
+ struct t_gui_buffer *buffer;
+ char *property;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SS", &z_buffer, &z_property) == FAILURE)
{
return;
}
- weelist = (struct t_weelist *)API_STR2PTR(ZSTR_VAL(z_weelist));
- data = ZSTR_VAL(z_data);
- retval = weechat_list_search_pos (weelist, (const char *)data);
+ buffer = (struct t_gui_buffer *)API_STR2PTR(ZSTR_VAL(z_buffer));
+ property = ZSTR_VAL(z_property);
+ retval = weechat_buffer_get_integer (buffer, (const char *)property);
RETURN_LONG(retval);
}
-PHP_FUNCTION(weechat_list_set)
+PHP_FUNCTION(weechat_buffer_get_string)
{
- API_FUNC_INIT(weechat_list_set);
- zend_string *z_item;
+ API_FUNC_INIT(weechat_buffer_get_string);
+ zend_string *z_buffer;
+ zend_string *z_property;
+ const char *retval;
+ struct t_gui_buffer *buffer;
+ char *property;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SS", &z_buffer, &z_property) == FAILURE)
+ {
+ return;
+ }
+ buffer = (struct t_gui_buffer *)API_STR2PTR(ZSTR_VAL(z_buffer));
+ property = ZSTR_VAL(z_property);
+ retval = weechat_buffer_get_string (buffer, (const char *)property);
+ SAFE_RETURN_STRING(retval);
+}
+
+PHP_FUNCTION(weechat_buffer_get_pointer)
+{
+ API_FUNC_INIT(weechat_buffer_get_pointer);
+ zend_string *z_buffer;
+ zend_string *z_property;
+ void *retval;
+ struct t_gui_buffer *buffer;
+ char *property;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SS", &z_buffer, &z_property) == FAILURE)
+ {
+ return;
+ }
+ buffer = (struct t_gui_buffer *)API_STR2PTR(ZSTR_VAL(z_buffer));
+ property = ZSTR_VAL(z_property);
+ retval = weechat_buffer_get_pointer (buffer, (const char *)property);
+ char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
+}
+
+PHP_FUNCTION(weechat_buffer_set)
+{
+ API_FUNC_INIT(weechat_buffer_set);
+ zend_string *z_buffer;
+ zend_string *z_property;
zend_string *z_value;
- struct t_weelist_item *item;
+ struct t_gui_buffer *buffer;
+ char *property;
char *value;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SS", &z_item, &z_value) == FAILURE)
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SSS", &z_buffer, &z_property,
+ &z_value) == FAILURE)
{
return;
}
- item = (struct t_weelist_item *)API_STR2PTR(ZSTR_VAL(z_item));
+ buffer = (struct t_gui_buffer *)API_STR2PTR(ZSTR_VAL(z_buffer));
+ property = ZSTR_VAL(z_property);
value = ZSTR_VAL(z_value);
- weechat_list_set (item, (const char *)value);
+ weechat_buffer_set (buffer, (const char *)property, (const char *)value);
RETURN_NULL();
}
-PHP_FUNCTION(weechat_list_size)
+PHP_FUNCTION(weechat_buffer_string_replace_local_var)
{
- API_FUNC_INIT(weechat_list_size);
- zend_string *z_weelist;
+ API_FUNC_INIT(weechat_buffer_string_replace_local_var);
+ zend_string *z_buffer;
+ zend_string *z_string;
+ char *retval;
+ struct t_gui_buffer *buffer;
+ char *string;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SS", &z_buffer, &z_string) == FAILURE)
+ {
+ return;
+ }
+ buffer = (struct t_gui_buffer *)API_STR2PTR(ZSTR_VAL(z_buffer));
+ string = ZSTR_VAL(z_string);
+ retval = weechat_buffer_string_replace_local_var (buffer,
+ (const char *)string);
+ SAFE_RETURN_STRING(retval);
+}
+
+PHP_FUNCTION(weechat_buffer_match_list)
+{
+ API_FUNC_INIT(weechat_buffer_match_list);
+ zend_string *z_buffer;
+ zend_string *z_string;
int retval;
- struct t_weelist *weelist;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_weelist) == FAILURE)
+ struct t_gui_buffer *buffer;
+ char *string;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SS", &z_buffer, &z_string) == FAILURE)
{
return;
}
- weelist = (struct t_weelist *)API_STR2PTR(ZSTR_VAL(z_weelist));
- retval = weechat_list_size (weelist);
+ buffer = (struct t_gui_buffer *)API_STR2PTR(ZSTR_VAL(z_buffer));
+ string = ZSTR_VAL(z_string);
+ retval = weechat_buffer_match_list (buffer, (const char *)string);
RETURN_LONG(retval);
}
-PHP_FUNCTION(weechat_list_string)
+PHP_FUNCTION(weechat_window_search_with_buffer)
{
- API_FUNC_INIT(weechat_list_string);
- zend_string *z_item;
- const char *retval;
- struct t_weelist_item *item;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_item) == FAILURE)
+ API_FUNC_INIT(weechat_window_search_with_buffer);
+ zend_string *z_buffer;
+ struct t_gui_window *retval;
+ struct t_gui_buffer *buffer;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_buffer) == FAILURE)
{
return;
}
- item = (struct t_weelist_item *)API_STR2PTR(ZSTR_VAL(z_item));
- retval = weechat_list_string (item);
- SAFE_RETURN_STRING(retval);
+ buffer = (struct t_gui_buffer *)API_STR2PTR(ZSTR_VAL(z_buffer));
+ retval = weechat_window_search_with_buffer (buffer);
+ char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
}
-PHP_FUNCTION(weechat_mkdir)
+PHP_FUNCTION(weechat_window_get_integer)
{
- API_FUNC_INIT(weechat_mkdir);
- zend_string *z_directory;
- zend_long z_mode;
+ API_FUNC_INIT(weechat_window_get_integer);
+ zend_string *z_window;
+ zend_string *z_property;
int retval;
- char *directory;
- int mode;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "Sl", &z_directory, &z_mode) == FAILURE)
+ struct t_gui_window *window;
+ char *property;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SS", &z_window, &z_property) == FAILURE)
{
return;
}
- directory = ZSTR_VAL(z_directory);
- mode = (int)z_mode;
- retval = weechat_mkdir ((const char *)directory, mode);
+ window = (struct t_gui_window *)API_STR2PTR(ZSTR_VAL(z_window));
+ property = ZSTR_VAL(z_property);
+ retval = weechat_window_get_integer (window, (const char *)property);
RETURN_LONG(retval);
}
-PHP_FUNCTION(weechat_mkdir_home)
+PHP_FUNCTION(weechat_window_get_string)
{
- API_FUNC_INIT(weechat_mkdir_home);
- zend_string *z_directory;
- zend_long z_mode;
- int retval;
- char *directory;
- int mode;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "Sl", &z_directory, &z_mode) == FAILURE)
+ API_FUNC_INIT(weechat_window_get_string);
+ zend_string *z_window;
+ zend_string *z_property;
+ const char *retval;
+ struct t_gui_window *window;
+ char *property;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SS", &z_window, &z_property) == FAILURE)
{
return;
}
- directory = ZSTR_VAL(z_directory);
- mode = (int)z_mode;
- retval = weechat_mkdir_home ((const char *)directory, mode);
- RETURN_LONG(retval);
+ window = (struct t_gui_window *)API_STR2PTR(ZSTR_VAL(z_window));
+ property = ZSTR_VAL(z_property);
+ retval = weechat_window_get_string (window, (const char *)property);
+ SAFE_RETURN_STRING(retval);
}
-PHP_FUNCTION(weechat_mkdir_parents)
+PHP_FUNCTION(weechat_window_get_pointer)
{
- API_FUNC_INIT(weechat_mkdir_parents);
- zend_string *z_directory;
- zend_long z_mode;
- int retval;
- char *directory;
- int mode;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "Sl", &z_directory, &z_mode) == FAILURE)
+ API_FUNC_INIT(weechat_window_get_pointer);
+ zend_string *z_window;
+ zend_string *z_property;
+ void *retval;
+ struct t_gui_window *window;
+ char *property;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SS", &z_window, &z_property) == FAILURE)
{
return;
}
- directory = ZSTR_VAL(z_directory);
- mode = (int)z_mode;
- retval = weechat_mkdir_parents ((const char *)directory, mode);
- RETURN_LONG(retval);
+ window = (struct t_gui_window *)API_STR2PTR(ZSTR_VAL(z_window));
+ property = ZSTR_VAL(z_property);
+ retval = weechat_window_get_pointer (window, (const char *)property);
+ char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
}
-PHP_FUNCTION(weechat_ngettext)
+PHP_FUNCTION(weechat_window_set_title)
{
- API_FUNC_INIT(weechat_ngettext);
- zend_string *z_single;
- zend_string *z_plural;
- zend_long z_count;
- const char *retval;
- char *single;
- char *plural;
- int count;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SSl", &z_single, &z_plural, &z_count) == FAILURE)
+ API_FUNC_INIT(weechat_window_set_title);
+ zend_string *z_title;
+ char *title;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_title) == FAILURE)
{
return;
}
- single = ZSTR_VAL(z_single);
- plural = ZSTR_VAL(z_plural);
- count = (int)z_count;
- retval = weechat_ngettext ((const char *)single, (const char *)plural, count);
- SAFE_RETURN_STRING(retval);
+ title = ZSTR_VAL(z_title);
+ weechat_window_set_title ((const char *)title);
+ RETURN_NULL();
}
PHP_FUNCTION(weechat_nicklist_add_group)
@@ -2747,7 +3368,9 @@ PHP_FUNCTION(weechat_nicklist_add_group)
char *name;
char *color;
int visible;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SSSSl", &z_buffer, &z_parent_group, &z_name, &z_color, &z_visible) == FAILURE)
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SSSSl", &z_buffer, &z_parent_group, &z_name,
+ &z_color, &z_visible) == FAILURE)
{
return;
}
@@ -2756,7 +3379,36 @@ PHP_FUNCTION(weechat_nicklist_add_group)
name = ZSTR_VAL(z_name);
color = ZSTR_VAL(z_color);
visible = (int)z_visible;
- retval = weechat_nicklist_add_group (buffer, parent_group, (const char *)name, (const char *)color, visible);
+ retval = weechat_nicklist_add_group (buffer,
+ parent_group,
+ (const char *)name,
+ (const char *)color,
+ visible);
+ char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
+}
+
+PHP_FUNCTION(weechat_nicklist_search_group)
+{
+ API_FUNC_INIT(weechat_nicklist_search_group);
+ zend_string *z_buffer;
+ zend_string *z_from_group;
+ zend_string *z_name;
+ struct t_gui_nick_group *retval;
+ struct t_gui_buffer *buffer;
+ struct t_gui_nick_group *from_group;
+ char *name;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SSS", &z_buffer, &z_from_group,
+ &z_name) == FAILURE)
+ {
+ return;
+ }
+ buffer = (struct t_gui_buffer *)API_STR2PTR(ZSTR_VAL(z_buffer));
+ from_group = (struct t_gui_nick_group *)API_STR2PTR(ZSTR_VAL(z_from_group));
+ name = ZSTR_VAL(z_name);
+ retval = weechat_nicklist_search_group (buffer,
+ from_group,
+ (const char *)name);
char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
}
@@ -2778,7 +3430,10 @@ PHP_FUNCTION(weechat_nicklist_add_nick)
char *prefix;
char *prefix_color;
int visible;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SSSSSSl", &z_buffer, &z_group, &z_name, &z_color, &z_prefix, &z_prefix_color, &z_visible) == FAILURE)
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SSSSSSl", &z_buffer, &z_group, &z_name,
+ &z_color, &z_prefix, &z_prefix_color,
+ &z_visible) == FAILURE)
{
return;
}
@@ -2789,10 +3444,91 @@ PHP_FUNCTION(weechat_nicklist_add_nick)
prefix = ZSTR_VAL(z_prefix);
prefix_color = ZSTR_VAL(z_prefix_color);
visible = (int)z_visible;
- retval = weechat_nicklist_add_nick (buffer, group, (const char *)name, (const char *)color, (const char *)prefix, (const char *)prefix_color, visible);
+ retval = weechat_nicklist_add_nick (buffer,
+ group,
+ (const char *)name,
+ (const char *)color,
+ (const char *)prefix,
+ (const char *)prefix_color,
+ visible);
+ char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
+}
+
+PHP_FUNCTION(weechat_nicklist_search_nick)
+{
+ API_FUNC_INIT(weechat_nicklist_search_nick);
+ zend_string *z_buffer;
+ zend_string *z_from_group;
+ zend_string *z_name;
+ struct t_gui_nick *retval;
+ struct t_gui_buffer *buffer;
+ struct t_gui_nick_group *from_group;
+ char *name;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SSS", &z_buffer, &z_from_group,
+ &z_name) == FAILURE)
+ {
+ return;
+ }
+ buffer = (struct t_gui_buffer *)API_STR2PTR(ZSTR_VAL(z_buffer));
+ from_group = (struct t_gui_nick_group *)API_STR2PTR(ZSTR_VAL(z_from_group));
+ name = ZSTR_VAL(z_name);
+ retval = weechat_nicklist_search_nick (buffer,
+ from_group,
+ (const char *)name);
char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
}
+PHP_FUNCTION(weechat_nicklist_remove_group)
+{
+ API_FUNC_INIT(weechat_nicklist_remove_group);
+ zend_string *z_buffer;
+ zend_string *z_group;
+ struct t_gui_buffer *buffer;
+ struct t_gui_nick_group *group;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SS", &z_buffer, &z_group) == FAILURE)
+ {
+ return;
+ }
+ buffer = (struct t_gui_buffer *)API_STR2PTR(ZSTR_VAL(z_buffer));
+ group = (struct t_gui_nick_group *)API_STR2PTR(ZSTR_VAL(z_group));
+ weechat_nicklist_remove_group (buffer, group);
+ RETURN_NULL();
+}
+
+PHP_FUNCTION(weechat_nicklist_remove_nick)
+{
+ API_FUNC_INIT(weechat_nicklist_remove_nick);
+ zend_string *z_buffer;
+ zend_string *z_nick;
+ struct t_gui_buffer *buffer;
+ struct t_gui_nick *nick;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SS", &z_buffer, &z_nick) == FAILURE)
+ {
+ return;
+ }
+ buffer = (struct t_gui_buffer *)API_STR2PTR(ZSTR_VAL(z_buffer));
+ nick = (struct t_gui_nick *)API_STR2PTR(ZSTR_VAL(z_nick));
+ weechat_nicklist_remove_nick (buffer, nick);
+ RETURN_NULL();
+}
+
+PHP_FUNCTION(weechat_nicklist_remove_all)
+{
+ API_FUNC_INIT(weechat_nicklist_remove_all);
+ zend_string *z_buffer;
+ struct t_gui_buffer *buffer;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_buffer) == FAILURE)
+ {
+ return;
+ }
+ buffer = (struct t_gui_buffer *)API_STR2PTR(ZSTR_VAL(z_buffer));
+ weechat_nicklist_remove_all (buffer);
+ RETURN_NULL();
+}
+
PHP_FUNCTION(weechat_nicklist_group_get_integer)
{
API_FUNC_INIT(weechat_nicklist_group_get_integer);
@@ -2803,57 +3539,69 @@ PHP_FUNCTION(weechat_nicklist_group_get_integer)
struct t_gui_buffer *buffer;
struct t_gui_nick_group *group;
char *property;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SSS", &z_buffer, &z_group, &z_property) == FAILURE)
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SSS", &z_buffer, &z_group,
+ &z_property) == FAILURE)
{
return;
}
buffer = (struct t_gui_buffer *)API_STR2PTR(ZSTR_VAL(z_buffer));
group = (struct t_gui_nick_group *)API_STR2PTR(ZSTR_VAL(z_group));
property = ZSTR_VAL(z_property);
- retval = weechat_nicklist_group_get_integer (buffer, group, (const char *)property);
+ retval = weechat_nicklist_group_get_integer (buffer,
+ group,
+ (const char *)property);
RETURN_LONG(retval);
}
-PHP_FUNCTION(weechat_nicklist_group_get_pointer)
+PHP_FUNCTION(weechat_nicklist_group_get_string)
{
- API_FUNC_INIT(weechat_nicklist_group_get_pointer);
+ API_FUNC_INIT(weechat_nicklist_group_get_string);
zend_string *z_buffer;
zend_string *z_group;
zend_string *z_property;
- void *retval;
+ const char *retval;
struct t_gui_buffer *buffer;
struct t_gui_nick_group *group;
char *property;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SSS", &z_buffer, &z_group, &z_property) == FAILURE)
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SSS", &z_buffer, &z_group,
+ &z_property) == FAILURE)
{
return;
}
buffer = (struct t_gui_buffer *)API_STR2PTR(ZSTR_VAL(z_buffer));
group = (struct t_gui_nick_group *)API_STR2PTR(ZSTR_VAL(z_group));
property = ZSTR_VAL(z_property);
- retval = weechat_nicklist_group_get_pointer (buffer, group, (const char *)property);
- char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
+ retval = weechat_nicklist_group_get_string (buffer,
+ group,
+ (const char *)property);
+ SAFE_RETURN_STRING(retval);
}
-PHP_FUNCTION(weechat_nicklist_group_get_string)
+PHP_FUNCTION(weechat_nicklist_group_get_pointer)
{
- API_FUNC_INIT(weechat_nicklist_group_get_string);
+ API_FUNC_INIT(weechat_nicklist_group_get_pointer);
zend_string *z_buffer;
zend_string *z_group;
zend_string *z_property;
- const char *retval;
+ void *retval;
struct t_gui_buffer *buffer;
struct t_gui_nick_group *group;
char *property;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SSS", &z_buffer, &z_group, &z_property) == FAILURE)
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SSS", &z_buffer, &z_group,
+ &z_property) == FAILURE)
{
return;
}
buffer = (struct t_gui_buffer *)API_STR2PTR(ZSTR_VAL(z_buffer));
group = (struct t_gui_nick_group *)API_STR2PTR(ZSTR_VAL(z_group));
property = ZSTR_VAL(z_property);
- retval = weechat_nicklist_group_get_string (buffer, group, (const char *)property);
- SAFE_RETURN_STRING(retval);
+ retval = weechat_nicklist_group_get_pointer (buffer,
+ group,
+ (const char *)property);
+ char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
}
PHP_FUNCTION(weechat_nicklist_group_set)
@@ -2867,7 +3615,9 @@ PHP_FUNCTION(weechat_nicklist_group_set)
struct t_gui_nick_group *group;
char *property;
char *value;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SSSS", &z_buffer, &z_group, &z_property, &z_value) == FAILURE)
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SSSS", &z_buffer, &z_group, &z_property,
+ &z_value) == FAILURE)
{
return;
}
@@ -2875,7 +3625,10 @@ PHP_FUNCTION(weechat_nicklist_group_set)
group = (struct t_gui_nick_group *)API_STR2PTR(ZSTR_VAL(z_group));
property = ZSTR_VAL(z_property);
value = ZSTR_VAL(z_value);
- weechat_nicklist_group_set (buffer, group, (const char *)property, (const char *)value);
+ weechat_nicklist_group_set (buffer,
+ group,
+ (const char *)property,
+ (const char *)value);
RETURN_NULL();
}
@@ -2889,57 +3642,69 @@ PHP_FUNCTION(weechat_nicklist_nick_get_integer)
struct t_gui_buffer *buffer;
struct t_gui_nick *nick;
char *property;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SSS", &z_buffer, &z_nick, &z_property) == FAILURE)
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SSS", &z_buffer, &z_nick,
+ &z_property) == FAILURE)
{
return;
}
buffer = (struct t_gui_buffer *)API_STR2PTR(ZSTR_VAL(z_buffer));
nick = (struct t_gui_nick *)API_STR2PTR(ZSTR_VAL(z_nick));
property = ZSTR_VAL(z_property);
- retval = weechat_nicklist_nick_get_integer (buffer, nick, (const char *)property);
+ retval = weechat_nicklist_nick_get_integer (buffer,
+ nick,
+ (const char *)property);
RETURN_LONG(retval);
}
-PHP_FUNCTION(weechat_nicklist_nick_get_pointer)
+PHP_FUNCTION(weechat_nicklist_nick_get_string)
{
- API_FUNC_INIT(weechat_nicklist_nick_get_pointer);
+ API_FUNC_INIT(weechat_nicklist_nick_get_string);
zend_string *z_buffer;
zend_string *z_nick;
zend_string *z_property;
- void *retval;
+ const char *retval;
struct t_gui_buffer *buffer;
struct t_gui_nick *nick;
char *property;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SSS", &z_buffer, &z_nick, &z_property) == FAILURE)
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SSS", &z_buffer, &z_nick,
+ &z_property) == FAILURE)
{
return;
}
buffer = (struct t_gui_buffer *)API_STR2PTR(ZSTR_VAL(z_buffer));
nick = (struct t_gui_nick *)API_STR2PTR(ZSTR_VAL(z_nick));
property = ZSTR_VAL(z_property);
- retval = weechat_nicklist_nick_get_pointer (buffer, nick, (const char *)property);
- char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
+ retval = weechat_nicklist_nick_get_string (buffer,
+ nick,
+ (const char *)property);
+ SAFE_RETURN_STRING(retval);
}
-PHP_FUNCTION(weechat_nicklist_nick_get_string)
+PHP_FUNCTION(weechat_nicklist_nick_get_pointer)
{
- API_FUNC_INIT(weechat_nicklist_nick_get_string);
+ API_FUNC_INIT(weechat_nicklist_nick_get_pointer);
zend_string *z_buffer;
zend_string *z_nick;
zend_string *z_property;
- const char *retval;
+ void *retval;
struct t_gui_buffer *buffer;
struct t_gui_nick *nick;
char *property;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SSS", &z_buffer, &z_nick, &z_property) == FAILURE)
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SSS", &z_buffer, &z_nick,
+ &z_property) == FAILURE)
{
return;
}
buffer = (struct t_gui_buffer *)API_STR2PTR(ZSTR_VAL(z_buffer));
nick = (struct t_gui_nick *)API_STR2PTR(ZSTR_VAL(z_nick));
property = ZSTR_VAL(z_property);
- retval = weechat_nicklist_nick_get_string (buffer, nick, (const char *)property);
- SAFE_RETURN_STRING(retval);
+ retval = weechat_nicklist_nick_get_pointer (buffer,
+ nick,
+ (const char *)property);
+ char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
}
PHP_FUNCTION(weechat_nicklist_nick_set)
@@ -2953,7 +3718,9 @@ PHP_FUNCTION(weechat_nicklist_nick_set)
struct t_gui_nick *nick;
char *property;
char *value;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SSSS", &z_buffer, &z_nick, &z_property, &z_value) == FAILURE)
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SSSS", &z_buffer, &z_nick, &z_property,
+ &z_value) == FAILURE)
{
return;
}
@@ -2961,168 +3728,246 @@ PHP_FUNCTION(weechat_nicklist_nick_set)
nick = (struct t_gui_nick *)API_STR2PTR(ZSTR_VAL(z_nick));
property = ZSTR_VAL(z_property);
value = ZSTR_VAL(z_value);
- weechat_nicklist_nick_set (buffer, nick, (const char *)property, (const char *)value);
+ weechat_nicklist_nick_set (buffer,
+ nick,
+ (const char *)property,
+ (const char *)value);
RETURN_NULL();
}
-PHP_FUNCTION(weechat_nicklist_remove_all)
+PHP_FUNCTION(weechat_bar_item_search)
{
- API_FUNC_INIT(weechat_nicklist_remove_all);
- zend_string *z_buffer;
- struct t_gui_buffer *buffer;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_buffer) == FAILURE)
+ API_FUNC_INIT(weechat_bar_item_search);
+ zend_string *z_name;
+ struct t_gui_bar_item *retval;
+ char *name;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_name) == FAILURE)
{
return;
}
- buffer = (struct t_gui_buffer *)API_STR2PTR(ZSTR_VAL(z_buffer));
- weechat_nicklist_remove_all (buffer);
- RETURN_NULL();
+ name = ZSTR_VAL(z_name);
+ retval = weechat_bar_item_search ((const char *)name);
+ char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
}
-PHP_FUNCTION(weechat_nicklist_remove_group)
+static char *
+weechat_php_bar_item_new_build_callback (const void *pointer, void *data,
+ struct t_gui_bar_item *item,
+ struct t_gui_window *window,
+ struct t_gui_buffer *buffer,
+ struct t_hashtable *extra_info)
{
- API_FUNC_INIT(weechat_nicklist_remove_group);
- zend_string *z_buffer;
- zend_string *z_group;
- struct t_gui_buffer *buffer;
- struct t_gui_nick_group *group;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SS", &z_buffer, &z_group) == FAILURE)
+ char *rc;
+ void *func_argv[5];
+ func_argv[1] = API_PTR2STR(item);
+ func_argv[2] = API_PTR2STR(window);
+ func_argv[3] = API_PTR2STR(buffer);
+ func_argv[4] = extra_info;
+ weechat_php_cb (pointer, data, func_argv, "ssssh",
+ WEECHAT_SCRIPT_EXEC_STRING, &rc);
+ if (func_argv[1])
+ free (func_argv[1]);
+ if (func_argv[2])
+ free (func_argv[2]);
+ if (func_argv[3])
+ free (func_argv[3]);
+ return rc;
+}
+
+PHP_FUNCTION(weechat_bar_item_new)
+{
+ API_FUNC_INIT(weechat_bar_item_new);
+ zend_string *z_name;
+ zval *z_build_callback;
+ zend_string *z_data;
+ struct t_gui_bar_item *retval;
+ char *name;
+ char *data;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SzS", &z_name, &z_build_callback,
+ &z_data) == FAILURE)
{
return;
}
- buffer = (struct t_gui_buffer *)API_STR2PTR(ZSTR_VAL(z_buffer));
- group = (struct t_gui_nick_group *)API_STR2PTR(ZSTR_VAL(z_group));
- weechat_nicklist_remove_group (buffer, group);
- RETURN_NULL();
+ name = ZSTR_VAL(z_name);
+ weechat_php_get_function_name (z_build_callback, build_callback_name);
+ data = ZSTR_VAL(z_data);
+ retval = plugin_script_api_bar_item_new (weechat_php_plugin,
+ php_current_script,
+ (const char *)name,
+ weechat_php_bar_item_new_build_callback,
+ (const char *)build_callback_name,
+ (const char *)data);
+ char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
}
-PHP_FUNCTION(weechat_nicklist_remove_nick)
+PHP_FUNCTION(weechat_bar_item_update)
{
- API_FUNC_INIT(weechat_nicklist_remove_nick);
- zend_string *z_buffer;
- zend_string *z_nick;
- struct t_gui_buffer *buffer;
- struct t_gui_nick *nick;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SS", &z_buffer, &z_nick) == FAILURE)
+ API_FUNC_INIT(weechat_bar_item_update);
+ zend_string *z_name;
+ char *name;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_name) == FAILURE)
{
return;
}
- buffer = (struct t_gui_buffer *)API_STR2PTR(ZSTR_VAL(z_buffer));
- nick = (struct t_gui_nick *)API_STR2PTR(ZSTR_VAL(z_nick));
- weechat_nicklist_remove_nick (buffer, nick);
+ name = ZSTR_VAL(z_name);
+ weechat_bar_item_update ((const char *)name);
RETURN_NULL();
}
-PHP_FUNCTION(weechat_nicklist_search_group)
+PHP_FUNCTION(weechat_bar_item_remove)
{
- API_FUNC_INIT(weechat_nicklist_search_group);
- zend_string *z_buffer;
- zend_string *z_from_group;
- zend_string *z_name;
- struct t_gui_nick_group *retval;
- struct t_gui_buffer *buffer;
- struct t_gui_nick_group *from_group;
- char *name;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SSS", &z_buffer, &z_from_group, &z_name) == FAILURE)
+ API_FUNC_INIT(weechat_bar_item_remove);
+ zend_string *z_item;
+ struct t_gui_bar_item *item;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_item) == FAILURE)
{
return;
}
- buffer = (struct t_gui_buffer *)API_STR2PTR(ZSTR_VAL(z_buffer));
- from_group = (struct t_gui_nick_group *)API_STR2PTR(ZSTR_VAL(z_from_group));
- name = ZSTR_VAL(z_name);
- retval = weechat_nicklist_search_group (buffer, from_group, (const char *)name);
- char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
+ item = (struct t_gui_bar_item *)API_STR2PTR(ZSTR_VAL(z_item));
+ weechat_bar_item_remove (item);
+ RETURN_NULL();
}
-PHP_FUNCTION(weechat_nicklist_search_nick)
+PHP_FUNCTION(weechat_bar_search)
{
- API_FUNC_INIT(weechat_nicklist_search_nick);
- zend_string *z_buffer;
- zend_string *z_from_group;
+ API_FUNC_INIT(weechat_bar_search);
zend_string *z_name;
- struct t_gui_nick *retval;
- struct t_gui_buffer *buffer;
- struct t_gui_nick_group *from_group;
+ struct t_gui_bar *retval;
char *name;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SSS", &z_buffer, &z_from_group, &z_name) == FAILURE)
+ if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_name) == FAILURE)
{
return;
}
- buffer = (struct t_gui_buffer *)API_STR2PTR(ZSTR_VAL(z_buffer));
- from_group = (struct t_gui_nick_group *)API_STR2PTR(ZSTR_VAL(z_from_group));
name = ZSTR_VAL(z_name);
- retval = weechat_nicklist_search_nick (buffer, from_group, (const char *)name);
+ retval = weechat_bar_search ((const char *)name);
char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
}
-PHP_FUNCTION(weechat_plugin_get_name)
+PHP_FUNCTION(weechat_bar_new)
{
- API_FUNC_INIT(weechat_plugin_get_name);
- const char *retval;
- if (zend_parse_parameters_none () == FAILURE)
+ API_FUNC_INIT(weechat_bar_new);
+ zend_string *z_name;
+ zend_string *z_hidden;
+ zend_string *z_priority;
+ zend_string *z_type;
+ zend_string *z_condition;
+ zend_string *z_position;
+ zend_string *z_filling_top_bottom;
+ zend_string *z_filling_left_right;
+ zend_string *z_size;
+ zend_string *z_size_max;
+ zend_string *z_color_fg;
+ zend_string *z_color_delim;
+ zend_string *z_color_bg;
+ zend_string *z_separator;
+ zend_string *z_items;
+ struct t_gui_bar *retval;
+ char *name;
+ char *hidden;
+ char *priority;
+ char *type;
+ char *condition;
+ char *position;
+ char *filling_top_bottom;
+ char *filling_left_right;
+ char *size;
+ char *size_max;
+ char *color_fg;
+ char *color_delim;
+ char *color_bg;
+ char *separator;
+ char *items;
+ if (zend_parse_parameters (
+ ZEND_NUM_ARGS(), "SSSSSSSSSSSSSSS", &z_name, &z_hidden,
+ &z_priority, &z_type, &z_condition, &z_position,
+ &z_filling_top_bottom, &z_filling_left_right, &z_size, &z_size_max,
+ &z_color_fg, &z_color_delim, &z_color_bg, &z_separator,
+ &z_items) == FAILURE)
{
return;
}
- retval = weechat_plugin_get_name (weechat_php_plugin);
- SAFE_RETURN_STRING(retval);
+ name = ZSTR_VAL(z_name);
+ hidden = ZSTR_VAL(z_hidden);
+ priority = ZSTR_VAL(z_priority);
+ type = ZSTR_VAL(z_type);
+ condition = ZSTR_VAL(z_condition);
+ position = ZSTR_VAL(z_position);
+ filling_top_bottom = ZSTR_VAL(z_filling_top_bottom);
+ filling_left_right = ZSTR_VAL(z_filling_left_right);
+ size = ZSTR_VAL(z_size);
+ size_max = ZSTR_VAL(z_size_max);
+ color_fg = ZSTR_VAL(z_color_fg);
+ color_delim = ZSTR_VAL(z_color_delim);
+ color_bg = ZSTR_VAL(z_color_bg);
+ separator = ZSTR_VAL(z_separator);
+ items = ZSTR_VAL(z_items);
+ retval = weechat_bar_new (
+ (const char *)name,
+ (const char *)hidden,
+ (const char *)priority,
+ (const char *)type,
+ (const char *)condition,
+ (const char *)position,
+ (const char *)filling_top_bottom,
+ (const char *)filling_left_right,
+ (const char *)size,
+ (const char *)size_max,
+ (const char *)color_fg,
+ (const char *)color_delim,
+ (const char *)color_bg,
+ (const char *)separator,
+ (const char *)items);
+ char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
}
-PHP_FUNCTION(weechat_bar_item_new)
+PHP_FUNCTION(weechat_bar_set)
{
- API_FUNC_INIT(weechat_bar_item_new);
- zend_string *z_name;
- zval *z_build_callback;
- zend_string *z_data;
- struct t_gui_bar_item *retval;
- char *name;
- char *data;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SzS", &z_name, &z_build_callback, &z_data) == FAILURE)
+ API_FUNC_INIT(weechat_bar_set);
+ zend_string *z_bar;
+ zend_string *z_property;
+ zend_string *z_value;
+ int retval;
+ struct t_gui_bar *bar;
+ char *property;
+ char *value;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SSS", &z_bar, &z_property, &z_value) == FAILURE)
{
return;
}
- name = ZSTR_VAL(z_name);
- weechat_php_get_function_name (z_build_callback, build_callback_name);
- data = ZSTR_VAL(z_data);
- retval = plugin_script_api_bar_item_new (weechat_php_plugin, php_current_script, (const char *)name, weechat_php_bar_item_new_build_callback, (const char *)build_callback_name, (const char *)data);
- char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
+ bar = (struct t_gui_bar *)API_STR2PTR(ZSTR_VAL(z_bar));
+ property = ZSTR_VAL(z_property);
+ value = ZSTR_VAL(z_value);
+ retval = weechat_bar_set (bar, (const char *)property, (const char *)value);
+ RETURN_LONG(retval);
}
-PHP_FUNCTION(weechat_buffer_new)
+PHP_FUNCTION(weechat_bar_update)
{
- API_FUNC_INIT(weechat_buffer_new);
+ API_FUNC_INIT(weechat_bar_update);
zend_string *z_name;
- zval *z_input_callback;
- zend_string *z_data_input;
- zval *z_close_callback;
- zend_string *z_data_close;
- struct t_gui_buffer *retval;
char *name;
- char *data_input;
- char *data_close;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SzSzS", &z_name, &z_input_callback, &z_data_input, &z_close_callback, &z_data_close) == FAILURE)
+ if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_name) == FAILURE)
{
return;
}
name = ZSTR_VAL(z_name);
- weechat_php_get_function_name (z_input_callback, input_callback_name);
- data_input = ZSTR_VAL(z_data_input);
- weechat_php_get_function_name (z_close_callback, close_callback_name);
- data_close = ZSTR_VAL(z_data_close);
- retval = plugin_script_api_buffer_new (weechat_php_plugin, php_current_script, (const char *)name, weechat_php_buffer_new_input_callback, (const char *)input_callback_name, (const char *)data_input, weechat_php_buffer_new_close_callback, (const char *)close_callback_name, (const char *)data_close);
- char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
+ weechat_bar_update ((const char *)name);
+ RETURN_NULL();
}
-PHP_FUNCTION(weechat_charset_set)
+PHP_FUNCTION(weechat_bar_remove)
{
- API_FUNC_INIT(weechat_charset_set);
- zend_string *z_charset;
- char *charset;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_charset) == FAILURE)
+ API_FUNC_INIT(weechat_bar_remove);
+ zend_string *z_bar;
+ struct t_gui_bar *bar;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_bar) == FAILURE)
{
return;
}
- charset = ZSTR_VAL(z_charset);
- plugin_script_api_charset_set (php_current_script, (const char *)charset);
+ bar = (struct t_gui_bar *)API_STR2PTR(ZSTR_VAL(z_bar));
+ weechat_bar_remove (bar);
RETURN_NULL();
}
@@ -3134,1053 +3979,860 @@ PHP_FUNCTION(weechat_command)
int retval;
struct t_gui_buffer *buffer;
char *command;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SS", &z_buffer, &z_command) == FAILURE)
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SS", &z_buffer, &z_command) == FAILURE)
{
return;
}
buffer = (struct t_gui_buffer *)API_STR2PTR(ZSTR_VAL(z_buffer));
command = ZSTR_VAL(z_command);
- retval = plugin_script_api_command (weechat_php_plugin, php_current_script, buffer, (const char *)command);
+ retval = plugin_script_api_command (weechat_php_plugin,
+ php_current_script,
+ buffer,
+ (const char *)command);
RETURN_LONG(retval);
}
-PHP_FUNCTION(weechat_config_get_plugin)
+PHP_FUNCTION(weechat_info_get)
{
- API_FUNC_INIT(weechat_config_get_plugin);
- zend_string *z_option;
+ API_FUNC_INIT(weechat_info_get);
+ zend_string *z_info_name;
+ zend_string *z_arguments;
const char *retval;
- char *option;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_option) == FAILURE)
+ char *info_name;
+ char *arguments;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SS", &z_info_name, &z_arguments) == FAILURE)
{
return;
}
- option = ZSTR_VAL(z_option);
- retval = plugin_script_api_config_get_plugin (weechat_php_plugin, php_current_script, (const char *)option);
+ info_name = ZSTR_VAL(z_info_name);
+ arguments = ZSTR_VAL(z_arguments);
+ retval = weechat_info_get ((const char *)info_name,
+ (const char *)arguments);
SAFE_RETURN_STRING(retval);
}
-PHP_FUNCTION(weechat_config_is_set_plugin)
+PHP_FUNCTION(weechat_info_get_hashtable)
{
- API_FUNC_INIT(weechat_config_is_set_plugin);
- zend_string *z_option;
- int retval;
- char *option;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_option) == FAILURE)
+ API_FUNC_INIT(weechat_info_get_hashtable);
+ zend_string *z_info_name;
+ zval *z_hashtable;
+ struct t_hashtable *retval;
+ char *info_name;
+ struct t_hashtable *hashtable;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "Sa", &z_info_name, &z_hashtable) == FAILURE)
{
return;
}
- option = ZSTR_VAL(z_option);
- retval = plugin_script_api_config_is_set_plugin (weechat_php_plugin, php_current_script, (const char *)option);
- RETURN_LONG(retval);
+ info_name = ZSTR_VAL(z_info_name);
+ hashtable = weechat_php_array_to_hashtable (
+ z_hashtable,
+ WEECHAT_SCRIPT_HASHTABLE_DEFAULT_SIZE,
+ WEECHAT_HASHTABLE_STRING,
+ WEECHAT_HASHTABLE_STRING);
+ retval = weechat_info_get_hashtable ((const char *)info_name, hashtable);
+ weechat_php_hashtable_to_array(retval, return_value);
}
-PHP_FUNCTION(weechat_config_new)
+PHP_FUNCTION(weechat_infolist_new)
{
- API_FUNC_INIT(weechat_config_new);
- zend_string *z_name;
- zval *z_callback_reload;
- zend_string *z_data;
- struct t_config_file *retval;
- char *name;
- char *data;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SzS", &z_name, &z_callback_reload, &z_data) == FAILURE)
+ API_FUNC_INIT(weechat_infolist_new);
+ struct t_infolist *retval;
+ if (zend_parse_parameters_none () == FAILURE)
{
return;
}
- name = ZSTR_VAL(z_name);
- weechat_php_get_function_name (z_callback_reload, callback_reload_name);
- data = ZSTR_VAL(z_data);
- retval = plugin_script_api_config_new (weechat_php_plugin, php_current_script, (const char *)name, weechat_php_config_new_callback_reload, (const char *)callback_reload_name, (const char *)data);
+ retval = weechat_infolist_new ();
char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
}
-PHP_FUNCTION(weechat_config_new_option)
+PHP_FUNCTION(weechat_infolist_new_item)
{
- API_FUNC_INIT(weechat_config_new_option);
- zend_string *z_config_file;
- zend_string *z_section;
- zend_string *z_name;
- zend_string *z_type;
- zend_string *z_description;
- zend_string *z_string_values;
- zend_long z_min;
- zend_long z_max;
- zend_string *z_default_value;
- zend_string *z_value;
- zend_long z_null_value_allowed;
- zval *z_callback_check_value;
- zend_string *z_data_check_value;
- zval *z_callback_change;
- zend_string *z_data_change;
- zval *z_callback_delete;
- zend_string *z_data_delete;
- struct t_config_option *retval;
- struct t_config_file *config_file;
- struct t_config_section *section;
- char *name;
- char *type;
- char *description;
- char *string_values;
- int min;
- int max;
- char *default_value;
- char *value;
- int null_value_allowed;
- char *data_check_value;
- char *data_change;
- char *data_delete;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SSSSSSllSSlzSzSzS", &z_config_file, &z_section, &z_name, &z_type, &z_description, &z_string_values, &z_min, &z_max, &z_default_value, &z_value, &z_null_value_allowed, &z_callback_check_value, &z_data_check_value, &z_callback_change, &z_data_change, &z_callback_delete, &z_data_delete) == FAILURE)
+ API_FUNC_INIT(weechat_infolist_new_item);
+ zend_string *z_infolist;
+ struct t_infolist_item *retval;
+ struct t_infolist *infolist;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_infolist) == FAILURE)
{
return;
}
- config_file = (struct t_config_file *)API_STR2PTR(ZSTR_VAL(z_config_file));
- section = (struct t_config_section *)API_STR2PTR(ZSTR_VAL(z_section));
- name = ZSTR_VAL(z_name);
- type = ZSTR_VAL(z_type);
- description = ZSTR_VAL(z_description);
- string_values = ZSTR_VAL(z_string_values);
- min = (int)z_min;
- max = (int)z_max;
- default_value = ZSTR_VAL(z_default_value);
- value = ZSTR_VAL(z_value);
- null_value_allowed = (int)z_null_value_allowed;
- weechat_php_get_function_name (z_callback_check_value, callback_check_value_name);
- data_check_value = ZSTR_VAL(z_data_check_value);
- weechat_php_get_function_name (z_callback_change, callback_change_name);
- data_change = ZSTR_VAL(z_data_change);
- weechat_php_get_function_name (z_callback_delete, callback_delete_name);
- data_delete = ZSTR_VAL(z_data_delete);
- retval = plugin_script_api_config_new_option (weechat_php_plugin, php_current_script, config_file, section, (const char *)name, (const char *)type, (const char *)description, (const char *)string_values, min, max, (const char *)default_value, (const char *)value, null_value_allowed, weechat_php_config_new_option_callback_check_value, (const char *)callback_check_value_name, (const char *)data_check_value, weechat_php_config_new_option_callback_change, (const char *)callback_change_name, (const char *)data_change, weechat_php_config_new_option_callback_delete, (const char *)callback_delete_name, (const char *)data_delete);
+ infolist = (struct t_infolist *)API_STR2PTR(ZSTR_VAL(z_infolist));
+ retval = weechat_infolist_new_item (infolist);
char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
}
-PHP_FUNCTION(weechat_config_new_section)
+PHP_FUNCTION(weechat_infolist_new_var_integer)
{
- API_FUNC_INIT(weechat_config_new_section);
- zend_string *z_config_file;
+ API_FUNC_INIT(weechat_infolist_new_var_integer);
+ zend_string *z_item;
zend_string *z_name;
- zend_long z_user_can_add_options;
- zend_long z_user_can_delete_options;
- zval *z_callback_read;
- zend_string *z_data_read;
- zval *z_callback_write;
- zend_string *z_data_write;
- zval *z_callback_write_default;
- zend_string *z_data_write_default;
- zval *z_callback_create_option;
- zend_string *z_data_create_option;
- zval *z_callback_delete_option;
- zend_string *z_data_delete_option;
- struct t_config_section *retval;
- struct t_config_file *config_file;
+ zend_long z_value;
+ struct t_infolist_var *retval;
+ struct t_infolist_item *item;
char *name;
- int user_can_add_options;
- int user_can_delete_options;
- char *data_read;
- char *data_write;
- char *data_write_default;
- char *data_create_option;
- char *data_delete_option;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SSllzSzSzSzSzS", &z_config_file, &z_name, &z_user_can_add_options, &z_user_can_delete_options, &z_callback_read, &z_data_read, &z_callback_write, &z_data_write, &z_callback_write_default, &z_data_write_default, &z_callback_create_option, &z_data_create_option, &z_callback_delete_option, &z_data_delete_option) == FAILURE)
+ int value;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SSl", &z_item, &z_name, &z_value) == FAILURE)
{
return;
}
- config_file = (struct t_config_file *)API_STR2PTR(ZSTR_VAL(z_config_file));
+ item = (struct t_infolist_item *)API_STR2PTR(ZSTR_VAL(z_item));
name = ZSTR_VAL(z_name);
- user_can_add_options = (int)z_user_can_add_options;
- user_can_delete_options = (int)z_user_can_delete_options;
- weechat_php_get_function_name (z_callback_read, callback_read_name);
- data_read = ZSTR_VAL(z_data_read);
- weechat_php_get_function_name (z_callback_write, callback_write_name);
- data_write = ZSTR_VAL(z_data_write);
- weechat_php_get_function_name (z_callback_write_default, callback_write_default_name);
- data_write_default = ZSTR_VAL(z_data_write_default);
- weechat_php_get_function_name (z_callback_create_option, callback_create_option_name);
- data_create_option = ZSTR_VAL(z_data_create_option);
- weechat_php_get_function_name (z_callback_delete_option, callback_delete_option_name);
- data_delete_option = ZSTR_VAL(z_data_delete_option);
- retval = plugin_script_api_config_new_section (weechat_php_plugin, php_current_script, config_file, (const char *)name, user_can_add_options, user_can_delete_options, weechat_php_config_new_section_callback_read, (const char *)callback_read_name, (const char *)data_read, weechat_php_config_new_section_callback_write, (const char *)callback_write_name, (const char *)data_write, weechat_php_config_new_section_callback_write_default, (const char *)callback_write_default_name, (const char *)data_write_default, weechat_php_config_new_section_callback_create_option, (const char *)callback_create_option_name, (const char *)data_create_option, weechat_php_config_new_section_callback_delete_option, (const char *)callback_delete_option_name, (const char *)data_delete_option);
+ value = (int)z_value;
+ retval = weechat_infolist_new_var_integer (item,
+ (const char *)name,
+ value);
char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
}
-PHP_FUNCTION(weechat_config_set_desc_plugin)
-{
- API_FUNC_INIT(weechat_config_set_desc_plugin);
- zend_string *z_option;
- zend_string *z_description;
- char *option;
- char *description;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SS", &z_option, &z_description) == FAILURE)
- {
- return;
- }
- option = ZSTR_VAL(z_option);
- description = ZSTR_VAL(z_description);
- plugin_script_api_config_set_desc_plugin (weechat_php_plugin, php_current_script, (const char *)option, (const char *)description);
- RETURN_NULL();
-}
-
-PHP_FUNCTION(weechat_config_set_plugin)
+PHP_FUNCTION(weechat_infolist_new_var_string)
{
- API_FUNC_INIT(weechat_config_set_plugin);
- zend_string *z_option;
+ API_FUNC_INIT(weechat_infolist_new_var_string);
+ zend_string *z_item;
+ zend_string *z_name;
zend_string *z_value;
- int retval;
- char *option;
+ struct t_infolist_var *retval;
+ struct t_infolist_item *item;
+ char *name;
char *value;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SS", &z_option, &z_value) == FAILURE)
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SSS", &z_item, &z_name, &z_value) == FAILURE)
{
return;
}
- option = ZSTR_VAL(z_option);
+ item = (struct t_infolist_item *)API_STR2PTR(ZSTR_VAL(z_item));
+ name = ZSTR_VAL(z_name);
value = ZSTR_VAL(z_value);
- retval = plugin_script_api_config_set_plugin (weechat_php_plugin, php_current_script, (const char *)option, (const char *)value);
- RETURN_LONG(retval);
-}
-
-PHP_FUNCTION(weechat_config_unset_plugin)
-{
- API_FUNC_INIT(weechat_config_unset_plugin);
- zend_string *z_option;
- int retval;
- char *option;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_option) == FAILURE)
- {
- return;
- }
- option = ZSTR_VAL(z_option);
- retval = plugin_script_api_config_unset_plugin (weechat_php_plugin, php_current_script, (const char *)option);
- RETURN_LONG(retval);
+ retval = weechat_infolist_new_var_string (item,
+ (const char *)name,
+ (const char *)value);
+ char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
}
-PHP_FUNCTION(weechat_hook_command)
+PHP_FUNCTION(weechat_infolist_new_var_pointer)
{
- API_FUNC_INIT(weechat_hook_command);
- zend_string *z_command;
- zend_string *z_description;
- zend_string *z_args;
- zend_string *z_args_description;
- zend_string *z_completion;
- zval *z_callback;
- zend_string *z_data;
- struct t_hook *retval;
- char *command;
- char *description;
- char *args;
- char *args_description;
- char *completion;
- char *data;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SSSSSzS", &z_command, &z_description, &z_args, &z_args_description, &z_completion, &z_callback, &z_data) == FAILURE)
+ API_FUNC_INIT(weechat_infolist_new_var_pointer);
+ zend_string *z_item;
+ zend_string *z_name;
+ zend_string *z_pointer;
+ struct t_infolist_var *retval;
+ struct t_infolist_item *item;
+ char *name;
+ void *pointer;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SSS", &z_item, &z_name, &z_pointer) == FAILURE)
{
return;
}
- command = ZSTR_VAL(z_command);
- description = ZSTR_VAL(z_description);
- args = ZSTR_VAL(z_args);
- args_description = ZSTR_VAL(z_args_description);
- completion = ZSTR_VAL(z_completion);
- weechat_php_get_function_name (z_callback, callback_name);
- data = ZSTR_VAL(z_data);
- retval = plugin_script_api_hook_command (weechat_php_plugin, php_current_script, (const char *)command, (const char *)description, (const char *)args, (const char *)args_description, (const char *)completion, weechat_php_hook_command_callback, (const char *)callback_name, (const char *)data);
+ item = (struct t_infolist_item *)API_STR2PTR(ZSTR_VAL(z_item));
+ name = ZSTR_VAL(z_name);
+ pointer = (void *)API_STR2PTR(ZSTR_VAL(z_pointer));
+ retval = weechat_infolist_new_var_pointer (item,
+ (const char *)name,
+ pointer);
char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
}
-PHP_FUNCTION(weechat_hook_command_run)
+PHP_FUNCTION(weechat_infolist_new_var_time)
{
- API_FUNC_INIT(weechat_hook_command_run);
- zend_string *z_command;
- zval *z_callback;
- zend_string *z_data;
- struct t_hook *retval;
- char *command;
- char *data;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SzS", &z_command, &z_callback, &z_data) == FAILURE)
+ API_FUNC_INIT(weechat_infolist_new_var_time);
+ zend_string *z_item;
+ zend_string *z_name;
+ zend_long z_time;
+ struct t_infolist_var *retval;
+ struct t_infolist_item *item;
+ char *name;
+ time_t time;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SSl", &z_item, &z_name, &z_time) == FAILURE)
{
return;
}
- command = ZSTR_VAL(z_command);
- weechat_php_get_function_name (z_callback, callback_name);
- data = ZSTR_VAL(z_data);
- retval = plugin_script_api_hook_command_run (weechat_php_plugin, php_current_script, (const char *)command, weechat_php_hook_command_run_callback, (const char *)callback_name, (const char *)data);
+ item = (struct t_infolist_item *)API_STR2PTR(ZSTR_VAL(z_item));
+ name = ZSTR_VAL(z_name);
+ time = (time_t)z_time;
+ retval = weechat_infolist_new_var_time (item, (const char *)name, time);
char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
}
-PHP_FUNCTION(weechat_hook_completion)
+PHP_FUNCTION(weechat_infolist_search_var)
{
- API_FUNC_INIT(weechat_hook_completion);
- zend_string *z_completion;
- zend_string *z_description;
- zval *z_callback;
- zend_string *z_data;
- struct t_hook *retval;
- char *completion;
- char *description;
- char *data;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SSzS", &z_completion, &z_description, &z_callback, &z_data) == FAILURE)
+ API_FUNC_INIT(weechat_infolist_search_var);
+ zend_string *z_infolist;
+ zend_string *z_name;
+ struct t_infolist_var *retval;
+ struct t_infolist *infolist;
+ char *name;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SS", &z_infolist, &z_name) == FAILURE)
{
return;
}
- completion = ZSTR_VAL(z_completion);
- description = ZSTR_VAL(z_description);
- weechat_php_get_function_name (z_callback, callback_name);
- data = ZSTR_VAL(z_data);
- retval = plugin_script_api_hook_completion (weechat_php_plugin, php_current_script, (const char *)completion, (const char *)description, weechat_php_hook_completion_callback, (const char *)callback_name, (const char *)data);
+ infolist = (struct t_infolist *)API_STR2PTR(ZSTR_VAL(z_infolist));
+ name = ZSTR_VAL(z_name);
+ retval = weechat_infolist_search_var (infolist, (const char *)name);
char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
}
-PHP_FUNCTION(weechat_hook_config)
+PHP_FUNCTION(weechat_infolist_get)
{
- API_FUNC_INIT(weechat_hook_config);
- zend_string *z_option;
- zval *z_callback;
- zend_string *z_data;
- struct t_hook *retval;
- char *option;
- char *data;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SzS", &z_option, &z_callback, &z_data) == FAILURE)
+ API_FUNC_INIT(weechat_infolist_get);
+ zend_string *z_infolist_name;
+ zend_string *z_pointer;
+ zend_string *z_arguments;
+ struct t_infolist *retval;
+ char *infolist_name;
+ void *pointer;
+ char *arguments;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SSS", &z_infolist_name, &z_pointer,
+ &z_arguments) == FAILURE)
{
return;
}
- option = ZSTR_VAL(z_option);
- weechat_php_get_function_name (z_callback, callback_name);
- data = ZSTR_VAL(z_data);
- retval = plugin_script_api_hook_config (weechat_php_plugin, php_current_script, (const char *)option, weechat_php_hook_config_callback, (const char *)callback_name, (const char *)data);
+ infolist_name = ZSTR_VAL(z_infolist_name);
+ pointer = (void *)API_STR2PTR(ZSTR_VAL(z_pointer));
+ arguments = ZSTR_VAL(z_arguments);
+ retval = weechat_infolist_get ((const char *)infolist_name,
+ pointer,
+ (const char *)arguments);
char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
}
-PHP_FUNCTION(weechat_hook_connect)
+PHP_FUNCTION(weechat_infolist_next)
{
- API_FUNC_INIT(weechat_hook_connect);
- zend_string *z_proxy;
- zend_string *z_address;
- zend_long z_port;
- zend_long z_ipv6;
- zend_long z_retry;
- zend_string *z_gnutls_sess;
- zend_string *z_gnutls_cb;
- zend_long z_gnutls_dhkey_size;
- zend_string *z_gnutls_priorities;
- zend_string *z_local_hostname;
- zval *z_callback;
- zend_string *z_data;
- struct t_hook *retval;
- char *proxy;
- char *address;
- int port;
- int ipv6;
- int retry;
- void *gnutls_sess;
- void *gnutls_cb;
- int gnutls_dhkey_size;
- char *gnutls_priorities;
- char *local_hostname;
- char *data;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SSlllSSlSSzS", &z_proxy, &z_address, &z_port, &z_ipv6, &z_retry, &z_gnutls_sess, &z_gnutls_cb, &z_gnutls_dhkey_size, &z_gnutls_priorities, &z_local_hostname, &z_callback, &z_data) == FAILURE)
+ API_FUNC_INIT(weechat_infolist_next);
+ zend_string *z_infolist;
+ int retval;
+ struct t_infolist *infolist;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_infolist) == FAILURE)
{
return;
}
- proxy = ZSTR_VAL(z_proxy);
- address = ZSTR_VAL(z_address);
- port = (int)z_port;
- ipv6 = (int)z_ipv6;
- retry = (int)z_retry;
- gnutls_sess = (void *)API_STR2PTR(ZSTR_VAL(z_gnutls_sess));
- gnutls_cb = (void *)API_STR2PTR(ZSTR_VAL(z_gnutls_cb));
- gnutls_dhkey_size = (int)z_gnutls_dhkey_size;
- gnutls_priorities = ZSTR_VAL(z_gnutls_priorities);
- local_hostname = ZSTR_VAL(z_local_hostname);
- weechat_php_get_function_name (z_callback, callback_name);
- data = ZSTR_VAL(z_data);
- retval = plugin_script_api_hook_connect (weechat_php_plugin, php_current_script, (const char *)proxy, (const char *)address, port, ipv6, retry, gnutls_sess, gnutls_cb, gnutls_dhkey_size, (const char *)gnutls_priorities, (const char *)local_hostname, weechat_php_hook_connect_callback, (const char *)callback_name, (const char *)data);
- char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
+ infolist = (struct t_infolist *)API_STR2PTR(ZSTR_VAL(z_infolist));
+ retval = weechat_infolist_next (infolist);
+ RETURN_LONG(retval);
}
-PHP_FUNCTION(weechat_hook_fd)
+PHP_FUNCTION(weechat_infolist_prev)
{
- API_FUNC_INIT(weechat_hook_fd);
- zend_long z_fd;
- zend_long z_flag_read;
- zend_long z_flag_write;
- zend_long z_flag_exception;
- zval *z_callback;
- zend_string *z_data;
- struct t_hook *retval;
- int fd;
- int flag_read;
- int flag_write;
- int flag_exception;
- char *data;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "llllzS", &z_fd, &z_flag_read, &z_flag_write, &z_flag_exception, &z_callback, &z_data) == FAILURE)
+ API_FUNC_INIT(weechat_infolist_prev);
+ zend_string *z_infolist;
+ int retval;
+ struct t_infolist *infolist;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_infolist) == FAILURE)
{
return;
}
- fd = (int)z_fd;
- flag_read = (int)z_flag_read;
- flag_write = (int)z_flag_write;
- flag_exception = (int)z_flag_exception;
- weechat_php_get_function_name (z_callback, callback_name);
- data = ZSTR_VAL(z_data);
- retval = plugin_script_api_hook_fd (weechat_php_plugin, php_current_script, fd, flag_read, flag_write, flag_exception, weechat_php_hook_fd_callback, (const char *)callback_name, (const char *)data);
- char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
+ infolist = (struct t_infolist *)API_STR2PTR(ZSTR_VAL(z_infolist));
+ retval = weechat_infolist_prev (infolist);
+ RETURN_LONG(retval);
}
-PHP_FUNCTION(weechat_hook_focus)
+PHP_FUNCTION(weechat_infolist_reset_item_cursor)
{
- API_FUNC_INIT(weechat_hook_focus);
- zend_string *z_area;
- zval *z_callback;
- zend_string *z_data;
- struct t_hook *retval;
- char *area;
- char *data;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SzS", &z_area, &z_callback, &z_data) == FAILURE)
+ API_FUNC_INIT(weechat_infolist_reset_item_cursor);
+ zend_string *z_infolist;
+ struct t_infolist *infolist;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_infolist) == FAILURE)
{
return;
}
- area = ZSTR_VAL(z_area);
- data = ZSTR_VAL(z_data);
- weechat_php_get_function_name (z_callback, callback_name);
- retval = plugin_script_api_hook_focus (weechat_php_plugin,
- php_current_script,
- area,
- weechat_php_api_hook_focus_callback,
- callback_name,
- data);
- char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
+ infolist = (struct t_infolist *)API_STR2PTR(ZSTR_VAL(z_infolist));
+ weechat_infolist_reset_item_cursor (infolist);
+ RETURN_NULL();
}
-PHP_FUNCTION(weechat_hook_hsignal)
+PHP_FUNCTION(weechat_infolist_fields)
{
- API_FUNC_INIT(weechat_hook_hsignal);
- zend_string *z_signal;
- zval *z_callback;
- zend_string *z_data;
- struct t_hook *retval;
- char *signal;
- char *data;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SzS", &z_signal, &z_callback, &z_data) == FAILURE)
+ API_FUNC_INIT(weechat_infolist_fields);
+ zend_string *z_infolist;
+ const char *retval;
+ struct t_infolist *infolist;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_infolist) == FAILURE)
{
return;
}
- signal = ZSTR_VAL(z_signal);
- weechat_php_get_function_name (z_callback, callback_name);
- data = ZSTR_VAL(z_data);
- retval = plugin_script_api_hook_hsignal (weechat_php_plugin, php_current_script, (const char *)signal, weechat_php_hook_hsignal_callback, (const char *)callback_name, (const char *)data);
- char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
+ infolist = (struct t_infolist *)API_STR2PTR(ZSTR_VAL(z_infolist));
+ retval = weechat_infolist_fields (infolist);
+ SAFE_RETURN_STRING(retval);
}
-PHP_FUNCTION(weechat_hook_info)
+PHP_FUNCTION(weechat_infolist_integer)
{
- API_FUNC_INIT(weechat_hook_info);
- zend_string *z_info_name;
- zend_string *z_description;
- zend_string *z_args_description;
- zval *z_callback;
- zend_string *z_data;
- struct t_hook *retval;
- char *info_name;
- char *description;
- char *args_description;
- char *data;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SSSzS", &z_info_name, &z_description, &z_args_description, &z_callback, &z_data) == FAILURE)
+ API_FUNC_INIT(weechat_infolist_integer);
+ zend_string *z_infolist;
+ zend_string *z_var;
+ int retval;
+ struct t_infolist *infolist;
+ char *var;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SS", &z_infolist, &z_var) == FAILURE)
{
return;
}
- info_name = ZSTR_VAL(z_info_name);
- description = ZSTR_VAL(z_description);
- args_description = ZSTR_VAL(z_args_description);
- weechat_php_get_function_name (z_callback, callback_name);
- data = ZSTR_VAL(z_data);
- retval = plugin_script_api_hook_info (weechat_php_plugin, php_current_script, (const char *)info_name, (const char *)description, (const char *)args_description, weechat_php_hook_info_callback, (const char *)callback_name, (const char *)data);
- char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
+ infolist = (struct t_infolist *)API_STR2PTR(ZSTR_VAL(z_infolist));
+ var = ZSTR_VAL(z_var);
+ retval = weechat_infolist_integer (infolist, (const char *)var);
+ RETURN_LONG(retval);
}
-PHP_FUNCTION(weechat_hook_info_hashtable)
+PHP_FUNCTION(weechat_infolist_string)
{
- API_FUNC_INIT(weechat_hook_info_hashtable);
- zend_string *z_info_name;
- zend_string *z_description;
- zend_string *z_args_description;
- zend_string *z_output_description;
- zval *z_callback;
- zend_string *z_data;
- struct t_hook *retval;
- char *info_name;
- char *description;
- char *args_description;
- char *output_description;
- char *data;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SSSSSzS", &z_info_name, &z_description, &z_args_description, &z_output_description, &z_callback, &z_data) == FAILURE)
+ API_FUNC_INIT(weechat_infolist_string);
+ zend_string *z_infolist;
+ zend_string *z_var;
+ const char *retval;
+ struct t_infolist *infolist;
+ char *var;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SS", &z_infolist, &z_var) == FAILURE)
{
return;
}
- info_name = ZSTR_VAL(z_info_name);
- description = ZSTR_VAL(z_description);
- args_description = ZSTR_VAL(z_args_description);
- output_description = ZSTR_VAL(z_output_description);
- data = ZSTR_VAL(z_data);
- weechat_php_get_function_name (z_callback, callback_name);
- retval = plugin_script_api_hook_info_hashtable (weechat_php_plugin,
- php_current_script,
- info_name,
- description,
- args_description,
- output_description,
- weechat_php_api_hook_info_hashtable_callback,
- callback_name,
- data);
- char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
+ infolist = (struct t_infolist *)API_STR2PTR(ZSTR_VAL(z_infolist));
+ var = ZSTR_VAL(z_var);
+ retval = weechat_infolist_string (infolist, (const char *)var);
+ SAFE_RETURN_STRING(retval);
}
-PHP_FUNCTION(weechat_hook_infolist)
+PHP_FUNCTION(weechat_infolist_pointer)
{
- API_FUNC_INIT(weechat_hook_infolist);
- zend_string *z_infolist_name;
- zend_string *z_description;
- zend_string *z_pointer_description;
- zend_string *z_args_description;
- zval *z_callback;
- zend_string *z_data;
- struct t_hook *retval;
- char *infolist_name;
- char *description;
- char *pointer_description;
- char *args_description;
- char *data;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SSSSzS", &z_infolist_name, &z_description, &z_pointer_description, &z_args_description, &z_callback, &z_data) == FAILURE)
+ API_FUNC_INIT(weechat_infolist_pointer);
+ zend_string *z_infolist;
+ zend_string *z_var;
+ void *retval;
+ struct t_infolist *infolist;
+ char *var;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SS", &z_infolist, &z_var) == FAILURE)
{
return;
}
- infolist_name = ZSTR_VAL(z_infolist_name);
- description = ZSTR_VAL(z_description);
- pointer_description = ZSTR_VAL(z_pointer_description);
- args_description = ZSTR_VAL(z_args_description);
- data = ZSTR_VAL(z_data);
- weechat_php_get_function_name(z_callback, callback_name);
- retval = plugin_script_api_hook_infolist (weechat_php_plugin,
- php_current_script,
- infolist_name,
- description,
- pointer_description,
- args_description,
- weechat_php_api_hook_infolist_callback,
- callback_name,
- data);
+ infolist = (struct t_infolist *)API_STR2PTR(ZSTR_VAL(z_infolist));
+ var = ZSTR_VAL(z_var);
+ retval = weechat_infolist_pointer (infolist, (const char *)var);
char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
}
-PHP_FUNCTION(weechat_hook_modifier)
+PHP_FUNCTION(weechat_infolist_time)
{
- API_FUNC_INIT(weechat_hook_modifier);
- zend_string *z_modifier;
- zval *z_callback;
- zend_string *z_data;
- struct t_hook *retval;
- char *modifier;
- char *data;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SzS", &z_modifier, &z_callback, &z_data) == FAILURE)
+ API_FUNC_INIT(weechat_infolist_time);
+ zend_string *z_infolist;
+ zend_string *z_var;
+ time_t retval;
+ struct t_infolist *infolist;
+ char *var;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SS", &z_infolist, &z_var) == FAILURE)
{
return;
}
- modifier = ZSTR_VAL(z_modifier);
- weechat_php_get_function_name (z_callback, callback_name);
- data = ZSTR_VAL(z_data);
- retval = plugin_script_api_hook_modifier (weechat_php_plugin, php_current_script, (const char *)modifier, weechat_php_hook_modifier_callback, (const char *)callback_name, (const char *)data);
- char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
+ infolist = (struct t_infolist *)API_STR2PTR(ZSTR_VAL(z_infolist));
+ var = ZSTR_VAL(z_var);
+ retval = weechat_infolist_time (infolist, (const char *)var);
+ RETURN_LONG(retval);
}
-PHP_FUNCTION(weechat_hook_print)
+PHP_FUNCTION(weechat_infolist_free)
{
- API_FUNC_INIT(weechat_hook_print);
- zend_string *z_buffer;
- zend_string *z_tags;
- zend_string *z_message;
- zend_long z_strip_colors;
- zval *z_callback;
- zend_string *z_data;
- struct t_hook *retval;
- struct t_gui_buffer *buffer;
- char *tags;
- char *message;
- int strip_colors;
- char *data;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SSSlzS", &z_buffer, &z_tags, &z_message, &z_strip_colors, &z_callback, &z_data) == FAILURE)
+ API_FUNC_INIT(weechat_infolist_free);
+ zend_string *z_infolist;
+ struct t_infolist *infolist;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_infolist) == FAILURE)
{
return;
}
- buffer = (struct t_gui_buffer *)API_STR2PTR(ZSTR_VAL(z_buffer));
- tags = ZSTR_VAL(z_tags);
- message = ZSTR_VAL(z_message);
- strip_colors = (int)z_strip_colors;
- weechat_php_get_function_name (z_callback, callback_name);
- data = ZSTR_VAL(z_data);
- retval = plugin_script_api_hook_print (weechat_php_plugin, php_current_script, buffer, (const char *)tags, (const char *)message, strip_colors, weechat_php_hook_print_callback, (const char *)callback_name, (const char *)data);
- char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
+ infolist = (struct t_infolist *)API_STR2PTR(ZSTR_VAL(z_infolist));
+ weechat_infolist_free (infolist);
+ RETURN_NULL();
}
-PHP_FUNCTION(weechat_hook_process)
+PHP_FUNCTION(weechat_hdata_get)
{
- API_FUNC_INIT(weechat_hook_process);
- zend_string *z_command;
- zend_long z_timeout;
- zval *z_callback;
- zend_string *z_data;
- struct t_hook *retval;
- char *command;
- int timeout;
- char *data;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SlzS", &z_command, &z_timeout, &z_callback, &z_data) == FAILURE)
+ API_FUNC_INIT(weechat_hdata_get);
+ zend_string *z_hdata_name;
+ struct t_hdata *retval;
+ char *hdata_name;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_hdata_name) == FAILURE)
{
return;
}
- command = ZSTR_VAL(z_command);
- timeout = (int)z_timeout;
- weechat_php_get_function_name (z_callback, callback_name);
- data = ZSTR_VAL(z_data);
- retval = plugin_script_api_hook_process (weechat_php_plugin, php_current_script, (const char *)command, timeout, weechat_php_hook_process_callback, (const char *)callback_name, (const char *)data);
+ hdata_name = ZSTR_VAL(z_hdata_name);
+ retval = weechat_hdata_get ((const char *)hdata_name);
char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
}
-PHP_FUNCTION(weechat_hook_process_hashtable)
+PHP_FUNCTION(weechat_hdata_get_var_offset)
{
- API_FUNC_INIT(weechat_hook_process_hashtable);
- zend_string *z_command;
- zval *z_options;
- zend_long z_timeout;
- zval *z_callback;
- zend_string *z_data;
- struct t_hook *retval;
- char *command;
- struct t_hashtable *options;
- int timeout;
- char *data;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SalzS", &z_command, &z_options, &z_timeout, &z_callback, &z_data) == FAILURE)
+ API_FUNC_INIT(weechat_hdata_get_var_offset);
+ zend_string *z_hdata;
+ zend_string *z_name;
+ int retval;
+ struct t_hdata *hdata;
+ char *name;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SS", &z_hdata, &z_name) == FAILURE)
{
return;
}
- command = ZSTR_VAL(z_command);
- options = weechat_php_array_to_hashtable(z_options, WEECHAT_SCRIPT_HASHTABLE_DEFAULT_SIZE, WEECHAT_HASHTABLE_STRING, WEECHAT_HASHTABLE_STRING);
- timeout = (int)z_timeout;
- weechat_php_get_function_name (z_callback, callback_name);
- data = ZSTR_VAL(z_data);
- retval = plugin_script_api_hook_process_hashtable (weechat_php_plugin, php_current_script, (const char *)command, options, timeout, weechat_php_hook_process_hashtable_callback, (const char *)callback_name, (const char *)data);
- char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
+ hdata = (struct t_hdata *)API_STR2PTR(ZSTR_VAL(z_hdata));
+ name = ZSTR_VAL(z_name);
+ retval = weechat_hdata_get_var_offset (hdata, (const char *)name);
+ RETURN_LONG(retval);
}
-PHP_FUNCTION(weechat_hook_signal)
+PHP_FUNCTION(weechat_hdata_get_var_type_string)
{
- API_FUNC_INIT(weechat_hook_signal);
- zend_string *z_signal;
- zval *z_callback;
- zend_string *z_data;
- struct t_hook *retval;
- char *signal;
- char *data;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SzS", &z_signal, &z_callback, &z_data) == FAILURE)
+ API_FUNC_INIT(weechat_hdata_get_var_type_string);
+ zend_string *z_hdata;
+ zend_string *z_name;
+ const char *retval;
+ struct t_hdata *hdata;
+ char *name;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SS", &z_hdata, &z_name) == FAILURE)
{
return;
}
- signal = ZSTR_VAL(z_signal);
- weechat_php_get_function_name (z_callback, callback_name);
- data = ZSTR_VAL(z_data);
- retval = plugin_script_api_hook_signal (weechat_php_plugin, php_current_script, (const char *)signal, weechat_php_hook_signal_callback, (const char *)callback_name, (const char *)data);
- char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
+ hdata = (struct t_hdata *)API_STR2PTR(ZSTR_VAL(z_hdata));
+ name = ZSTR_VAL(z_name);
+ retval = weechat_hdata_get_var_type_string (hdata, (const char *)name);
+ SAFE_RETURN_STRING(retval);
}
-PHP_FUNCTION(weechat_hook_timer)
+PHP_FUNCTION(weechat_hdata_get_var_array_size)
{
- API_FUNC_INIT(weechat_hook_timer);
- zend_long z_interval;
- zend_long z_align_second;
- zend_long z_max_calls;
- zval *z_callback;
- zend_string *z_data;
- struct t_hook *retval;
- int interval;
- int align_second;
- int max_calls;
- char *data;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "lllzS", &z_interval, &z_align_second, &z_max_calls, &z_callback, &z_data) == FAILURE)
+ API_FUNC_INIT(weechat_hdata_get_var_array_size);
+ zend_string *z_hdata;
+ zend_string *z_pointer;
+ zend_string *z_name;
+ int retval;
+ struct t_hdata *hdata;
+ void *pointer;
+ char *name;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SSS", &z_hdata, &z_pointer, &z_name) == FAILURE)
{
return;
}
- interval = (int)z_interval;
- align_second = (int)z_align_second;
- max_calls = (int)z_max_calls;
- weechat_php_get_function_name (z_callback, callback_name);
- data = ZSTR_VAL(z_data);
- retval = plugin_script_api_hook_timer (weechat_php_plugin, php_current_script, interval, align_second, max_calls, weechat_php_hook_timer_callback, (const char *)callback_name, (const char *)data);
- char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
+ hdata = (struct t_hdata *)API_STR2PTR(ZSTR_VAL(z_hdata));
+ pointer = (void *)API_STR2PTR(ZSTR_VAL(z_pointer));
+ name = ZSTR_VAL(z_name);
+ retval = weechat_hdata_get_var_array_size (hdata,
+ pointer,
+ (const char *)name);
+ RETURN_LONG(retval);
}
-PHP_FUNCTION(weechat_log_printf)
+PHP_FUNCTION(weechat_hdata_get_var_array_size_string)
{
- API_FUNC_INIT(weechat_log_printf);
- zend_string *z_format;
- char *format;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_format) == FAILURE)
+ API_FUNC_INIT(weechat_hdata_get_var_array_size_string);
+ zend_string *z_hdata;
+ zend_string *z_pointer;
+ zend_string *z_name;
+ const char *retval;
+ struct t_hdata *hdata;
+ void *pointer;
+ char *name;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SSS", &z_hdata, &z_pointer, &z_name) == FAILURE)
{
return;
}
- format = ZSTR_VAL(z_format);
- plugin_script_api_log_printf (weechat_php_plugin, php_current_script, "%s", format);
- RETURN_NULL();
+ hdata = (struct t_hdata *)API_STR2PTR(ZSTR_VAL(z_hdata));
+ pointer = (void *)API_STR2PTR(ZSTR_VAL(z_pointer));
+ name = ZSTR_VAL(z_name);
+ retval = weechat_hdata_get_var_array_size_string (hdata,
+ pointer,
+ (const char *)name);
+ SAFE_RETURN_STRING(retval);
}
-PHP_FUNCTION(weechat_printf)
+PHP_FUNCTION(weechat_hdata_get_var_hdata)
{
- API_FUNC_INIT(weechat_printf);
- zend_string *z_buffer;
- zend_string *z_format;
- struct t_gui_buffer *buffer;
- char *format;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SS", &z_buffer, &z_format) == FAILURE)
+ API_FUNC_INIT(weechat_hdata_get_var_hdata);
+ zend_string *z_hdata;
+ zend_string *z_name;
+ const char *retval;
+ struct t_hdata *hdata;
+ char *name;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SS", &z_hdata, &z_name) == FAILURE)
{
return;
}
- buffer = (struct t_gui_buffer *)API_STR2PTR(ZSTR_VAL(z_buffer));
- format = ZSTR_VAL(z_format);
- plugin_script_api_printf (weechat_php_plugin, php_current_script, buffer, "%s", format);
- RETURN_NULL();
+ hdata = (struct t_hdata *)API_STR2PTR(ZSTR_VAL(z_hdata));
+ name = ZSTR_VAL(z_name);
+ retval = weechat_hdata_get_var_hdata (hdata, (const char *)name);
+ SAFE_RETURN_STRING(retval);
}
-PHP_FUNCTION(weechat_printf_date_tags)
+PHP_FUNCTION(weechat_hdata_get_list)
{
- API_FUNC_INIT(weechat_printf_date_tags);
- zend_string *z_buffer;
- zend_long z_date;
- zend_string *z_tags;
- zend_string *z_format;
- struct t_gui_buffer *buffer;
- time_t date;
- char *tags;
- char *format;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SlSS", &z_buffer, &z_date, &z_tags, &z_format) == FAILURE)
+ API_FUNC_INIT(weechat_hdata_get_list);
+ zend_string *z_hdata;
+ zend_string *z_name;
+ void *retval;
+ struct t_hdata *hdata;
+ char *name;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SS", &z_hdata, &z_name) == FAILURE)
{
return;
}
- 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);
- plugin_script_api_printf_date_tags (weechat_php_plugin, php_current_script, buffer, date, (const char *)tags, "%s", format);
- RETURN_NULL();
+ hdata = (struct t_hdata *)API_STR2PTR(ZSTR_VAL(z_hdata));
+ name = ZSTR_VAL(z_name);
+ retval = weechat_hdata_get_list (hdata, (const char *)name);
+ char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
}
-PHP_FUNCTION(weechat_printf_y)
+PHP_FUNCTION(weechat_hdata_check_pointer)
{
- API_FUNC_INIT(weechat_printf_y);
- zend_string *z_buffer;
- zend_long z_y;
- zend_string *z_format;
- struct t_gui_buffer *buffer;
- int y;
- char *format;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SlS", &z_buffer, &z_y, &z_format) == FAILURE)
+ API_FUNC_INIT(weechat_hdata_check_pointer);
+ zend_string *z_hdata;
+ zend_string *z_list;
+ zend_string *z_pointer;
+ int retval;
+ struct t_hdata *hdata;
+ void *list;
+ void *pointer;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SSS", &z_hdata, &z_list, &z_pointer) == FAILURE)
{
return;
}
- buffer = (struct t_gui_buffer *)API_STR2PTR(ZSTR_VAL(z_buffer));
- y = (int)z_y;
- format = ZSTR_VAL(z_format);
- plugin_script_api_printf_y (weechat_php_plugin, php_current_script, buffer, y, "%s", format);
- RETURN_NULL();
+ hdata = (struct t_hdata *)API_STR2PTR(ZSTR_VAL(z_hdata));
+ list = (void *)API_STR2PTR(ZSTR_VAL(z_list));
+ pointer = (void *)API_STR2PTR(ZSTR_VAL(z_pointer));
+ retval = weechat_hdata_check_pointer (hdata, list, pointer);
+ RETURN_LONG(retval);
}
-PHP_FUNCTION(weechat_upgrade_new)
+PHP_FUNCTION(weechat_hdata_move)
{
- API_FUNC_INIT(weechat_upgrade_new);
- zend_string *z_filename;
- zval *z_callback_read;
- zend_string *z_data;
- struct t_upgrade_file *retval;
- char *filename;
- char *data;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SzS", &z_filename, &z_callback_read, &z_data) == FAILURE)
+ API_FUNC_INIT(weechat_hdata_move);
+ zend_string *z_hdata;
+ zend_string *z_pointer;
+ zend_long z_count;
+ void *retval;
+ struct t_hdata *hdata;
+ void *pointer;
+ int count;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SSl", &z_hdata, &z_pointer, &z_count) == FAILURE)
{
return;
}
- filename = ZSTR_VAL(z_filename);
- weechat_php_get_function_name (z_callback_read, callback_read_name);
- data = ZSTR_VAL(z_data);
- retval = plugin_script_api_upgrade_new (weechat_php_plugin, php_current_script, (const char *)filename, weechat_php_upgrade_new_callback_read, (const char *)callback_read_name, (const char *)data);
+ hdata = (struct t_hdata *)API_STR2PTR(ZSTR_VAL(z_hdata));
+ pointer = (void *)API_STR2PTR(ZSTR_VAL(z_pointer));
+ count = (int)z_count;
+ retval = weechat_hdata_move (hdata, pointer, count);
char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
}
-PHP_FUNCTION(weechat_prefix)
+PHP_FUNCTION(weechat_hdata_search)
{
- API_FUNC_INIT(weechat_prefix);
- zend_string *z_prefix;
- const char *retval;
- char *prefix;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_prefix) == FAILURE)
+ API_FUNC_INIT(weechat_hdata_search);
+ zend_string *z_hdata;
+ zend_string *z_pointer;
+ zend_string *z_search;
+ zend_long z_move;
+ void *retval;
+ struct t_hdata *hdata;
+ void *pointer;
+ char *search;
+ int move;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SSSl", &z_hdata, &z_pointer, &z_search,
+ &z_move) == FAILURE)
{
return;
}
- prefix = ZSTR_VAL(z_prefix);
- retval = weechat_prefix ((const char *)prefix);
- SAFE_RETURN_STRING(retval);
+ hdata = (struct t_hdata *)API_STR2PTR(ZSTR_VAL(z_hdata));
+ pointer = (void *)API_STR2PTR(ZSTR_VAL(z_pointer));
+ search = ZSTR_VAL(z_search);
+ move = (int)z_move;
+ retval = weechat_hdata_search (hdata, pointer, (const char *)search, move);
+ char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
}
-PHP_FUNCTION(weechat_string_eval_expression)
+PHP_FUNCTION(weechat_hdata_char)
{
- API_FUNC_INIT(weechat_string_eval_expression);
- zend_string *z_expr;
- zval *z_pointers;
- zval *z_extra_vars;
- zval *z_options;
- char *retval;
- char *expr;
- struct t_hashtable *pointers;
- struct t_hashtable *extra_vars;
- struct t_hashtable *options;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "Saaa", &z_expr, &z_pointers, &z_extra_vars, &z_options) == FAILURE)
+ API_FUNC_INIT(weechat_hdata_char);
+ zend_string *z_hdata;
+ zend_string *z_pointer;
+ zend_string *z_name;
+ char retval;
+ struct t_hdata *hdata;
+ void *pointer;
+ char *name;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SSS", &z_hdata, &z_pointer, &z_name) == FAILURE)
{
return;
}
- expr = ZSTR_VAL(z_expr);
- pointers = weechat_php_array_to_hashtable(z_pointers, WEECHAT_SCRIPT_HASHTABLE_DEFAULT_SIZE, WEECHAT_HASHTABLE_STRING, WEECHAT_HASHTABLE_STRING);
- extra_vars = weechat_php_array_to_hashtable(z_extra_vars, WEECHAT_SCRIPT_HASHTABLE_DEFAULT_SIZE, WEECHAT_HASHTABLE_STRING, WEECHAT_HASHTABLE_STRING);
- options = weechat_php_array_to_hashtable(z_options, WEECHAT_SCRIPT_HASHTABLE_DEFAULT_SIZE, WEECHAT_HASHTABLE_STRING, WEECHAT_HASHTABLE_STRING);
- retval = weechat_string_eval_expression ((const char *)expr, pointers, extra_vars, options);
- SAFE_RETURN_STRING(retval);
+ hdata = (struct t_hdata *)API_STR2PTR(ZSTR_VAL(z_hdata));
+ pointer = (void *)API_STR2PTR(ZSTR_VAL(z_pointer));
+ name = ZSTR_VAL(z_name);
+ retval = weechat_hdata_char (hdata, pointer, (const char *)name);
+ RETURN_LONG((int)retval);
}
-PHP_FUNCTION(weechat_string_eval_path_home)
+PHP_FUNCTION(weechat_hdata_integer)
{
- API_FUNC_INIT(weechat_string_eval_path_home);
- zend_string *z_path;
- zval *z_pointers;
- zval *z_extra_vars;
- zval *z_options;
- char *retval;
- char *path;
- struct t_hashtable *pointers;
- struct t_hashtable *extra_vars;
- struct t_hashtable *options;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "Saaa", &z_path, &z_pointers, &z_extra_vars, &z_options) == FAILURE)
+ API_FUNC_INIT(weechat_hdata_integer);
+ zend_string *z_hdata;
+ zend_string *z_pointer;
+ zend_string *z_name;
+ int retval;
+ struct t_hdata *hdata;
+ void *pointer;
+ char *name;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SSS", &z_hdata, &z_pointer, &z_name) == FAILURE)
{
return;
}
- path = ZSTR_VAL(z_path);
- pointers = weechat_php_array_to_hashtable(z_pointers, WEECHAT_SCRIPT_HASHTABLE_DEFAULT_SIZE, WEECHAT_HASHTABLE_STRING, WEECHAT_HASHTABLE_STRING);
- extra_vars = weechat_php_array_to_hashtable(z_extra_vars, WEECHAT_SCRIPT_HASHTABLE_DEFAULT_SIZE, WEECHAT_HASHTABLE_STRING, WEECHAT_HASHTABLE_STRING);
- options = weechat_php_array_to_hashtable(z_options, WEECHAT_SCRIPT_HASHTABLE_DEFAULT_SIZE, WEECHAT_HASHTABLE_STRING, WEECHAT_HASHTABLE_STRING);
- retval = weechat_string_eval_path_home ((const char *)path, pointers, extra_vars, options);
- SAFE_RETURN_STRING(retval);
+ hdata = (struct t_hdata *)API_STR2PTR(ZSTR_VAL(z_hdata));
+ pointer = (void *)API_STR2PTR(ZSTR_VAL(z_pointer));
+ name = ZSTR_VAL(z_name);
+ retval = weechat_hdata_integer (hdata, pointer, (const char *)name);
+ RETURN_LONG(retval);
}
-PHP_FUNCTION(weechat_string_has_highlight)
+PHP_FUNCTION(weechat_hdata_long)
{
- API_FUNC_INIT(weechat_string_has_highlight);
- zend_string *z_string;
- zend_string *z_highlight_words;
- int retval;
- char *string;
- char *highlight_words;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SS", &z_string, &z_highlight_words) == FAILURE)
+ API_FUNC_INIT(weechat_hdata_long);
+ zend_string *z_hdata;
+ zend_string *z_pointer;
+ zend_string *z_name;
+ long retval;
+ struct t_hdata *hdata;
+ void *pointer;
+ char *name;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SSS", &z_hdata, &z_pointer, &z_name) == FAILURE)
{
return;
}
- string = ZSTR_VAL(z_string);
- highlight_words = ZSTR_VAL(z_highlight_words);
- retval = weechat_string_has_highlight ((const char *)string, (const char *)highlight_words);
+ hdata = (struct t_hdata *)API_STR2PTR(ZSTR_VAL(z_hdata));
+ pointer = (void *)API_STR2PTR(ZSTR_VAL(z_pointer));
+ name = ZSTR_VAL(z_name);
+ retval = weechat_hdata_long (hdata, pointer, (const char *)name);
RETURN_LONG(retval);
}
-PHP_FUNCTION(weechat_string_has_highlight_regex)
+PHP_FUNCTION(weechat_hdata_string)
{
- API_FUNC_INIT(weechat_string_has_highlight_regex);
- zend_string *z_string;
- zend_string *z_regex;
- int retval;
- char *string;
- char *regex;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SS", &z_string, &z_regex) == FAILURE)
+ API_FUNC_INIT(weechat_hdata_string);
+ zend_string *z_hdata;
+ zend_string *z_pointer;
+ zend_string *z_name;
+ const char *retval;
+ struct t_hdata *hdata;
+ void *pointer;
+ char *name;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SSS", &z_hdata, &z_pointer, &z_name) == FAILURE)
{
return;
}
- string = ZSTR_VAL(z_string);
- regex = ZSTR_VAL(z_regex);
- retval = weechat_string_has_highlight_regex ((const char *)string, (const char *)regex);
- RETURN_LONG(retval);
+ hdata = (struct t_hdata *)API_STR2PTR(ZSTR_VAL(z_hdata));
+ pointer = (void *)API_STR2PTR(ZSTR_VAL(z_pointer));
+ name = ZSTR_VAL(z_name);
+ retval = weechat_hdata_string (hdata, pointer, (const char *)name);
+ SAFE_RETURN_STRING(retval);
}
-PHP_FUNCTION(weechat_string_input_for_buffer)
+PHP_FUNCTION(weechat_hdata_pointer)
{
- API_FUNC_INIT(weechat_string_input_for_buffer);
- zend_string *z_string;
- const char *retval;
- char *string;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_string) == FAILURE)
+ API_FUNC_INIT(weechat_hdata_pointer);
+ zend_string *z_hdata;
+ zend_string *z_pointer;
+ zend_string *z_name;
+ void *retval;
+ struct t_hdata *hdata;
+ void *pointer;
+ char *name;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SSS", &z_hdata, &z_pointer, &z_name) == FAILURE)
{
return;
}
- string = ZSTR_VAL(z_string);
- retval = weechat_string_input_for_buffer ((const char *)string);
- SAFE_RETURN_STRING(retval);
+ hdata = (struct t_hdata *)API_STR2PTR(ZSTR_VAL(z_hdata));
+ pointer = (void *)API_STR2PTR(ZSTR_VAL(z_pointer));
+ name = ZSTR_VAL(z_name);
+ retval = weechat_hdata_pointer (hdata, pointer, (const char *)name);
+ char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
}
-PHP_FUNCTION(weechat_string_is_command_char)
+PHP_FUNCTION(weechat_hdata_time)
{
- API_FUNC_INIT(weechat_string_is_command_char);
- zend_string *z_string;
- int retval;
- char *string;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_string) == FAILURE)
+ API_FUNC_INIT(weechat_hdata_time);
+ zend_string *z_hdata;
+ zend_string *z_pointer;
+ zend_string *z_name;
+ time_t retval;
+ struct t_hdata *hdata;
+ void *pointer;
+ char *name;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SSS", &z_hdata, &z_pointer, &z_name) == FAILURE)
{
return;
}
- string = ZSTR_VAL(z_string);
- retval = weechat_string_is_command_char ((const char *)string);
+ hdata = (struct t_hdata *)API_STR2PTR(ZSTR_VAL(z_hdata));
+ pointer = (void *)API_STR2PTR(ZSTR_VAL(z_pointer));
+ name = ZSTR_VAL(z_name);
+ retval = weechat_hdata_time (hdata, pointer, (const char *)name);
RETURN_LONG(retval);
}
-PHP_FUNCTION(weechat_string_mask_to_regex)
+PHP_FUNCTION(weechat_hdata_hashtable)
{
- API_FUNC_INIT(weechat_string_mask_to_regex);
- zend_string *z_mask;
- char *retval;
- char *mask;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_mask) == FAILURE)
+ API_FUNC_INIT(weechat_hdata_hashtable);
+ zend_string *z_hdata;
+ zend_string *z_pointer;
+ zend_string *z_name;
+ struct t_hashtable *retval;
+ struct t_hdata *hdata;
+ void *pointer;
+ char *name;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SSS", &z_hdata, &z_pointer, &z_name) == FAILURE)
{
return;
}
- mask = ZSTR_VAL(z_mask);
- retval = weechat_string_mask_to_regex ((const char *)mask);
- SAFE_RETURN_STRING(retval);
+ hdata = (struct t_hdata *)API_STR2PTR(ZSTR_VAL(z_hdata));
+ pointer = (void *)API_STR2PTR(ZSTR_VAL(z_pointer));
+ name = ZSTR_VAL(z_name);
+ retval = weechat_hdata_hashtable (hdata, pointer, (const char *)name);
+ weechat_php_hashtable_to_array(retval, return_value);
}
-PHP_FUNCTION(weechat_string_match)
+PHP_FUNCTION(weechat_hdata_compare)
{
- API_FUNC_INIT(weechat_string_match);
- zend_string *z_string;
- zend_string *z_mask;
+ API_FUNC_INIT(weechat_hdata_compare);
+ zend_string *z_hdata;
+ zend_string *z_pointer1;
+ zend_string *z_pointer2;
+ zend_string *z_name;
zend_long z_case_sensitive;
int retval;
- char *string;
- char *mask;
+ struct t_hdata *hdata;
+ void *pointer1;
+ void *pointer2;
+ char *name;
int case_sensitive;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SSl", &z_string, &z_mask, &z_case_sensitive) == FAILURE)
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SSSSl", &z_hdata, &z_pointer1, &z_pointer2,
+ &z_name, &z_case_sensitive) == FAILURE)
{
return;
}
- string = ZSTR_VAL(z_string);
- mask = ZSTR_VAL(z_mask);
+ hdata = (struct t_hdata *)API_STR2PTR(ZSTR_VAL(z_hdata));
+ pointer1 = (void *)API_STR2PTR(ZSTR_VAL(z_pointer1));
+ pointer2 = (void *)API_STR2PTR(ZSTR_VAL(z_pointer2));
+ name = (void *)API_STR2PTR(ZSTR_VAL(z_name));
case_sensitive = (int)z_case_sensitive;
- retval = weechat_string_match ((const char *)string, (const char *)mask, case_sensitive);
+ retval = weechat_hdata_compare (hdata, pointer1, pointer2, name,
+ case_sensitive);
RETURN_LONG(retval);
}
-PHP_FUNCTION(weechat_string_remove_color)
-{
- API_FUNC_INIT(weechat_string_remove_color);
- zend_string *z_string;
- zend_string *z_replacement;
- char *retval;
- char *string;
- char *replacement;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SS", &z_string, &z_replacement) == FAILURE)
- {
- return;
- }
- string = ZSTR_VAL(z_string);
- replacement = ZSTR_VAL(z_replacement);
- retval = weechat_string_remove_color ((const char *)string, (const char *)replacement);
- SAFE_RETURN_STRING(retval);
-}
-
-PHP_FUNCTION(weechat_string_replace)
-{
- API_FUNC_INIT(weechat_string_replace);
- zend_string *z_string;
- zend_string *z_search;
- zend_string *z_replace;
- char *retval;
- char *string;
- char *search;
- char *replace;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SSS", &z_string, &z_search, &z_replace) == FAILURE)
- {
- return;
- }
- string = ZSTR_VAL(z_string);
- search = ZSTR_VAL(z_search);
- replace = ZSTR_VAL(z_replace);
- retval = weechat_string_replace ((const char *)string, (const char *)search, (const char *)replace);
- SAFE_RETURN_STRING(retval);
-}
-
-PHP_FUNCTION(weechat_strlen_screen)
+PHP_FUNCTION(weechat_hdata_update)
{
- API_FUNC_INIT(weechat_strlen_screen);
- zend_string *z_string;
+ API_FUNC_INIT(weechat_hdata_update);
+ zend_string *z_hdata;
+ zend_string *z_pointer;
+ zval *z_hashtable;
int retval;
- char *string;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_string) == FAILURE)
+ struct t_hdata *hdata;
+ void *pointer;
+ struct t_hashtable *hashtable;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SSa", &z_hdata, &z_pointer,
+ &z_hashtable) == FAILURE)
{
return;
}
- string = ZSTR_VAL(z_string);
- retval = weechat_strlen_screen ((const char *)string);
+ hdata = (struct t_hdata *)API_STR2PTR(ZSTR_VAL(z_hdata));
+ pointer = (void *)API_STR2PTR(ZSTR_VAL(z_pointer));
+ hashtable = weechat_php_array_to_hashtable (
+ z_hashtable,
+ WEECHAT_SCRIPT_HASHTABLE_DEFAULT_SIZE,
+ WEECHAT_HASHTABLE_STRING,
+ WEECHAT_HASHTABLE_STRING);
+ retval = weechat_hdata_update (hdata, pointer, hashtable);
RETURN_LONG(retval);
}
-PHP_FUNCTION(weechat_unhook)
-{
- API_FUNC_INIT(weechat_unhook);
- zend_string *z_hook;
- struct t_hook *hook;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_hook) == FAILURE)
- {
- return;
- }
- hook = (struct t_hook *)API_STR2PTR(ZSTR_VAL(z_hook));
- weechat_unhook (hook);
- RETURN_NULL();
-}
-
-PHP_FUNCTION(weechat_unhook_all)
+PHP_FUNCTION(weechat_hdata_get_string)
{
- API_FUNC_INIT(weechat_unhook_all);
- zend_string *z_subplugin;
- char *subplugin;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_subplugin) == FAILURE)
+ API_FUNC_INIT(weechat_hdata_get_string);
+ zend_string *z_hdata;
+ zend_string *z_property;
+ const char *retval;
+ struct t_hdata *hdata;
+ char *property;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SS", &z_hdata, &z_property) == FAILURE)
{
return;
}
- subplugin = ZSTR_VAL(z_subplugin);
- weechat_unhook_all ((const char *)subplugin);
- RETURN_NULL();
+ hdata = (struct t_hdata *)API_STR2PTR(ZSTR_VAL(z_hdata));
+ property = ZSTR_VAL(z_property);
+ retval = weechat_hdata_get_string (hdata, (const char *)property);
+ SAFE_RETURN_STRING(retval);
}
-PHP_FUNCTION(weechat_upgrade_close)
+static int
+weechat_php_upgrade_new_callback_read (const void *pointer, void *data,
+ struct t_upgrade_file *upgrade_file,
+ int object_id,
+ struct t_infolist *infolist)
{
- API_FUNC_INIT(weechat_upgrade_close);
- zend_string *z_upgrade_file;
- struct t_upgrade_file *upgrade_file;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_upgrade_file) == FAILURE)
- {
- return;
- }
- upgrade_file = (struct t_upgrade_file *)API_STR2PTR(ZSTR_VAL(z_upgrade_file));
- weechat_upgrade_close (upgrade_file);
- RETURN_NULL();
+ int rc;
+ void *func_argv[4];
+ func_argv[1] = API_PTR2STR(upgrade_file);
+ func_argv[2] = &object_id;
+ func_argv[3] = API_PTR2STR(infolist);
+ weechat_php_cb(pointer, data, func_argv, "ssis",
+ WEECHAT_SCRIPT_EXEC_INT, &rc);
+ if (func_argv[1])
+ free (func_argv[1]);
+ if (func_argv[3])
+ free (func_argv[3]);
+ return rc;
}
-PHP_FUNCTION(weechat_upgrade_read)
+PHP_FUNCTION(weechat_upgrade_new)
{
- API_FUNC_INIT(weechat_upgrade_read);
- zend_string *z_upgrade_file;
- int retval;
- struct t_upgrade_file *upgrade_file;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_upgrade_file) == FAILURE)
+ API_FUNC_INIT(weechat_upgrade_new);
+ zend_string *z_filename;
+ zval *z_callback_read;
+ zend_string *z_data;
+ struct t_upgrade_file *retval;
+ char *filename;
+ char *data;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(), "SzS", &z_filename,
+ &z_callback_read, &z_data) == FAILURE)
{
return;
}
- upgrade_file = (struct t_upgrade_file *)API_STR2PTR(ZSTR_VAL(z_upgrade_file));
- retval = weechat_upgrade_read (upgrade_file);
- RETURN_LONG(retval);
+ filename = ZSTR_VAL(z_filename);
+ weechat_php_get_function_name (z_callback_read, callback_read_name);
+ data = ZSTR_VAL(z_data);
+ retval = plugin_script_api_upgrade_new (weechat_php_plugin,
+ php_current_script,
+ (const char *)filename,
+ weechat_php_upgrade_new_callback_read,
+ (const char *)callback_read_name,
+ (const char *)data);
+ char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
}
PHP_FUNCTION(weechat_upgrade_write_object)
@@ -4193,7 +4845,9 @@ PHP_FUNCTION(weechat_upgrade_write_object)
struct t_upgrade_file *upgrade_file;
int object_id;
struct t_infolist *infolist;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SlS", &z_upgrade_file, &z_object_id, &z_infolist) == FAILURE)
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "SlS", &z_upgrade_file, &z_object_id,
+ &z_infolist) == FAILURE)
{
return;
}
@@ -4204,86 +4858,34 @@ PHP_FUNCTION(weechat_upgrade_write_object)
RETURN_LONG(retval);
}
-PHP_FUNCTION(weechat_window_get_integer)
+PHP_FUNCTION(weechat_upgrade_read)
{
- API_FUNC_INIT(weechat_window_get_integer);
- zend_string *z_window;
- zend_string *z_property;
+ API_FUNC_INIT(weechat_upgrade_read);
+ zend_string *z_upgrade_file;
int retval;
- struct t_gui_window *window;
- char *property;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SS", &z_window, &z_property) == FAILURE)
+ struct t_upgrade_file *upgrade_file;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "S", &z_upgrade_file) == FAILURE)
{
return;
}
- window = (struct t_gui_window *)API_STR2PTR(ZSTR_VAL(z_window));
- property = ZSTR_VAL(z_property);
- retval = weechat_window_get_integer (window, (const char *)property);
+ upgrade_file = (struct t_upgrade_file *)API_STR2PTR(ZSTR_VAL(z_upgrade_file));
+ retval = weechat_upgrade_read (upgrade_file);
RETURN_LONG(retval);
}
-PHP_FUNCTION(weechat_window_get_pointer)
-{
- API_FUNC_INIT(weechat_window_get_pointer);
- zend_string *z_window;
- zend_string *z_property;
- void *retval;
- struct t_gui_window *window;
- char *property;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SS", &z_window, &z_property) == FAILURE)
- {
- return;
- }
- window = (struct t_gui_window *)API_STR2PTR(ZSTR_VAL(z_window));
- property = ZSTR_VAL(z_property);
- retval = weechat_window_get_pointer (window, (const char *)property);
- char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
-}
-
-PHP_FUNCTION(weechat_window_get_string)
-{
- API_FUNC_INIT(weechat_window_get_string);
- zend_string *z_window;
- zend_string *z_property;
- const char *retval;
- struct t_gui_window *window;
- char *property;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "SS", &z_window, &z_property) == FAILURE)
- {
- return;
- }
- window = (struct t_gui_window *)API_STR2PTR(ZSTR_VAL(z_window));
- property = ZSTR_VAL(z_property);
- retval = weechat_window_get_string (window, (const char *)property);
- SAFE_RETURN_STRING(retval);
-}
-
-PHP_FUNCTION(weechat_window_search_with_buffer)
-{
- API_FUNC_INIT(weechat_window_search_with_buffer);
- zend_string *z_buffer;
- struct t_gui_window *retval;
- struct t_gui_buffer *buffer;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_buffer) == FAILURE)
- {
- return;
- }
- buffer = (struct t_gui_buffer *)API_STR2PTR(ZSTR_VAL(z_buffer));
- retval = weechat_window_search_with_buffer (buffer);
- char *__retstr = API_PTR2STR(retval); SAFE_RETURN_STRING(__retstr);
-}
-
-PHP_FUNCTION(weechat_window_set_title)
+PHP_FUNCTION(weechat_upgrade_close)
{
- API_FUNC_INIT(weechat_window_set_title);
- zend_string *z_title;
- char *title;
- if (zend_parse_parameters (ZEND_NUM_ARGS(), "S", &z_title) == FAILURE)
+ API_FUNC_INIT(weechat_upgrade_close);
+ zend_string *z_upgrade_file;
+ struct t_upgrade_file *upgrade_file;
+ if (zend_parse_parameters (ZEND_NUM_ARGS(),
+ "S", &z_upgrade_file) == FAILURE)
{
return;
}
- title = ZSTR_VAL(z_title);
- weechat_window_set_title ((const char *)title);
+ upgrade_file = (struct t_upgrade_file *)API_STR2PTR(ZSTR_VAL(z_upgrade_file));
+ weechat_upgrade_close (upgrade_file);
RETURN_NULL();
}
diff --git a/src/plugins/php/weechat-php-api.h b/src/plugins/php/weechat-php-api.h
index 600b2c7ff..aef80cebb 100644
--- a/src/plugins/php/weechat-php-api.h
+++ b/src/plugins/php/weechat-php-api.h
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2006-2017 Adam Saponara <as@php.net>
+ * Copyright (C) 2017 Sébastien Helleu <flashcode@flashtux.org>
*
* This file is part of WeeChat, the extensible chat client.
*
@@ -26,199 +27,196 @@ extern struct t_php_const weechat_php_api_consts[];
extern int weechat_php_buffer_new_input_callback(const void *pointer, void *data, struct t_gui_buffer *buffer, const char *input_data);
extern int weechat_php_buffer_new_close_callback(const void *pointer, void *data, struct t_gui_buffer *buffer);
-PHP_FUNCTION(weechat_bar_item_new);
-PHP_FUNCTION(weechat_bar_item_remove);
-PHP_FUNCTION(weechat_bar_item_search);
-PHP_FUNCTION(weechat_bar_item_update);
-PHP_FUNCTION(weechat_bar_new);
-PHP_FUNCTION(weechat_bar_remove);
-PHP_FUNCTION(weechat_bar_search);
-PHP_FUNCTION(weechat_bar_set);
-PHP_FUNCTION(weechat_bar_update);
-PHP_FUNCTION(weechat_buffer_clear);
-PHP_FUNCTION(weechat_buffer_close);
-PHP_FUNCTION(weechat_buffer_get_integer);
-PHP_FUNCTION(weechat_buffer_get_pointer);
-PHP_FUNCTION(weechat_buffer_get_string);
-PHP_FUNCTION(weechat_buffer_match_list);
-PHP_FUNCTION(weechat_buffer_merge);
-PHP_FUNCTION(weechat_buffer_new);
-PHP_FUNCTION(weechat_buffer_search);
-PHP_FUNCTION(weechat_buffer_search_main);
-PHP_FUNCTION(weechat_buffer_set);
-PHP_FUNCTION(weechat_buffer_string_replace_local_var);
-PHP_FUNCTION(weechat_buffer_unmerge);
+PHP_FUNCTION(weechat_register);
+PHP_FUNCTION(weechat_plugin_get_name);
PHP_FUNCTION(weechat_charset_set);
-PHP_FUNCTION(weechat_color);
-PHP_FUNCTION(weechat_command);
-PHP_FUNCTION(weechat_config_boolean);
-PHP_FUNCTION(weechat_config_boolean_default);
-PHP_FUNCTION(weechat_config_color);
-PHP_FUNCTION(weechat_config_color_default);
-PHP_FUNCTION(weechat_config_free);
-PHP_FUNCTION(weechat_config_get);
-PHP_FUNCTION(weechat_config_get_plugin);
-PHP_FUNCTION(weechat_config_integer);
-PHP_FUNCTION(weechat_config_integer_default);
-PHP_FUNCTION(weechat_config_is_set_plugin);
+PHP_FUNCTION(weechat_iconv_to_internal);
+PHP_FUNCTION(weechat_iconv_from_internal);
+PHP_FUNCTION(weechat_gettext);
+PHP_FUNCTION(weechat_ngettext);
+PHP_FUNCTION(weechat_strlen_screen);
+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_remove_color);
+PHP_FUNCTION(weechat_string_is_command_char);
+PHP_FUNCTION(weechat_string_input_for_buffer);
+PHP_FUNCTION(weechat_string_eval_expression);
+PHP_FUNCTION(weechat_string_eval_path_home);
+PHP_FUNCTION(weechat_mkdir_home);
+PHP_FUNCTION(weechat_mkdir);
+PHP_FUNCTION(weechat_mkdir_parents);
+PHP_FUNCTION(weechat_list_new);
+PHP_FUNCTION(weechat_list_add);
+PHP_FUNCTION(weechat_list_search);
+PHP_FUNCTION(weechat_list_search_pos);
+PHP_FUNCTION(weechat_list_casesearch);
+PHP_FUNCTION(weechat_list_casesearch_pos);
+PHP_FUNCTION(weechat_list_get);
+PHP_FUNCTION(weechat_list_set);
+PHP_FUNCTION(weechat_list_next);
+PHP_FUNCTION(weechat_list_prev);
+PHP_FUNCTION(weechat_list_string);
+PHP_FUNCTION(weechat_list_size);
+PHP_FUNCTION(weechat_list_remove);
+PHP_FUNCTION(weechat_list_remove_all);
+PHP_FUNCTION(weechat_list_free);
PHP_FUNCTION(weechat_config_new);
-PHP_FUNCTION(weechat_config_new_option);
PHP_FUNCTION(weechat_config_new_section);
-PHP_FUNCTION(weechat_config_option_default_is_null);
-PHP_FUNCTION(weechat_config_option_free);
-PHP_FUNCTION(weechat_config_option_is_null);
-PHP_FUNCTION(weechat_config_option_rename);
+PHP_FUNCTION(weechat_config_search_section);
+PHP_FUNCTION(weechat_config_new_option);
+PHP_FUNCTION(weechat_config_search_option);
+PHP_FUNCTION(weechat_config_string_to_boolean);
PHP_FUNCTION(weechat_config_option_reset);
PHP_FUNCTION(weechat_config_option_set);
PHP_FUNCTION(weechat_config_option_set_null);
PHP_FUNCTION(weechat_config_option_unset);
+PHP_FUNCTION(weechat_config_option_rename);
+PHP_FUNCTION(weechat_config_option_is_null);
+PHP_FUNCTION(weechat_config_option_default_is_null);
+PHP_FUNCTION(weechat_config_boolean);
+PHP_FUNCTION(weechat_config_boolean_default);
+PHP_FUNCTION(weechat_config_integer);
+PHP_FUNCTION(weechat_config_integer_default);
+PHP_FUNCTION(weechat_config_string);
+PHP_FUNCTION(weechat_config_string_default);
+PHP_FUNCTION(weechat_config_color);
+PHP_FUNCTION(weechat_config_color_default);
+PHP_FUNCTION(weechat_config_write_option);
+PHP_FUNCTION(weechat_config_write_line);
+PHP_FUNCTION(weechat_config_write);
PHP_FUNCTION(weechat_config_read);
PHP_FUNCTION(weechat_config_reload);
-PHP_FUNCTION(weechat_config_search_option);
-PHP_FUNCTION(weechat_config_search_section);
-PHP_FUNCTION(weechat_config_section_free);
+PHP_FUNCTION(weechat_config_option_free);
PHP_FUNCTION(weechat_config_section_free_options);
-PHP_FUNCTION(weechat_config_set_desc_plugin);
+PHP_FUNCTION(weechat_config_section_free);
+PHP_FUNCTION(weechat_config_free);
+PHP_FUNCTION(weechat_config_get);
+PHP_FUNCTION(weechat_config_get_plugin);
+PHP_FUNCTION(weechat_config_is_set_plugin);
PHP_FUNCTION(weechat_config_set_plugin);
-PHP_FUNCTION(weechat_config_string);
-PHP_FUNCTION(weechat_config_string_default);
-PHP_FUNCTION(weechat_config_string_to_boolean);
+PHP_FUNCTION(weechat_config_set_desc_plugin);
PHP_FUNCTION(weechat_config_unset_plugin);
-PHP_FUNCTION(weechat_config_write);
-PHP_FUNCTION(weechat_config_write_line);
-PHP_FUNCTION(weechat_config_write_option);
-PHP_FUNCTION(weechat_gettext);
-PHP_FUNCTION(weechat_hdata_char);
-PHP_FUNCTION(weechat_hdata_check_pointer);
-PHP_FUNCTION(weechat_hdata_compare);
-PHP_FUNCTION(weechat_hdata_get);
-PHP_FUNCTION(weechat_hdata_get_list);
-PHP_FUNCTION(weechat_hdata_get_string);
-PHP_FUNCTION(weechat_hdata_get_var);
-PHP_FUNCTION(weechat_hdata_get_var_array_size);
-PHP_FUNCTION(weechat_hdata_get_var_array_size_string);
-PHP_FUNCTION(weechat_hdata_get_var_hdata);
-PHP_FUNCTION(weechat_hdata_get_var_offset);
-PHP_FUNCTION(weechat_hdata_get_var_type);
-PHP_FUNCTION(weechat_hdata_get_var_type_string);
-PHP_FUNCTION(weechat_hdata_hashtable);
-PHP_FUNCTION(weechat_hdata_integer);
-PHP_FUNCTION(weechat_hdata_long);
-PHP_FUNCTION(weechat_hdata_move);
-PHP_FUNCTION(weechat_hdata_pointer);
-PHP_FUNCTION(weechat_hdata_search);
-PHP_FUNCTION(weechat_hdata_string);
-PHP_FUNCTION(weechat_hdata_time);
-PHP_FUNCTION(weechat_hdata_update);
+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_hook_command);
-PHP_FUNCTION(weechat_hook_command_run);
PHP_FUNCTION(weechat_hook_completion);
PHP_FUNCTION(weechat_hook_completion_get_string);
PHP_FUNCTION(weechat_hook_completion_list_add);
-PHP_FUNCTION(weechat_hook_config);
-PHP_FUNCTION(weechat_hook_connect);
+PHP_FUNCTION(weechat_hook_command_run);
+PHP_FUNCTION(weechat_hook_timer);
PHP_FUNCTION(weechat_hook_fd);
-PHP_FUNCTION(weechat_hook_focus);
+PHP_FUNCTION(weechat_hook_process);
+PHP_FUNCTION(weechat_hook_process_hashtable);
+PHP_FUNCTION(weechat_hook_connect);
+PHP_FUNCTION(weechat_hook_print);
+PHP_FUNCTION(weechat_hook_signal);
+PHP_FUNCTION(weechat_hook_signal_send);
PHP_FUNCTION(weechat_hook_hsignal);
PHP_FUNCTION(weechat_hook_hsignal_send);
+PHP_FUNCTION(weechat_hook_config);
+PHP_FUNCTION(weechat_hook_modifier);
+PHP_FUNCTION(weechat_hook_modifier_exec);
PHP_FUNCTION(weechat_hook_info);
PHP_FUNCTION(weechat_hook_info_hashtable);
PHP_FUNCTION(weechat_hook_infolist);
-PHP_FUNCTION(weechat_hook_modifier);
-PHP_FUNCTION(weechat_hook_modifier_exec);
-PHP_FUNCTION(weechat_hook_print);
-PHP_FUNCTION(weechat_hook_process);
-PHP_FUNCTION(weechat_hook_process_hashtable);
+PHP_FUNCTION(weechat_hook_focus);
PHP_FUNCTION(weechat_hook_set);
-PHP_FUNCTION(weechat_hook_signal);
-PHP_FUNCTION(weechat_hook_signal_send);
-PHP_FUNCTION(weechat_hook_timer);
-PHP_FUNCTION(weechat_iconv_from_internal);
-PHP_FUNCTION(weechat_iconv_to_internal);
+PHP_FUNCTION(weechat_unhook);
+PHP_FUNCTION(weechat_unhook_all);
+PHP_FUNCTION(weechat_buffer_new);
+PHP_FUNCTION(weechat_buffer_search);
+PHP_FUNCTION(weechat_buffer_search_main);
+PHP_FUNCTION(weechat_buffer_clear);
+PHP_FUNCTION(weechat_buffer_close);
+PHP_FUNCTION(weechat_buffer_merge);
+PHP_FUNCTION(weechat_buffer_unmerge);
+PHP_FUNCTION(weechat_buffer_get_integer);
+PHP_FUNCTION(weechat_buffer_get_string);
+PHP_FUNCTION(weechat_buffer_get_pointer);
+PHP_FUNCTION(weechat_buffer_set);
+PHP_FUNCTION(weechat_buffer_string_replace_local_var);
+PHP_FUNCTION(weechat_buffer_match_list);
+PHP_FUNCTION(weechat_window_search_with_buffer);
+PHP_FUNCTION(weechat_window_get_integer);
+PHP_FUNCTION(weechat_window_get_string);
+PHP_FUNCTION(weechat_window_get_pointer);
+PHP_FUNCTION(weechat_window_set_title);
+PHP_FUNCTION(weechat_nicklist_add_group);
+PHP_FUNCTION(weechat_nicklist_search_group);
+PHP_FUNCTION(weechat_nicklist_add_nick);
+PHP_FUNCTION(weechat_nicklist_search_nick);
+PHP_FUNCTION(weechat_nicklist_remove_group);
+PHP_FUNCTION(weechat_nicklist_remove_nick);
+PHP_FUNCTION(weechat_nicklist_remove_all);
+PHP_FUNCTION(weechat_nicklist_group_get_integer);
+PHP_FUNCTION(weechat_nicklist_group_get_string);
+PHP_FUNCTION(weechat_nicklist_group_get_pointer);
+PHP_FUNCTION(weechat_nicklist_group_set);
+PHP_FUNCTION(weechat_nicklist_nick_get_integer);
+PHP_FUNCTION(weechat_nicklist_nick_get_string);
+PHP_FUNCTION(weechat_nicklist_nick_get_pointer);
+PHP_FUNCTION(weechat_nicklist_nick_set);
+PHP_FUNCTION(weechat_bar_item_search);
+PHP_FUNCTION(weechat_bar_item_new);
+PHP_FUNCTION(weechat_bar_item_update);
+PHP_FUNCTION(weechat_bar_item_remove);
+PHP_FUNCTION(weechat_bar_search);
+PHP_FUNCTION(weechat_bar_new);
+PHP_FUNCTION(weechat_bar_set);
+PHP_FUNCTION(weechat_bar_update);
+PHP_FUNCTION(weechat_bar_remove);
+PHP_FUNCTION(weechat_command);
PHP_FUNCTION(weechat_info_get);
PHP_FUNCTION(weechat_info_get_hashtable);
-PHP_FUNCTION(weechat_infolist_fields);
-PHP_FUNCTION(weechat_infolist_free);
-PHP_FUNCTION(weechat_infolist_get);
-PHP_FUNCTION(weechat_infolist_integer);
PHP_FUNCTION(weechat_infolist_new);
PHP_FUNCTION(weechat_infolist_new_item);
PHP_FUNCTION(weechat_infolist_new_var_integer);
-PHP_FUNCTION(weechat_infolist_new_var_pointer);
PHP_FUNCTION(weechat_infolist_new_var_string);
+PHP_FUNCTION(weechat_infolist_new_var_pointer);
PHP_FUNCTION(weechat_infolist_new_var_time);
+PHP_FUNCTION(weechat_infolist_search_var);
+PHP_FUNCTION(weechat_infolist_get);
PHP_FUNCTION(weechat_infolist_next);
-PHP_FUNCTION(weechat_infolist_pointer);
PHP_FUNCTION(weechat_infolist_prev);
PHP_FUNCTION(weechat_infolist_reset_item_cursor);
-PHP_FUNCTION(weechat_infolist_search_var);
+PHP_FUNCTION(weechat_infolist_fields);
+PHP_FUNCTION(weechat_infolist_integer);
PHP_FUNCTION(weechat_infolist_string);
+PHP_FUNCTION(weechat_infolist_pointer);
PHP_FUNCTION(weechat_infolist_time);
-PHP_FUNCTION(weechat_key_bind);
-PHP_FUNCTION(weechat_key_unbind);
-PHP_FUNCTION(weechat_list_add);
-PHP_FUNCTION(weechat_list_casesearch);
-PHP_FUNCTION(weechat_list_casesearch_pos);
-PHP_FUNCTION(weechat_list_free);
-PHP_FUNCTION(weechat_list_get);
-PHP_FUNCTION(weechat_list_new);
-PHP_FUNCTION(weechat_list_next);
-PHP_FUNCTION(weechat_list_prev);
-PHP_FUNCTION(weechat_list_remove);
-PHP_FUNCTION(weechat_list_remove_all);
-PHP_FUNCTION(weechat_list_search);
-PHP_FUNCTION(weechat_list_search_pos);
-PHP_FUNCTION(weechat_list_set);
-PHP_FUNCTION(weechat_list_size);
-PHP_FUNCTION(weechat_list_string);
-PHP_FUNCTION(weechat_log_printf);
-PHP_FUNCTION(weechat_mkdir);
-PHP_FUNCTION(weechat_mkdir_home);
-PHP_FUNCTION(weechat_mkdir_parents);
-PHP_FUNCTION(weechat_ngettext);
-PHP_FUNCTION(weechat_nicklist_add_group);
-PHP_FUNCTION(weechat_nicklist_add_nick);
-PHP_FUNCTION(weechat_nicklist_group_get_integer);
-PHP_FUNCTION(weechat_nicklist_group_get_pointer);
-PHP_FUNCTION(weechat_nicklist_group_get_string);
-PHP_FUNCTION(weechat_nicklist_group_set);
-PHP_FUNCTION(weechat_nicklist_nick_get_integer);
-PHP_FUNCTION(weechat_nicklist_nick_get_pointer);
-PHP_FUNCTION(weechat_nicklist_nick_get_string);
-PHP_FUNCTION(weechat_nicklist_nick_set);
-PHP_FUNCTION(weechat_nicklist_remove_all);
-PHP_FUNCTION(weechat_nicklist_remove_group);
-PHP_FUNCTION(weechat_nicklist_remove_nick);
-PHP_FUNCTION(weechat_nicklist_search_group);
-PHP_FUNCTION(weechat_nicklist_search_nick);
-PHP_FUNCTION(weechat_plugin_get_name);
-PHP_FUNCTION(weechat_prefix);
-PHP_FUNCTION(weechat_printf);
-PHP_FUNCTION(weechat_printf_date_tags);
-PHP_FUNCTION(weechat_printf_y);
-PHP_FUNCTION(weechat_register);
-PHP_FUNCTION(weechat_string_eval_expression);
-PHP_FUNCTION(weechat_string_eval_path_home);
-PHP_FUNCTION(weechat_string_has_highlight);
-PHP_FUNCTION(weechat_string_has_highlight_regex);
-PHP_FUNCTION(weechat_string_input_for_buffer);
-PHP_FUNCTION(weechat_string_is_command_char);
-PHP_FUNCTION(weechat_string_mask_to_regex);
-PHP_FUNCTION(weechat_string_match);
-PHP_FUNCTION(weechat_string_remove_color);
-PHP_FUNCTION(weechat_string_replace);
-PHP_FUNCTION(weechat_strlen_screen);
-PHP_FUNCTION(weechat_unhook);
-PHP_FUNCTION(weechat_unhook_all);
-PHP_FUNCTION(weechat_upgrade_close);
+PHP_FUNCTION(weechat_infolist_free);
+PHP_FUNCTION(weechat_hdata_get);
+PHP_FUNCTION(weechat_hdata_get_var_offset);
+PHP_FUNCTION(weechat_hdata_get_var_type_string);
+PHP_FUNCTION(weechat_hdata_get_var_array_size);
+PHP_FUNCTION(weechat_hdata_get_var_array_size_string);
+PHP_FUNCTION(weechat_hdata_get_var_hdata);
+PHP_FUNCTION(weechat_hdata_get_list);
+PHP_FUNCTION(weechat_hdata_check_pointer);
+PHP_FUNCTION(weechat_hdata_move);
+PHP_FUNCTION(weechat_hdata_search);
+PHP_FUNCTION(weechat_hdata_char);
+PHP_FUNCTION(weechat_hdata_integer);
+PHP_FUNCTION(weechat_hdata_long);
+PHP_FUNCTION(weechat_hdata_string);
+PHP_FUNCTION(weechat_hdata_pointer);
+PHP_FUNCTION(weechat_hdata_time);
+PHP_FUNCTION(weechat_hdata_hashtable);
+PHP_FUNCTION(weechat_hdata_compare);
+PHP_FUNCTION(weechat_hdata_update);
+PHP_FUNCTION(weechat_hdata_get_string);
PHP_FUNCTION(weechat_upgrade_new);
-PHP_FUNCTION(weechat_upgrade_read);
PHP_FUNCTION(weechat_upgrade_write_object);
-PHP_FUNCTION(weechat_window_get_integer);
-PHP_FUNCTION(weechat_window_get_pointer);
-PHP_FUNCTION(weechat_window_get_string);
-PHP_FUNCTION(weechat_window_search_with_buffer);
-PHP_FUNCTION(weechat_window_set_title);
+PHP_FUNCTION(weechat_upgrade_read);
+PHP_FUNCTION(weechat_upgrade_close);
PHP_FUNCTION(forget_class);
PHP_FUNCTION(forget_function);
diff --git a/src/plugins/php/weechat-php.c b/src/plugins/php/weechat-php.c
index 8e009d16e..ce73c30b1 100644
--- a/src/plugins/php/weechat-php.c
+++ b/src/plugins/php/weechat-php.c
@@ -2,6 +2,7 @@
* weechat-php.c - PHP plugin for WeeChat
*
* Copyright (C) 2006-2017 Adam Saponara <as@php.net>
+ * Copyright (C) 2017 Sébastien Helleu <flashcode@flashtux.org>
*
* This file is part of WeeChat, the extensible chat client.
*
@@ -71,199 +72,196 @@ char *php_action_remove_list = NULL;
char *php_action_autoload_list = NULL;
const zend_function_entry weechat_functions[] = {
- PHP_FE(weechat_bar_item_new, NULL)
- PHP_FE(weechat_bar_item_remove, NULL)
- PHP_FE(weechat_bar_item_search, NULL)
- PHP_FE(weechat_bar_item_update, NULL)
- PHP_FE(weechat_bar_new, NULL)
- PHP_FE(weechat_bar_remove, NULL)
- PHP_FE(weechat_bar_search, NULL)
- PHP_FE(weechat_bar_set, NULL)
- PHP_FE(weechat_bar_update, NULL)
- PHP_FE(weechat_buffer_clear, NULL)
- PHP_FE(weechat_buffer_close, NULL)
- PHP_FE(weechat_buffer_get_integer, NULL)
- PHP_FE(weechat_buffer_get_pointer, NULL)
- PHP_FE(weechat_buffer_get_string, NULL)
- PHP_FE(weechat_buffer_match_list, NULL)
- PHP_FE(weechat_buffer_merge, NULL)
- PHP_FE(weechat_buffer_new, NULL)
- PHP_FE(weechat_buffer_search_main, NULL)
- PHP_FE(weechat_buffer_search, NULL)
- PHP_FE(weechat_buffer_set, NULL)
- PHP_FE(weechat_buffer_string_replace_local_var, NULL)
- PHP_FE(weechat_buffer_unmerge, NULL)
+ PHP_FE(weechat_register, NULL)
+ PHP_FE(weechat_plugin_get_name, NULL)
PHP_FE(weechat_charset_set, NULL)
- PHP_FE(weechat_color, NULL)
- PHP_FE(weechat_command, NULL)
- PHP_FE(weechat_config_boolean_default, NULL)
- PHP_FE(weechat_config_boolean, NULL)
- PHP_FE(weechat_config_color_default, NULL)
- PHP_FE(weechat_config_color, NULL)
- PHP_FE(weechat_config_free, NULL)
- PHP_FE(weechat_config_get, NULL)
- PHP_FE(weechat_config_get_plugin, NULL)
- PHP_FE(weechat_config_integer_default, NULL)
- PHP_FE(weechat_config_integer, NULL)
- PHP_FE(weechat_config_is_set_plugin, NULL)
+ PHP_FE(weechat_iconv_to_internal, NULL)
+ PHP_FE(weechat_iconv_from_internal, NULL)
+ PHP_FE(weechat_gettext, NULL)
+ PHP_FE(weechat_ngettext, NULL)
+ PHP_FE(weechat_strlen_screen, NULL)
+ PHP_FE(weechat_string_match, NULL)
+ 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_remove_color, NULL)
+ PHP_FE(weechat_string_is_command_char, NULL)
+ PHP_FE(weechat_string_input_for_buffer, NULL)
+ PHP_FE(weechat_string_eval_expression, NULL)
+ PHP_FE(weechat_string_eval_path_home, NULL)
+ PHP_FE(weechat_mkdir_home, NULL)
+ PHP_FE(weechat_mkdir, NULL)
+ PHP_FE(weechat_mkdir_parents, NULL)
+ PHP_FE(weechat_list_new, NULL)
+ PHP_FE(weechat_list_add, NULL)
+ PHP_FE(weechat_list_search, NULL)
+ PHP_FE(weechat_list_search_pos, NULL)
+ PHP_FE(weechat_list_casesearch, NULL)
+ PHP_FE(weechat_list_casesearch_pos, NULL)
+ PHP_FE(weechat_list_get, NULL)
+ PHP_FE(weechat_list_set, NULL)
+ PHP_FE(weechat_list_next, NULL)
+ PHP_FE(weechat_list_prev, NULL)
+ PHP_FE(weechat_list_string, NULL)
+ PHP_FE(weechat_list_size, NULL)
+ PHP_FE(weechat_list_remove, NULL)
+ PHP_FE(weechat_list_remove_all, NULL)
+ PHP_FE(weechat_list_free, NULL)
PHP_FE(weechat_config_new, NULL)
- PHP_FE(weechat_config_new_option, NULL)
PHP_FE(weechat_config_new_section, NULL)
- PHP_FE(weechat_config_option_default_is_null, NULL)
- PHP_FE(weechat_config_option_free, NULL)
- PHP_FE(weechat_config_option_is_null, NULL)
- PHP_FE(weechat_config_option_rename, NULL)
+ PHP_FE(weechat_config_search_section, NULL)
+ PHP_FE(weechat_config_new_option, NULL)
+ PHP_FE(weechat_config_search_option, NULL)
+ PHP_FE(weechat_config_string_to_boolean, NULL)
PHP_FE(weechat_config_option_reset, NULL)
PHP_FE(weechat_config_option_set, NULL)
PHP_FE(weechat_config_option_set_null, NULL)
PHP_FE(weechat_config_option_unset, NULL)
+ PHP_FE(weechat_config_option_rename, NULL)
+ PHP_FE(weechat_config_option_is_null, NULL)
+ PHP_FE(weechat_config_option_default_is_null, NULL)
+ PHP_FE(weechat_config_boolean, NULL)
+ PHP_FE(weechat_config_boolean_default, NULL)
+ PHP_FE(weechat_config_integer, NULL)
+ PHP_FE(weechat_config_integer_default, NULL)
+ PHP_FE(weechat_config_string, NULL)
+ PHP_FE(weechat_config_string_default, NULL)
+ PHP_FE(weechat_config_color, NULL)
+ PHP_FE(weechat_config_color_default, NULL)
+ PHP_FE(weechat_config_write_option, NULL)
+ PHP_FE(weechat_config_write_line, NULL)
+ PHP_FE(weechat_config_write, NULL)
PHP_FE(weechat_config_read, NULL)
PHP_FE(weechat_config_reload, NULL)
- PHP_FE(weechat_config_search_option, NULL)
- PHP_FE(weechat_config_search_section, NULL)
- PHP_FE(weechat_config_section_free, NULL)
+ PHP_FE(weechat_config_option_free, NULL)
PHP_FE(weechat_config_section_free_options, NULL)
- PHP_FE(weechat_config_set_desc_plugin, NULL)
+ PHP_FE(weechat_config_section_free, NULL)
+ PHP_FE(weechat_config_free, NULL)
+ PHP_FE(weechat_config_get, NULL)
+ PHP_FE(weechat_config_get_plugin, NULL)
+ PHP_FE(weechat_config_is_set_plugin, NULL)
PHP_FE(weechat_config_set_plugin, NULL)
- PHP_FE(weechat_config_string_default, NULL)
- PHP_FE(weechat_config_string, NULL)
- PHP_FE(weechat_config_string_to_boolean, NULL)
+ PHP_FE(weechat_config_set_desc_plugin, NULL)
PHP_FE(weechat_config_unset_plugin, NULL)
- PHP_FE(weechat_config_write_line, NULL)
- PHP_FE(weechat_config_write, NULL)
- PHP_FE(weechat_config_write_option, NULL)
- PHP_FE(weechat_gettext, NULL)
- PHP_FE(weechat_hdata_char, NULL)
- PHP_FE(weechat_hdata_check_pointer, NULL)
- PHP_FE(weechat_hdata_compare, NULL)
- PHP_FE(weechat_hdata_get_list, NULL)
- PHP_FE(weechat_hdata_get, NULL)
- PHP_FE(weechat_hdata_get_string, NULL)
- PHP_FE(weechat_hdata_get_var_array_size, NULL)
- PHP_FE(weechat_hdata_get_var_array_size_string, NULL)
- PHP_FE(weechat_hdata_get_var_hdata, NULL)
- PHP_FE(weechat_hdata_get_var, NULL)
- PHP_FE(weechat_hdata_get_var_offset, NULL)
- PHP_FE(weechat_hdata_get_var_type, NULL)
- PHP_FE(weechat_hdata_get_var_type_string, NULL)
- PHP_FE(weechat_hdata_hashtable, NULL)
- PHP_FE(weechat_hdata_integer, NULL)
- PHP_FE(weechat_hdata_long, NULL)
- PHP_FE(weechat_hdata_move, NULL)
- PHP_FE(weechat_hdata_pointer, NULL)
- PHP_FE(weechat_hdata_search, NULL)
- PHP_FE(weechat_hdata_string, NULL)
- PHP_FE(weechat_hdata_time, NULL)
- PHP_FE(weechat_hdata_update, NULL)
+ PHP_FE(weechat_key_bind, NULL)
+ 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_hook_command, NULL)
- PHP_FE(weechat_hook_command_run, NULL)
+ PHP_FE(weechat_hook_completion, NULL)
PHP_FE(weechat_hook_completion_get_string, NULL)
PHP_FE(weechat_hook_completion_list_add, NULL)
- PHP_FE(weechat_hook_completion, NULL)
- PHP_FE(weechat_hook_config, NULL)
- PHP_FE(weechat_hook_connect, NULL)
+ PHP_FE(weechat_hook_command_run, NULL)
+ PHP_FE(weechat_hook_timer, NULL)
PHP_FE(weechat_hook_fd, NULL)
- PHP_FE(weechat_hook_focus, NULL)
+ PHP_FE(weechat_hook_process, NULL)
+ PHP_FE(weechat_hook_process_hashtable, NULL)
+ PHP_FE(weechat_hook_connect, NULL)
+ PHP_FE(weechat_hook_print, NULL)
+ PHP_FE(weechat_hook_signal, NULL)
+ PHP_FE(weechat_hook_signal_send, NULL)
PHP_FE(weechat_hook_hsignal, NULL)
PHP_FE(weechat_hook_hsignal_send, NULL)
+ PHP_FE(weechat_hook_config, NULL)
+ PHP_FE(weechat_hook_modifier, NULL)
+ PHP_FE(weechat_hook_modifier_exec, NULL)
+ PHP_FE(weechat_hook_info, NULL)
PHP_FE(weechat_hook_info_hashtable, NULL)
PHP_FE(weechat_hook_infolist, NULL)
- PHP_FE(weechat_hook_info, NULL)
- PHP_FE(weechat_hook_modifier_exec, NULL)
- PHP_FE(weechat_hook_modifier, NULL)
- PHP_FE(weechat_hook_print, NULL)
- PHP_FE(weechat_hook_process_hashtable, NULL)
- PHP_FE(weechat_hook_process, NULL)
+ PHP_FE(weechat_hook_focus, NULL)
PHP_FE(weechat_hook_set, NULL)
- PHP_FE(weechat_hook_signal, NULL)
- PHP_FE(weechat_hook_signal_send, NULL)
- PHP_FE(weechat_hook_timer, NULL)
- PHP_FE(weechat_iconv_from_internal, NULL)
- PHP_FE(weechat_iconv_to_internal, NULL)
- PHP_FE(weechat_info_get_hashtable, NULL)
+ PHP_FE(weechat_unhook, NULL)
+ PHP_FE(weechat_unhook_all, NULL)
+ PHP_FE(weechat_buffer_new, NULL)
+ PHP_FE(weechat_buffer_search, NULL)
+ PHP_FE(weechat_buffer_search_main, NULL)
+ PHP_FE(weechat_buffer_clear, NULL)
+ PHP_FE(weechat_buffer_close, NULL)
+ PHP_FE(weechat_buffer_merge, NULL)
+ PHP_FE(weechat_buffer_unmerge, NULL)
+ PHP_FE(weechat_buffer_get_integer, NULL)
+ PHP_FE(weechat_buffer_get_string, NULL)
+ PHP_FE(weechat_buffer_get_pointer, NULL)
+ PHP_FE(weechat_buffer_set, NULL)
+ PHP_FE(weechat_buffer_string_replace_local_var, NULL)
+ PHP_FE(weechat_buffer_match_list, NULL)
+ PHP_FE(weechat_window_search_with_buffer, NULL)
+ PHP_FE(weechat_window_get_integer, NULL)
+ PHP_FE(weechat_window_get_string, NULL)
+ PHP_FE(weechat_window_get_pointer, NULL)
+ PHP_FE(weechat_window_set_title, NULL)
+ PHP_FE(weechat_nicklist_add_group, NULL)
+ PHP_FE(weechat_nicklist_search_group, NULL)
+ PHP_FE(weechat_nicklist_add_nick, NULL)
+ PHP_FE(weechat_nicklist_search_nick, NULL)
+ PHP_FE(weechat_nicklist_remove_group, NULL)
+ PHP_FE(weechat_nicklist_remove_nick, NULL)
+ PHP_FE(weechat_nicklist_remove_all, NULL)
+ PHP_FE(weechat_nicklist_group_get_integer, NULL)
+ PHP_FE(weechat_nicklist_group_get_string, NULL)
+ PHP_FE(weechat_nicklist_group_get_pointer, NULL)
+ PHP_FE(weechat_nicklist_group_set, NULL)
+ PHP_FE(weechat_nicklist_nick_get_integer, NULL)
+ PHP_FE(weechat_nicklist_nick_get_string, NULL)
+ PHP_FE(weechat_nicklist_nick_get_pointer, NULL)
+ PHP_FE(weechat_nicklist_nick_set, NULL)
+ PHP_FE(weechat_bar_item_search, NULL)
+ PHP_FE(weechat_bar_item_new, NULL)
+ PHP_FE(weechat_bar_item_update, NULL)
+ PHP_FE(weechat_bar_item_remove, NULL)
+ PHP_FE(weechat_bar_search, NULL)
+ PHP_FE(weechat_bar_new, NULL)
+ PHP_FE(weechat_bar_set, NULL)
+ PHP_FE(weechat_bar_update, NULL)
+ PHP_FE(weechat_bar_remove, NULL)
+ PHP_FE(weechat_command, NULL)
PHP_FE(weechat_info_get, NULL)
- PHP_FE(weechat_infolist_fields, NULL)
- PHP_FE(weechat_infolist_free, NULL)
- PHP_FE(weechat_infolist_get, NULL)
- PHP_FE(weechat_infolist_integer, NULL)
- PHP_FE(weechat_infolist_new_item, NULL)
+ PHP_FE(weechat_info_get_hashtable, NULL)
PHP_FE(weechat_infolist_new, NULL)
+ PHP_FE(weechat_infolist_new_item, NULL)
PHP_FE(weechat_infolist_new_var_integer, NULL)
- PHP_FE(weechat_infolist_new_var_pointer, NULL)
PHP_FE(weechat_infolist_new_var_string, NULL)
+ PHP_FE(weechat_infolist_new_var_pointer, NULL)
PHP_FE(weechat_infolist_new_var_time, NULL)
+ PHP_FE(weechat_infolist_search_var, NULL)
+ PHP_FE(weechat_infolist_get, NULL)
PHP_FE(weechat_infolist_next, NULL)
- PHP_FE(weechat_infolist_pointer, NULL)
PHP_FE(weechat_infolist_prev, NULL)
PHP_FE(weechat_infolist_reset_item_cursor, NULL)
- PHP_FE(weechat_infolist_search_var, NULL)
+ PHP_FE(weechat_infolist_fields, NULL)
+ PHP_FE(weechat_infolist_integer, NULL)
PHP_FE(weechat_infolist_string, NULL)
+ PHP_FE(weechat_infolist_pointer, NULL)
PHP_FE(weechat_infolist_time, NULL)
- PHP_FE(weechat_key_bind, NULL)
- PHP_FE(weechat_key_unbind, NULL)
- PHP_FE(weechat_list_add, NULL)
- PHP_FE(weechat_list_casesearch, NULL)
- PHP_FE(weechat_list_casesearch_pos, NULL)
- PHP_FE(weechat_list_free, NULL)
- PHP_FE(weechat_list_get, NULL)
- PHP_FE(weechat_list_new, NULL)
- PHP_FE(weechat_list_next, NULL)
- PHP_FE(weechat_list_prev, NULL)
- PHP_FE(weechat_list_remove_all, NULL)
- PHP_FE(weechat_list_remove, NULL)
- PHP_FE(weechat_list_search, NULL)
- PHP_FE(weechat_list_search_pos, NULL)
- PHP_FE(weechat_list_set, NULL)
- PHP_FE(weechat_list_size, NULL)
- PHP_FE(weechat_list_string, NULL)
- PHP_FE(weechat_log_printf, NULL)
- PHP_FE(weechat_mkdir_home, NULL)
- PHP_FE(weechat_mkdir, NULL)
- PHP_FE(weechat_mkdir_parents, NULL)
- PHP_FE(weechat_ngettext, NULL)
- PHP_FE(weechat_nicklist_add_group, NULL)
- PHP_FE(weechat_nicklist_add_nick, NULL)
- PHP_FE(weechat_nicklist_group_get_integer, NULL)
- PHP_FE(weechat_nicklist_group_get_pointer, NULL)
- PHP_FE(weechat_nicklist_group_get_string, NULL)
- PHP_FE(weechat_nicklist_group_set, NULL)
- PHP_FE(weechat_nicklist_nick_get_integer, NULL)
- PHP_FE(weechat_nicklist_nick_get_pointer, NULL)
- PHP_FE(weechat_nicklist_nick_get_string, NULL)
- PHP_FE(weechat_nicklist_nick_set, NULL)
- PHP_FE(weechat_nicklist_remove_all, NULL)
- PHP_FE(weechat_nicklist_remove_group, NULL)
- PHP_FE(weechat_nicklist_remove_nick, NULL)
- PHP_FE(weechat_nicklist_search_group, NULL)
- PHP_FE(weechat_nicklist_search_nick, NULL)
- PHP_FE(weechat_plugin_get_name, NULL)
- PHP_FE(weechat_prefix, NULL)
- PHP_FE(weechat_printf_date_tags, NULL)
- PHP_FE(weechat_printf, NULL)
- PHP_FE(weechat_printf_y, NULL)
- PHP_FE(weechat_register, NULL)
- PHP_FE(weechat_string_eval_expression, NULL)
- PHP_FE(weechat_string_eval_path_home, NULL)
- PHP_FE(weechat_string_has_highlight, NULL)
- PHP_FE(weechat_string_has_highlight_regex, NULL)
- PHP_FE(weechat_string_input_for_buffer, NULL)
- PHP_FE(weechat_string_is_command_char, NULL)
- PHP_FE(weechat_string_mask_to_regex, NULL)
- PHP_FE(weechat_string_match, NULL)
- PHP_FE(weechat_string_remove_color, NULL)
- PHP_FE(weechat_string_replace, NULL)
- PHP_FE(weechat_strlen_screen, NULL)
- PHP_FE(weechat_unhook_all, NULL)
- PHP_FE(weechat_unhook, NULL)
- PHP_FE(weechat_upgrade_close, NULL)
+ PHP_FE(weechat_infolist_free, NULL)
+ PHP_FE(weechat_hdata_get, NULL)
+ PHP_FE(weechat_hdata_get_var_offset, NULL)
+ PHP_FE(weechat_hdata_get_var_type_string, NULL)
+ PHP_FE(weechat_hdata_get_var_array_size, NULL)
+ PHP_FE(weechat_hdata_get_var_array_size_string, NULL)
+ PHP_FE(weechat_hdata_get_var_hdata, NULL)
+ PHP_FE(weechat_hdata_get_list, NULL)
+ PHP_FE(weechat_hdata_check_pointer, NULL)
+ PHP_FE(weechat_hdata_move, NULL)
+ PHP_FE(weechat_hdata_search, NULL)
+ PHP_FE(weechat_hdata_char, NULL)
+ PHP_FE(weechat_hdata_integer, NULL)
+ PHP_FE(weechat_hdata_long, NULL)
+ PHP_FE(weechat_hdata_string, NULL)
+ PHP_FE(weechat_hdata_pointer, NULL)
+ PHP_FE(weechat_hdata_time, NULL)
+ PHP_FE(weechat_hdata_hashtable, NULL)
+ PHP_FE(weechat_hdata_compare, NULL)
+ PHP_FE(weechat_hdata_update, NULL)
+ PHP_FE(weechat_hdata_get_string, NULL)
PHP_FE(weechat_upgrade_new, NULL)
- PHP_FE(weechat_upgrade_read, NULL)
PHP_FE(weechat_upgrade_write_object, NULL)
- PHP_FE(weechat_window_get_integer, NULL)
- PHP_FE(weechat_window_get_pointer, NULL)
- PHP_FE(weechat_window_get_string, NULL)
- PHP_FE(weechat_window_search_with_buffer, NULL)
- PHP_FE(weechat_window_set_title, NULL)
+ PHP_FE(weechat_upgrade_read, NULL)
+ PHP_FE(weechat_upgrade_close, NULL)
PHP_FE(forget_class, NULL)
PHP_FE(forget_function, NULL)
PHP_FE_END
@@ -1090,9 +1088,8 @@ php_weechat_sapi_error (int type, const char *format, ...)
}
void
-php_weechat_log_message (char *message, int syslog_type_int)
+php_weechat_log_message (char *message)
{
- (void) syslog_type_int;
php_weechat_ub_write (message, strlen (message));
}
diff --git a/src/plugins/php/weechat-php.h b/src/plugins/php/weechat-php.h
index 4db39283f..c645f5657 100644
--- a/src/plugins/php/weechat-php.h
+++ b/src/plugins/php/weechat-php.h
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2006-2017 Adam Saponara <as@php.net>
+ * Copyright (C) 2017 Sébastien Helleu <flashcode@flashtux.org>
*
* This file is part of WeeChat, the extensible chat client.
*
@@ -44,7 +45,8 @@ extern struct t_plugin_script *php_current_script;
extern struct t_plugin_script *php_registered_script;
extern const char *php_current_script_filename;
-extern void weechat_php_hashtable_to_array (struct t_hashtable *hashtable, zval *arr);
+extern void weechat_php_hashtable_to_array (struct t_hashtable *hashtable,
+ zval *arr);
extern struct t_hashtable *weechat_php_array_to_hashtable (zval* arr,
int size,
const char *type_keys,