php_fcgi.h 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /*
  2. +----------------------------------------------------------------------+
  3. | PHP Version 5 |
  4. +----------------------------------------------------------------------+
  5. | Copyright (c) 1997-2015 The PHP Group |
  6. +----------------------------------------------------------------------+
  7. | This source file is subject to version 3.01 of the PHP license, |
  8. | that is bundled with this package in the file LICENSE, and is |
  9. | available through the world-wide-web at the following url: |
  10. | http://www.php.net/license/3_01.txt |
  11. | If you did not receive a copy of the PHP license and are unable to |
  12. | obtain it through the world-wide-web, please send a note to |
  13. | license@php.net so we can mail you a copy immediately. |
  14. +----------------------------------------------------------------------+
  15. | Author: |
  16. +----------------------------------------------------------------------+
  17. */
  18. /* $Id$ */
  19. #ifndef PHP_FCGI_H
  20. #define PHP_FCGI_H
  21. extern zend_module_entry fcgi_module_entry;
  22. #define phpext_fcgi_ptr &fcgi_module_entry
  23. #define PHP_FCGI_VERSION "0.1.0" /* Replace with version number for your extension */
  24. #ifdef PHP_WIN32
  25. # define PHP_FCGI_API __declspec(dllexport)
  26. #elif defined(__GNUC__) && __GNUC__ >= 4
  27. # define PHP_FCGI_API __attribute__ ((visibility("default")))
  28. #else
  29. # define PHP_FCGI_API
  30. #endif
  31. #ifdef ZTS
  32. #include "TSRM.h"
  33. #endif
  34. PHP_MINIT_FUNCTION(fcgi);
  35. PHP_MSHUTDOWN_FUNCTION(fcgi);
  36. PHP_RINIT_FUNCTION(fcgi);
  37. PHP_RSHUTDOWN_FUNCTION(fcgi);
  38. PHP_MINFO_FUNCTION(fcgi);
  39. PHP_FUNCTION(confirm_fcgi_compiled); /* For testing, remove later. */
  40. PHP_FUNCTION(fcgi_init);
  41. PHP_FUNCTION(fcgi_fini);
  42. PHP_FUNCTION(fcgi_accept);
  43. PHP_FUNCTION(fcgi_finish);
  44. PHP_FUNCTION(fcgi_getparam);
  45. PHP_FUNCTION(fcgi_echo);
  46. /*
  47. Declare any global variables you may need between the BEGIN
  48. and END macros here:
  49. ZEND_BEGIN_MODULE_GLOBALS(fcgi)
  50. long global_value;
  51. char *global_string;
  52. ZEND_END_MODULE_GLOBALS(fcgi)
  53. */
  54. /* In every utility function you add that needs to use variables
  55. in php_fcgi_globals, call TSRMLS_FETCH(); after declaring other
  56. variables used by that function, or better yet, pass in TSRMLS_CC
  57. after the last function argument and declare your utility function
  58. with TSRMLS_DC after the last declared argument. Always refer to
  59. the globals in your function as FCGI_G(variable). You are
  60. encouraged to rename these macros something shorter, see
  61. examples in any other php module directory.
  62. */
  63. #ifdef ZTS
  64. #define FCGI_G(v) TSRMG(fcgi_globals_id, zend_fcgi_globals *, v)
  65. #else
  66. #define FCGI_G(v) (fcgi_globals.v)
  67. #endif
  68. #endif /* PHP_FCGI_H */
  69. /*
  70. * Local variables:
  71. * tab-width: 4
  72. * c-basic-offset: 4
  73. * End:
  74. * vim600: noet sw=4 ts=4 fdm=marker
  75. * vim<600: noet sw=4 ts=4
  76. */