| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
#ifndef _UUID_UUID_H |
| 37 |
#define _UUID_UUID_H |
| 38 |
|
| 39 |
#include <sys/types.h> |
| 40 |
#include <sys/time.h> |
| 41 |
#include <time.h> |
| 42 |
|
| 43 |
typedef unsigned char uuid_t[16]; |
| 44 |
|
| 45 |
|
| 46 |
#define UUID_VARIANT_NCS 0 |
| 47 |
#define UUID_VARIANT_DCE 1 |
| 48 |
#define UUID_VARIANT_MICROSOFT 2 |
| 49 |
#define UUID_VARIANT_OTHER 3 |
| 50 |
|
| 51 |
|
| 52 |
#define UUID_TYPE_DCE_TIME 1 |
| 53 |
#define UUID_TYPE_DCE_RANDOM 4 |
| 54 |
|
| 55 |
|
| 56 |
#ifdef __GNUC__ |
| 57 |
#define UUID_DEFINE(name,u0,u1,u2,u3,u4,u5,u6,u7,u8,u9,u10,u11,u12,u13,u14,u15) \ |
| 58 |
static const uuid_t name __attribute__ ((unused)) = {u0,u1,u2,u3,u4,u5,u6,u7,u8,u9,u10,u11,u12,u13,u14,u15} |
| 59 |
#else |
| 60 |
#define UUID_DEFINE(name,u0,u1,u2,u3,u4,u5,u6,u7,u8,u9,u10,u11,u12,u13,u14,u15) \ |
| 61 |
static const uuid_t name = {u0,u1,u2,u3,u4,u5,u6,u7,u8,u9,u10,u11,u12,u13,u14,u15} |
| 62 |
#endif |
| 63 |
|
| 64 |
#ifdef PSM_UUID |
| 65 |
#define UUID_STATIC static |
| 66 |
#else |
| 67 |
#define UUID_STATIC |
| 68 |
#endif |
| 69 |
|
| 70 |
#ifdef __cplusplus |
| 71 |
extern "C" { |
| 72 |
#endif |
| 73 |
|
| 74 |
|
| 75 |
UUID_STATIC void uuid_generate(uuid_t out); |
| 76 |
UUID_STATIC void uuid_generate_random(uuid_t out); |
| 77 |
UUID_STATIC void uuid_generate_time(uuid_t out); |
| 78 |
|
| 79 |
|
| 80 |
UUID_STATIC void uuid_clear(uuid_t uu); |
| 81 |
|
| 82 |
|
| 83 |
UUID_STATIC int uuid_compare(const uuid_t uu1, const uuid_t uu2); |
| 84 |
|
| 85 |
|
| 86 |
UUID_STATIC void uuid_copy(uuid_t dst, const uuid_t src); |
| 87 |
|
| 88 |
|
| 89 |
UUID_STATIC int uuid_is_null(const uuid_t uu); |
| 90 |
|
| 91 |
|
| 92 |
UUID_STATIC int uuid_parse(const char *in, uuid_t uu); |
| 93 |
|
| 94 |
|
| 95 |
UUID_STATIC void uuid_unparse(const uuid_t uu, char *out); |
| 96 |
UUID_STATIC void uuid_unparse_lower(const uuid_t uu, char *out); |
| 97 |
UUID_STATIC void uuid_unparse_upper(const uuid_t uu, char *out); |
| 98 |
|
| 99 |
|
| 100 |
UUID_STATIC time_t uuid_time(const uuid_t uu, struct timeval *ret_tv); |
| 101 |
UUID_STATIC int uuid_type(const uuid_t uu); |
| 102 |
UUID_STATIC int uuid_variant(const uuid_t uu); |
| 103 |
|
| 104 |
#ifdef __cplusplus |
| 105 |
} |
| 106 |
#endif |
| 107 |
|
| 108 |
#endif |