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