Lines Matching refs:pattern
32 zend_string *pattern; member
69 zend_string_release_ex(entry->pattern, 0);
79 zend_string_release_ex(entry->pattern, 1); in browscap_entry_dtor_persistent()
91 static uint8_t browscap_compute_prefix_len(const zend_string *pattern) { in browscap_compute_prefix_len() argument
93 for (i = 0; i < ZSTR_LEN(pattern); i++) { in browscap_compute_prefix_len()
94 if (is_placeholder(ZSTR_VAL(pattern)[i])) { in browscap_compute_prefix_len()
102 zend_string *pattern, size_t start_pos, in browscap_compute_contains() argument
106 for (; i < ZSTR_LEN(pattern); i++) { in browscap_compute_contains()
107 if (!is_placeholder(ZSTR_VAL(pattern)[i])) { in browscap_compute_contains()
110 if (i + 1 < ZSTR_LEN(pattern) && in browscap_compute_contains()
111 !is_placeholder(ZSTR_VAL(pattern)[i + 1])) { in browscap_compute_contains()
119 for (; i < ZSTR_LEN(pattern); i++) { in browscap_compute_contains()
120 if (is_placeholder(ZSTR_VAL(pattern)[i])) { in browscap_compute_contains()
129 static size_t browscap_compute_regex_len(const zend_string *pattern) { in browscap_compute_regex_len() argument
130 size_t i, len = ZSTR_LEN(pattern); in browscap_compute_regex_len()
131 for (i = 0; i < ZSTR_LEN(pattern); i++) { in browscap_compute_regex_len()
132 switch (ZSTR_VAL(pattern)[i]) { in browscap_compute_regex_len() local
148 static zend_string *browscap_convert_pattern(const zend_string *pattern, bool persistent) /* {{{ */ in browscap_convert_pattern() argument
154 res = zend_string_alloc(browscap_compute_regex_len(pattern), persistent); in browscap_convert_pattern()
160 for (i = 0; i < ZSTR_LEN(pattern); i++, j++) { in browscap_convert_pattern()
161 char c = ZSTR_VAL(pattern)[i]; in browscap_convert_pattern()
280 ZVAL_STR(&tmp, browscap_convert_pattern(entry->pattern, 0)); in browscap_entry_to_array()
286 ZVAL_STR_COPY(&tmp, entry->pattern); in browscap_entry_to_array()
362 zend_string *pattern = Z_STR_P(arg1); in php_browscap_parser_cb() local
366 if (ZSTR_LEN(pattern) > UINT16_MAX) { in php_browscap_parser_cb()
368 "Skipping excessively long pattern of length %zd", ZSTR_LEN(pattern)); in php_browscap_parser_cb()
373 pattern = zend_new_interned_string(zend_string_copy(pattern)); in php_browscap_parser_cb()
374 if (ZSTR_IS_INTERNED(pattern)) { in php_browscap_parser_cb()
377 zend_string_release(pattern); in php_browscap_parser_cb()
383 zend_hash_update_ptr(bdata->htab, pattern, entry); in php_browscap_parser_cb()
388 ctx->current_section_name = zend_string_copy(pattern); in php_browscap_parser_cb()
390 entry->pattern = zend_string_copy(pattern); in php_browscap_parser_cb()
394 pos = entry->prefix_len = browscap_compute_prefix_len(pattern); in php_browscap_parser_cb()
396 pos = browscap_compute_contains(pattern, pos, in php_browscap_parser_cb()
550 static bool browscap_match_string_wildcard(const char *s, const char *s_end, const char *pattern, c… in browscap_match_string_wildcard() argument
552 const char *pattern_current = pattern; in browscap_match_string_wildcard()
633 ZSTR_ALLOCA_ALLOC(pattern_lc, ZSTR_LEN(entry->pattern), use_heap); in browser_reg_compare()
634 zend_str_tolower_copy(ZSTR_VAL(pattern_lc), ZSTR_VAL(entry->pattern), ZSTR_LEN(entry->pattern)); in browser_reg_compare()
670 const zend_string *current_match = entry->pattern; in browser_reg_compare()
765 if (ZSTR_VAL(lookup_browser_name)[i] != zend_tolower_ascii(ZSTR_VAL(entry->pattern)[i])) { in PHP_FUNCTION()