You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

211 lines
5.4 KiB

24 years ago
24 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
27 years ago
26 years ago
26 years ago
  1. /*
  2. +----------------------------------------------------------------------+
  3. | PHP Version 4 |
  4. +----------------------------------------------------------------------+
  5. | Copyright (c) 1997-2002 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: Andi Gutmans <andi@zend.com> |
  16. | Zeev Suraski <zeev@zend.com> |
  17. +----------------------------------------------------------------------+
  18. */
  19. /* $Id$ */
  20. #ifndef BASIC_FUNCTIONS_H
  21. #define BASIC_FUNCTIONS_H
  22. #include <sys/stat.h>
  23. #include "zend_highlight.h"
  24. #include "url_scanner.h"
  25. #include "url_scanner_ex.h"
  26. extern zend_module_entry basic_functions_module;
  27. #define basic_functions_module_ptr &basic_functions_module
  28. PHP_MINIT_FUNCTION(basic);
  29. PHP_MSHUTDOWN_FUNCTION(basic);
  30. PHP_RINIT_FUNCTION(basic);
  31. PHP_RSHUTDOWN_FUNCTION(basic);
  32. PHP_MINFO_FUNCTION(basic);
  33. PHP_FUNCTION(constant);
  34. PHP_FUNCTION(toggle_short_open_tag);
  35. PHP_FUNCTION(sleep);
  36. PHP_FUNCTION(usleep);
  37. PHP_FUNCTION(flush);
  38. PHP_FUNCTION(ip2long);
  39. PHP_FUNCTION(long2ip);
  40. /* system functions */
  41. PHP_FUNCTION(getenv);
  42. PHP_FUNCTION(putenv);
  43. PHP_FUNCTION(getopt);
  44. PHP_FUNCTION(get_current_user);
  45. PHP_FUNCTION(set_time_limit);
  46. PHP_FUNCTION(get_cfg_var);
  47. PHP_FUNCTION(set_magic_quotes_runtime);
  48. PHP_FUNCTION(get_magic_quotes_runtime);
  49. PHP_FUNCTION(get_magic_quotes_gpc);
  50. PHP_FUNCTION(import_request_variables);
  51. PHP_FUNCTION(error_log);
  52. PHP_FUNCTION(call_user_func);
  53. PHP_FUNCTION(call_user_func_array);
  54. PHP_FUNCTION(call_user_method);
  55. PHP_FUNCTION(call_user_method_array);
  56. PHP_FUNCTION(register_shutdown_function);
  57. PHP_FUNCTION(highlight_file);
  58. PHP_FUNCTION(highlight_string);
  59. ZEND_API void php_get_highlight_struct(zend_syntax_highlighter_ini *syntax_highlighter_ini);
  60. PHP_FUNCTION(ini_get);
  61. PHP_FUNCTION(ini_get_all);
  62. PHP_FUNCTION(ini_set);
  63. PHP_FUNCTION(ini_restore);
  64. PHP_FUNCTION(print_r);
  65. PHP_FUNCTION(connection_aborted);
  66. PHP_FUNCTION(connection_status);
  67. PHP_FUNCTION(ignore_user_abort);
  68. PHP_FUNCTION(getservbyname);
  69. PHP_FUNCTION(getservbyport);
  70. PHP_FUNCTION(getprotobyname);
  71. PHP_FUNCTION(getprotobynumber);
  72. PHP_NAMED_FUNCTION(php_if_crc32);
  73. PHP_FUNCTION(register_tick_function);
  74. PHP_FUNCTION(unregister_tick_function);
  75. PHP_FUNCTION(is_uploaded_file);
  76. PHP_FUNCTION(move_uploaded_file);
  77. /* From the INI parser */
  78. PHP_FUNCTION(parse_ini_file);
  79. PHP_FUNCTION(str_rot13);
  80. #ifdef PHP_WIN32
  81. typedef unsigned int php_stat_len;
  82. #else
  83. typedef int php_stat_len;
  84. #endif
  85. PHPAPI int _php_error_log(int opt_err, char *message, char *opt, char *headers TSRMLS_DC);
  86. #if SIZEOF_INT == 4
  87. /* Most 32-bit and 64-bit systems have 32-bit ints */
  88. typedef unsigned int php_uint32;
  89. typedef signed int php_int32;
  90. #elif SIZEOF_LONG == 4
  91. /* 16-bit systems? */
  92. typedef unsigned long php_uint32;
  93. typedef signed int php_int32;
  94. #else
  95. #error Need type which holds 32 bits
  96. #endif
  97. #define MT_N (624)
  98. typedef struct {
  99. HashTable *user_shutdown_function_names;
  100. HashTable putenv_ht;
  101. zval *strtok_zval;
  102. char *strtok_string;
  103. char *locale_string;
  104. char *strtok_last;
  105. char strtok_table[256];
  106. ulong strtok_len;
  107. char str_ebuf[40];
  108. zval **array_walk_func_name;
  109. zval **user_compare_func_name;
  110. zend_llist *user_tick_functions;
  111. zval *active_ini_file_section;
  112. HashTable sm_protected_env_vars;
  113. char *sm_allowed_env_vars;
  114. /* pageinfo.c */
  115. long page_uid;
  116. long page_gid;
  117. long page_inode;
  118. long page_mtime;
  119. /* filestat.c */
  120. char *CurrentStatFile;
  121. php_stat_len CurrentStatLength;
  122. struct stat sb;
  123. struct stat lsb;
  124. /* rand.c */
  125. php_uint32 state[MT_N+1]; /* state vector + 1 extra to not violate ANSI C */
  126. php_uint32 *next; /* next random value is computed from here */
  127. int left; /* can *next++ this many times before reloading */
  128. unsigned int rand_seed; /* Seed for rand(), in ts version */
  129. zend_bool rand_is_seeded; /* Whether rand() has been seeded */
  130. zend_bool mt_rand_is_seeded; /* Whether mt_rand() has been seeded */
  131. /* syslog.c */
  132. int syslog_started;
  133. char *syslog_device;
  134. /* var.c */
  135. zend_class_entry *incomplete_class;
  136. /* url_scanner.c */
  137. url_adapt_state_t url_adapt_state;
  138. /* url_scanner_ex.re */
  139. url_adapt_state_ex_t url_adapt_state_ex;
  140. #ifdef HAVE_MMAP
  141. void *mmap_file;
  142. size_t mmap_len;
  143. #endif
  144. HashTable *aggregation_table;
  145. } php_basic_globals;
  146. #ifdef ZTS
  147. #define BG(v) TSRMG(basic_globals_id, php_basic_globals *, v)
  148. extern int basic_globals_id;
  149. #else
  150. #define BG(v) (basic_globals.v)
  151. extern php_basic_globals basic_globals;
  152. #endif
  153. #if HAVE_PUTENV
  154. typedef struct {
  155. char *putenv_string;
  156. char *previous_value;
  157. char *key;
  158. int key_len;
  159. } putenv_entry;
  160. #endif
  161. /* Values are comma-delimited
  162. */
  163. #define SAFE_MODE_PROTECTED_ENV_VARS "LD_LIBRARY_PATH"
  164. #define SAFE_MODE_ALLOWED_ENV_VARS "PHP_"
  165. #endif /* BASIC_FUNCTIONS_H */