xref: /php-src/main/php_variables.h (revision bc30ae4f)
1 /*
2    +----------------------------------------------------------------------+
3    | Copyright (c) The PHP Group                                          |
4    +----------------------------------------------------------------------+
5    | This source file is subject to version 3.01 of the PHP license,      |
6    | that is bundled with this package in the file LICENSE, and is        |
7    | available through the world-wide-web at the following url:           |
8    | https://www.php.net/license/3_01.txt                                 |
9    | If you did not receive a copy of the PHP license and are unable to   |
10    | obtain it through the world-wide-web, please send a note to          |
11    | license@php.net so we can mail you a copy immediately.               |
12    +----------------------------------------------------------------------+
13    | Authors: Rasmus Lerdorf <rasmus@lerdorf.on.ca>                       |
14    |          Zeev Suraski <zeev@php.net>                                 |
15    +----------------------------------------------------------------------+
16 */
17 
18 #ifndef PHP_VARIABLES_H
19 #define PHP_VARIABLES_H
20 
21 #include "php.h"
22 #include "SAPI.h"
23 
24 #define PARSE_POST 0
25 #define PARSE_GET 1
26 #define PARSE_COOKIE 2
27 #define PARSE_STRING 3
28 #define PARSE_ENV 4
29 #define PARSE_SERVER 5
30 #define PARSE_SESSION 6
31 
32 BEGIN_EXTERN_C()
33 void php_startup_auto_globals(void);
34 extern PHPAPI void (*php_import_environment_variables)(zval *array_ptr);
35 extern PHPAPI void (*php_load_environment_variables)(zval *array_ptr);
36 PHPAPI void php_register_variable(const char *var, const char *val, zval *track_vars_array);
37 /* binary-safe version */
38 PHPAPI void php_register_variable_safe(const char *var, const char *val, size_t val_len, zval *track_vars_array);
39 PHPAPI void php_register_variable_ex(const char *var, zval *val, zval *track_vars_array);
40 PHPAPI void php_register_known_variable(const char *var, size_t var_len, zval *value, zval *track_vars_array);
41 
42 PHPAPI void php_build_argv(const char *s, zval *track_vars_array);
43 PHPAPI int php_hash_environment(void);
44 END_EXTERN_C()
45 
46 #define NUM_TRACK_VARS	6
47 
48 #endif /* PHP_VARIABLES_H */
49