CVS update: php3/functions

From: Date: Sun, 27 Dec 1998 21:44:37 +0000
Subject: CVS update: php3/functions
Groups: php.dev 
Request: Send a blank email to php-dev+get-3084@lists.php.net to get a copy of this message
Date: Sunday December 27, 1998 @ 16:44 Author: zeev Update of /repository/php3/functions In directory asf:/u/temp/cvs-serv14946/functions Modified Files: reg.c Log Message: - Fix the regex cache bug (untested) - Add a paragraph to the coding standards file Index: php3/functions/reg.c diff -c php3/functions/reg.c:1.89 php3/functions/reg.c:1.90 *** php3/functions/reg.c:1.89 Fri Dec 25 15:09:47 1998 --- php3/functions/reg.c Sun Dec 27 16:44:37 1998 *************** *** 28,34 **** | Jaakko Hyvätti <jaakko@hyvatti.iki.fi> | +----------------------------------------------------------------------+ */ ! /* $Id: reg.c,v 1.89 1998/12/25 20:09:47 sas Exp $ */ #ifdef THREAD_SAFE #include "tls.h" #endif --- 28,34 ---- | Jaakko Hyvätti <jaakko@hyvatti.iki.fi> | +----------------------------------------------------------------------+ */ ! /* $Id: reg.c,v 1.90 1998/12/27 21:44:37 zeev Exp $ */ #ifdef THREAD_SAFE #include "tls.h" #endif *************** *** 52,59 **** {NULL, NULL, NULL} }; php3_module_entry regexp_module_entry = { ! "Regular Expressions", reg_functions, NULL, NULL, NULL, NULL, NULL, STANDARD_MODULE_PROPERTIES }; /* This is the maximum number of (..) constructs we'll generate from a --- 52,62 ---- {NULL, NULL, NULL} }; + static int php3_rinit_regex(INIT_FUNC_ARGS); + static int php3_rshutdown_regex(); + php3_module_entry regexp_module_entry = { ! "Regular Expressions", reg_functions, NULL, NULL, php3_rinit_regex, php3_rshutdown_regex, NULL, STANDARD_MODULE_PROPERTIES }; /* This is the maximum number of (..) constructs we'll generate from a *************** *** 61,67 **** #define NS 10 #ifndef THREAD_SAFE ! reg_cache *rc = NULL; #define php3_regcomp(a,b,c) \ _php3_regcomp(INTERNAL_FUNCTION_PARAM_PASSTHRU,a,b,c) --- 64,70 ---- #define NS 10 #ifndef THREAD_SAFE ! static reg_cache *rc; #define php3_regcomp(a,b,c) \ _php3_regcomp(INTERNAL_FUNCTION_PARAM_PASSTHRU,a,b,c) *************** *** 596,601 **** --- 599,630 ---- return_value->type = IS_STRING; } /* }}} */ + + + static int php3_rinit_regex(INIT_FUNC_ARGS) + { + #ifndef THREAD_SAFE + rc = NULL; + #endif + return SUCCESS; + } + + + static int php3_rshutdown_regex() + { + #ifndef THREAD_SAFE + /* add additional shutdown code here */ + if (rc) { + if (rc->pattern) { + efree(rc->pattern); + } + efree(rc); + } + #endif + return SUCCESS; + } + + /* * Local variables: -- PHP Development Mailing List http://www.php.net/ To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net For help: php-dev-help@lists.php.net

« previous php.dev (#3084) next »