mirror of
https://github.com/weechat/weechat.git
synced 2026-06-29 22:36:38 +02:00
api: add function string_match_list
This commit is contained in:
@@ -396,6 +396,29 @@ API_FUNC(string_match)
|
||||
API_RETURN_INT(result);
|
||||
}
|
||||
|
||||
API_FUNC(string_match_list)
|
||||
{
|
||||
zend_string *z_string, *z_masks;
|
||||
zend_long z_case_sensitive;
|
||||
int case_sensitive, result;
|
||||
char *string, *masks;
|
||||
|
||||
API_INIT_FUNC(1, "string_match_list", API_RETURN_INT(0));
|
||||
if (zend_parse_parameters (ZEND_NUM_ARGS(), "SSl", &z_string, &z_masks,
|
||||
&z_case_sensitive) == FAILURE)
|
||||
API_WRONG_ARGS(API_RETURN_INT(0));
|
||||
|
||||
string = ZSTR_VAL(z_string);
|
||||
masks = ZSTR_VAL(z_masks);
|
||||
case_sensitive = (int)z_case_sensitive;
|
||||
result = plugin_script_api_string_match_list (weechat_php_plugin,
|
||||
(const char *)string,
|
||||
(const char *)masks,
|
||||
case_sensitive);
|
||||
|
||||
API_RETURN_INT(result);
|
||||
}
|
||||
|
||||
API_FUNC(string_has_highlight)
|
||||
{
|
||||
zend_string *z_string, *z_highlight_words;
|
||||
|
||||
@@ -54,6 +54,7 @@ PHP_FUNCTION(weechat_gettext);
|
||||
PHP_FUNCTION(weechat_ngettext);
|
||||
PHP_FUNCTION(weechat_strlen_screen);
|
||||
PHP_FUNCTION(weechat_string_match);
|
||||
PHP_FUNCTION(weechat_string_match_list);
|
||||
PHP_FUNCTION(weechat_string_has_highlight);
|
||||
PHP_FUNCTION(weechat_string_has_highlight_regex);
|
||||
PHP_FUNCTION(weechat_string_mask_to_regex);
|
||||
|
||||
@@ -108,6 +108,7 @@ const zend_function_entry weechat_functions[] = {
|
||||
PHP_FE(weechat_ngettext, NULL)
|
||||
PHP_FE(weechat_strlen_screen, NULL)
|
||||
PHP_FE(weechat_string_match, NULL)
|
||||
PHP_FE(weechat_string_match_list, NULL)
|
||||
PHP_FE(weechat_string_has_highlight, NULL)
|
||||
PHP_FE(weechat_string_has_highlight_regex, NULL)
|
||||
PHP_FE(weechat_string_mask_to_regex, NULL)
|
||||
|
||||
Reference in New Issue
Block a user