diff options
| author | Cameron Katri <me@cameronkatri.com> | 2022-05-20 10:42:38 -0400 |
|---|---|---|
| committer | Cameron Katri <me@cameronkatri.com> | 2022-05-20 10:42:38 -0400 |
| commit | aa035f73ce081b3f07247bd15860d72355a096b2 (patch) | |
| tree | 170a83f5aa816f936df5ae906f20da3fb6b9404e /uuid/uuid.h | |
| download | trustcache-aa035f73ce081b3f07247bd15860d72355a096b2.tar.gz trustcache-aa035f73ce081b3f07247bd15860d72355a096b2.zip | |
Initial import
Diffstat (limited to 'uuid/uuid.h')
| -rw-r--r-- | uuid/uuid.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/uuid/uuid.h b/uuid/uuid.h new file mode 100644 index 0000000..a4be9a5 --- /dev/null +++ b/uuid/uuid.h @@ -0,0 +1,23 @@ +#ifndef _UUID_H_ +#define _UUID_H_ + +#include <sys/types.h> + +typedef unsigned char uuid_t[16]; + +struct uuid { + uint32_t time_low; + uint16_t time_mid; + uint16_t time_hi_and_version; + uint16_t clock_seq; + uint8_t node[6]; +}; + +void uuid_generate(uuid_t out); +void uuid_unpack(const uuid_t in, struct uuid *uu); +void uuid_pack(const struct uuid *uu, uuid_t ptr); +int uuid_parse(const char *in, uuid_t uu); +void uuid_unparse(const uuid_t uu, char *out); +void uuid_copy(uuid_t dst, const uuid_t src); + +#endif |
