1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-29 22:36:38 +02:00

php: add function "hdata_compare"

This commit is contained in:
Sébastien Helleu
2017-09-03 12:50:48 +02:00
parent 6a45c5e243
commit baa1d5fbc9
3 changed files with 29 additions and 0 deletions
+27
View File
@@ -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);
+1
View File
@@ -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);
+1
View File
@@ -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)