1999-11-27 01:12:01 +08:00
|
|
|
/*
|
|
|
|
+----------------------------------------------------------------------+
|
2019-01-30 17:03:12 +08:00
|
|
|
| Copyright (c) The PHP Group |
|
1999-11-27 01:12:01 +08:00
|
|
|
+----------------------------------------------------------------------+
|
2006-01-01 20:51:34 +08:00
|
|
|
| This source file is subject to version 3.01 of the PHP license, |
|
1999-11-27 01:12:01 +08:00
|
|
|
| that is bundled with this package in the file LICENSE, and is |
|
2003-06-11 04:04:29 +08:00
|
|
|
| available through the world-wide-web at the following url: |
|
2021-05-06 18:16:35 +08:00
|
|
|
| https://www.php.net/license/3_01.txt |
|
1999-11-27 01:12:01 +08:00
|
|
|
| If you did not receive a copy of the PHP license and are unable to |
|
|
|
|
| obtain it through the world-wide-web, please send a note to |
|
|
|
|
| license@php.net so we can mail you a copy immediately. |
|
|
|
|
+----------------------------------------------------------------------+
|
2002-02-28 16:29:35 +08:00
|
|
|
| Author: Sascha Schumann <sascha@schumann.cx> |
|
1999-11-27 01:12:01 +08:00
|
|
|
+----------------------------------------------------------------------+
|
|
|
|
*/
|
|
|
|
|
1999-11-27 01:07:41 +08:00
|
|
|
#ifndef PHP_REENTRANCY_H
|
|
|
|
#define PHP_REENTRANCY_H
|
|
|
|
|
1999-11-28 01:11:20 +08:00
|
|
|
#include "php.h"
|
1999-11-27 01:07:41 +08:00
|
|
|
|
2000-05-23 23:13:16 +08:00
|
|
|
#include <sys/types.h>
|
2000-05-23 23:15:48 +08:00
|
|
|
#ifdef HAVE_DIRENT_H
|
2000-05-23 23:13:16 +08:00
|
|
|
#include <dirent.h>
|
2000-05-23 23:15:48 +08:00
|
|
|
#endif
|
1999-11-27 01:07:41 +08:00
|
|
|
#include <time.h>
|
|
|
|
|
|
|
|
/* currently, PHP does not check for these functions, but assumes
|
|
|
|
that they are available on all systems. */
|
|
|
|
|
|
|
|
#define HAVE_LOCALTIME 1
|
|
|
|
#define HAVE_GMTIME 1
|
|
|
|
#define HAVE_ASCTIME 1
|
|
|
|
#define HAVE_CTIME 1
|
|
|
|
|
2001-05-21 05:29:55 +08:00
|
|
|
#if defined(PHP_IRIX_TIME_R)
|
|
|
|
#undef HAVE_ASCTIME_R
|
|
|
|
#undef HAVE_CTIME_R
|
|
|
|
#endif
|
1999-11-27 01:07:41 +08:00
|
|
|
|
2001-05-21 05:29:55 +08:00
|
|
|
#if defined(PHP_HPUX_TIME_R)
|
2000-04-17 00:32:51 +08:00
|
|
|
#undef HAVE_LOCALTIME_R
|
|
|
|
#undef HAVE_ASCTIME_R
|
|
|
|
#undef HAVE_CTIME_R
|
|
|
|
#undef HAVE_GMTIME_R
|
|
|
|
#endif
|
|
|
|
|
2004-02-20 16:04:30 +08:00
|
|
|
BEGIN_EXTERN_C()
|
|
|
|
|
1999-11-27 01:07:41 +08:00
|
|
|
#if !defined(HAVE_LOCALTIME_R) && defined(HAVE_LOCALTIME)
|
|
|
|
#define PHP_NEED_REENTRANCY 1
|
2000-05-04 18:38:17 +08:00
|
|
|
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
|
1999-11-27 01:07:41 +08:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#if !defined(HAVE_CTIME_R) && defined(HAVE_CTIME)
|
|
|
|
#define PHP_NEED_REENTRANCY 1
|
2000-05-04 18:38:17 +08:00
|
|
|
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
|
1999-11-27 01:07:41 +08:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#if !defined(HAVE_ASCTIME_R) && defined(HAVE_ASCTIME)
|
|
|
|
#define PHP_NEED_REENTRANCY 1
|
2000-05-04 18:38:17 +08:00
|
|
|
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
|
1999-11-27 01:07:41 +08:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2017-08-30 04:03:56 +08:00
|
|
|
#if !defined(HAVE_GMTIME_R) && defined(HAVE_GMTIME)
|
1999-11-27 01:07:41 +08:00
|
|
|
#define PHP_NEED_REENTRANCY 1
|
2000-05-04 18:38:17 +08:00
|
|
|
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
|
1999-11-27 01:07:41 +08:00
|
|
|
#endif
|
|
|
|
|
1999-11-27 01:33:53 +08:00
|
|
|
#if !defined(HAVE_STRTOK_R)
|
2000-05-04 18:38:17 +08:00
|
|
|
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
|
1999-11-27 01:33:53 +08:00
|
|
|
#endif
|
|
|
|
|
2004-02-20 16:04:30 +08:00
|
|
|
END_EXTERN_C()
|
|
|
|
|
1999-11-27 01:33:53 +08:00
|
|
|
#if !defined(ZTS)
|
|
|
|
#undef PHP_NEED_REENTRANCY
|
|
|
|
#endif
|
1999-11-27 01:07:41 +08:00
|
|
|
|
1999-11-27 01:33:53 +08:00
|
|
|
#if defined(PHP_NEED_REENTRANCY)
|
1999-11-27 01:07:41 +08:00
|
|
|
void reentrancy_startup(void);
|
|
|
|
void reentrancy_shutdown(void);
|
|
|
|
#else
|
|
|
|
#define reentrancy_startup()
|
|
|
|
#define reentrancy_shutdown()
|
|
|
|
#endif
|
|
|
|
|
2015-01-03 17:22:58 +08:00
|
|
|
#endif
|