[PHP4BETA] CVS update: php4/ext/standard

From: Date: Thu, 13 May 1999 15:54:49 +0000
Subject: [PHP4BETA] CVS update: php4/ext/standard
Groups: php.version4 
Request: Send a blank email to php-version4+get-841@lists.php.net to get a copy of this message
Date: Thursday May 13, 1999 @ 11:54 Author: zeev Update of /repository/php4/ext/standard In directory php:/tmp/cvs-serv14330/ext/standard Modified Files: reg.c reg.h Log Message: * HTTP-auth bugfix * Patch the regex thread safe code to compile in thread safe mode Index: php4/ext/standard/reg.c diff -u php4/ext/standard/reg.c:1.6 php4/ext/standard/reg.c:1.7 --- php4/ext/standard/reg.c:1.6 Wed May 12 11:40:15 1999 +++ php4/ext/standard/reg.c Thu May 13 11:54:49 1999 @@ -28,7 +28,7 @@ | Jaakko Hyvätti <jaakko@hyvatti.iki.fi> | +----------------------------------------------------------------------+ */ -/* $Id: reg.c,v 1.6 1999/05/12 15:40:15 sas Exp $ */ +/* $Id: reg.c,v 1.7 1999/05/13 15:54:49 zeev Exp $ */ #include <stdio.h> #include "php.h" @@ -75,10 +75,10 @@ static int _php_regcomp(regex_t *preg, const char *pattern, int cflags) { - REGSLS_FETCH int r = 0; int patlen = strlen(pattern); reg_cache *rc = NULL; + REGLS_FETCH(); if(_php3_hash_find(&REG(ht_rc), (char *) pattern, patlen, (void **) &rc) == FAILURE || rc->cflags != cflags) { @@ -114,7 +114,7 @@ static int php_minit_regex(INIT_FUNC_ARGS) { #ifdef ZTS - reg_globals_id = tsrm_allocate_id(sizeof(php_reg_globals), php_reg_init_globals, NULL); + reg_globals_id = ts_allocate_id(sizeof(php_reg_globals), php_reg_init_globals, NULL); #else php_reg_init_globals(&reg_globals); #endif @@ -124,6 +124,8 @@ static int php_mshutdown_regex(SHUTDOWN_FUNC_ARGS) { + REGLS_FETCH(); + _php3_hash_destroy(&REG(ht_rc)); return SUCCESS; } Index: php4/ext/standard/reg.h diff -u php4/ext/standard/reg.h:1.2 php4/ext/standard/reg.h:1.3 --- php4/ext/standard/reg.h:1.2 Wed May 12 11:40:15 1999 +++ php4/ext/standard/reg.h Thu May 13 11:54:49 1999 @@ -28,7 +28,7 @@ */ -/* $Id: reg.h,v 1.2 1999/05/12 15:40:15 sas Exp $ */ +/* $Id: reg.h,v 1.3 1999/05/13 15:54:49 zeev Exp $ */ #ifndef _REG_H #define _REG_H @@ -43,7 +43,7 @@ PHP_FUNCTION(eregireplace); PHP_FUNCTION(eregreplace); PHP_FUNCTION(split); -PHP_FUNCTION(sql_regcase); +PHPAPI PHP_FUNCTION(sql_regcase); typedef struct { HashTable ht_rc; @@ -51,19 +51,19 @@ #ifdef ZTS -#define REGSLS_D php_reg_globals *reg_globals -#define REGSLS_DC , REGSLS_D -#define REGSLS_C reg_globals -#define REGSLS_CC , REGSLS_C +#define REGLS_D php_reg_globals *reg_globals +#define REGLS_DC , REGLS_D +#define REGLS_C reg_globals +#define REGLS_CC , REGLS_C #define REG(v) (reg_globals->v) -#define REGSLS_FETCH php_reg_globals *reg_globals = ts_resource(reg_globals_id); +#define REGLS_FETCH() php_reg_globals *reg_globals = ts_resource(reg_globals_id) #else -#define REGSLS_D -#define REGSLS_DC -#define REGSLS_C -#define REGSLS_CC +#define REGLS_D +#define REGLS_DC +#define REGLS_C +#define REGLS_CC #define REG(v) (reg_globals.v) -#define REGSLS_FETCH +#define REGLS_FETCH() #endif #define phpext_regex_ptr regexp_module_ptr -- PHP 4 Beta

« previous php.version4 (#841) next »