Lines Matching refs:pce

145 	pcre_cache_entry *pce = (pcre_cache_entry *) Z_PTR_P(data);  in php_free_pcre_cache()  local
146 if (!pce) return; in php_free_pcre_cache()
147 pcre2_code_free(pce->re); in php_free_pcre_cache()
148 free(pce); in php_free_pcre_cache()
154 pcre_cache_entry *pce = (pcre_cache_entry *) Z_PTR_P(data); in php_efree_pcre_cache() local
155 if (!pce) return; in php_efree_pcre_cache()
156 pcre2_code_free(pce->re); in php_efree_pcre_cache()
157 efree(pce); in php_efree_pcre_cache()
502 pcre_cache_entry *pce = (pcre_cache_entry *) Z_PTR_P(data); in pcre_clean_cache() local
505 if (*num_clean > 0 && !pce->refcount) { in pcre_clean_cache()
525 static zend_string **make_subpats_table(uint32_t num_subpats, pcre_cache_entry *pce) in make_subpats_table() argument
527 uint32_t name_cnt = pce->name_count, name_size, ni = 0; in make_subpats_table()
532 rc1 = pcre2_pattern_info(pce->re, PCRE2_INFO_NAMETABLE, &name_table); in make_subpats_table()
533 rc2 = pcre2_pattern_info(pce->re, PCRE2_INFO_NAMEENTRYSIZE, &name_size); in make_subpats_table()
557 static zend_always_inline size_t calculate_unit_length(pcre_cache_entry *pce, char *start) in calculate_unit_length() argument
561 if (pce->compile_options & PCRE2_UTF) { in calculate_unit_length()
906 pcre_cache_entry * pce = pcre_get_compiled_regex_cache(regex); in pcre_get_compiled_regex() local
909 *capture_count = pce ? pce->capture_count : 0; in pcre_get_compiled_regex()
912 return pce ? pce->re : NULL; in pcre_get_compiled_regex()
920 pcre_cache_entry * pce = pcre_get_compiled_regex_cache(regex); in pcre_get_compiled_regex_ex() local
923 *preg_options = pce ? pce->preg_options : 0; in pcre_get_compiled_regex_ex()
926 *compile_options = pce ? pce->compile_options : 0; in pcre_get_compiled_regex_ex()
929 *capture_count = pce ? pce->capture_count : 0; in pcre_get_compiled_regex_ex()
932 return pce ? pce->re : NULL; in pcre_get_compiled_regex_ex()
1129 pcre_cache_entry *pce; /* Compiled regular expression */ in php_do_pcre_match() local
1144 if ((pce = pcre_get_compiled_regex_cache(regex)) == NULL) { in php_do_pcre_match()
1148 pce->refcount++; in php_do_pcre_match()
1149 php_pcre_match_impl(pce, subject, return_value, subpats, in php_do_pcre_match()
1151 pce->refcount--; in php_do_pcre_match()
1172 PHPAPI void php_pcre_match_impl(pcre_cache_entry *pce, zend_string *subject_str, zval *return_value, in php_pcre_match_impl() argument
1247 num_subpats = pce->capture_count + 1; in php_pcre_match_impl()
1254 if (subpats && pce->name_count > 0) { in php_pcre_match_impl()
1255 subpat_names = make_subpats_table(num_subpats, pce); in php_pcre_match_impl()
1275 match_data = pcre2_match_data_create_from_pattern(pce->re, gctx); in php_pcre_match_impl()
1290 (pce->compile_options & PCRE2_UTF) && !is_known_valid_utf8(subject_str, orig_start_offset) in php_pcre_match_impl()
1295 if ((pce->preg_options & PREG_JIT) && options) { in php_pcre_match_impl()
1296 count = pcre2_jit_match(pce->re, (PCRE2_SPTR)subject, subject_len, start_offset2, in php_pcre_match_impl()
1300 count = pcre2_match(pce->re, (PCRE2_SPTR)subject, subject_len, start_offset2, in php_pcre_match_impl()
1399 count = pcre2_match(pce->re, (PCRE2_SPTR)subject, subject_len, start_offset2, in php_pcre_match_impl()
1413 size_t unit_len = calculate_unit_length(pce, subject + start_offset2); in php_pcre_match_impl()
1437 if ((pce->preg_options & PREG_JIT)) { in php_pcre_match_impl()
1442 count = pcre2_jit_match(pce->re, (PCRE2_SPTR)subject, subject_len, start_offset2, in php_pcre_match_impl()
1446 count = pcre2_match(pce->re, (PCRE2_SPTR)subject, subject_len, start_offset2, in php_pcre_match_impl()
1481 if ((pce->compile_options & PCRE2_UTF) in php_pcre_match_impl()
1593 pcre_cache_entry *pce; /* Compiled regular expression */ in php_pcre_replace() local
1602 if ((pce = pcre_get_compiled_regex_cache(regex)) == NULL) { in php_pcre_replace()
1605 pce->refcount++; in php_pcre_replace()
1606 result = php_pcre_replace_impl(pce, subject_str, subject, subject_len, replace_str, in php_pcre_replace()
1608 pce->refcount--; in php_pcre_replace()
1615 PHPAPI zend_string *php_pcre_replace_impl(pcre_cache_entry *pce, zend_string *subject_str, char *su… in php_pcre_replace_impl() argument
1638 num_subpats = pce->capture_count + 1; in php_pcre_replace_impl()
1652 match_data = pcre2_match_data_create_from_pattern(pce->re, gctx); in php_pcre_replace_impl()
1659 options = (pce->compile_options & PCRE2_UTF) ? 0 : PCRE2_NO_UTF_CHECK; in php_pcre_replace_impl()
1663 if ((pce->preg_options & PREG_JIT) && options) { in php_pcre_replace_impl()
1664 count = pcre2_jit_match(pce->re, (PCRE2_SPTR)subject, subject_len, start_offset, in php_pcre_replace_impl()
1668 count = pcre2_match(pce->re, (PCRE2_SPTR)subject, subject_len, start_offset, in php_pcre_replace_impl()
1786 count = pcre2_match(pce->re, (PCRE2_SPTR)subject, subject_len, start_offset, in php_pcre_replace_impl()
1798 size_t unit_len = calculate_unit_length(pce, piece); in php_pcre_replace_impl()
1838 if (pce->preg_options & PREG_JIT) { in php_pcre_replace_impl()
1839 count = pcre2_jit_match(pce->re, (PCRE2_SPTR)subject, subject_len, start_offset, in php_pcre_replace_impl()
1843 count = pcre2_match(pce->re, (PCRE2_SPTR)subject, subject_len, start_offset, in php_pcre_replace_impl()
1855 static zend_string *php_pcre_replace_func_impl(pcre_cache_entry *pce, zend_string *subject_str, cha… in php_pcre_replace_func_impl() argument
1875 num_subpats = pce->capture_count + 1; in php_pcre_replace_func_impl()
1882 if (UNEXPECTED(pce->name_count > 0)) { in php_pcre_replace_func_impl()
1883 subpat_names = make_subpats_table(num_subpats, pce); in php_pcre_replace_func_impl()
1904 match_data = pcre2_match_data_create_from_pattern(pce->re, gctx); in php_pcre_replace_func_impl()
1915 options = (pce->compile_options & PCRE2_UTF) ? 0 : PCRE2_NO_UTF_CHECK; in php_pcre_replace_func_impl()
1919 if ((pce->preg_options & PREG_JIT) && options) { in php_pcre_replace_func_impl()
1920 count = pcre2_jit_match(pce->re, (PCRE2_SPTR)subject, subject_len, start_offset, in php_pcre_replace_func_impl()
1924 count = pcre2_match(pce->re, (PCRE2_SPTR)subject, subject_len, start_offset, in php_pcre_replace_func_impl()
1995 count = pcre2_match(pce->re, (PCRE2_SPTR)subject, subject_len, start_offset, in php_pcre_replace_func_impl()
2007 size_t unit_len = calculate_unit_length(pce, piece); in php_pcre_replace_func_impl()
2046 if ((pce->preg_options & PREG_JIT)) { in php_pcre_replace_func_impl()
2047 count = pcre2_jit_match(pce->re, (PCRE2_SPTR)subject, subject_len, start_offset, in php_pcre_replace_func_impl()
2051 count = pcre2_match(pce->re, (PCRE2_SPTR)subject, subject_len, start_offset, in php_pcre_replace_func_impl()
2074 pcre_cache_entry *pce; /* Compiled regular expression */ in php_pcre_replace_func() local
2078 if ((pce = pcre_get_compiled_regex_cache(regex)) == NULL) { in php_pcre_replace_func()
2081 pce->refcount++; in php_pcre_replace_func()
2083 pce, subject_str, ZSTR_VAL(subject_str), ZSTR_LEN(subject_str), fci, fcc, in php_pcre_replace_func()
2085 pce->refcount--; in php_pcre_replace_func()
2510 pcre_cache_entry *pce; /* Compiled regular expression */ in PHP_FUNCTION() local
2522 if ((pce = pcre_get_compiled_regex_cache(regex)) == NULL) { in PHP_FUNCTION()
2526 pce->refcount++; in PHP_FUNCTION()
2527 php_pcre_split_impl(pce, subject, return_value, limit_val, flags); in PHP_FUNCTION()
2528 pce->refcount--; in PHP_FUNCTION()
2534 PHPAPI void php_pcre_split_impl(pcre_cache_entry *pce, zend_string *subject_str, zval *return_value, in php_pcre_split_impl() argument
2558 num_subpats = pce->capture_count + 1; in php_pcre_split_impl()
2576 match_data = pcre2_match_data_create_from_pattern(pce->re, gctx); in php_pcre_split_impl()
2584 options = (pce->compile_options & PCRE2_UTF) ? 0 : PCRE2_NO_UTF_CHECK; in php_pcre_split_impl()
2587 if ((pce->preg_options & PREG_JIT) && options) { in php_pcre_split_impl()
2588 count = pcre2_jit_match(pce->re, (PCRE2_SPTR)subject, ZSTR_LEN(subject_str), start_offset, in php_pcre_split_impl()
2592 count = pcre2_match(pce->re, (PCRE2_SPTR)subject, ZSTR_LEN(subject_str), start_offset, in php_pcre_split_impl()
2657 count = pcre2_match(pce->re, (PCRE2_SPTR)subject, ZSTR_LEN(subject_str), start_offset, in php_pcre_split_impl()
2667 start_offset += calculate_unit_length(pce, subject + start_offset); in php_pcre_split_impl()
2690 if (pce->preg_options & PREG_JIT) { in php_pcre_split_impl()
2691 count = pcre2_jit_match(pce->re, (PCRE2_SPTR)subject, ZSTR_LEN(subject_str), start_offset, in php_pcre_split_impl()
2695 count = pcre2_match(pce->re, (PCRE2_SPTR)subject, ZSTR_LEN(subject_str), start_offset, in php_pcre_split_impl()
2871 pcre_cache_entry *pce; /* Compiled regular expression */ in PHP_FUNCTION() local
2882 if ((pce = pcre_get_compiled_regex_cache(regex)) == NULL) { in PHP_FUNCTION()
2886 pce->refcount++; in PHP_FUNCTION()
2887 php_pcre_grep_impl(pce, input, return_value, flags); in PHP_FUNCTION()
2888 pce->refcount--; in PHP_FUNCTION()
2892 PHPAPI void php_pcre_grep_impl(pcre_cache_entry *pce, zval *input, zval *return_value, zend_long f… in php_pcre_grep_impl() argument
2906 num_subpats = pce->capture_count + 1; in php_pcre_grep_impl()
2916 match_data = pcre2_match_data_create_from_pattern(pce->re, gctx); in php_pcre_grep_impl()
2923 options = (pce->compile_options & PCRE2_UTF) ? 0 : PCRE2_NO_UTF_CHECK; in php_pcre_grep_impl()
2932 if ((pce->preg_options & PREG_JIT) && options) { in php_pcre_grep_impl()
2933 count = pcre2_jit_match(pce->re, (PCRE2_SPTR)ZSTR_VAL(subject_str), ZSTR_LEN(subject_str), 0, in php_pcre_grep_impl()
2937 count = pcre2_match(pce->re, (PCRE2_SPTR)ZSTR_VAL(subject_str), ZSTR_LEN(subject_str), 0, in php_pcre_grep_impl()
3109 PHPAPI void php_pcre_pce_incref(pcre_cache_entry *pce) in php_pcre_pce_incref() argument
3111 assert(NULL != pce); in php_pcre_pce_incref()
3112 pce->refcount++; in php_pcre_pce_incref()
3115 PHPAPI void php_pcre_pce_decref(pcre_cache_entry *pce) in php_pcre_pce_decref() argument
3117 assert(NULL != pce); in php_pcre_pce_decref()
3118 assert(0 != pce->refcount); in php_pcre_pce_decref()
3119 pce->refcount--; in php_pcre_pce_decref()
3122 PHPAPI pcre2_code *php_pcre_pce_re(pcre_cache_entry *pce) in php_pcre_pce_re() argument
3124 assert(NULL != pce); in php_pcre_pce_re()
3125 return pce->re; in php_pcre_pce_re()