#ifndef PHP_PQ_H
#define PHP_PQ_H
-#define PHP_PQ_EXT_VERSION "1.0.0dev"
-
-int pq_module_number;
-zend_module_entry pq_module_entry;
-#define phpext_pq_ptr &pq_module_entry
+#define PHP_PQ_VERSION "2.1.7"
#ifdef PHP_WIN32
# define PHP_PQ_API __declspec(dllexport)
#elif defined(__GNUC__) && __GNUC__ >= 4
-# define PHP_PQ_API __attribute__ ((visibility("default")))
+# define PHP_PQ_API extern __attribute__ ((visibility("default")))
#else
-# define PHP_PQ_API
+# define PHP_PQ_API extern
#endif
-#ifdef ZTS
-# include "TSRM.h"
-#endif
+extern int pq_module_number;
+extern zend_module_entry pq_module_entry;
+#define phpext_pq_ptr &pq_module_entry
+
+ZEND_BEGIN_MODULE_GLOBALS(php_pq)
+ struct {
+ /* for ext-raphf */
+ zend_string *name;
+ } connection;
+ZEND_END_MODULE_GLOBALS(php_pq)
-/*
-ZEND_BEGIN_MODULE_GLOBALS(pq)
- long global_value;
- char *global_string;
-ZEND_END_MODULE_GLOBALS(pq)
+ZEND_EXTERN_MODULE_GLOBALS(php_pq);
#ifdef ZTS
-#define PQ_G(v) TSRMG(pq_globals_id, zend_pq_globals *, v)
+# include "TSRM/TSRM.h"
+# define PHP_PQ_G ((zend_php_pq_globals *) (*((void ***) tsrm_get_ls_cache()))[TSRM_UNSHUFFLE_RSRC_ID(php_pq_globals_id)])
#else
-#define PQ_G(v) (pq_globals.v)
+# define PHP_PQ_G (&php_pq_globals)
#endif
-*/
#endif /* PHP_PQ_H */