head 1.16; access; symbols UUID_1_6_2:1.15 UUID_1_6_1:1.15 UUID_1_6_0:1.14 UUID_1_5_1:1.12 UUID_1_5_0:1.12 UUID_1_4_2:1.11 UUID_1_4_1:1.11 UUID_1_4_0:1.10 UUID_1_3_2:1.9 UUID_1_3_1:1.9 UUID_1_3_0:1.9 UUID_1_2_1:1.7 UUID_1_2_0:1.6 UUID_1_1_2:1.5 UUID_1_1_1:1.4 UUID_1_1_0:1.4 UUID_1_0_4:1.4 UUID_1_0_3:1.4 UUID_1_0_2:1.4 UUID_1_0_1:1.4 UUID_1_0_0:1.4 UUID_0_9_7:1.4 UUID_0_9_6:1.4 UUID_0_9_5:1.4 UUID_0_9_4:1.4; locks; strict; comment @# @; 1.16 date 2008.07.05.12.58.16; author rse; state dead; branches; next 1.15; commitid XLXN7vUmABwPcC9t; 1.15 date 2008.01.10.14.18.47; author rse; state Exp; branches; next 1.14; commitid LqMgFGBgTR7clSMs; 1.14 date 2007.01.01.18.14.54; author rse; state Exp; branches; next 1.13; commitid jOXiIO8S8v7xFP0s; 1.13 date 2006.10.06.08.32.40; author rse; state Exp; branches; next 1.12; commitid UUM6UebO1uCWeBPr; 1.12 date 2006.05.11.09.37.28; author rse; state Exp; branches; next 1.11; commitid u4EPMISJDipjmAwr; 1.11 date 2006.02.07.08.19.15; author rse; state Exp; branches; next 1.10; commitid ysd3ZoQahbomUCkr; 1.10 date 2006.01.13.06.44.30; author rse; state Exp; branches; next 1.9; commitid hYfQc9JIMh4bcphr; 1.9 date 2005.08.31.19.20.43; author rse; state Exp; branches; next 1.8; 1.8 date 2005.08.31.14.28.28; author rse; state Exp; branches; next 1.7; 1.7 date 2005.03.29.19.01.41; author rse; state Exp; branches; next 1.6; 1.6 date 2005.01.23.11.28.51; author rse; state Exp; branches; next 1.5; 1.5 date 2004.12.31.19.20.34; author rse; state Exp; branches; next 1.4; 1.4 date 2004.01.19.14.11.50; author rse; state Exp; branches; next 1.3; 1.3 date 2004.01.19.13.48.30; author rse; state Exp; branches; next 1.2; 1.2 date 2004.01.19.12.19.25; author rse; state Exp; branches; next 1.1; 1.1 date 2004.01.18.20.19.23; author rse; state Exp; branches; next ; desc @@ 1.16 log @remove OSSP uuid from CVS -- it is now versioned controlled in a Monotone repository @ text @/* ** OSSP uuid - Universally Unique Identifier ** Copyright (c) 2004-2008 Ralf S. Engelschall ** Copyright (c) 2004-2008 The OSSP Project ** ** This file is part of OSSP uuid, a library for the generation ** of UUIDs which can found at http://www.ossp.org/pkg/lib/uuid/ ** ** Permission to use, copy, modify, and distribute this software for ** any purpose with or without fee is hereby granted, provided that ** the above copyright notice and this permission notice appear in all ** copies. ** ** THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED ** WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF ** MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ** IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR ** CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF ** USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ** ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, ** OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT ** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF ** SUCH DAMAGE. ** ** uuid.h: library API definition */ #ifndef __UUID_H__ #define __UUID_H__ /* workaround conflicts with system headers */ #define uuid_t __vendor_uuid_t #define uuid_create __vendor_uuid_create #define uuid_compare __vendor_uuid_compare #include #include #undef uuid_t #undef uuid_create #undef uuid_compare /* required system headers */ #include /* minimum C++ support */ #ifdef __cplusplus #define DECLARATION_BEGIN extern "C" { #define DECLARATION_END } #else #define DECLARATION_BEGIN #define DECLARATION_END #endif DECLARATION_BEGIN /* OSSP uuid version (compile-time information) */ #define UUID_VERSION @@UUID_VERSION_HEX@@ /* encoding octet stream lengths */ #define UUID_LEN_BIN (128 /*bit*/ / 8 /*bytes*/) #define UUID_LEN_STR (128 /*bit*/ / 4 /*nibbles*/ + 4 /*hyphens*/) #define UUID_LEN_SIV (39 /*int(log(10,exp(2,128)-1)+1) digits*/) /* API return codes */ typedef enum { UUID_RC_OK = 0, /* everything ok */ UUID_RC_ARG = 1, /* invalid argument */ UUID_RC_MEM = 2, /* out of memory */ UUID_RC_SYS = 3, /* system error */ UUID_RC_INT = 4, /* internal error */ UUID_RC_IMP = 5 /* not implemented */ } uuid_rc_t; /* UUID make modes */ enum { UUID_MAKE_V1 = (1 << 0), /* DCE 1.1 v1 UUID */ UUID_MAKE_V3 = (1 << 1), /* DCE 1.1 v3 UUID */ UUID_MAKE_V4 = (1 << 2), /* DCE 1.1 v4 UUID */ UUID_MAKE_V5 = (1 << 3), /* DCE 1.1 v5 UUID */ UUID_MAKE_MC = (1 << 4) /* enforce multi-cast MAC address */ }; /* UUID import/export formats */ typedef enum { UUID_FMT_BIN = 0, /* binary representation (import/export) */ UUID_FMT_STR = 1, /* string representation (import/export) */ UUID_FMT_SIV = 2, /* single integer value (import/export) */ UUID_FMT_TXT = 3 /* textual description (export only) */ } uuid_fmt_t; /* UUID abstract data type */ struct uuid_st; typedef struct uuid_st uuid_t; /* UUID object handling */ extern uuid_rc_t uuid_create ( uuid_t **_uuid); extern uuid_rc_t uuid_destroy ( uuid_t *_uuid); extern uuid_rc_t uuid_clone (const uuid_t *_uuid, uuid_t **_clone); /* UUID generation */ extern uuid_rc_t uuid_load ( uuid_t *_uuid, const char *_name); extern uuid_rc_t uuid_make ( uuid_t *_uuid, unsigned int _mode, ...); /* UUID comparison */ extern uuid_rc_t uuid_isnil (const uuid_t *_uuid, int *_result); extern uuid_rc_t uuid_compare (const uuid_t *_uuid, const uuid_t *_uuid2, int *_result); /* UUID import/export */ extern uuid_rc_t uuid_import ( uuid_t *_uuid, uuid_fmt_t _fmt, const void *_data_ptr, size_t _data_len); extern uuid_rc_t uuid_export (const uuid_t *_uuid, uuid_fmt_t _fmt, void *_data_ptr, size_t *_data_len); /* library utilities */ extern char *uuid_error (uuid_rc_t _rc); extern unsigned long uuid_version (void); DECLARATION_END #endif /* __UUID_H__ */ @ 1.15 log @adjust copyright messages for 2008 and bump version in advance @ text @@ 1.14 log @Adjust copyright messages for new year 2007. @ text @d3 2 a4 2 ** Copyright (c) 2004-2007 Ralf S. Engelschall ** Copyright (c) 2004-2007 The OSSP Project @ 1.13 log @Change type of "data_ptr" argument in uuid_export() API signature from "void **" to "void *" as there is unfortunately no "generic pointer to pointer type" in ISO C (see also http://c-faq.com/ptrs/genericpp.html) and "void **" is just a "pointer to a 'void *'". The "void **" especially had the nasty side-effect that it breaks strict pointer aliasing rules of ISO C and hence would require fiddling with temporary variables on all uuid_export() calls if one would be 100% correct and avoid aliasing related compiler warnings. Instead, as uuid_export() internally has to cast the "data_ptr" to the particular expected type anyway, it is better to have "data_ptr" just be a really generic "void *" in the API signature. Keep in mind that although this is an API change, it doesn't cause any incompatibilities as the function still expects the same "pointer to a pointer of a particular type". This expected pointer is just now passed the more correct although less intuitive way. Submitted by: Hrvoje Niksic @ text @d3 2 a4 2 ** Copyright (c) 2004-2006 Ralf S. Engelschall ** Copyright (c) 2004-2006 The OSSP Project @ 1.12 log @Add full support for Single Integer Value (SIV) UUID representation for both importing and exporting in C/C++/Perl/PHP APIs. @ text @d111 1 a111 1 extern uuid_rc_t uuid_export (const uuid_t *_uuid, uuid_fmt_t _fmt, void **_data_ptr, size_t *_data_len); @ 1.11 log @Apply workaround to uuid.h to avoid conflicts with vendor UUID implementations where uuid_t (Darwin / MacOS X) or uuid_create/uuid_compare (POSIX) might exist. Supported by: SpaceNet (MacOS X platform) @ text @d63 1 d88 2 a89 1 UUID_FMT_TXT = 2 /* textual description (export only) */ @ 1.10 log @Adjust copyright messages for new year 2006. @ text @d33 10 @ 1.9 log @Add missing "const" in manual page and cleanup formatting in header file. @ text @d3 2 a4 2 ** Copyright (c) 2004-2005 Ralf S. Engelschall ** Copyright (c) 2004-2005 The OSSP Project @ 1.8 log @Cleanup the internals of the uuid_create() function and add a new corresponding uuid_clone() API function. @ text @d85 3 a87 3 extern uuid_rc_t uuid_create (uuid_t **_uuid); extern uuid_rc_t uuid_destroy (uuid_t *_uuid); extern uuid_rc_t uuid_clone (uuid_t *_uuid, uuid_t **_uuid_clone); d90 2 a91 2 extern uuid_rc_t uuid_load (uuid_t *_uuid, const char *_name); extern uuid_rc_t uuid_make (uuid_t *_uuid, unsigned int _mode, ...); d94 2 a95 2 extern uuid_rc_t uuid_isnil (const uuid_t *_uuid, int *_result); extern uuid_rc_t uuid_compare (const uuid_t *_uuid, const uuid_t *_uuid2, int *_result); d98 2 a99 2 extern uuid_rc_t uuid_import (uuid_t *_uuid, uuid_fmt_t _fmt, const void *_data_ptr, size_t _data_len); extern uuid_rc_t uuid_export (const uuid_t *_uuid, uuid_fmt_t _fmt, void **_data_ptr, size_t *_data_len); @ 1.7 log @Cleanup the source code even more by following a large set of FlexeLint's suggestions. @ text @d87 1 @ 1.6 log @Added support for new version 5 UUIDs (name-based, SHA-1) according to latest draft-mealling-uuid-urn-05.txt. @ text @d93 2 a94 2 extern uuid_rc_t uuid_isnil (uuid_t *_uuid, int *_result); extern uuid_rc_t uuid_compare (uuid_t *_uuid, uuid_t *_uuid2, int *_result); d97 2 a98 2 extern uuid_rc_t uuid_import (uuid_t *_uuid, uuid_fmt_t _fmt, const void *_data_ptr, size_t _data_len); extern uuid_rc_t uuid_export (uuid_t *_uuid, uuid_fmt_t _fmt, void **_data_ptr, size_t *_data_len); @ 1.5 log @Adjust copyright messages for new year 2005. @ text @d69 2 a70 1 UUID_MAKE_MC = (1 << 3) /* enforce multi-cast MAC address */ @ 1.4 log @flush more pending cleanups @ text @d3 2 a4 2 ** Copyright (c) 2004 Ralf S. Engelschall ** Copyright (c) 2004 The OSSP Project @ 1.3 log @add lost include @ text @a35 3 /* OSSP uuid version (compile-time information) */ #define UUID_VERSION @@UUID_VERSION_HEX@@ d41 2 a42 2 #define DECLARATION_BEGIN /*nop*/ #define DECLARATION_END /*nop*/ d47 3 d51 2 a52 2 #define UUID_LEN_BIN (128 / 8 /*bytes*/) #define UUID_LEN_STR (128 / 4 /*nibbles*/ + 4 /*hyphens*/) d54 1 a54 1 /* return codes */ d56 6 a61 6 UUID_RC_OK = 0, UUID_RC_ARG = 1, UUID_RC_MEM = 2, UUID_RC_SYS = 3, UUID_RC_INT = 4, UUID_RC_IMP = 5 d64 1 a64 1 /* generation mode flags */ d66 4 a69 4 UUID_VERSION1 = (1 << 0), UUID_VERSION3 = (1 << 1), UUID_VERSION4 = (1 << 2), UUID_MCASTRND = (1 << 3) d72 1 a72 1 /* import/export formats */ d74 3 a76 3 UUID_FMT_BIN = 0, /* import/export */ UUID_FMT_STR = 1, /* import/export */ UUID_FMT_TXT = 2 /* export only */ d79 1 a79 1 /* abstract data type */ d83 3 a85 3 /* object handling */ extern uuid_rc_t uuid_create (uuid_t **_uuid); extern uuid_rc_t uuid_destroy (uuid_t *_uuid); d88 2 a89 2 extern uuid_rc_t uuid_load (uuid_t *_uuid, const char *_name); extern uuid_rc_t uuid_make (uuid_t *_uuid, unsigned int _mode, ...); d92 2 a93 2 extern uuid_rc_t uuid_isnil (uuid_t *_uuid, int *_result); extern uuid_rc_t uuid_compare (uuid_t *_uuid, uuid_t *_uuid2, int *_result); d96 2 a97 2 extern uuid_rc_t uuid_import (uuid_t *_uuid, uuid_fmt_t _fmt, const void *_data_ptr, size_t _data_len); extern uuid_rc_t uuid_export (uuid_t *_uuid, uuid_fmt_t _fmt, void **_data_ptr, size_t *_data_len); d99 3 a101 3 /* library error handling */ extern char *uuid_error (uuid_rc_t _rc); extern unsigned long uuid_version (void); @ 1.2 log @fix building (I've changed the generated file last time) @ text @d33 3 @ 1.1 log @Add version support to API via UUID_VERSION (compile-time) and uuid_version() (link-time). @ text @d85 2 a86 2 extern uuid_rc_t uuid_nil (uuid_t *_uuid); extern uuid_rc_t uuid_generate (uuid_t *_uuid, unsigned int _mode, ...); @