23 lines
409 B
C
23 lines
409 B
C
#if !defined(_IDGEN_H_)
|
|
|
|
#define _IDGEN_H_ 1
|
|
|
|
#include "config.h"
|
|
|
|
#include <stdint.h>
|
|
#include <sys/types.h>
|
|
#include <time.h>
|
|
|
|
#include "mylock.h"
|
|
|
|
typedef struct {
|
|
mylock_t lock;
|
|
time_t timestamp;
|
|
uint32_t sequence;
|
|
} idgen_ctx_t;
|
|
|
|
extern int idgen_ctx_init(idgen_ctx_t*);
|
|
extern int idgen(idgen_ctx_t*, size_t, size_t, size_t, uint64_t*);
|
|
extern void idgen_ctx_fini(idgen_ctx_t*);
|
|
|
|
#endif
|