1 /* __header_here__ */ 2 3 #ifndef PHP_EXTNAME_H 4 #define PHP_EXTNAME_H 5 6 extern zend_module_entry extname_module_entry; 7 #define phpext_extname_ptr &extname_module_entry 8 9 #define PHP_EXTNAME_VERSION "0.1.0" /* Replace with version number for your extension */ 10 11 #ifdef PHP_WIN32 12 # define PHP_EXTNAME_API __declspec(dllexport) 13 #elif defined(__GNUC__) && __GNUC__ >= 4 14 # define PHP_EXTNAME_API __attribute__ ((visibility("default"))) 15 #else 16 # define PHP_EXTNAME_API 17 #endif 18 19 #ifdef ZTS 20 #include "TSRM.h" 21 #endif 22 23 PHP_MINIT_FUNCTION(extname); 24 PHP_MSHUTDOWN_FUNCTION(extname); 25 PHP_RINIT_FUNCTION(extname); 26 PHP_RSHUTDOWN_FUNCTION(extname); 27 PHP_MINFO_FUNCTION(extname); 28 29 PHP_FUNCTION(confirm_extname_compiled); /* For testing, remove later. */ 30 /* __function_declarations_here__ */ 31 32 /* 33 Declare any global variables you may need between the BEGIN 34 and END macros here: 35 36 ZEND_BEGIN_MODULE_GLOBALS(extname) 37 long global_value; 38 char *global_string; 39 ZEND_END_MODULE_GLOBALS(extname) 40 */ 41 42 /* In every utility function you add that needs to use variables 43 in php_extname_globals, call TSRMLS_FETCH(); after declaring other 44 variables used by that function, or better yet, pass in TSRMLS_CC 45 after the last function argument and declare your utility function 46 with TSRMLS_DC after the last declared argument. Always refer to 47 the globals in your function as EXTNAME_G(variable). You are 48 encouraged to rename these macros something shorter, see 49 examples in any other php module directory. 50 */ 51 52 #ifdef ZTS 53 #define EXTNAME_G(v) TSRMG(extname_globals_id, zend_extname_globals *, v) 54 #else 55 #define EXTNAME_G(v) (extname_globals.v) 56 #endif 57 58 #endif /* PHP_EXTNAME_H */ 59 60 /* __footer_here__ */ 61