PageRenderTime 53ms CodeModel.GetById 14ms RepoModel.GetById 1ms app.codeStats 0ms

/release/src-rt-6.x.4708/router/php/ext/standard/basic_functions.h

https://bitbucket.org/oglop/tomato-arm-kille72
C Header | 271 lines | 188 code | 53 blank | 30 comment | 3 complexity | 03ea07c2f9c50b22645013d02e5f02aa MD5 | raw file
Possible License(s): LGPL-2.0, LGPL-3.0, MPL-2.0-no-copyleft-exception, 0BSD, BSD-3-Clause, WTFPL, CC-BY-SA-3.0, LGPL-2.1, GPL-3.0, GPL-2.0
  1. /*
  2. +----------------------------------------------------------------------+
  3. | PHP Version 7 |
  4. +----------------------------------------------------------------------+
  5. | Copyright (c) 1997-2018 The PHP Group |
  6. +----------------------------------------------------------------------+
  7. | This source file is subject to version 3.01 of the PHP license, |
  8. | that is bundled with this package in the file LICENSE, and is |
  9. | available through the world-wide-web at the following url: |
  10. | http://www.php.net/license/3_01.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. #ifdef HAVE_WCHAR_H
  24. #include <wchar.h>
  25. #endif
  26. #include "php_filestat.h"
  27. #include "zend_highlight.h"
  28. #include "url_scanner_ex.h"
  29. #if defined(_WIN32) && defined(__clang__)
  30. #include <intrin.h>
  31. #endif
  32. extern zend_module_entry basic_functions_module;
  33. #define basic_functions_module_ptr &basic_functions_module
  34. PHP_MINIT_FUNCTION(basic);
  35. PHP_MSHUTDOWN_FUNCTION(basic);
  36. PHP_RINIT_FUNCTION(basic);
  37. PHP_RSHUTDOWN_FUNCTION(basic);
  38. PHP_MINFO_FUNCTION(basic);
  39. PHP_FUNCTION(constant);
  40. PHP_FUNCTION(sleep);
  41. PHP_FUNCTION(usleep);
  42. #if HAVE_NANOSLEEP
  43. PHP_FUNCTION(time_nanosleep);
  44. PHP_FUNCTION(time_sleep_until);
  45. #endif
  46. PHP_FUNCTION(flush);
  47. #ifdef HAVE_INET_NTOP
  48. PHP_NAMED_FUNCTION(php_inet_ntop);
  49. #endif
  50. #ifdef HAVE_INET_PTON
  51. PHP_NAMED_FUNCTION(php_inet_pton);
  52. #endif
  53. PHP_FUNCTION(ip2long);
  54. PHP_FUNCTION(long2ip);
  55. /* system functions */
  56. PHP_FUNCTION(getenv);
  57. PHP_FUNCTION(putenv);
  58. PHP_FUNCTION(getopt);
  59. PHP_FUNCTION(get_current_user);
  60. PHP_FUNCTION(set_time_limit);
  61. PHP_FUNCTION(header_register_callback);
  62. PHP_FUNCTION(get_cfg_var);
  63. PHP_FUNCTION(get_magic_quotes_runtime);
  64. PHP_FUNCTION(get_magic_quotes_gpc);
  65. PHP_FUNCTION(error_log);
  66. PHP_FUNCTION(error_get_last);
  67. PHP_FUNCTION(error_clear_last);
  68. PHP_FUNCTION(call_user_func);
  69. PHP_FUNCTION(call_user_func_array);
  70. PHP_FUNCTION(forward_static_call);
  71. PHP_FUNCTION(forward_static_call_array);
  72. PHP_FUNCTION(register_shutdown_function);
  73. PHP_FUNCTION(highlight_file);
  74. PHP_FUNCTION(highlight_string);
  75. PHP_FUNCTION(php_strip_whitespace);
  76. ZEND_API void php_get_highlight_struct(zend_syntax_highlighter_ini *syntax_highlighter_ini);
  77. PHP_FUNCTION(ini_get);
  78. PHP_FUNCTION(ini_get_all);
  79. PHP_FUNCTION(ini_set);
  80. PHP_FUNCTION(ini_restore);
  81. PHP_FUNCTION(get_include_path);
  82. PHP_FUNCTION(set_include_path);
  83. PHP_FUNCTION(restore_include_path);
  84. PHP_FUNCTION(print_r);
  85. PHP_FUNCTION(fprintf);
  86. PHP_FUNCTION(vfprintf);
  87. PHP_FUNCTION(connection_aborted);
  88. PHP_FUNCTION(connection_status);
  89. PHP_FUNCTION(ignore_user_abort);
  90. PHP_FUNCTION(getservbyname);
  91. PHP_FUNCTION(getservbyport);
  92. PHP_FUNCTION(getprotobyname);
  93. PHP_FUNCTION(getprotobynumber);
  94. PHP_NAMED_FUNCTION(php_if_crc32);
  95. PHP_FUNCTION(register_tick_function);
  96. PHP_FUNCTION(unregister_tick_function);
  97. #ifdef HAVE_GETLOADAVG
  98. PHP_FUNCTION(sys_getloadavg);
  99. #endif
  100. PHP_FUNCTION(is_uploaded_file);
  101. PHP_FUNCTION(move_uploaded_file);
  102. /* From the INI parser */
  103. PHP_FUNCTION(parse_ini_file);
  104. PHP_FUNCTION(parse_ini_string);
  105. #if ZEND_DEBUG
  106. PHP_FUNCTION(config_get_hash);
  107. #endif
  108. #if defined(PHP_WIN32)
  109. PHP_FUNCTION(sapi_windows_cp_set);
  110. PHP_FUNCTION(sapi_windows_cp_get);
  111. PHP_FUNCTION(sapi_windows_cp_is_utf8);
  112. PHP_FUNCTION(sapi_windows_cp_conv);
  113. #endif
  114. PHP_FUNCTION(str_rot13);
  115. PHP_FUNCTION(stream_get_filters);
  116. PHP_FUNCTION(stream_filter_register);
  117. PHP_FUNCTION(stream_bucket_make_writeable);
  118. PHP_FUNCTION(stream_bucket_prepend);
  119. PHP_FUNCTION(stream_bucket_append);
  120. PHP_FUNCTION(stream_bucket_new);
  121. PHP_MINIT_FUNCTION(user_filters);
  122. PHP_RSHUTDOWN_FUNCTION(user_filters);
  123. PHP_RSHUTDOWN_FUNCTION(browscap);
  124. /* Left for BC (not binary safe!) */
  125. PHPAPI int _php_error_log(int opt_err, char *message, char *opt, char *headers);
  126. PHPAPI int _php_error_log_ex(int opt_err, char *message, size_t message_len, char *opt, char *headers);
  127. PHPAPI int php_prefix_varname(zval *result, zval *prefix, char *var_name, size_t var_name_len, zend_bool add_underscore);
  128. #define MT_N (624)
  129. /* Deprecated type aliases -- use the standard types instead */
  130. typedef uint32_t php_uint32;
  131. typedef int32_t php_int32;
  132. typedef struct _php_basic_globals {
  133. HashTable *user_shutdown_function_names;
  134. HashTable putenv_ht;
  135. zval strtok_zval;
  136. char *strtok_string;
  137. zend_string *locale_string; /* current LC_CTYPE locale (or NULL for 'C') */
  138. zend_bool locale_changed; /* locale was changed and has to be restored */
  139. char *strtok_last;
  140. char strtok_table[256];
  141. zend_ulong strtok_len;
  142. char str_ebuf[40];
  143. zend_fcall_info array_walk_fci;
  144. zend_fcall_info_cache array_walk_fci_cache;
  145. zend_fcall_info user_compare_fci;
  146. zend_fcall_info_cache user_compare_fci_cache;
  147. zend_llist *user_tick_functions;
  148. zval active_ini_file_section;
  149. /* pageinfo.c */
  150. zend_long page_uid;
  151. zend_long page_gid;
  152. zend_long page_inode;
  153. time_t page_mtime;
  154. /* filestat.c && main/streams/streams.c */
  155. char *CurrentStatFile, *CurrentLStatFile;
  156. php_stream_statbuf ssb, lssb;
  157. /* mt_rand.c */
  158. uint32_t state[MT_N+1]; /* state vector + 1 extra to not violate ANSI C */
  159. uint32_t *next; /* next random value is computed from here */
  160. int left; /* can *next++ this many times before reloading */
  161. zend_bool mt_rand_is_seeded; /* Whether mt_rand() has been seeded */
  162. zend_long mt_rand_mode;
  163. /* syslog.c */
  164. char *syslog_device;
  165. /* var.c */
  166. zend_class_entry *incomplete_class;
  167. unsigned serialize_lock; /* whether to use the locally supplied var_hash instead (__sleep/__wakeup) */
  168. struct {
  169. struct php_serialize_data *data;
  170. unsigned level;
  171. } serialize;
  172. struct {
  173. struct php_unserialize_data *data;
  174. unsigned level;
  175. } unserialize;
  176. /* url_scanner_ex.re */
  177. url_adapt_state_ex_t url_adapt_session_ex;
  178. HashTable url_adapt_session_hosts_ht;
  179. url_adapt_state_ex_t url_adapt_output_ex;
  180. HashTable url_adapt_output_hosts_ht;
  181. #ifdef HAVE_MMAP
  182. void *mmap_file;
  183. size_t mmap_len;
  184. #endif
  185. HashTable *user_filter_map;
  186. /* file.c */
  187. #if defined(_REENTRANT) && defined(HAVE_MBRLEN) && defined(HAVE_MBSTATE_T)
  188. mbstate_t mblen_state;
  189. #endif
  190. int umask;
  191. } php_basic_globals;
  192. #ifdef ZTS
  193. #define BG(v) ZEND_TSRMG(basic_globals_id, php_basic_globals *, v)
  194. PHPAPI extern int basic_globals_id;
  195. #else
  196. #define BG(v) (basic_globals.v)
  197. PHPAPI extern php_basic_globals basic_globals;
  198. #endif
  199. #if HAVE_PUTENV
  200. typedef struct {
  201. char *putenv_string;
  202. char *previous_value;
  203. char *key;
  204. int key_len;
  205. } putenv_entry;
  206. #endif
  207. PHPAPI double php_get_nan(void);
  208. PHPAPI double php_get_inf(void);
  209. typedef struct _php_shutdown_function_entry {
  210. zval *arguments;
  211. int arg_count;
  212. } php_shutdown_function_entry;
  213. PHPAPI extern zend_bool register_user_shutdown_function(char *function_name, size_t function_len, php_shutdown_function_entry *shutdown_function_entry);
  214. PHPAPI extern zend_bool remove_user_shutdown_function(char *function_name, size_t function_len);
  215. PHPAPI extern zend_bool append_user_shutdown_function(php_shutdown_function_entry shutdown_function_entry);
  216. PHPAPI void php_call_shutdown_functions(void);
  217. PHPAPI void php_free_shutdown_functions(void);
  218. #endif /* BASIC_FUNCTIONS_H */