cvs: /php4 acinclude.m4 configure.in main.c php_reentrancy.h php_variables.c reentrancy.c /php4/ext/calendar cal_unix.c /php4/ext/filepro filepro.c
/php4/ext/ftp ftp.c /php4/ext/hyperwave hw.c /php4/ext/session session.c /php4/ext/standard datetime.c info.c parsedate.y /php4/sapi/isapi php4isapi.c
/php4/win32 registry.c
| From: | Sascha Schumann | Date: | Thu, 04 May 2000 10:38:15 +0000 |
| Subject: | cvs: /php4 acinclude.m4 configure.in main.c php_reentrancy.h php_variables.c reentrancy.c /php4/ext/calendar cal_unix.c /php4/ext/filepro filepro.c /php4/ext/ftp ftp.c /php4/ext/hyperwave hw.c /php4/ext/session session.c /php4/ext/standard datetime.c info.c parsedate.y /php4/sapi/isapi php4isapi.c /php4/win32 registry.c |
||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-14454@lists.php.net to get a copy of this message | ||
sas Thu May 4 03:38:15 2000 EDT
Modified files:
/php4 acinclude.m4 configure.in main.c php_reentrancy.h
php_variables.c reentrancy.c
/php4/ext/calendar cal_unix.c
/php4/ext/filepro filepro.c
/php4/ext/ftp ftp.c
/php4/ext/hyperwave hw.c
/php4/ext/session session.c
/php4/ext/standard datetime.c info.c parsedate.y
/php4/sapi/isapi php4isapi.c
/php4/win32 registry.c
Log:
Change reentrancy API to always use the php prefix.
Check for the declaration of reentrant functions, so that we can use
them in non-ZTS mode on all platforms.
Index: php4/acinclude.m4
diff -u php4/acinclude.m4:1.77 php4/acinclude.m4:1.78
--- php4/acinclude.m4:1.77 Thu May 4 02:42:26 2000
+++ php4/acinclude.m4 Thu May 4 03:38:12 2000
@@ -1,9 +1,39 @@
-dnl $Id: acinclude.m4,v 1.77 2000/05/04 09:42:26 sas Exp $
+dnl $Id: acinclude.m4,v 1.78 2000/05/04 10:38:12 sas Exp $
dnl
dnl This file contains local autoconf functions.
sinclude(dynlib.m4)
+AC_DEFUN(PHP_MISSING_TIME_R_DECL,[
+ AC_MSG_CHECKING(for missing declarations of reentrant functions)
+ AC_TRY_COMPILE([#include <time.h>],[struct tm *(*func)() = localtime_r],[
+ :
+ ],[
+ AC_DEFINE(MISSING_LOCALTIME_R_DECL,1,[Whether localtime_r is declared])
+ ])
+ AC_TRY_COMPILE([#include <time.h>],[struct tm *(*func)() = gmtime_r],[
+ :
+ ],[
+ AC_DEFINE(MISSING_GMTIME_R_DECL,1,[Whether gmtime_r is declared])
+ ])
+ AC_TRY_COMPILE([#include <time.h>],[char *(*func)() = asctime_r],[
+ :
+ ],[
+ AC_DEFINE(MISSING_ASCTIME_R_DECL,1,[Whether asctime_r is declared])
+ ])
+ AC_TRY_COMPILE([#include <time.h>],[char *(*func)() = ctime_r],[
+ :
+ ],[
+ AC_DEFINE(MISSING_CTIME_R_DECL,1,[Whether ctime_r is declared])
+ ])
+ AC_TRY_COMPILE([#include <string.h>],[char *(*func)() = strtok_r],[
+ :
+ ],[
+ AC_DEFINE(MISSING_STRTOK_R_DECL,1,[Whether strtok_r is declared])
+ ])
+ AC_MSG_RESULT(done)
+])
+
dnl
dnl PHP_LIBGCC_LIBPATH(gcc)
dnl Stores the location of libgcc in libgcc_libpath
@@ -96,7 +126,7 @@
])
AC_DEFUN(PHP_TIME_R_TYPE,[
-AC_CACHE_CHECK(for time_r type, ac_cv_time_r_type,[
+AC_CACHE_CHECK(for *time_r type, ac_cv_time_r_type,[
AC_TRY_RUN([
#include <time.h>
#include <stdlib.h>
Index: php4/configure.in
diff -u php4/configure.in:1.117 php4/configure.in:1.118
--- php4/configure.in:1.117 Thu May 4 02:42:27 2000
+++ php4/configure.in Thu May 4 03:38:12 2000
@@ -1,4 +1,4 @@
-dnl ## $Id: configure.in,v 1.117 2000/05/04 09:42:27 sas Exp $ -*- sh -*-
+dnl ## $Id: configure.in,v 1.118 2000/05/04 10:38:12 sas Exp $ -*- sh -*-
dnl ## Process this file with autoconf to produce a configure script.
divert(1)
@@ -136,6 +136,7 @@
PHP_CONFIGURE_PART(Running system checks)
+PHP_MISSING_TIME_R_DECL
dnl check for -R, etc. switch
AC_MSG_CHECKING(whether compiler supports -R)
Index: php4/main.c
diff -u php4/main.c:1.242 php4/main.c:1.243
--- php4/main.c:1.242 Tue May 2 07:46:20 2000
+++ php4/main.c Thu May 4 03:38:12 2000
@@ -19,7 +19,7 @@
*/
-/* $Id: main.c,v 1.242 2000/05/02 14:46:20 sas Exp $ */
+/* $Id: main.c,v 1.243 2000/05/04 10:38:12 sas Exp $ */
#include <stdio.h>
@@ -255,7 +255,7 @@
log_file = V_FOPEN(PG(error_log), "a");
if (log_file != NULL) {
time(&error_time);
- strftime(error_time_str, 128, "%d-%b-%Y %H:%M:%S", localtime_r(&error_time,
&tmbuf));
+ strftime(error_time_str, 128, "%d-%b-%Y %H:%M:%S", php_localtime_r(&error_time,
&tmbuf));
fprintf(log_file, "[%s] ", error_time_str);
fprintf(log_file, log_message);
fprintf(log_file, "\n");
@@ -626,8 +626,8 @@
SLS_FETCH();
time(&curtime);
- ta = localtime_r(&curtime, &tmbuf);
- datetime_str = asctime_r(ta, asctimebuf);
+ ta = php_localtime_r(&curtime, &tmbuf);
+ datetime_str = php_asctime_r(ta, asctimebuf);
datetime_str[strlen(datetime_str)-1]=0; /* get rid of the trailing newline */
fprintf(stderr, "[%s] Script: '%s'\n", datetime_str,
SAFE_FILENAME(SG(request_info).path_translated));
}
Index: php4/php_reentrancy.h
diff -u php4/php_reentrancy.h:1.8 php4/php_reentrancy.h:1.9
--- php4/php_reentrancy.h:1.8 Sun Apr 16 09:32:51 2000
+++ php4/php_reentrancy.h Thu May 4 03:38:12 2000
@@ -42,39 +42,60 @@
#if !defined(HAVE_LOCALTIME_R) && defined(HAVE_LOCALTIME)
#define PHP_NEED_REENTRANCY 1
-#define localtime_r php_localtime_r
-PHPAPI struct tm *localtime_r(const time_t *const timep, struct tm *p_tm);
+PHPAPI struct tm *php_localtime_r(const time_t *const timep, struct tm *p_tm);
+#else
+#define php_localtime_r localtime_r
+#ifdef MISSING_LOCALTIME_R_DECL
+struct tm *localtime_r(const time_t *const timep, struct tm *p_tm);
#endif
+#endif
#if !defined(HAVE_CTIME_R) && defined(HAVE_CTIME)
#define PHP_NEED_REENTRANCY 1
-#define ctime_r php_ctime_r
-PHPAPI char *ctime_r(const time_t *clock, char *buf);
+PHPAPI char *php_ctime_r(const time_t *clock, char *buf);
+#else
+#define php_ctime_r ctime_r
+#ifdef MISSING_CTIME_R_DECL
+char *ctime_r(const time_t *clock, char *buf);
+#endif
#endif
#if !defined(HAVE_ASCTIME_R) && defined(HAVE_ASCTIME)
#define PHP_NEED_REENTRANCY 1
-#define asctime_r php_asctime_r
-PHPAPI char *asctime_r(const struct tm *tm, char *buf);
+PHPAPI char *php_asctime_r(const struct tm *tm, char *buf);
+#else
+#define php_asctime_r asctime_r
+#ifdef MISSING_ASCTIME_R_DECL
+char *asctime_r(const struct tm *tm, char *buf);
+#endif
#endif
#if !defined(HAVE_GMTIME_R) && defined(HAVE_GMTIME)
#define PHP_NEED_REENTRANCY 1
-#define gmtime_r php_gmtime_r
-PHPAPI struct tm *gmtime_r(const time_t *const timep, struct tm *p_tm);
+PHPAPI struct tm *php_gmtime_r(const time_t *const timep, struct tm *p_tm);
+#else
+#define php_gmtime_r gmtime_r
+#ifdef MISSING_GMTIME_R_DECL
+struct tm *php_gmtime_r(const time_t *const timep, struct tm *p_tm);
#endif
+#endif
#if !defined(HAVE_STRTOK_R)
-#define strtok_r php_strtok_r
-PHPAPI char *strtok_r(char *s, const char *delim, char **last);
+PHPAPI char *php_strtok_r(char *s, const char *delim, char **last);
+#else
+#define php_strtok_r strtok_r
+#ifdef MISSING_STRTOK_R_DECL
+char *strtok_r(char *s, const char *delim, char **last);
+#endif
#endif
#if !defined(HAVE_RAND_R)
-#define rand_r php_rand_r
-PHPAPI int rand_r(unsigned int *seed);
+PHPAPI int php_rand_r(unsigned int *seed);
+#else
+#define php_rand_r rand_r
#endif
#if !defined(ZTS)
Index: php4/php_variables.c
diff -u php4/php_variables.c:1.12 php4/php_variables.c:1.13
--- php4/php_variables.c:1.12 Fri Mar 24 03:16:24 2000
+++ php4/php_variables.c Thu May 4 03:38:12 2000
@@ -192,7 +192,7 @@
ELS_FETCH();
PLS_FETCH();
- var = strtok_r(SG(request_info).post_data, "&", &strtok_buf);
+ var = php_strtok_r(SG(request_info).post_data, "&", &strtok_buf);
while (var) {
val = strchr(var, '=');
@@ -203,7 +203,7 @@
php_url_decode(val, strlen(val));
php_register_variable(var, val, array_ptr ELS_CC PLS_CC);
}
- var = strtok_r(NULL, "&", &strtok_buf);
+ var = php_strtok_r(NULL, "&", &strtok_buf);
}
}
@@ -274,11 +274,11 @@
}
if (arg == PARSE_COOKIE) {
- var = strtok_r(res, ";", &strtok_buf);
+ var = php_strtok_r(res, ";", &strtok_buf);
} else if (arg == PARSE_POST) {
- var = strtok_r(res, "&", &strtok_buf);
+ var = php_strtok_r(res, "&", &strtok_buf);
} else {
- var = strtok_r(res, PG(arg_separator), &strtok_buf);
+ var = php_strtok_r(res, PG(arg_separator), &strtok_buf);
}
while (var) {
@@ -291,9 +291,9 @@
php_register_variable(var, val, array_ptr ELS_CC PLS_CC);
}
if (arg == PARSE_COOKIE) {
- var = strtok_r(NULL, ";", &strtok_buf);
+ var = php_strtok_r(NULL, ";", &strtok_buf);
} else {
- var = strtok_r(NULL, PG(arg_separator), &strtok_buf);
+ var = php_strtok_r(NULL, PG(arg_separator), &strtok_buf);
}
}
if (free_buffer) {
Index: php4/reentrancy.c
diff -u php4/reentrancy.c:1.12 php4/reentrancy.c:1.13
--- php4/reentrancy.c:1.12 Mon Apr 24 09:16:45 2000
+++ php4/reentrancy.c Thu May 4 03:38:12 2000
@@ -48,33 +48,29 @@
#if defined(PHP_HPUX_TIME_R)
-PHPAPI struct tm *localtime_r(const time_t *const timep, struct tm *p_tm)
+PHPAPI struct tm *php_localtime_r(const time_t *const timep, struct tm *p_tm)
{
-#undef localtime_r
if (localtime_r(timep, p_tm) == 0)
return (p_tm);
return (NULL);
}
-PHPAPI char *ctime_r(const time_t *clock, char *buf)
+PHPAPI char *php_ctime_r(const time_t *clock, char *buf)
{
-#undef ctime_r
if (ctime_r(clock, buf, 26) != -1)
return (buf);
return (NULL);
}
-PHPAPI char *asctime_r(const struct tm *tm, char *buf)
+PHPAPI char *php_asctime_r(const struct tm *tm, char *buf)
{
-#undef asctime_r
if (asctime_r(tm, buf, 26) != -1)
return (buf);
return (NULL);
}
-PHPAPI struct tm *gmtime_r(const time_t *const timep, struct tm *p_tm)
+PHPAPI struct tm *php_gmtime_r(const time_t *const timep, struct tm *p_tm)
{
-#undef gmtime_r
if (gmtime_r(timep, p_tm) == 0)
return (p_tm);
return (NULL);
@@ -123,7 +119,7 @@
#if !defined(HAVE_ASCTIME_R) && defined(HAVE_ASCTIME)
-PHPAPI char *asctime_r(const struct tm *tm, char *buf)
+PHPAPI char *php_asctime_r(const struct tm *tm, char *buf)
{
char *tmp;
@@ -141,7 +137,7 @@
#if !defined(HAVE_GMTIME_R) && defined(HAVE_GMTIME)
-PHPAPI struct tm *gmtime_r(const time_t *const timep, struct tm *p_tm)
+PHPAPI struct tm *php_gmtime_r(const time_t *const timep, struct tm *p_tm)
{
struct tm *tmp;
@@ -227,7 +223,7 @@
PHPAPI int
-rand_r(unsigned int *ctx)
+php_rand_r(unsigned int *ctx)
{
u_long val = (u_long) *ctx;
*ctx = do_rand(&val);
@@ -285,7 +281,7 @@
#include <stddef.h>
PHPAPI char *
-strtok_r(char *s, const char *delim, char **last)
+php_strtok_r(char *s, const char *delim, char **last)
{
char *spanp;
int c, sc;
Index: php4/ext/calendar/cal_unix.c
diff -u php4/ext/calendar/cal_unix.c:1.1 php4/ext/calendar/cal_unix.c:1.2
--- php4/ext/calendar/cal_unix.c:1.1 Mon Apr 17 02:44:49 2000
+++ php4/ext/calendar/cal_unix.c Thu May 4 03:38:13 2000
@@ -45,7 +45,7 @@
t = time(NULL);
}
- ta = localtime_r(&t, &tmbuf);
+ ta = php_localtime_r(&t, &tmbuf);
jdate = GregorianToSdn(ta->tm_year+1900, ta->tm_mon+1,ta->tm_mday);
RETURN_LONG(jdate);
Index: php4/ext/filepro/filepro.c
diff -u php4/ext/filepro/filepro.c:1.19 php4/ext/filepro/filepro.c:1.20
--- php4/ext/filepro/filepro.c:1.19 Mon May 1 17:44:23 2000
+++ php4/ext/filepro/filepro.c Thu May 4 03:38:13 2000
@@ -223,13 +223,13 @@
}
/* Get the field count, assume the file is readable! */
- if (strcmp(strtok_r(readbuf, ":", &strtok_buf), "map")) {
+ if (strcmp(php_strtok_r(readbuf, ":", &strtok_buf), "map")) {
php_error(E_WARNING, "filePro: map file corrupt or encrypted");
RETURN_FALSE;
}
- FP_GLOBAL(fp_keysize) = atoi(strtok_r(NULL, ":", &strtok_buf));
- strtok_r(NULL, ":", &strtok_buf);
- FP_GLOBAL(fp_fcount) = atoi(strtok_r(NULL, ":", &strtok_buf));
+ FP_GLOBAL(fp_keysize) = atoi(php_strtok_r(NULL, ":", &strtok_buf));
+ php_strtok_r(NULL, ":", &strtok_buf);
+ FP_GLOBAL(fp_fcount) = atoi(php_strtok_r(NULL, ":", &strtok_buf));
/* Read in the fields themselves */
for (i = 0; i < FP_GLOBAL(fp_fcount); i++) {
@@ -241,9 +241,9 @@
}
new_field = emalloc(sizeof(FP_FIELD));
new_field->next = NULL;
- new_field->name = estrdup(strtok_r(readbuf, ":", &strtok_buf));
- new_field->width = atoi(strtok_r(NULL, ":", &strtok_buf));
- new_field->format = estrdup(strtok_r(NULL, ":", &strtok_buf));
+ new_field->name = estrdup(php_strtok_r(readbuf, ":", &strtok_buf));
+ new_field->width = atoi(php_strtok_r(NULL, ":", &strtok_buf));
+ new_field->format = estrdup(php_strtok_r(NULL, ":", &strtok_buf));
/* Store in forward-order to save time later */
if (!FP_GLOBAL(fp_fieldlist)) {
Index: php4/ext/ftp/ftp.c
diff -u php4/ext/ftp/ftp.c:1.15 php4/ext/ftp/ftp.c:1.16
--- php4/ext/ftp/ftp.c:1.15 Tue Feb 22 12:50:00 2000
+++ php4/ext/ftp/ftp.c Thu May 4 03:38:13 2000
@@ -28,7 +28,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: ftp.c,v 1.15 2000/02/22 20:50:00 askalski Exp $ */
+/* $Id: ftp.c,v 1.16 2000/05/04 10:38:13 sas Exp $ */
#include "php.h"
@@ -635,7 +635,7 @@
/* figure out the GMT offset */
stamp = time(NULL);
- gmt = gmtime_r(&stamp, &tmbuf);
+ gmt = php_gmtime_r(&stamp, &tmbuf);
gmt->tm_isdst = -1;
/* apply the GMT offset */
Index: php4/ext/hyperwave/hw.c
diff -u php4/ext/hyperwave/hw.c:1.51 php4/ext/hyperwave/hw.c:1.52
--- php4/ext/hyperwave/hw.c:1.51 Mon May 1 17:44:23 2000
+++ php4/ext/hyperwave/hw.c Thu May 4 03:38:13 2000
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: hw.c,v 1.51 2000/05/02 00:44:23 sas Exp $ */
+/* $Id: hw.c,v 1.52 2000/05/04 10:38:13 sas Exp $ */
#if defined(COMPILE_DL) || defined(COMPILE_DL_HYPERWAVE)
#include "dl/phpdl.h"
#endif
@@ -316,7 +316,7 @@
to the return_value array.
*/
temp = estrdup(objrec);
- attrname = strtok_r(temp, "\n", &strtok_buf);
+ attrname = php_strtok_r(temp, "\n", &strtok_buf);
while(attrname != NULL) {
zval *data, **dataptr;
long spec;
@@ -372,7 +372,7 @@
}
}
- attrname = strtok_r(NULL, "\n", &strtok_buf);
+ attrname = php_strtok_r(NULL, "\n", &strtok_buf);
}
if(NULL == sarr){
// spec_arr->refcount--;
@@ -413,7 +413,7 @@
/* Fill Array of titles, descriptions and keywords */
temp = estrdup(objrec);
- attrname = strtok_r(temp, "\n", &strtok_buf);
+ attrname = php_strtok_r(temp, "\n", &strtok_buf);
while(attrname != NULL) {
str = attrname;
iTitle = 0;
@@ -468,7 +468,7 @@
if(iGroup)
add_next_index_string(group_arr, str, 1);
}
- attrname = strtok_r(NULL, "\n", &strtok_buf);
+ attrname = php_strtok_r(NULL, "\n", &strtok_buf);
}
efree(temp);
@@ -507,7 +507,7 @@
/* All other attributes. Make a another copy first */
temp = estrdup(objrec);
- attrname = strtok_r(temp, "\n", &strtok_buf);
+ attrname = php_strtok_r(temp, "\n", &strtok_buf);
while(attrname != NULL) {
str = attrname;
/* We don't want to insert titles, descr., keywords a second time */
@@ -521,7 +521,7 @@
str++;
add_assoc_string(*return_value, attrname, str, 1);
}
- attrname = strtok_r(NULL, "\n", &strtok_buf);
+ attrname = php_strtok_r(NULL, "\n", &strtok_buf);
}
efree(temp);
@@ -1171,7 +1171,7 @@
}
temp = estrdup(ptr);
- attrname = strtok_r(temp, "\n", &strtok_buf);
+ attrname = php_strtok_r(temp, "\n", &strtok_buf);
i = 0;
while(attrname != NULL) {
char *name;
@@ -1245,7 +1245,7 @@
/* Add the user array */
zend_hash_index_update(return_value->value.ht, i++, &user_arr, sizeof(pval), NULL);
- attrname = strtok_r(NULL, "\n", &strtok_buf);
+ attrname = php_strtok_r(NULL, "\n", &strtok_buf);
}
efree(temp);
efree(object);
Index: php4/ext/session/session.c
diff -u php4/ext/session/session.c:1.133 php4/ext/session/session.c:1.134
--- php4/ext/session/session.c:1.133 Mon May 1 17:44:25 2000
+++ php4/ext/session/session.c Thu May 4 03:38:14 2000
@@ -485,7 +485,7 @@
char buf[MAX_STR];
struct tm tm;
- gmtime_r(when, &tm);
+ php_gmtime_r(when, &tm);
/* we know all components, thus it is safe to use sprintf */
sprintf(buf, "%s, %d %s %d %02d:%02d:%02d GMT", week_days[tm.tm_wday], tm.tm_mday,
month_names[tm.tm_mon], tm.tm_year + 1900, tm.tm_hour, tm.tm_min, tm.tm_sec);
Index: php4/ext/standard/datetime.c
diff -u php4/ext/standard/datetime.c:1.36 php4/ext/standard/datetime.c:1.37
--- php4/ext/standard/datetime.c:1.36 Tue Mar 28 12:47:47 2000
+++ php4/ext/standard/datetime.c Thu May 4 03:38:14 2000
@@ -19,7 +19,7 @@
*/
-/* $Id: datetime.c,v 1.36 2000/03/28 20:47:47 eschmid Exp $ */
+/* $Id: datetime.c,v 1.37 2000/05/04 10:38:14 sas Exp $ */
#include "php.h"
@@ -103,7 +103,7 @@
** default parameters for PHP gmmktime would be the current
** GMT time values...
*/
- ta = localtime_r(&t, &tmbuf);
+ ta = php_localtime_r(&t, &tmbuf);
/* Let DST be unknown. mktime() should compute the right value
** and behave correctly. Unless the user overrides this.
@@ -221,9 +221,9 @@
convert_to_string_ex(format);
if (gm) {
- ta = gmtime_r(&the_time, &tmbuf);
+ ta = php_gmtime_r(&the_time, &tmbuf);
} else {
- ta = localtime_r(&the_time, &tmbuf);
+ ta = php_localtime_r(&the_time, &tmbuf);
}
if (!ta) { /* that really shouldn't happen... */
@@ -489,7 +489,7 @@
assoc_array = (*assoc_array_arg)->value.lval;
break;
}
- ta = localtime_r(×tamp, &tmbuf);
+ ta = php_localtime_r(×tamp, &tmbuf);
if (array_init(return_value) == FAILURE) {
php_error(E_ERROR, "Cannot prepare return array from localtime");
RETURN_FALSE;
@@ -536,7 +536,7 @@
timestamp = (*timestamp_arg)->value.lval;
}
- ta = localtime_r(×tamp, &tmbuf);
+ ta = php_localtime_r(×tamp, &tmbuf);
if (!ta) {
php_error(E_WARNING, "Cannot perform date calculation");
return;
@@ -566,7 +566,7 @@
char *str;
PLS_FETCH();
- tm1 = gmtime_r(&t, &tmbuf);
+ tm1 = php_gmtime_r(&t, &tmbuf);
str = emalloc(81);
if (PG(y2k_compliance)) {
snprintf(str, 80, "%s, %02d %s %04d %02d:%02d:%02d GMT",
@@ -658,9 +658,9 @@
}
format = (*format_arg)->value.str.val;
if (gm) {
- ta = gmtime_r(×tamp, &tmbuf);
+ ta = php_gmtime_r(×tamp, &tmbuf);
} else {
- ta = localtime_r(×tamp, &tmbuf);
+ ta = php_localtime_r(×tamp, &tmbuf);
}
buf = (char *) emalloc(buf_len);
Index: php4/ext/standard/info.c
diff -u php4/ext/standard/info.c:1.88 php4/ext/standard/info.c:1.89
--- php4/ext/standard/info.c:1.88 Thu Apr 27 11:37:02 2000
+++ php4/ext/standard/info.c Thu May 4 03:38:14 2000
@@ -136,7 +136,7 @@
SLS_FETCH();
the_time = time(NULL);
- ta = localtime_r(&the_time, &tmbuf);
+ ta = php_localtime_r(&the_time, &tmbuf);
if (flag & PHP_INFO_GENERAL) {
#ifdef PHP_WIN32
Index: php4/ext/standard/parsedate.y
diff -u php4/ext/standard/parsedate.y:1.17 php4/ext/standard/parsedate.y:1.18
--- php4/ext/standard/parsedate.y:1.17 Fri Feb 11 07:59:29 2000
+++ php4/ext/standard/parsedate.y Thu May 4 03:38:14 2000
@@ -1,5 +1,5 @@
%{
-/* $Revision: 1.17 $
+/* $Revision: 1.18 $
**
** Originally written by Steven M. Bellovin <smb@research.att.com> while
** at the University of North Carolina at Chapel Hill. Later tweaked by
@@ -556,13 +556,13 @@
/* Now get the timezone if the last time < HH:00:00 <= now for some HH. */
if (NextHour <= Now->time) {
- if ((tm = localtime_r(&Now->time, &tmbuf)) == NULL)
+ if ((tm = php_localtime_r(&Now->time, &tmbuf)) == NULL)
return -1;
secondsUntilNextHour = 60 * (60 - tm->tm_min) - tm->tm_sec;
#if !defined(HAVE_TM_GMTOFF)
/* To get the timezone, compare localtime with GMT. */
local = *tm;
- if ((tm = gmtime_r(&Now->time, &tmbuf)) == NULL)
+ if ((tm = php_gmtime_r(&Now->time, &tmbuf)) == NULL)
return -1;
gmt = *tm;
@@ -661,7 +661,7 @@
return -1;
Julian += tod;
tod = Julian;
- if (dst == DSTon || (dst == DSTmaybe && localtime_r(&tod,&tmbuf)->tm_isdst))
+ if (dst == DSTon || (dst == DSTmaybe &&
php_localtime_r(&tod,&tmbuf)->tm_isdst))
Julian -= DST_OFFSET * 60 * 60;
return Julian;
}
@@ -674,8 +674,8 @@
time_t FutureDay;
struct tm tmbuf;
- StartDay = (localtime_r(&Start,&tmbuf)->tm_hour + 1) % 24;
- FutureDay = (localtime_r(&Future,&tmbuf)->tm_hour + 1) % 24;
+ StartDay = (php_localtime_r(&Start,&tmbuf)->tm_hour + 1) % 24;
+ FutureDay = (php_localtime_r(&Future,&tmbuf)->tm_hour + 1) % 24;
return (Future - Start) + (StartDay - FutureDay) * DST_OFFSET * 60 * 60;
}
@@ -687,7 +687,7 @@
time_t Month;
time_t Year;
- tm = localtime_r(&Start, &tmbuf);
+ tm = php_localtime_r(&Start, &tmbuf);
Month = 12 * tm->tm_year + tm->tm_mon + RelMonth;
Year = Month / 12;
Year += 1900;
@@ -862,7 +862,7 @@
(void)GetTimeInfo(&ti);
}
- tm = localtime_r(&now->time, &tmbuf);
+ tm = php_localtime_r(&now->time, &tmbuf);
yyYear = tm->tm_year + 1900;
yyMonth = tm->tm_mon + 1;
yyDay = tm->tm_mday;
Index: php4/sapi/isapi/php4isapi.c
diff -u php4/sapi/isapi/php4isapi.c:1.41 php4/sapi/isapi/php4isapi.c:1.42
--- php4/sapi/isapi/php4isapi.c:1.41 Wed Apr 19 08:21:22 2000
+++ php4/sapi/isapi/php4isapi.c Thu May 4 03:38:14 2000
@@ -356,7 +356,7 @@
return;
}
}
- variable = strtok_r(variable_buf, "\r\n", &strtok_buf);
+ variable = php_strtok_r(variable_buf, "\r\n", &strtok_buf);
while (variable) {
char *colon = strchr(variable, ':');
@@ -370,7 +370,7 @@
php_register_variable(variable, value, track_vars_array ELS_CC PLS_CC);
*colon = ':';
}
- variable = strtok_r(NULL, "\r\n", &strtok_buf);
+ variable = php_strtok_r(NULL, "\r\n", &strtok_buf);
}
if (variable_buf!=static_variable_buf) {
efree(variable_buf);
Index: php4/win32/registry.c
diff -u php4/win32/registry.c:1.6 php4/win32/registry.c:1.7
--- php4/win32/registry.c:1.6 Sat Apr 15 07:28:48 2000
+++ php4/win32/registry.c Thu May 4 03:38:14 2000
@@ -49,7 +49,7 @@
}
- path = p = strtok_r(path, "\\/", &strtok_buf);
+ path = p = php_strtok_r(path, "\\/", &strtok_buf);
while (p) {
HKEY hKey;
@@ -73,7 +73,7 @@
}
RegCloseKey(hKey);
- p = strtok_r(NULL, "\\/", &strtok_buf);
+ p = php_strtok_r(NULL, "\\/", &strtok_buf);
}
RegCloseKey(MainKey);
efree(orig_path);