Index: ossp-pkg/uuid/ChangeLog RCS File: /v/ossp/cvs/ossp-pkg/uuid/Attic/ChangeLog,v rcsdiff -q -kk '-r1.11' '-r1.12' -u '/v/ossp/cvs/ossp-pkg/uuid/Attic/ChangeLog,v' 2>/dev/null --- ChangeLog 2004/01/15 12:32:26 1.11 +++ ChangeLog 2004/01/15 12:38:32 1.12 @@ -13,6 +13,10 @@ Changes between 0.9.1 and 0.9.2 (13-Jan-2004 to xx-Jan-2004) + o Moved uuid_[u]int{8,16,32}_t auto-configuration into + own internal header uuid_ac.h. + [Ralf S. Engelschall] + o Fixed portability by replacing accidentally introduced uint{8,16,32}_t with the portable uuid_uint{8,16,32}_t. [Guerry Semones ] Index: ossp-pkg/uuid/uuid.c RCS File: /v/ossp/cvs/ossp-pkg/uuid/Attic/uuid.c,v rcsdiff -q -kk '-r1.24' '-r1.25' -u '/v/ossp/cvs/ossp-pkg/uuid/Attic/uuid.c,v' 2>/dev/null --- uuid.c 2004/01/15 12:32:26 1.24 +++ uuid.c 2004/01/15 12:38:32 1.25 @@ -27,6 +27,7 @@ ** uuid.c: library API implementation */ +/* system headers */ #include #include #include @@ -39,6 +40,7 @@ #include #include +/* own headers */ #include "config.h" #include "uuid.h" #include "uuid_md5.h" @@ -47,69 +49,7 @@ #include "uuid_ui64.h" #include "uuid_str.h" #include "uuid_bm.h" - -/* determine types of 8-bit size */ -#if SIZEOF_CHAR == 1 -typedef char uuid_int8_t; -#else -#error uexpected: sizeof(char) != 1 !? -#endif -#if SIZEOF_UNSIGNED_CHAR == 1 -typedef unsigned char uuid_uint8_t; -#else -#error uexpected: sizeof(unsigned char) != 1 !? -#endif - -/* determine types of 16-bit size */ -#if SIZEOF_SHORT == 2 -typedef short uuid_int16_t; -#elif SIZEOF_INT == 2 -typedef int uuid_int16_t; -#elif SIZEOF_LONG == 2 -typedef long uuid_int16_t; -#else -#error unexpected: no type found for uuid_int16_t -#endif -#if SIZEOF_UNSIGNED_SHORT == 2 -typedef unsigned short uuid_uint16_t; -#elif SIZEOF_UNSIGNED_INT == 2 -typedef unsigned int uuid_uint16_t; -#elif SIZEOF_UNSIGNED_LONG == 2 -typedef unsigned long uuid_uint16_t; -#else -#error unexpected: no type found for uuid_uint16_t -#endif - -/* determine types of 32-bit size */ -#if SIZEOF_SHORT == 4 -typedef short uuid_int32_t; -#elif SIZEOF_INT == 4 -typedef int uuid_int32_t; -#elif SIZEOF_LONG == 4 -typedef long uuid_int32_t; -#elif SIZEOF_LONG_LONG == 4 -typedef long long uuid_int32_t; -#else -#error unexpected: no type found for uuid_int32_t -#endif -#if SIZEOF_UNSIGNED_SHORT == 4 -typedef unsigned short uuid_uint32_t; -#elif SIZEOF_UNSIGNED_INT == 4 -typedef unsigned int uuid_uint32_t; -#elif SIZEOF_UNSIGNED_LONG == 4 -typedef unsigned long uuid_uint32_t; -#elif SIZEOF_UNSIGNED_LONG_LONG == 4 -typedef unsigned long long uuid_uint32_t; -#else -#error unexpected: no type found for uuid_uint32_t -#endif - -#ifndef FALSE -#define FALSE 0 -#endif -#ifndef TRUE -#define TRUE !FALSE -#endif +#include "uuid_ac.h" /* UUID binary representation according to UUID standards */ typedef struct { @@ -206,10 +146,10 @@ return UUID_RC_ARG; /* a "nil UUID" is defined as all octets zero, so check for this case */ - *result = TRUE; + *result = UUID_TRUE; for (i = 0, ucp = (unsigned char *)&(uuid->obj); i < UUID_LEN_BIN; i++) { if (*ucp++ != '\0') { - *result = FALSE; + *result = UUID_FALSE; break; } } @@ -376,23 +316,23 @@ 012345678901234567890123456789012345 0 1 2 3 */ if (str == NULL) - return FALSE; + return UUID_FALSE; if (strlen(str) != UUID_LEN_STR) - return FALSE; + return UUID_FALSE; for (i = 0, cp = str; i <= UUID_LEN_STR; i++, cp++) { if ((i == 8) || (i == 13) || (i == 18) || (i == 23)) { if (*cp == '-') continue; else - return FALSE; + return UUID_FALSE; } if (i == UUID_LEN_STR) if (*cp == '\0') continue; if (!isxdigit((int)(*cp))) - return FALSE; + return UUID_FALSE; } - return TRUE; + return UUID_TRUE; } /* parse string representation into UUID object */ Index: ossp-pkg/uuid/uuid_ac.h RCS File: /v/ossp/cvs/ossp-pkg/uuid/Attic/uuid_ac.h,v co -q -kk -p'1.1' '/v/ossp/cvs/ossp-pkg/uuid/Attic/uuid_ac.h,v' | diff -u /dev/null - -L'ossp-pkg/uuid/uuid_ac.h' 2>/dev/null --- ossp-pkg/uuid/uuid_ac.h +++ - 2024-05-17 18:34:32.078756137 +0200 @@ -0,0 +1,96 @@ +/* +** OSSP uuid - Universally Unique Identifier +** Copyright (c) 2004 Ralf S. Engelschall +** Copyright (c) 2004 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_ac.c: auto-configuration +*/ + +#ifndef __UUID_AC_H__ +#define __UUID_AC_H__ + +#include "config.h" + +/* define boolean values */ +#define UUID_FALSE 0 +#define UUID_TRUE !UUID_FALSE + +/* determine types of 8-bit size */ +#if SIZEOF_CHAR == 1 +typedef char uuid_int8_t; +#else +#error uexpected: sizeof(char) != 1 !? +#endif +#if SIZEOF_UNSIGNED_CHAR == 1 +typedef unsigned char uuid_uint8_t; +#else +#error uexpected: sizeof(unsigned char) != 1 !? +#endif + +/* determine types of 16-bit size */ +#if SIZEOF_SHORT == 2 +typedef short uuid_int16_t; +#elif SIZEOF_INT == 2 +typedef int uuid_int16_t; +#elif SIZEOF_LONG == 2 +typedef long uuid_int16_t; +#else +#error unexpected: no type found for uuid_int16_t +#endif +#if SIZEOF_UNSIGNED_SHORT == 2 +typedef unsigned short uuid_uint16_t; +#elif SIZEOF_UNSIGNED_INT == 2 +typedef unsigned int uuid_uint16_t; +#elif SIZEOF_UNSIGNED_LONG == 2 +typedef unsigned long uuid_uint16_t; +#else +#error unexpected: no type found for uuid_uint16_t +#endif + +/* determine types of 32-bit size */ +#if SIZEOF_SHORT == 4 +typedef short uuid_int32_t; +#elif SIZEOF_INT == 4 +typedef int uuid_int32_t; +#elif SIZEOF_LONG == 4 +typedef long uuid_int32_t; +#elif SIZEOF_LONG_LONG == 4 +typedef long long uuid_int32_t; +#else +#error unexpected: no type found for uuid_int32_t +#endif +#if SIZEOF_UNSIGNED_SHORT == 4 +typedef unsigned short uuid_uint32_t; +#elif SIZEOF_UNSIGNED_INT == 4 +typedef unsigned int uuid_uint32_t; +#elif SIZEOF_UNSIGNED_LONG == 4 +typedef unsigned long uuid_uint32_t; +#elif SIZEOF_UNSIGNED_LONG_LONG == 4 +typedef unsigned long long uuid_uint32_t; +#else +#error unexpected: no type found for uuid_uint32_t +#endif + +#endif /* __UUID_AC_H__ */ +