diff options
Diffstat (limited to 'ext/pcre/php_pcre.h')
-rw-r--r-- | ext/pcre/php_pcre.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/ext/pcre/php_pcre.h b/ext/pcre/php_pcre.h index a5b5671111..551f35b5a4 100644 --- a/ext/pcre/php_pcre.h +++ b/ext/pcre/php_pcre.h @@ -37,6 +37,8 @@ #include "pcre.h" extern void php_info_pcre(ZEND_MODULE_INFO_FUNC_ARGS); +extern int php_minit_pcre(INIT_FUNC_ARGS); +extern int php_mshutdown_pcre(SHUTDOWN_FUNC_ARGS); extern int php_rinit_pcre(INIT_FUNC_ARGS); PHP_FUNCTION(pcre_match); @@ -45,6 +47,32 @@ PHP_FUNCTION(pcre_replace); extern zend_module_entry pcre_module_entry; #define pcre_module_ptr &pcre_module_entry +typedef struct { + pcre *re; + pcre_extra *extra; +} pcre_cache_entry; + +typedef struct { + HashTable pcre_cache; +} php_pcre_globals; + +#ifdef ZTS +# define PCRE_LS_D php_pcre_globals *pcre_globals +# define PCRE_LS_DC , PCRE_LS_D +# define PCRE_LS_C pcre_globals +# define PCRE_LS_CC , PCRE_LS_C +# define PCRE_G(v) (pcre_globals->v) +# define PCRE_LS_FETCH() php_pcre_globals *pcre_globals = ts_resource(pcre_globals_id); +#else +# define PCRE_LS_D +# define PCRE_LS_DC +# define PCRE_LS_C +# define PCRE_LS_CC +# define PCRE_G(v) (pcre_globals.v) +# define PCRE_LS_FETCH() +extern ZEND_API php_pcre_globals pcre_globals; +#endif + #else #define pcre_module_ptr NULL |