2 Star 1 Fork 0

alvinor / pecl_snowflake

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
php_snowflake.h 2.17 KB
一键复制 编辑 原始数据 按行查看 历史
alvinor 提交于 2018-11-25 08:21 . Initial Git repository
/*
+----------------------------------------------------------------------+
| Snowflake |
+----------------------------------------------------------------------+
| Copyright (c) 2016 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.php.net/license/3_01.txt |
| If you did not receive a copy of the PHP license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
+----------------------------------------------------------------------+
| Author: hook <erntoo@gmail.com> |
+----------------------------------------------------------------------+
*/
#ifndef PHP_SNOWFLAKE_H
#define PHP_SNOWFLAKE_H
#define PHP_SNOWFLAKE_VERSION "1.0"
extern zend_module_entry snowflake_module_entry;
#define phpext_snowflake_ptr &snowflake_module_entry
#ifdef PHP_WIN32
#define PHP_SNOWFLAKE_API __declspec(dllexport)
#else
#define PHP_SNOWFLAKE_API
#endif
#ifdef ZTS
#include "TSRM.h"
#define SNOWFLAKE_G(v) TSRMG(snowflake_globals_id, zend_snowflake_globals *, v)
#else
#define SNOWFLAKE_G(v) (snowflake_globals.v)
#endif
ZEND_BEGIN_MODULE_GLOBALS(snowflake)
int initialized;
uint32_t node;
uint64_t epoch;
ZEND_END_MODULE_GLOBALS(snowflake)
PHP_MINIT_FUNCTION(snowflake);
PHP_MSHUTDOWN_FUNCTION(snowflake);
PHP_RINIT_FUNCTION(snowflake);
PHP_RSHUTDOWN_FUNCTION(snowflake);
PHP_MINFO_FUNCTION(snowflake);
PHP_FUNCTION(snowflake_id);
typedef volatile unsigned int atomic_t;
typedef struct {
uint32_t sequence;
uint64_t timestamp;
char name[10];
} shmdat_t;
#endif /* PHP_SNOWFLAKE_H */
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
* vim600: et sw=4 ts=4 fdm=marker
* vim<600: noet sw=4 ts=4
*/
C
1
https://gitee.com/alvinor/pecl_snowflake.git
git@gitee.com:alvinor/pecl_snowflake.git
alvinor
pecl_snowflake
pecl_snowflake
master

搜索帮助