OSSP CVS Repository

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

Check-in Number: 4970
Date: 2005-Jan-23 13:38:10 (local)
2005-Jan-23 12:38:10 (UTC)
User:rse
Branch:
Comment: add support for version 5 UUIDs also to Perl API
Tickets:
Inspections:
Files:
ossp-pkg/uuid/perl/uuid.pm      1.7 -> 1.8     4 inserted, 2 deleted
ossp-pkg/uuid/perl/uuid.pod      1.5 -> 1.6     6 inserted, 5 deleted
ossp-pkg/uuid/perl/uuid.xs      1.3 -> 1.4     4 inserted, 3 deleted

ossp-pkg/uuid/perl/uuid.pm 1.7 -> 1.8

--- uuid.pm      2005/01/23 11:28:54     1.7
+++ uuid.pm      2005/01/23 12:38:10     1.8
@@ -61,6 +61,7 @@
         UUID_MAKE_V1
         UUID_MAKE_V3
         UUID_MAKE_V4
+        UUID_MAKE_V5
         UUID_MAKE_MC
         UUID_FMT_BIN
         UUID_FMT_STR
@@ -136,12 +137,13 @@
         if    ($spec eq 'v1') { $mode_code |= $self->UUID_MAKE_V1; }
         elsif ($spec eq 'v3') { $mode_code |= $self->UUID_MAKE_V3; }
         elsif ($spec eq 'v4') { $mode_code |= $self->UUID_MAKE_V4; }
+        elsif ($spec eq 'v5') { $mode_code |= $self->UUID_MAKE_V5; }
         elsif ($spec eq 'mc') { $mode_code |= $self->UUID_MAKE_MC; }
         else  { croak("invalid mode specification \"$spec\""); }
     }
-    if ($mode_code & $self->UUID_MAKE_V3) {
+    if (($mode_code & $self->UUID_MAKE_V3) or ($mode_code & $self->UUID_MAKE_V5)) {
         if (not (ref($valist[0]) and $valist[0]->isa("OSSP::uuid"))) {
-            croak("UUID_MAKE_V3 requires namespace argument to be OSSP::uuid object");
+            croak("UUID_MAKE_V3/UUID_MAKE_V5 requires namespace argument to be OSSP::uuid object");
         }
         my $ns   = $valist[0]->{-uuid};
         my $name = $valist[1];


ossp-pkg/uuid/perl/uuid.pod 1.5 -> 1.6

--- uuid.pod     2004/12/31 19:20:39     1.5
+++ uuid.pod     2005/01/23 12:38:10     1.6
@@ -41,8 +41,8 @@
 (API) and corresponding command line interface (CLI) for the generation
 of DCE 1.1 and ISO/IEC 11578:1996 compliant I<Universally Unique
 Identifier> (UUID). It supports DCE 1.1 variant UUIDs of version 1 (time
-and node based), version 3 (name based) and version 4 (random number
-based).
+and node based), version 3 (name based, MD5), version 4 (random number
+based) and version 5 (name based, SHA-1).
 
 B<OSSP::uuid> provides two Perl APIs:
 
@@ -77,9 +77,9 @@
 
 =back
 
-Additionally, the strings C<"v1">, C<"v2">, C<"v3"> and C<"mc"> can be
-used in C<$mode> and the strings C<"bin">, C<"str">, and C<"txt"> can be
-used for C<$fmt>.
+Additionally, the strings C<"v1">, C<"v3">, C<"v4">, C<"v5"> and C<"mc">
+can be used in C<$mode> and the strings C<"bin">, C<"str">, and C<"txt">
+can be used for C<$fmt>.
 
 =head2 C-STYLE API
 
@@ -128,6 +128,7 @@
 C<UUID_MAKE_V1>,
 C<UUID_MAKE_V3>,
 C<UUID_MAKE_V4>,
+C<UUID_MAKE_V5>,
 C<UUID_MAKE_MC>,
 C<UUID_FMT_BIN>,
 C<UUID_FMT_STR>,


ossp-pkg/uuid/perl/uuid.xs 1.3 -> 1.4

--- uuid.xs      2004/12/31 19:20:39     1.3
+++ uuid.xs      2005/01/23 12:38:10     1.4
@@ -57,6 +57,7 @@
             { "UUID_MAKE_V1", UUID_MAKE_V1 },
             { "UUID_MAKE_V3", UUID_MAKE_V3 },
             { "UUID_MAKE_V4", UUID_MAKE_V4 },
+            { "UUID_MAKE_V5", UUID_MAKE_V5 },
             { "UUID_MAKE_MC", UUID_MAKE_MC },
             { "UUID_FMT_BIN", UUID_FMT_BIN },
             { "UUID_FMT_STR", UUID_FMT_STR },
@@ -126,11 +127,11 @@
         uuid_t *ns;
         const char *name;
     CODE:
-        if (mode & UUID_MAKE_V3) {
+        if ((mode & UUID_MAKE_V3) || (mode & UUID_MAKE_V5)) {
             if (items != 4)
-                croak("mode UUID_MAKE_V3 requires two additional arguments to uuid_make()");
+                croak("mode UUID_MAKE_V3/UUID_MAKE_V5 requires two additional arguments to uuid_make()");
                 if (!SvROK(ST(2)))
-                croak("mode UUID_MAKE_V3 requires a UUID object as namespace");
+                croak("mode UUID_MAKE_V3/UUID_MAKE_V5 requires a UUID object as namespace");
             ns   = INT2PTR(uuid_t *, SvIV((SV*)SvRV(ST(2))));
             name = (const char *)SvPV_nolen(ST(3));
             RETVAL = uuid_make(uuid, mode, ns, name);

CVSTrac 2.0.1