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