1
0
mirror of synced 2025-12-13 16:48:08 +08:00
Files
SnowFlake-IdGenerator/C/source/idgen/IdGenerator.h
AuroraTea 2da2aa8b4b fix: compatibility of C and C++
// fix: move .h to .c for cpp
// static IdGenerator *_idGenerator = NULL;
2023-01-23 17:35:48 +08:00

27 lines
515 B
C
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/*
* 版权属于yitter(yitter@126.com)
* 开源地址https://gitee.com/yitter/idgenerator
*/
#pragma once
#include <stdio.h>
#include <malloc.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include "IdGenOptions.h"
#include "SnowWorkerM1.h"
#include "SnowWorkerM2.h"
typedef struct IdGenerator {
SnowFlakeWorker *Worker;
uint64_t (*NextId)();
} IdGenerator;
extern IdGenerator *GetIdGenInstance();
extern void SetOptions(IdGeneratorOptions options);