summaryrefslogtreecommitdiff
path: root/src/plugins/php/weechat-php-api.c
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 /src/plugins/php/weechat-php-api.c
parent6a45c5e2432991b320bbae2d96d707690f5bc63c (diff)
downloadweechat-baa1d5fbc92f944aa4198d5b7665b7483b6e3ca8.zip
php: add function "hdata_compare"
Diffstat (limited to 'src/plugins/php/weechat-php-api.c')
-rw-r--r--src/plugins/php/weechat-php-api.c27
1 files changed, 27 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);