diff options
author | Andrey Hristov <andrey@php.net> | 1999-05-21 19:27:44 +0000 |
---|---|---|
committer | Andrey Hristov <andrey@php.net> | 1999-05-21 19:27:44 +0000 |
commit | e3a70c1f04e8fc8df5fb7ba64509bc08ae25f12c (patch) | |
tree | f8a7a183b8f0eff1498b78d84ddaa63ddb5123f7 /ext/pcre/php_pcre.h | |
parent | c57c0e9cd58da7c583b029e9709d5420f286c31e (diff) | |
download | php-git-e3a70c1f04e8fc8df5fb7ba64509bc08ae25f12c.tar.gz |
-Added regex cache
-Made module thread-safe
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 |