Lines Matching refs:pce

91 	pcre_cache_entry *pce = (pcre_cache_entry *) data;  in php_free_pcre_cache()  local
92 if (!pce) return; in php_free_pcre_cache()
93 pefree(pce->re, 1); in php_free_pcre_cache()
94 if (pce->extra) pefree(pce->extra, 1); in php_free_pcre_cache()
96 if ((void*)pce->tables) pefree((void*)pce->tables, 1); in php_free_pcre_cache()
97 pefree(pce->locale, 1); in php_free_pcre_cache()
172 pcre_cache_entry *pce = (pcre_cache_entry *) data; in pcre_clean_cache() local
175 if (*num_clean > 0 && !pce->refcount) { in pcre_clean_cache()
185 static char **make_subpats_table(int num_subpats, pcre_cache_entry *pce TSRMLS_DC) in make_subpats_table()
187 pcre_extra *extra = pce->extra; in make_subpats_table()
194 rc = pcre_fullinfo(pce->re, extra, PCRE_INFO_NAMECOUNT, &name_cnt); in make_subpats_table()
203 rc1 = pcre_fullinfo(pce->re, extra, PCRE_INFO_NAMETABLE, &name_table); in make_subpats_table()
204 rc2 = pcre_fullinfo(pce->re, extra, PCRE_INFO_NAMEENTRYSIZE, &name_size); in make_subpats_table()
230 static zend_always_inline int calculate_unit_length(pcre_cache_entry *pce, char *start) in calculate_unit_length() argument
234 if (pce->compile_options & PCRE_UTF8) { in calculate_unit_length()
269 pcre_cache_entry *pce; in pcre_get_compiled_regex_cache() local
282 if (zend_hash_find(&PCRE_G(pcre_cache), regex, regex_len+1, (void **)&pce) == SUCCESS) { in pcre_get_compiled_regex_cache()
287 if (pcre_fullinfo(pce->re, NULL, PCRE_INFO_CAPTURECOUNT, &count) == PCRE_ERROR_BADMAGIC) { in pcre_get_compiled_regex_cache()
291 if (!strcmp(pce->locale, locale)) { in pcre_get_compiled_regex_cache()
293 return pce; in pcre_get_compiled_regex_cache()
484 sizeof(pcre_cache_entry), (void**)&pce); in pcre_get_compiled_regex_cache()
490 return pce; in pcre_get_compiled_regex_cache()
498 pcre_cache_entry * pce = pcre_get_compiled_regex_cache(regex, strlen(regex) TSRMLS_CC); in pcre_get_compiled_regex() local
501 *extra = pce ? pce->extra : NULL; in pcre_get_compiled_regex()
504 *preg_options = pce ? pce->preg_options : 0; in pcre_get_compiled_regex()
507 return pce ? pce->re : NULL; in pcre_get_compiled_regex()
515 pcre_cache_entry * pce = pcre_get_compiled_regex_cache(regex, strlen(regex) TSRMLS_CC); in pcre_get_compiled_regex_ex() local
518 *extra = pce ? pce->extra : NULL; in pcre_get_compiled_regex_ex()
521 *preg_options = pce ? pce->preg_options : 0; in pcre_get_compiled_regex_ex()
524 *compile_options = pce ? pce->compile_options : 0; in pcre_get_compiled_regex_ex()
527 return pce ? pce->re : NULL; in pcre_get_compiled_regex_ex()
559 pcre_cache_entry *pce; /* Compiled regular expression */ in php_do_pcre_match() local
570 if ((pce = pcre_get_compiled_regex_cache(regex, regex_len TSRMLS_CC)) == NULL) { in php_do_pcre_match()
574 pce->refcount++; in php_do_pcre_match()
575 php_pcre_match_impl(pce, subject, subject_len, return_value, subpats, in php_do_pcre_match()
577 pce->refcount--; in php_do_pcre_match()
582 PHPAPI void php_pcre_match_impl(pcre_cache_entry *pce, char *subject, int subject_len, zval *return… in php_pcre_match_impl() argument
589 pcre_extra *extra = pce->extra;/* Holds results of studying */ in php_pcre_match_impl()
647 rc = pcre_fullinfo(pce->re, extra, PCRE_INFO_CAPTURECOUNT, &num_subpats); in php_pcre_match_impl()
660 subpat_names = make_subpats_table(num_subpats, pce TSRMLS_CC); in php_pcre_match_impl()
682 count = pcre_exec(pce->re, extra, subject, subject_len, start_offset, in php_pcre_match_impl()
780 int unit_len = calculate_unit_length(pce, subject + start_offset); in php_pcre_match_impl()
1015 pcre_cache_entry *pce; /* Compiled regular expression */ in php_pcre_replace() local
1019 if ((pce = pcre_get_compiled_regex_cache(regex, regex_len TSRMLS_CC)) == NULL) { in php_pcre_replace()
1022 pce->refcount++; in php_pcre_replace()
1023 result = php_pcre_replace_impl(pce, subject, subject_len, replace_val, in php_pcre_replace()
1025 pce->refcount--; in php_pcre_replace()
1032 PHPAPI char *php_pcre_replace_impl(pcre_cache_entry *pce, char *subject, int subject_len, zval *rep… in php_pcre_replace_impl() argument
1035 pcre_extra *extra = pce->extra;/* Holds results of studying */ in php_pcre_replace_impl()
1072 eval = pce->preg_options & PREG_REPLACE_EVAL; in php_pcre_replace_impl()
1089 rc = pcre_fullinfo(pce->re, extra, PCRE_INFO_CAPTURECOUNT, &num_subpats); in php_pcre_replace_impl()
1102 subpat_names = make_subpats_table(num_subpats, pce TSRMLS_CC); in php_pcre_replace_impl()
1120 count = pcre_exec(pce->re, extra, subject, subject_len, start_offset, in php_pcre_replace_impl()
1230 int unit_len = calculate_unit_length(pce, piece); in php_pcre_replace_impl()
1497 pcre_cache_entry *pce; /* Compiled regular expression */ in PHP_FUNCTION() local
1506 if ((pce = pcre_get_compiled_regex_cache(regex, regex_len TSRMLS_CC)) == NULL) { in PHP_FUNCTION()
1510 pce->refcount++; in PHP_FUNCTION()
1511 php_pcre_split_impl(pce, subject, subject_len, return_value, limit_val, flags TSRMLS_CC); in PHP_FUNCTION()
1512 pce->refcount--; in PHP_FUNCTION()
1518 PHPAPI void php_pcre_split_impl(pcre_cache_entry *pce, char *subject, int subject_len, zval *return… in php_pcre_split_impl() argument
1557 rc = pcre_fullinfo(pce->re, extra, PCRE_INFO_CAPTURECOUNT, &size_offsets); in php_pcre_split_impl()
1573 count = pcre_exec(pce->re, extra, subject, in php_pcre_split_impl()
1629 if (pce->compile_options & PCRE_UTF8) { in php_pcre_split_impl()
1780 pcre_cache_entry *pce; /* Compiled regular expression */ in PHP_FUNCTION() local
1789 if ((pce = pcre_get_compiled_regex_cache(regex, regex_len TSRMLS_CC)) == NULL) { in PHP_FUNCTION()
1793 pce->refcount++; in PHP_FUNCTION()
1794 php_pcre_grep_impl(pce, input, return_value, flags TSRMLS_CC); in PHP_FUNCTION()
1795 pce->refcount--; in PHP_FUNCTION()
1799 PHPAPI void php_pcre_grep_impl(pcre_cache_entry *pce, zval *input, zval *return_value, long flags … in php_pcre_grep_impl() argument
1802 pcre_extra *extra = pce->extra;/* Holds results of studying */ in php_pcre_grep_impl()
1823 rc = pcre_fullinfo(pce->re, extra, PCRE_INFO_CAPTURECOUNT, &size_offsets); in php_pcre_grep_impl()
1847 count = pcre_exec(pce->re, extra, Z_STRVAL(subject), in php_pcre_grep_impl()