home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 26 / AACD 26.iso / AACD / Online / PHP / include / php / main / php_reentrancy.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-02-26  |  3.5 KB  |  125 lines

  1. /*
  2.    +----------------------------------------------------------------------+
  3.    | PHP version 4.0                                                      |
  4.    +----------------------------------------------------------------------+
  5.    | Copyright (c) 1997-2001 The PHP Group                                |
  6.    +----------------------------------------------------------------------+
  7.    | This source file is subject to version 2.02 of the PHP license,      |
  8.    | that is bundled with this package in the file LICENSE, and is        |
  9.    | available at through the world-wide-web at                           |
  10.    | http://www.php.net/license/2_02.txt.                                 |
  11.    | If you did not receive a copy of the PHP license and are unable to   |
  12.    | obtain it through the world-wide-web, please send a note to          |
  13.    | license@php.net so we can mail you a copy immediately.               |
  14.    +----------------------------------------------------------------------+
  15.    | Authors: Sascha Schumann <sascha@schumann.cx>                        |
  16.    +----------------------------------------------------------------------+
  17.  */
  18.  
  19.  
  20. #ifndef PHP_REENTRANCY_H
  21. #define PHP_REENTRANCY_H
  22.  
  23. #include "php.h"
  24.  
  25. #include <sys/types.h>
  26. #ifdef HAVE_DIRENT_H
  27. #include <dirent.h>
  28. #endif
  29. #include <time.h>
  30.  
  31. /* currently, PHP does not check for these functions, but assumes
  32.    that they are available on all systems. */
  33.  
  34. #define HAVE_LOCALTIME 1
  35. #define HAVE_GMTIME 1
  36. #define HAVE_ASCTIME 1
  37. #define HAVE_CTIME 1
  38.  
  39.  
  40. #ifdef PHP_HPUX_TIME_R
  41. #undef HAVE_LOCALTIME_R
  42. #undef HAVE_ASCTIME_R
  43. #undef HAVE_CTIME_R
  44. #undef HAVE_GMTIME_R
  45. #endif
  46.  
  47. #if defined(HAVE_POSIX_READDIR_R)
  48. #define php_readdir_r readdir_r
  49. #else
  50. PHPAPI int php_readdir_r(DIR *dirp, struct dirent *entry,
  51.         struct dirent **result);
  52. #endif
  53.  
  54. #if !defined(HAVE_LOCALTIME_R) && defined(HAVE_LOCALTIME)
  55. #define PHP_NEED_REENTRANCY 1
  56. PHPAPI struct tm *php_localtime_r(const time_t *const timep, struct tm *p_tm);
  57. #else
  58. #define php_localtime_r localtime_r
  59. #ifdef MISSING_LOCALTIME_R_DECL
  60. struct tm *localtime_r(const time_t *const timep, struct tm *p_tm);
  61. #endif
  62. #endif
  63.  
  64.  
  65. #if !defined(HAVE_CTIME_R) && defined(HAVE_CTIME)
  66. #define PHP_NEED_REENTRANCY 1
  67. PHPAPI char *php_ctime_r(const time_t *clock, char *buf);
  68. #else
  69. #define php_ctime_r ctime_r
  70. #ifdef MISSING_CTIME_R_DECL
  71. char *ctime_r(const time_t *clock, char *buf);
  72. #endif
  73. #endif
  74.  
  75.  
  76. #if !defined(HAVE_ASCTIME_R) && defined(HAVE_ASCTIME)
  77. #define PHP_NEED_REENTRANCY 1
  78. PHPAPI char *php_asctime_r(const struct tm *tm, char *buf);
  79. #else
  80. #define php_asctime_r asctime_r
  81. #ifdef MISSING_ASCTIME_R_DECL
  82. char *asctime_r(const struct tm *tm, char *buf);
  83. #endif
  84. #endif
  85.  
  86.  
  87. #if !defined(HAVE_GMTIME_R) && defined(HAVE_GMTIME)
  88. #define PHP_NEED_REENTRANCY 1
  89. PHPAPI struct tm *php_gmtime_r(const time_t *const timep, struct tm *p_tm);
  90. #else
  91. #define php_gmtime_r gmtime_r
  92. #ifdef MISSING_GMTIME_R_DECL
  93. struct tm *php_gmtime_r(const time_t *const timep, struct tm *p_tm);
  94. #endif
  95. #endif
  96.  
  97. #if !defined(HAVE_STRTOK_R)
  98. PHPAPI char *php_strtok_r(char *s, const char *delim, char **last);
  99. #else
  100. #define php_strtok_r strtok_r
  101. #ifdef MISSING_STRTOK_R_DECL
  102. char *strtok_r(char *s, const char *delim, char **last);
  103. #endif
  104. #endif
  105.  
  106. #if !defined(HAVE_RAND_R)
  107. PHPAPI int php_rand_r(unsigned int *seed);
  108. #else
  109. #define php_rand_r rand_r
  110. #endif
  111.  
  112. #if !defined(ZTS)
  113. #undef PHP_NEED_REENTRANCY
  114. #endif
  115.  
  116. #if defined(PHP_NEED_REENTRANCY)
  117. void reentrancy_startup(void);
  118. void reentrancy_shutdown(void);
  119. #else
  120. #define reentrancy_startup()
  121. #define reentrancy_shutdown()
  122. #endif
  123.  
  124. #endif    
  125.