xref: /php-src/ext/filter/php_filter.h (revision 01b3fc03)
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@php.net>                             |
14   |          Derick Rethans <derick@php.net>                             |
15   +----------------------------------------------------------------------+
16 */
17 
18 #ifndef PHP_FILTER_H
19 #define PHP_FILTER_H
20 
21 #include "SAPI.h"
22 #include "zend_API.h"
23 #include "php.h"
24 #include "php_ini.h"
25 #include "ext/standard/info.h"
26 #include "ext/standard/php_string.h"
27 #include "ext/standard/html.h"
28 #include "php_variables.h"
29 
30 extern zend_module_entry filter_module_entry;
31 #define phpext_filter_ptr &filter_module_entry
32 
33 #ifdef ZTS
34 #include "TSRM.h"
35 #endif
36 
37 #define PHP_FILTER_VERSION PHP_VERSION
38 
39 PHP_MINIT_FUNCTION(filter);
40 PHP_MSHUTDOWN_FUNCTION(filter);
41 PHP_RINIT_FUNCTION(filter);
42 PHP_RSHUTDOWN_FUNCTION(filter);
43 PHP_MINFO_FUNCTION(filter);
44 
45 ZEND_BEGIN_MODULE_GLOBALS(filter)
46 	zval post_array;
47 	zval get_array;
48 	zval cookie_array;
49 	zval env_array;
50 	zval server_array;
51 #if 0
52 	zval session_array;
53 #endif
54 	zend_long default_filter;
55 	zend_long default_filter_flags;
56 ZEND_END_MODULE_GLOBALS(filter)
57 
58 #if defined(COMPILE_DL_FILTER) && defined(ZTS)
59 ZEND_TSRMLS_CACHE_EXTERN()
60 #endif
61 
62 #define IF_G(v) ZEND_MODULE_GLOBALS_ACCESSOR(filter, v)
63 
64 #define PHP_INPUT_FILTER_PARAM_DECL zval *value, zend_long flags, zval *option_array, char *charset
65 void php_filter_int(PHP_INPUT_FILTER_PARAM_DECL);
66 void php_filter_boolean(PHP_INPUT_FILTER_PARAM_DECL);
67 void php_filter_float(PHP_INPUT_FILTER_PARAM_DECL);
68 void php_filter_validate_regexp(PHP_INPUT_FILTER_PARAM_DECL);
69 void php_filter_validate_domain(PHP_INPUT_FILTER_PARAM_DECL);
70 void php_filter_validate_url(PHP_INPUT_FILTER_PARAM_DECL);
71 void php_filter_validate_email(PHP_INPUT_FILTER_PARAM_DECL);
72 void php_filter_validate_ip(PHP_INPUT_FILTER_PARAM_DECL);
73 void php_filter_validate_mac(PHP_INPUT_FILTER_PARAM_DECL);
74 
75 void php_filter_string(PHP_INPUT_FILTER_PARAM_DECL);
76 void php_filter_encoded(PHP_INPUT_FILTER_PARAM_DECL);
77 void php_filter_special_chars(PHP_INPUT_FILTER_PARAM_DECL);
78 void php_filter_full_special_chars(PHP_INPUT_FILTER_PARAM_DECL);
79 void php_filter_unsafe_raw(PHP_INPUT_FILTER_PARAM_DECL);
80 void php_filter_email(PHP_INPUT_FILTER_PARAM_DECL);
81 void php_filter_url(PHP_INPUT_FILTER_PARAM_DECL);
82 void php_filter_number_int(PHP_INPUT_FILTER_PARAM_DECL);
83 void php_filter_number_float(PHP_INPUT_FILTER_PARAM_DECL);
84 void php_filter_add_slashes(PHP_INPUT_FILTER_PARAM_DECL);
85 
86 void php_filter_callback(PHP_INPUT_FILTER_PARAM_DECL);
87 
88 #endif	/* FILTER_H */
89