Lines Matching refs:pattern
34 zend_string *pattern; member
71 zend_string_release_ex(entry->pattern, 0);
81 zend_string_release_ex(entry->pattern, 1); in browscap_entry_dtor_persistent()
93 static uint8_t browscap_compute_prefix_len(zend_string *pattern) { in browscap_compute_prefix_len() argument
95 for (i = 0; i < ZSTR_LEN(pattern); i++) { in browscap_compute_prefix_len()
96 if (is_placeholder(ZSTR_VAL(pattern)[i])) { in browscap_compute_prefix_len()
104 zend_string *pattern, size_t start_pos, in browscap_compute_contains() argument
108 for (; i < ZSTR_LEN(pattern); i++) { in browscap_compute_contains()
109 if (!is_placeholder(ZSTR_VAL(pattern)[i])) { in browscap_compute_contains()
112 if (i + 1 < ZSTR_LEN(pattern) && in browscap_compute_contains()
113 !is_placeholder(ZSTR_VAL(pattern)[i + 1])) { in browscap_compute_contains()
121 for (; i < ZSTR_LEN(pattern); i++) { in browscap_compute_contains()
122 if (is_placeholder(ZSTR_VAL(pattern)[i])) { in browscap_compute_contains()
131 static size_t browscap_compute_regex_len(zend_string *pattern) { in browscap_compute_regex_len() argument
132 size_t i, len = ZSTR_LEN(pattern); in browscap_compute_regex_len()
133 for (i = 0; i < ZSTR_LEN(pattern); i++) { in browscap_compute_regex_len()
134 switch (ZSTR_VAL(pattern)[i]) { in browscap_compute_regex_len() local
150 static zend_string *browscap_convert_pattern(zend_string *pattern, int persistent) /* {{{ */ in browscap_convert_pattern() argument
158 res = zend_string_alloc(browscap_compute_regex_len(pattern), persistent); in browscap_convert_pattern()
161 lc_pattern = do_alloca(ZSTR_LEN(pattern) + 1, use_heap); in browscap_convert_pattern()
162 zend_str_tolower_copy(lc_pattern, ZSTR_VAL(pattern), ZSTR_LEN(pattern)); in browscap_convert_pattern()
167 for (i = 0; i < ZSTR_LEN(pattern); i++, j++) { in browscap_convert_pattern()
281 ZVAL_STR(&tmp, browscap_convert_pattern(entry->pattern, 0)); in browscap_entry_to_array()
284 ZVAL_STR_COPY(&tmp, entry->pattern); in browscap_entry_to_array()
357 zend_string *pattern = Z_STR_P(arg1); in php_browscap_parser_cb() local
361 if (ZSTR_LEN(pattern) > UINT16_MAX) { in php_browscap_parser_cb()
363 "Skipping excessively long pattern of length %zd", ZSTR_LEN(pattern)); in php_browscap_parser_cb()
368 pattern = zend_new_interned_string(zend_string_copy(pattern)); in php_browscap_parser_cb()
369 if (ZSTR_IS_INTERNED(pattern)) { in php_browscap_parser_cb()
372 zend_string_release(pattern); in php_browscap_parser_cb()
378 zend_hash_update_ptr(bdata->htab, pattern, entry); in php_browscap_parser_cb()
383 ctx->current_section_name = zend_string_copy(pattern); in php_browscap_parser_cb()
385 entry->pattern = zend_string_copy(pattern); in php_browscap_parser_cb()
389 pos = entry->prefix_len = browscap_compute_prefix_len(pattern); in php_browscap_parser_cb()
391 pos = browscap_compute_contains(pattern, pos, in php_browscap_parser_cb()
566 ZSTR_VAL(entry->pattern), entry->prefix_len) != 0) { in browser_reg_compare()
571 ZSTR_ALLOCA_ALLOC(pattern_lc, ZSTR_LEN(entry->pattern), use_heap); in browser_reg_compare()
572 zend_str_tolower_copy(ZSTR_VAL(pattern_lc), ZSTR_VAL(entry->pattern), ZSTR_LEN(entry->pattern)); in browser_reg_compare()
597 regex = browscap_convert_pattern(entry->pattern, 0); in browser_reg_compare()
619 zend_string *previous_match = found_entry->pattern; in browser_reg_compare()
620 zend_string *current_match = entry->pattern; in browser_reg_compare()