php_skeleton.h 1.4 KB

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