From 868f96c759b6650d88ff9f4fbc5c048302134248 Mon Sep 17 00:00:00 2001 From: Sebastien Blot Date: Wed, 20 Sep 2017 10:11:01 +0200 Subject: Initial import --- src/php_snuffleupagus.h | 71 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 src/php_snuffleupagus.h (limited to 'src/php_snuffleupagus.h') 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 @@ +#ifndef PHP_SNUFFLEUPAGUS_H +#define PHP_SNUFFLEUPAGUS_H + +#define PHP_SNUFFLEUPAGUS_VERSION "0.1" +#define PHP_SNUFFLEUPAGUS_EXTNAME "snuffleupagus" +#define PHP_SNUFFLEUPAGUS_AUTHOR "NBS System" +#define PHP_SNUFFLEUPAGUS_URL "https://github.com/nbs-system/snuffleupagus" +#define PHP_SNUFFLEUPAGUS_COPYRIGHT "LGPLv2" + +#include +#include + +#include +#include +#include + +#include "SAPI.h" +#include "ext/standard/info.h" +#include "php.h" +#include "php_ini.h" +#include "zend_hash.h" +#include "zend_string.h" +#include "zend_extensions.h" + +#include "sp_list.h" +#include "sp_compile.h" +#include "sp_config.h" +#include "sp_config_utils.h" +#include "sp_config_keywords.h" +#include "sp_cookie_encryption.h" +#include "sp_disable_xxe.h" +#include "sp_disabled_functions.h" +#include "sp_execute.h" +#include "sp_harden_rand.h" +#include "sp_network_utils.h" +#include "sp_unserialize.h" +#include "sp_upload_validation.h" +#include "sp_utils.h" + +extern zend_module_entry snuffleupagus_module_entry; +#define phpext_snuffleupagus_ptr &snuffleupagus_module_entry + +#ifdef PHP_WIN32 +#define PHP_SNUFFLEUPAGUS_API __declspec(dllexport) +#elif defined(__GNUC__) && __GNUC__ >= 4 +#define PHP_SNUFFLEUPAGUS_API __attribute__((visibility("default"))) +#else +#define PHP_SNUFFLEUPAGUS_API +#endif + +#ifdef ZTS +#include "TSRM.h" +#endif + +ZEND_BEGIN_MODULE_GLOBALS(snuffleupagus) +sp_config config; +HashTable *disabled_functions_hook; +HashTable *sp_internal_functions_hook; +ZEND_END_MODULE_GLOBALS(snuffleupagus) + +#define SNUFFLEUPAGUS_G(v) ZEND_MODULE_GLOBALS_ACCESSOR(snuffleupagus, v) + +#if defined(ZTS) && defined(COMPILE_DL_SNUFFLEUPAGUS) +ZEND_TSRMLS_CACHE_EXTERN() +#endif + +PHP_FUNCTION(check_disabled_function); + +static inline void sp_terminate() { zend_bailout(); } + +#endif /* PHP_SNUFFLEUPAGUS_H */ -- cgit v1.3