From 436cab2f1646a7fe54d977b7abf49fa3dfd86639 Mon Sep 17 00:00:00 2001 From: Emiel Bruijntjes Date: Sun, 6 Apr 2014 19:55:15 +0200 Subject: moved init.h from header files to src directory because it is zend-specific --- include/init.h | 54 ------------------------------------------------------ src/includes.h | 2 +- src/init.h | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 55 insertions(+), 55 deletions(-) delete mode 100644 include/init.h create mode 100644 src/init.h diff --git a/include/init.h b/include/init.h deleted file mode 100644 index 8f914f5..0000000 --- a/include/init.h +++ /dev/null @@ -1,54 +0,0 @@ -/** - * Init.h - * - * Variables and structured required by the Zend engine to work - * with global variables - * - * @author Emiel Bruijntjes - * @copyright 2013 Copernica BV - */ - -/** - * Namespace - */ -namespace Php { - -/** - * The way how PHP C API deals with "global" variables is peculiar. - * - * The following macros are supposed to turn into a structure that is going - * to be instantiated for each parallel running request, and for which the - * PHP engine allocates a certain amount of memory, and a magic pointer that - * is passed and should be forwarded to every thinkable PHP function. - * - * We don't use this architecture. We have our own environment object - * that makes much more sense, and that we use. However, the Zend engine - * expects this structure and this structure to exist. - */ -ZEND_BEGIN_MODULE_GLOBALS(phpcpp) -ZEND_END_MODULE_GLOBALS(phpcpp) - -/** - * And now we're going to define a macro. This also is a uncommon architecture - * from PHP to get access to a variable from the structure above. - */ -#ifdef ZTS -#define PHPCPP_G(v) TSRMG(phpcpp_globals_id, phpcpp_globals *, v) -#else -#define PHPCPP_G(v) (phpcpp_globals.v) -#endif - -/** - * We're almost there, we now need to declare an instance of the - * structure defined above (if building for a single thread) or some - * sort of impossible to understand magic pointer-to-a-pointer (for - * multi-threading builds). We make this a static variable because - * this already is bad enough. - */ -extern ZEND_DECLARE_MODULE_GLOBALS(phpcpp) - -/** - * End of namespace - */ -} - diff --git a/src/includes.h b/src/includes.h index 672cef1..6f28362 100644 --- a/src/includes.h +++ b/src/includes.h @@ -74,11 +74,11 @@ #include "../include/namespace.h" #include "../include/extension.h" #include "../include/call.h" -#include "../include/init.h" /** * Interface files for internal use only */ +#include "init.h" #include "callable.h" #include "function.h" #include "method.h" diff --git a/src/init.h b/src/init.h new file mode 100644 index 0000000..8f914f5 --- /dev/null +++ b/src/init.h @@ -0,0 +1,54 @@ +/** + * Init.h + * + * Variables and structured required by the Zend engine to work + * with global variables + * + * @author Emiel Bruijntjes + * @copyright 2013 Copernica BV + */ + +/** + * Namespace + */ +namespace Php { + +/** + * The way how PHP C API deals with "global" variables is peculiar. + * + * The following macros are supposed to turn into a structure that is going + * to be instantiated for each parallel running request, and for which the + * PHP engine allocates a certain amount of memory, and a magic pointer that + * is passed and should be forwarded to every thinkable PHP function. + * + * We don't use this architecture. We have our own environment object + * that makes much more sense, and that we use. However, the Zend engine + * expects this structure and this structure to exist. + */ +ZEND_BEGIN_MODULE_GLOBALS(phpcpp) +ZEND_END_MODULE_GLOBALS(phpcpp) + +/** + * And now we're going to define a macro. This also is a uncommon architecture + * from PHP to get access to a variable from the structure above. + */ +#ifdef ZTS +#define PHPCPP_G(v) TSRMG(phpcpp_globals_id, phpcpp_globals *, v) +#else +#define PHPCPP_G(v) (phpcpp_globals.v) +#endif + +/** + * We're almost there, we now need to declare an instance of the + * structure defined above (if building for a single thread) or some + * sort of impossible to understand magic pointer-to-a-pointer (for + * multi-threading builds). We make this a static variable because + * this already is bad enough. + */ +extern ZEND_DECLARE_MODULE_GLOBALS(phpcpp) + +/** + * End of namespace + */ +} + -- cgit v1.2.3