Lines Matching refs:pce

169 	pcre_cache_entry *pce = (pcre_cache_entry *) Z_PTR_P(data);  in php_free_pcre_cache()  local
170 if (!pce) return; in php_free_pcre_cache()
171 pcre2_code_free(pce->re); in php_free_pcre_cache()
172 free(pce); in php_free_pcre_cache()
178 pcre_cache_entry *pce = (pcre_cache_entry *) Z_PTR_P(data); in php_efree_pcre_cache() local
179 if (!pce) return; in php_efree_pcre_cache()
180 pcre2_code_free(pce->re); in php_efree_pcre_cache()
181 efree(pce); in php_efree_pcre_cache()
516 pcre_cache_entry *pce = (pcre_cache_entry *) Z_PTR_P(data); in pcre_clean_cache() local
519 if (*num_clean > 0 && !pce->refcount) { in pcre_clean_cache()
539 static zend_string **make_subpats_table(uint32_t num_subpats, pcre_cache_entry *pce) in make_subpats_table() argument
541 uint32_t name_cnt = pce->name_count, name_size, ni = 0; in make_subpats_table()
546 rc1 = pcre2_pattern_info(pce->re, PCRE2_INFO_NAMETABLE, &name_table); in make_subpats_table()
547 rc2 = pcre2_pattern_info(pce->re, PCRE2_INFO_NAMEENTRYSIZE, &name_size); in make_subpats_table()
571 static zend_always_inline size_t calculate_unit_length(pcre_cache_entry *pce, const char *start) in calculate_unit_length() argument
575 if (pce->compile_options & PCRE2_UTF) { in calculate_unit_length()
903 pcre_cache_entry * pce = pcre_get_compiled_regex_cache(regex); in pcre_get_compiled_regex() local
906 *capture_count = pce ? pce->capture_count : 0; in pcre_get_compiled_regex()
909 return pce ? pce->re : NULL; in pcre_get_compiled_regex()
1100 pcre_cache_entry *pce; /* Compiled regular expression */ in php_do_pcre_match() local
1115 if ((pce = pcre_get_compiled_regex_cache(regex)) == NULL) { in php_do_pcre_match()
1119 pce->refcount++; in php_do_pcre_match()
1120 php_pcre_match_impl(pce, subject, return_value, subpats, in php_do_pcre_match()
1122 pce->refcount--; in php_do_pcre_match()
1143 PHPAPI void php_pcre_match_impl(pcre_cache_entry *pce, zend_string *subject_str, zval *return_value, in php_pcre_match_impl() argument
1218 num_subpats = pce->capture_count + 1; in php_pcre_match_impl()
1225 if (subpats && pce->name_count > 0) { in php_pcre_match_impl()
1226 subpat_names = make_subpats_table(num_subpats, pce); in php_pcre_match_impl()
1246 match_data = pcre2_match_data_create_from_pattern(pce->re, PCRE_G(gctx_zmm)); in php_pcre_match_impl()
1261 (pce->compile_options & PCRE2_UTF) && !is_known_valid_utf8(subject_str, orig_start_offset) in php_pcre_match_impl()
1266 if ((pce->preg_options & PREG_JIT) && options) { in php_pcre_match_impl()
1267 count = pcre2_jit_match(pce->re, (PCRE2_SPTR)subject, subject_len, start_offset2, in php_pcre_match_impl()
1271 count = pcre2_match(pce->re, (PCRE2_SPTR)subject, subject_len, start_offset2, in php_pcre_match_impl()
1370 count = pcre2_match(pce->re, (PCRE2_SPTR)subject, subject_len, start_offset2, in php_pcre_match_impl()
1384 size_t unit_len = calculate_unit_length(pce, subject + start_offset2); in php_pcre_match_impl()
1408 if ((pce->preg_options & PREG_JIT)) { in php_pcre_match_impl()
1413 count = pcre2_jit_match(pce->re, (PCRE2_SPTR)subject, subject_len, start_offset2, in php_pcre_match_impl()
1417 count = pcre2_match(pce->re, (PCRE2_SPTR)subject, subject_len, start_offset2, in php_pcre_match_impl()
1452 if ((pce->compile_options & PCRE2_UTF) in php_pcre_match_impl()
1558 pcre_cache_entry *pce; /* Compiled regular expression */ in php_pcre_replace() local
1567 if ((pce = pcre_get_compiled_regex_cache(regex)) == NULL) { in php_pcre_replace()
1570 pce->refcount++; in php_pcre_replace()
1571 result = php_pcre_replace_impl(pce, subject_str, subject, subject_len, replace_str, in php_pcre_replace()
1573 pce->refcount--; in php_pcre_replace()
1580 PHPAPI zend_string *php_pcre_replace_impl(pcre_cache_entry *pce, zend_string *subject_str, const ch… in php_pcre_replace_impl() argument
1603 num_subpats = pce->capture_count + 1; in php_pcre_replace_impl()
1617 match_data = pcre2_match_data_create_from_pattern(pce->re, PCRE_G(gctx_zmm)); in php_pcre_replace_impl()
1624 options = (pce->compile_options & PCRE2_UTF) ? 0 : PCRE2_NO_UTF_CHECK; in php_pcre_replace_impl()
1628 if ((pce->preg_options & PREG_JIT) && options) { in php_pcre_replace_impl()
1629 count = pcre2_jit_match(pce->re, (PCRE2_SPTR)subject, subject_len, start_offset, in php_pcre_replace_impl()
1633 count = pcre2_match(pce->re, (PCRE2_SPTR)subject, subject_len, start_offset, in php_pcre_replace_impl()
1751 count = pcre2_match(pce->re, (PCRE2_SPTR)subject, subject_len, start_offset, in php_pcre_replace_impl()
1763 size_t unit_len = calculate_unit_length(pce, piece); in php_pcre_replace_impl()
1803 if (pce->preg_options & PREG_JIT) { in php_pcre_replace_impl()
1804 count = pcre2_jit_match(pce->re, (PCRE2_SPTR)subject, subject_len, start_offset, in php_pcre_replace_impl()
1808 count = pcre2_match(pce->re, (PCRE2_SPTR)subject, subject_len, start_offset, in php_pcre_replace_impl()
1820 static zend_string *php_pcre_replace_func_impl(pcre_cache_entry *pce, zend_string *subject_str, con… in php_pcre_replace_func_impl() argument
1840 num_subpats = pce->capture_count + 1; in php_pcre_replace_func_impl()
1847 if (UNEXPECTED(pce->name_count > 0)) { in php_pcre_replace_func_impl()
1848 subpat_names = make_subpats_table(num_subpats, pce); in php_pcre_replace_func_impl()
1869 match_data = pcre2_match_data_create_from_pattern(pce->re, PCRE_G(gctx_zmm)); in php_pcre_replace_func_impl()
1880 options = (pce->compile_options & PCRE2_UTF) ? 0 : PCRE2_NO_UTF_CHECK; in php_pcre_replace_func_impl()
1884 if ((pce->preg_options & PREG_JIT) && options) { in php_pcre_replace_func_impl()
1885 count = pcre2_jit_match(pce->re, (PCRE2_SPTR)subject, subject_len, start_offset, in php_pcre_replace_func_impl()
1889 count = pcre2_match(pce->re, (PCRE2_SPTR)subject, subject_len, start_offset, in php_pcre_replace_func_impl()
1960 count = pcre2_match(pce->re, (PCRE2_SPTR)subject, subject_len, start_offset, in php_pcre_replace_func_impl()
1972 size_t unit_len = calculate_unit_length(pce, piece); in php_pcre_replace_func_impl()
2011 if ((pce->preg_options & PREG_JIT)) { in php_pcre_replace_func_impl()
2012 count = pcre2_jit_match(pce->re, (PCRE2_SPTR)subject, subject_len, start_offset, in php_pcre_replace_func_impl()
2016 count = pcre2_match(pce->re, (PCRE2_SPTR)subject, subject_len, start_offset, in php_pcre_replace_func_impl()
2038 pcre_cache_entry *pce; /* Compiled regular expression */ in php_pcre_replace_func() local
2042 if ((pce = pcre_get_compiled_regex_cache(regex)) == NULL) { in php_pcre_replace_func()
2045 pce->refcount++; in php_pcre_replace_func()
2047 pce, subject_str, ZSTR_VAL(subject_str), ZSTR_LEN(subject_str), fci, fcc, in php_pcre_replace_func()
2049 pce->refcount--; in php_pcre_replace_func()
2478 pcre_cache_entry *pce; /* Compiled regular expression */ in PHP_FUNCTION() local
2490 if ((pce = pcre_get_compiled_regex_cache(regex)) == NULL) { in PHP_FUNCTION()
2494 pce->refcount++; in PHP_FUNCTION()
2495 php_pcre_split_impl(pce, subject, return_value, limit_val, flags); in PHP_FUNCTION()
2496 pce->refcount--; in PHP_FUNCTION()
2501 PHPAPI void php_pcre_split_impl(pcre_cache_entry *pce, zend_string *subject_str, zval *return_value, in php_pcre_split_impl() argument
2525 num_subpats = pce->capture_count + 1; in php_pcre_split_impl()
2543 match_data = pcre2_match_data_create_from_pattern(pce->re, PCRE_G(gctx_zmm)); in php_pcre_split_impl()
2551 options = (pce->compile_options & PCRE2_UTF) ? 0 : PCRE2_NO_UTF_CHECK; in php_pcre_split_impl()
2554 if ((pce->preg_options & PREG_JIT) && options) { in php_pcre_split_impl()
2555 count = pcre2_jit_match(pce->re, (PCRE2_SPTR)subject, ZSTR_LEN(subject_str), start_offset, in php_pcre_split_impl()
2559 count = pcre2_match(pce->re, (PCRE2_SPTR)subject, ZSTR_LEN(subject_str), start_offset, in php_pcre_split_impl()
2624 count = pcre2_match(pce->re, (PCRE2_SPTR)subject, ZSTR_LEN(subject_str), start_offset, in php_pcre_split_impl()
2634 start_offset += calculate_unit_length(pce, subject + start_offset); in php_pcre_split_impl()
2657 if (pce->preg_options & PREG_JIT) { in php_pcre_split_impl()
2658 count = pcre2_jit_match(pce->re, (PCRE2_SPTR)subject, ZSTR_LEN(subject_str), start_offset, in php_pcre_split_impl()
2662 count = pcre2_match(pce->re, (PCRE2_SPTR)subject, ZSTR_LEN(subject_str), start_offset, in php_pcre_split_impl()
2836 pcre_cache_entry *pce; /* Compiled regular expression */ in PHP_FUNCTION() local
2847 if ((pce = pcre_get_compiled_regex_cache(regex)) == NULL) { in PHP_FUNCTION()
2851 pce->refcount++; in PHP_FUNCTION()
2852 php_pcre_grep_impl(pce, input, return_value, flags); in PHP_FUNCTION()
2853 pce->refcount--; in PHP_FUNCTION()
2857 PHPAPI void php_pcre_grep_impl(pcre_cache_entry *pce, zval *input, zval *return_value, zend_long f… in php_pcre_grep_impl() argument
2871 num_subpats = pce->capture_count + 1; in php_pcre_grep_impl()
2881 match_data = pcre2_match_data_create_from_pattern(pce->re, PCRE_G(gctx_zmm)); in php_pcre_grep_impl()
2888 options = (pce->compile_options & PCRE2_UTF) ? 0 : PCRE2_NO_UTF_CHECK; in php_pcre_grep_impl()
2897 if ((pce->preg_options & PREG_JIT) && options) { in php_pcre_grep_impl()
2898 count = pcre2_jit_match(pce->re, (PCRE2_SPTR)ZSTR_VAL(subject_str), ZSTR_LEN(subject_str), 0, in php_pcre_grep_impl()
2902 count = pcre2_match(pce->re, (PCRE2_SPTR)ZSTR_VAL(subject_str), ZSTR_LEN(subject_str), 0, in php_pcre_grep_impl()
3004 PHPAPI void php_pcre_pce_incref(pcre_cache_entry *pce) in php_pcre_pce_incref() argument
3006 assert(NULL != pce); in php_pcre_pce_incref()
3007 pce->refcount++; in php_pcre_pce_incref()
3010 PHPAPI void php_pcre_pce_decref(pcre_cache_entry *pce) in php_pcre_pce_decref() argument
3012 assert(NULL != pce); in php_pcre_pce_decref()
3013 assert(0 != pce->refcount); in php_pcre_pce_decref()
3014 pce->refcount--; in php_pcre_pce_decref()
3017 PHPAPI pcre2_code *php_pcre_pce_re(pcre_cache_entry *pce) in php_pcre_pce_re() argument
3019 assert(NULL != pce); in php_pcre_pce_re()
3020 return pce->re; in php_pcre_pce_re()