You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

php_snowdrift.h 2.4 kB

4 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /*
  2. +----------------------------------------------------------------------+
  3. | snowdrift |
  4. +----------------------------------------------------------------------+
  5. | Copyright (c) 1997-2018 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. | 版权归属: yitter(yitter@126.com) |
  16. | Author: amuluowin(63851587@qq.com) |
  17. +----------------------------------------------------------------------+
  18. */
  19. /* $Id$ */
  20. #ifndef PHP_SNOWDRIFT_H
  21. #define PHP_SNOWDRIFT_H
  22. extern zend_module_entry snowdrift_module_entry;
  23. #define phpext_snowdrift_ptr &snowdrift_module_entry
  24. #define PHP_SNOWDRIFT_VERSION \
  25. "1.0.0" /* Replace with version number for your extension */
  26. #ifdef PHP_WIN32
  27. #define PHP_SNOWDRIFT_API __declspec(dllexport)
  28. #elif defined(__GNUC__) && __GNUC__ >= 4
  29. #define PHP_SNOWDRIFT_API __attribute__((visibility("default")))
  30. #else
  31. #define PHP_SNOWDRIFT_API
  32. #endif
  33. #ifdef ZTS
  34. #include "TSRM.h"
  35. #endif
  36. // PHP8
  37. #if PHP_VERSION_ID >= 80000
  38. #define TSRMLS_D void
  39. #define TSRMLS_DC
  40. #define TSRMLS_C
  41. #define TSRMLS_CC
  42. #define TSRMLS_FETCH()
  43. #define ZEND_ACC_DTOR 0
  44. #endif
  45. ZEND_BEGIN_MODULE_GLOBALS(snowdrift)
  46. uint8_t Method;
  47. uint64_t BaseTime;
  48. uint8_t WorkerId;
  49. uint8_t WorkerIdBitLength;
  50. uint8_t SeqBitLength;
  51. uint32_t MaxSeqNumber;
  52. uint32_t MinSeqNumber;
  53. uint16_t TopOverCostCount;
  54. ZEND_END_MODULE_GLOBALS(snowdrift)
  55. ZEND_DECLARE_MODULE_GLOBALS(snowdrift)
  56. #define SD_G(v) ZEND_MODULE_GLOBALS_ACCESSOR(snowdrift, v)
  57. #if defined(ZTS) && defined(COMPILE_DL_SNOWDRIFT)
  58. ZEND_TSRMLS_CACHE_EXTERN()
  59. #endif
  60. static int snowdrift_init();
  61. #endif /* PHP_SNOWDRIFT_H */