00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef _UUID_UUID_H
00013 #define _UUID_UUID_H
00014
00015 #include <sys/types.h>
00016 #include <sys/time.h>
00017 #include <time.h>
00018
00019 #define UUID_STR_LEN 36
00020
00021 #ifdef DARWIN
00022
00023 #ifndef _POSIX_C_SOURCE
00024 #ifndef _UUID_T
00025 #define _UUID_T
00026 typedef __darwin_uuid_t uuid_t;
00027 #endif
00028 #endif
00029
00030 #else
00031
00032 typedef unsigned char uuid_t[16];
00033
00034 #endif
00035
00036
00037 #define UUID_VARIANT_NCS 0
00038 #define UUID_VARIANT_DCE 1
00039 #define UUID_VARIANT_MICROSOFT 2
00040 #define UUID_VARIANT_OTHER 3
00041
00042 #ifdef __cplusplus
00043 extern "C" {
00044 #endif
00045
00046
00047 void uuid_init(void);
00048
00049
00050 void uuid_shutdown(void);
00051
00052
00053 void uuid_clear(uuid_t uu);
00054
00055
00056 int uuid_compare(const uuid_t uu1, const uuid_t uu2);
00057
00058
00059 void uuid_copy(uuid_t dst, const uuid_t src);
00060
00061
00062 void uuid_generate(uuid_t out);
00063 void uuid_generate_random(uuid_t out);
00064 void uuid_generate_time(uuid_t out);
00065
00066
00067 int uuid_is_null(const uuid_t uu);
00068
00069
00070 int uuid_parse(const char *in, uuid_t uu);
00071
00072
00073 void uuid_unparse(const uuid_t uu, char *out);
00074
00075
00076 time_t uuid_time(const uuid_t uu, struct timeval *ret_tv);
00077 int uuid_type(const uuid_t uu);
00078 int uuid_variant(const uuid_t uu);
00079
00080 #ifdef __cplusplus
00081 }
00082 #endif
00083
00084 #endif
See file LICENSE for details about the license agreement for using,
modifying, copying or deriving work from this software.