summaryrefslogtreecommitdiff
path: root/src/php_snuffleupagus.h
diff options
context:
space:
mode:
authorSebastien Blot2017-09-20 10:11:01 +0200
committerSebastien Blot2017-09-20 10:11:01 +0200
commit868f96c759b6650d88ff9f4fbc5c048302134248 (patch)
treec0de0af318bf77a8959164ef11aeeeb2b7bab294 /src/php_snuffleupagus.h
Initial import
Diffstat (limited to 'src/php_snuffleupagus.h')
-rw-r--r--src/php_snuffleupagus.h71
1 files changed, 71 insertions, 0 deletions
diff --git a/src/php_snuffleupagus.h b/src/php_snuffleupagus.h
new file mode 100644
index 0000000..e7a3d59
--- /dev/null
+++ b/src/php_snuffleupagus.h
@@ -0,0 +1,71 @@
1#ifndef PHP_SNUFFLEUPAGUS_H
2#define PHP_SNUFFLEUPAGUS_H
3
4#define PHP_SNUFFLEUPAGUS_VERSION "0.1"
5#define PHP_SNUFFLEUPAGUS_EXTNAME "snuffleupagus"
6#define PHP_SNUFFLEUPAGUS_AUTHOR "NBS System"
7#define PHP_SNUFFLEUPAGUS_URL "https://github.com/nbs-system/snuffleupagus"
8#define PHP_SNUFFLEUPAGUS_COPYRIGHT "LGPLv2"
9
10#include <stdbool.h>
11#include <stdio.h>
12
13#include <pcre.h>
14#include <sys/types.h>
15#include <sys/wait.h>
16
17#include "SAPI.h"
18#include "ext/standard/info.h"
19#include "php.h"
20#include "php_ini.h"
21#include "zend_hash.h"
22#include "zend_string.h"
23#include "zend_extensions.h"
24
25#include "sp_list.h"
26#include "sp_compile.h"
27#include "sp_config.h"
28#include "sp_config_utils.h"
29#include "sp_config_keywords.h"
30#include "sp_cookie_encryption.h"
31#include "sp_disable_xxe.h"
32#include "sp_disabled_functions.h"
33#include "sp_execute.h"
34#include "sp_harden_rand.h"
35#include "sp_network_utils.h"
36#include "sp_unserialize.h"
37#include "sp_upload_validation.h"
38#include "sp_utils.h"
39
40extern zend_module_entry snuffleupagus_module_entry;
41#define phpext_snuffleupagus_ptr &snuffleupagus_module_entry
42
43#ifdef PHP_WIN32
44#define PHP_SNUFFLEUPAGUS_API __declspec(dllexport)
45#elif defined(__GNUC__) && __GNUC__ >= 4
46#define PHP_SNUFFLEUPAGUS_API __attribute__((visibility("default")))
47#else
48#define PHP_SNUFFLEUPAGUS_API
49#endif
50
51#ifdef ZTS
52#include "TSRM.h"
53#endif
54
55ZEND_BEGIN_MODULE_GLOBALS(snuffleupagus)
56sp_config config;
57HashTable *disabled_functions_hook;
58HashTable *sp_internal_functions_hook;
59ZEND_END_MODULE_GLOBALS(snuffleupagus)
60
61#define SNUFFLEUPAGUS_G(v) ZEND_MODULE_GLOBALS_ACCESSOR(snuffleupagus, v)
62
63#if defined(ZTS) && defined(COMPILE_DL_SNUFFLEUPAGUS)
64ZEND_TSRMLS_CACHE_EXTERN()
65#endif
66
67PHP_FUNCTION(check_disabled_function);
68
69static inline void sp_terminate() { zend_bailout(); }
70
71#endif /* PHP_SNUFFLEUPAGUS_H */