Main Page | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

gw_uuid.h

Go to the documentation of this file.
00001 /*
00002  * Public include file for the UUID library
00003  * 
00004  * Copyright (C) 1996, 1997, 1998 Theodore Ts'o.
00005  *
00006  * %Begin-Header%
00007  * This file may be redistributed under the terms of the GNU 
00008  * Library General Public License.
00009  * %End-Header%
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 /* _UUID_T */
00028 #endif /* _POSIX_C_SOURCE */
00029 
00030 #else
00031 
00032 typedef unsigned char uuid_t[16];
00033 
00034 #endif
00035 
00036 /* UUID Variant definitions */
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 /* initialize uuid library */
00047 void uuid_init(void);
00048 
00049 /* shutdown uuid library */
00050 void uuid_shutdown(void);
00051 
00052 /* clear.c */
00053 void uuid_clear(uuid_t uu);
00054 
00055 /* compare.c */
00056 int uuid_compare(const uuid_t uu1, const uuid_t uu2);
00057 
00058 /* copy.c */
00059 void uuid_copy(uuid_t dst, const uuid_t src);
00060 
00061 /* gen_uuid.c */
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 /* isnull.c */
00067 int uuid_is_null(const uuid_t uu);
00068 
00069 /* parse.c */
00070 int uuid_parse(const char *in, uuid_t uu);
00071 
00072 /* unparse.c */
00073 void uuid_unparse(const uuid_t uu, char *out);
00074 
00075 /* uuid_time.c */
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 /* _UUID_UUID_H */
See file LICENSE for details about the license agreement for using, modifying, copying or deriving work from this software.