OSSP CVS Repository

ossp - Check-in [4330]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 4330
Date: 2004-Jan-15 13:38:32 (local)
2004-Jan-15 12:38:32 (UTC)
User:rse
Branch:
Comment: Moved uuid_[u]int{8,16,32}_t auto-configuration into own internal header uuid_ac.h.
Tickets:
Inspections:
Files:
ossp-pkg/uuid/ChangeLog      1.11 -> 1.12     4 inserted, 0 deleted
ossp-pkg/uuid/uuid.c      1.24 -> 1.25     10 inserted, 70 deleted
ossp-pkg/uuid/uuid_ac.h      added-> 1.1

ossp-pkg/uuid/ChangeLog 1.11 -> 1.12

--- 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 <guerry@tsunamiresearch.com>]


ossp-pkg/uuid/uuid.c 1.24 -> 1.25

--- 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 <stdio.h>
 #include <stdlib.h>
 #include <stdarg.h>
@@ -39,6 +40,7 @@
 #include <sys/time.h>
 #include <sys/types.h>
 
+/* 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 */


ossp-pkg/uuid/uuid_ac.h -> 1.1

*** /dev/null    Fri Nov 22 14:52:44 2024
--- -    Fri Nov 22 14:53:11 2024
***************
*** 0 ****
--- 1,96 ----
+ /*
+ **  OSSP uuid - Universally Unique Identifier
+ **  Copyright (c) 2004 Ralf S. Engelschall <rse@engelschall.com>
+ **  Copyright (c) 2004 The OSSP Project <http://www.ossp.org/>
+ **
+ **  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__ */
+ 

CVSTrac 2.0.1