Back to index

php5  5.3.10
php_skeleton.h
Go to the documentation of this file.
00001 /* __header_here__ */
00002 
00003 #ifndef PHP_EXTNAME_H
00004 #define PHP_EXTNAME_H
00005 
00006 extern zend_module_entry extname_module_entry;
00007 #define phpext_extname_ptr &extname_module_entry
00008 
00009 #ifdef PHP_WIN32
00010 #      define PHP_EXTNAME_API __declspec(dllexport)
00011 #elif defined(__GNUC__) && __GNUC__ >= 4
00012 #      define PHP_EXTNAME_API __attribute__ ((visibility("default")))
00013 #else
00014 #      define PHP_EXTNAME_API
00015 #endif
00016 
00017 #ifdef ZTS
00018 #include "TSRM.h"
00019 #endif
00020 
00021 PHP_MINIT_FUNCTION(extname);
00022 PHP_MSHUTDOWN_FUNCTION(extname);
00023 PHP_RINIT_FUNCTION(extname);
00024 PHP_RSHUTDOWN_FUNCTION(extname);
00025 PHP_MINFO_FUNCTION(extname);
00026 
00027 PHP_FUNCTION(confirm_extname_compiled);   /* For testing, remove later. */
00028 /* __function_declarations_here__ */
00029 
00030 /* 
00031        Declare any global variables you may need between the BEGIN
00032        and END macros here:     
00033 
00034 ZEND_BEGIN_MODULE_GLOBALS(extname)
00035        long  global_value;
00036        char *global_string;
00037 ZEND_END_MODULE_GLOBALS(extname)
00038 */
00039 
00040 /* In every utility function you add that needs to use variables 
00041    in php_extname_globals, call TSRMLS_FETCH(); after declaring other 
00042    variables used by that function, or better yet, pass in TSRMLS_CC
00043    after the last function argument and declare your utility function
00044    with TSRMLS_DC after the last declared argument.  Always refer to
00045    the globals in your function as EXTNAME_G(variable).  You are 
00046    encouraged to rename these macros something shorter, see
00047    examples in any other php module directory.
00048 */
00049 
00050 #ifdef ZTS
00051 #define EXTNAME_G(v) TSRMG(extname_globals_id, zend_extname_globals *, v)
00052 #else
00053 #define EXTNAME_G(v) (extname_globals.v)
00054 #endif
00055 
00056 #endif /* PHP_EXTNAME_H */
00057 
00058 /* __footer_here__ */