/* {{{ pcre_get_compiled_regex
*/
-PHPAPI pcre* pcre_get_compiled_regex(char *regex, pcre_extra *extra, int *preg_options) {
+PHPAPI pcre* pcre_get_compiled_regex(char *regex, pcre_extra **extra, int *preg_options) {
pcre *re = NULL;
int coptions = 0;
int soptions = 0;
#if HAVE_SETLOCALE
if (!strcmp(pce->locale, locale)) {
#endif
- extra = pce->extra;
+ *extra = pce->extra;
*preg_options = pce->preg_options;
return pce->re;
#if HAVE_SETLOCALE
/* If study option was specified, study the pattern and
store the result in extra for passing to pcre_exec. */
if (do_study) {
- extra = pcre_study(re, soptions, &error);
+ *extra = pcre_study(re, soptions, &error);
if (error != NULL) {
zend_error(E_WARNING, "Error while studying pattern");
}
/* Store the compiled pattern and extra info in the cache. */
new_entry.re = re;
- new_entry.extra = extra;
+ new_entry.extra = *extra;
new_entry.preg_options = poptions;
#if HAVE_SETLOCALE
new_entry.locale = locale;
}
/* Compile regex or get it from cache. */
- if ((re = pcre_get_compiled_regex(Z_STRVAL_PP(regex), extra, &preg_options)) == NULL) {
+ if ((re = pcre_get_compiled_regex(Z_STRVAL_PP(regex), &extra, &preg_options)) == NULL) {
RETURN_FALSE;
}
walk_last; /* Last walked character */
/* Compile regex or get it from cache. */
- if ((re = pcre_get_compiled_regex(regex, extra, &preg_options)) == NULL) {
+ if ((re = pcre_get_compiled_regex(regex, &extra, &preg_options)) == NULL) {
return NULL;
}
convert_to_string_ex(subject);
/* Compile regex or get it from cache. */
- if ((re = pcre_get_compiled_regex(Z_STRVAL_PP(regex), extra, &preg_options)) == NULL) {
+ if ((re = pcre_get_compiled_regex(Z_STRVAL_PP(regex), &extra, &preg_options)) == NULL) {
RETURN_FALSE;
}
}
/* Compile regex or get it from cache. */
- if ((re = pcre_get_compiled_regex(Z_STRVAL_PP(regex), extra, &preg_options)) == NULL) {
+ if ((re = pcre_get_compiled_regex(Z_STRVAL_PP(regex), &extra, &preg_options)) == NULL) {
RETURN_FALSE;
}
PHP_FUNCTION(preg_grep);
PHPAPI char *php_pcre_replace(char *regex, int regex_len, char *subject, int subject_len, zval *replace_val, int is_callable_replace, int *result_len, int limit TSRMLS_DC);
-PHPAPI pcre* pcre_get_compiled_regex(char *regex, pcre_extra *extra, int *options);
+PHPAPI pcre* pcre_get_compiled_regex(char *regex, pcre_extra **extra, int *options);
extern zend_module_entry pcre_module_entry;
#define pcre_module_ptr &pcre_module_entry