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()
916 pcre_cache_entry * pce = pcre_get_compiled_regex_cache(regex); in pcre_get_compiled_regex_ex() local
919 *preg_options = pce ? pce->preg_options : 0; in pcre_get_compiled_regex_ex()
922 *compile_options = pce ? pce->compile_options : 0; in pcre_get_compiled_regex_ex()
925 *capture_count = pce ? pce->capture_count : 0; in pcre_get_compiled_regex_ex()
928 return pce ? pce->re : NULL; in pcre_get_compiled_regex_ex()
1119 pcre_cache_entry *pce; /* Compiled regular expression */ in php_do_pcre_match() local
1134 if ((pce = pcre_get_compiled_regex_cache(regex)) == NULL) { in php_do_pcre_match()
1138 pce->refcount++; in php_do_pcre_match()
1139 php_pcre_match_impl(pce, subject, return_value, subpats, in php_do_pcre_match()
1141 pce->refcount--; in php_do_pcre_match()
1162 PHPAPI void php_pcre_match_impl(pcre_cache_entry *pce, zend_string *subject_str, zval *return_value, in php_pcre_match_impl() argument
1237 num_subpats = pce->capture_count + 1; in php_pcre_match_impl()
1244 if (subpats && pce->name_count > 0) { in php_pcre_match_impl()
1245 subpat_names = make_subpats_table(num_subpats, pce); in php_pcre_match_impl()
1265 match_data = pcre2_match_data_create_from_pattern(pce->re, PCRE_G(gctx_zmm)); in php_pcre_match_impl()
1280 (pce->compile_options & PCRE2_UTF) && !is_known_valid_utf8(subject_str, orig_start_offset) in php_pcre_match_impl()
1285 if ((pce->preg_options & PREG_JIT) && options) { in php_pcre_match_impl()
1286 count = pcre2_jit_match(pce->re, (PCRE2_SPTR)subject, subject_len, start_offset2, in php_pcre_match_impl()
1290 count = pcre2_match(pce->re, (PCRE2_SPTR)subject, subject_len, start_offset2, in php_pcre_match_impl()
1389 count = pcre2_match(pce->re, (PCRE2_SPTR)subject, subject_len, start_offset2, in php_pcre_match_impl()
1403 size_t unit_len = calculate_unit_length(pce, subject + start_offset2); in php_pcre_match_impl()
1427 if ((pce->preg_options & PREG_JIT)) { in php_pcre_match_impl()
1432 count = pcre2_jit_match(pce->re, (PCRE2_SPTR)subject, subject_len, start_offset2, in php_pcre_match_impl()
1436 count = pcre2_match(pce->re, (PCRE2_SPTR)subject, subject_len, start_offset2, in php_pcre_match_impl()
1471 if ((pce->compile_options & PCRE2_UTF) in php_pcre_match_impl()
1577 pcre_cache_entry *pce; /* Compiled regular expression */ in php_pcre_replace() local
1586 if ((pce = pcre_get_compiled_regex_cache(regex)) == NULL) { in php_pcre_replace()
1589 pce->refcount++; in php_pcre_replace()
1590 result = php_pcre_replace_impl(pce, subject_str, subject, subject_len, replace_str, in php_pcre_replace()
1592 pce->refcount--; in php_pcre_replace()
1599 PHPAPI zend_string *php_pcre_replace_impl(pcre_cache_entry *pce, zend_string *subject_str, const ch… in php_pcre_replace_impl() argument
1622 num_subpats = pce->capture_count + 1; in php_pcre_replace_impl()
1636 match_data = pcre2_match_data_create_from_pattern(pce->re, PCRE_G(gctx_zmm)); in php_pcre_replace_impl()
1643 options = (pce->compile_options & PCRE2_UTF) ? 0 : PCRE2_NO_UTF_CHECK; in php_pcre_replace_impl()
1647 if ((pce->preg_options & PREG_JIT) && options) { in php_pcre_replace_impl()
1648 count = pcre2_jit_match(pce->re, (PCRE2_SPTR)subject, subject_len, start_offset, in php_pcre_replace_impl()
1652 count = pcre2_match(pce->re, (PCRE2_SPTR)subject, subject_len, start_offset, in php_pcre_replace_impl()
1770 count = pcre2_match(pce->re, (PCRE2_SPTR)subject, subject_len, start_offset, in php_pcre_replace_impl()
1782 size_t unit_len = calculate_unit_length(pce, piece); in php_pcre_replace_impl()
1822 if (pce->preg_options & PREG_JIT) { in php_pcre_replace_impl()
1823 count = pcre2_jit_match(pce->re, (PCRE2_SPTR)subject, subject_len, start_offset, in php_pcre_replace_impl()
1827 count = pcre2_match(pce->re, (PCRE2_SPTR)subject, subject_len, start_offset, in php_pcre_replace_impl()
1839 static zend_string *php_pcre_replace_func_impl(pcre_cache_entry *pce, zend_string *subject_str, con… in php_pcre_replace_func_impl() argument
1859 num_subpats = pce->capture_count + 1; in php_pcre_replace_func_impl()
1866 if (UNEXPECTED(pce->name_count > 0)) { in php_pcre_replace_func_impl()
1867 subpat_names = make_subpats_table(num_subpats, pce); in php_pcre_replace_func_impl()
1888 match_data = pcre2_match_data_create_from_pattern(pce->re, PCRE_G(gctx_zmm)); in php_pcre_replace_func_impl()
1899 options = (pce->compile_options & PCRE2_UTF) ? 0 : PCRE2_NO_UTF_CHECK; in php_pcre_replace_func_impl()
1903 if ((pce->preg_options & PREG_JIT) && options) { in php_pcre_replace_func_impl()
1904 count = pcre2_jit_match(pce->re, (PCRE2_SPTR)subject, subject_len, start_offset, in php_pcre_replace_func_impl()
1908 count = pcre2_match(pce->re, (PCRE2_SPTR)subject, subject_len, start_offset, in php_pcre_replace_func_impl()
1979 count = pcre2_match(pce->re, (PCRE2_SPTR)subject, subject_len, start_offset, in php_pcre_replace_func_impl()
1991 size_t unit_len = calculate_unit_length(pce, piece); in php_pcre_replace_func_impl()
2030 if ((pce->preg_options & PREG_JIT)) { in php_pcre_replace_func_impl()
2031 count = pcre2_jit_match(pce->re, (PCRE2_SPTR)subject, subject_len, start_offset, in php_pcre_replace_func_impl()
2035 count = pcre2_match(pce->re, (PCRE2_SPTR)subject, subject_len, start_offset, in php_pcre_replace_func_impl()
2057 pcre_cache_entry *pce; /* Compiled regular expression */ in php_pcre_replace_func() local
2061 if ((pce = pcre_get_compiled_regex_cache(regex)) == NULL) { in php_pcre_replace_func()
2064 pce->refcount++; in php_pcre_replace_func()
2066 pce, subject_str, ZSTR_VAL(subject_str), ZSTR_LEN(subject_str), fci, fcc, in php_pcre_replace_func()
2068 pce->refcount--; in php_pcre_replace_func()
2497 pcre_cache_entry *pce; /* Compiled regular expression */ in PHP_FUNCTION() local
2509 if ((pce = pcre_get_compiled_regex_cache(regex)) == NULL) { in PHP_FUNCTION()
2513 pce->refcount++; in PHP_FUNCTION()
2514 php_pcre_split_impl(pce, subject, return_value, limit_val, flags); in PHP_FUNCTION()
2515 pce->refcount--; in PHP_FUNCTION()
2520 PHPAPI void php_pcre_split_impl(pcre_cache_entry *pce, zend_string *subject_str, zval *return_value, in php_pcre_split_impl() argument
2544 num_subpats = pce->capture_count + 1; in php_pcre_split_impl()
2562 match_data = pcre2_match_data_create_from_pattern(pce->re, PCRE_G(gctx_zmm)); in php_pcre_split_impl()
2570 options = (pce->compile_options & PCRE2_UTF) ? 0 : PCRE2_NO_UTF_CHECK; in php_pcre_split_impl()
2573 if ((pce->preg_options & PREG_JIT) && options) { in php_pcre_split_impl()
2574 count = pcre2_jit_match(pce->re, (PCRE2_SPTR)subject, ZSTR_LEN(subject_str), start_offset, in php_pcre_split_impl()
2578 count = pcre2_match(pce->re, (PCRE2_SPTR)subject, ZSTR_LEN(subject_str), start_offset, in php_pcre_split_impl()
2643 count = pcre2_match(pce->re, (PCRE2_SPTR)subject, ZSTR_LEN(subject_str), start_offset, in php_pcre_split_impl()
2653 start_offset += calculate_unit_length(pce, subject + start_offset); in php_pcre_split_impl()
2676 if (pce->preg_options & PREG_JIT) { in php_pcre_split_impl()
2677 count = pcre2_jit_match(pce->re, (PCRE2_SPTR)subject, ZSTR_LEN(subject_str), start_offset, in php_pcre_split_impl()
2681 count = pcre2_match(pce->re, (PCRE2_SPTR)subject, ZSTR_LEN(subject_str), start_offset, in php_pcre_split_impl()
2855 pcre_cache_entry *pce; /* Compiled regular expression */ in PHP_FUNCTION() local
2866 if ((pce = pcre_get_compiled_regex_cache(regex)) == NULL) { in PHP_FUNCTION()
2870 pce->refcount++; in PHP_FUNCTION()
2871 php_pcre_grep_impl(pce, input, return_value, flags); in PHP_FUNCTION()
2872 pce->refcount--; in PHP_FUNCTION()
2876 PHPAPI void php_pcre_grep_impl(pcre_cache_entry *pce, zval *input, zval *return_value, zend_long f… in php_pcre_grep_impl() argument
2890 num_subpats = pce->capture_count + 1; in php_pcre_grep_impl()
2900 match_data = pcre2_match_data_create_from_pattern(pce->re, PCRE_G(gctx_zmm)); in php_pcre_grep_impl()
2907 options = (pce->compile_options & PCRE2_UTF) ? 0 : PCRE2_NO_UTF_CHECK; in php_pcre_grep_impl()
2916 if ((pce->preg_options & PREG_JIT) && options) { in php_pcre_grep_impl()
2917 count = pcre2_jit_match(pce->re, (PCRE2_SPTR)ZSTR_VAL(subject_str), ZSTR_LEN(subject_str), 0, in php_pcre_grep_impl()
2921 count = pcre2_match(pce->re, (PCRE2_SPTR)ZSTR_VAL(subject_str), ZSTR_LEN(subject_str), 0, in php_pcre_grep_impl()
3023 PHPAPI void php_pcre_pce_incref(pcre_cache_entry *pce) in php_pcre_pce_incref() argument
3025 assert(NULL != pce); in php_pcre_pce_incref()
3026 pce->refcount++; in php_pcre_pce_incref()
3029 PHPAPI void php_pcre_pce_decref(pcre_cache_entry *pce) in php_pcre_pce_decref() argument
3031 assert(NULL != pce); in php_pcre_pce_decref()
3032 assert(0 != pce->refcount); in php_pcre_pce_decref()
3033 pce->refcount--; in php_pcre_pce_decref()
3036 PHPAPI pcre2_code *php_pcre_pce_re(pcre_cache_entry *pce) in php_pcre_pce_re() argument
3038 assert(NULL != pce); in php_pcre_pce_re()
3039 return pce->re; in php_pcre_pce_re()