]> git.cameronkatri.com Git - trustcache.git/blob - uuid/uuid.h
Add support for new version 2 trustcaches
[trustcache.git] / uuid / uuid.h
1 #ifndef _UUID_H_
2 #define _UUID_H_
3
4 #include <stdint.h>
5
6 typedef unsigned char uuid_t[16];
7
8 struct uuid {
9 uint32_t time_low;
10 uint16_t time_mid;
11 uint16_t time_hi_and_version;
12 uint16_t clock_seq;
13 uint8_t node[6];
14 };
15
16 void uuid_generate(uuid_t out);
17 void uuid_unpack(const uuid_t in, struct uuid *uu);
18 void uuid_pack(const struct uuid *uu, uuid_t ptr);
19 int uuid_parse(const char *in, uuid_t uu);
20 void uuid_unparse(const uuid_t uu, char *out);
21 void uuid_copy(uuid_t dst, const uuid_t src);
22
23 #endif