summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2017-09-03 12:50:48 +0200
committerSébastien Helleu <flashcode@flashtux.org>2017-09-03 15:34:29 +0200
commitbaa1d5fbc92f944aa4198d5b7665b7483b6e3ca8 (patch)
tree86a9f9578be9e2f3c8018ec059ac2f51dcdd913b
parent6a45c5e2432991b320bbae2d96d707690f5bc63c (diff)
downloadweechat-baa1d5fbc92f944aa4198d5b7665b7483b6e3ca8.zip
php: add function "hdata_compare"
-rw-r--r--src/plugins/php/weechat-php-api.c27
-rw-r--r--src/plugins/php/weechat-php-api.h1
-rw-r--r--src/plugins/php/weechat-php.c1
3 files changed, 29 insertions, 0 deletions
diff --git a/src/plugins/php/weechat-php-api.c b/src/plugins/php/weechat-php-api.c
index d7caf14f2..f0acc514f 100644
--- a/src/plugins/php/weechat-php-api.c
+++ b/src/plugins/php/weechat-php-api.c
@@ -1470,6 +1470,33 @@ PHP_FUNCTION(weechat_hdata_check_pointer)
RETURN_LONG(retval);
}
+PHP_FUNCTION(weechat_hdata_compare)
+{
+ 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)
+ {
+ 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);
+}
+
PHP_FUNCTION(weechat_hdata_get)
{
API_FUNC_INIT(weechat_hdata_get);
diff --git a/src/plugins/php/weechat-php-api.h b/src/plugins/php/weechat-php-api.h
index eadab84b9..600b2c7ff 100644
--- a/src/plugins/php/weechat-php-api.h
+++ b/src/plugins/php/weechat-php-api.h
@@ -90,6 +90,7 @@ 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);
diff --git a/src/plugins/php/weechat-php.c b/src/plugins/php/weechat-php.c
index 94a42f226..87be03395 100644
--- a/src/plugins/php/weechat-php.c
+++ b/src/plugins/php/weechat-php.c
@@ -114,6 +114,7 @@ const zend_function_entry weechat_functions[] = {
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)