1 .\" $NetBSD: uuid.3,v 1.6 2008/04/23 07:52:32 plunky Exp $
3 .\" Copyright (c) 2004 The NetBSD Foundation, Inc.
4 .\" All rights reserved.
6 .\" This code is derived from software contributed to The NetBSD Foundation
7 .\" by Jason R. Thorpe.
9 .\" Redistribution and use in source and binary forms, with or without
10 .\" modification, are permitted provided that the following conditions
12 .\" 1. Redistributions of source code must retain the above copyright
13 .\" notice, this list of conditions and the following disclaimer.
14 .\" 2. Redistributions in binary form must reproduce the above copyright
15 .\" notice, this list of conditions and the following disclaimer in the
16 .\" documentation and/or other materials provided with the distribution.
18 .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
19 .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20 .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21 .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
22 .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23 .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 .\" POSSIBILITY OF SUCH DAMAGE.
30 .\" Copyright (c) 2002 Marcel Moolenaar
31 .\" Copyright (c) 2002 Hiten Mahesh Pandya
32 .\" All rights reserved.
34 .\" Redistribution and use in source and binary forms, with or without
35 .\" modification, are permitted provided that the following conditions
37 .\" 1. Redistributions of source code must retain the above copyright
38 .\" notice, this list of conditions and the following disclaimer.
39 .\" 2. Redistributions in binary form must reproduce the above copyright
40 .\" notice, this list of conditions and the following disclaimer in the
41 .\" documentation and/or other materials provided with the distribution.
43 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
44 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
45 .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
46 .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
47 .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
48 .\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
49 .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
50 .\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
51 .\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
52 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
55 .\" $FreeBSD: src/lib/libc/uuid/uuid.3,v 1.4 2003/08/08 19:12:28 marcel Exp $
61 .Nm uuid_compare , uuid_create , uuid_create_nil , uuid_equal ,
62 .Nm uuid_from_string , uuid_hash , uuid_is_nil , uuid_to_string ,
63 .Nm uuid_enc_le , uuid_dec_le , uuid_enc_be , uuid_dec_be
64 .Nd Universally Unique Identifier routines
70 .Fn uuid_compare "const uuid_t *uuid1" "const uuid_t *uuid2" "uint32_t *status"
72 .Fn uuid_create "uuid_t *uuid" "uint32_t *status"
74 .Fn uuid_create_nil "uuid_t *uuid" "uint32_t *status"
76 .Fn uuid_equal "const uuid_t *uuid1" "const uuid_t *uuid2" "uint32_t *status"
78 .Fn uuid_from_string "const char *str" "uuid_t *uuid" "uint32_t *status"
80 .Fn uuid_hash "const uuid_t *uuid" "uint32_t *status"
82 .Fn uuid_is_nil "const uuid_t *uuid" "uint32_t *status"
84 .Fn uuid_to_string "const uuid_t *uuid" "char **str" "uint32_t *status"
86 .Fn uuid_enc_le "void *buf" "const uuid_t *uuid"
88 .Fn uuid_dec_le "const void *buf" "uuid_t *"
90 .Fn uuid_enc_be "void *buf" "const uuid_t *uuid"
92 .Fn uuid_dec_be "const void *buf" "uuid_t *"
94 These routines provide for the creation and manipulation of Universally
97 also referred to as Globally Unique Identifiers
102 function compares two UUIDs.
107 0 if they are equal, or 1 if
114 function creates a new UUID.
115 Storage for the new UUID must be pre-allocated by the caller.
119 function creates a nil-valued UUID.
120 Storage for the new UUID must be pre-allocated by the caller.
124 function compares two UUIDs to determine if they are equal.
125 It returns 1 if they are equal, and 0 if they are not equal.
129 function parses a 36-character string representation of a UUID and
130 converts it to binary representation.
131 Storage for the UUID must be pre-allocated by the caller.
135 function generates a hash value for the specified UUID.
136 Note that the hash value is not a cryptographic hash, and should not be
137 assumed to be unique given two different UUIDs.
141 function returns 1 if the UUID is nil-valued and 0 if it is not.
145 function converts a UUID from binary representation to string representation.
146 Storage for the string is dynamically allocated and returned via the
149 This pointer should be passed to
151 to release the allocated storage when it is no longer needed.
157 functions encode a binary representation of a UUID into an octet stream
158 in little-endian and big-endian byte-order, respectively.
159 The destination buffer must be pre-allocated by the caller, and must be
160 large enough to hold the 16-octet binary UUID.
166 functions decode a UUID from an octet stream in little-endian and
167 big-endian byte-order, respectively.
172 .Fn uuid_create_nil ,
174 .Fn uuid_from_string ,
179 functions return successful or unsuccessful completion status in the
184 .Bl -tag -width ".Dv uuid_s_invalid_string_uuid"
186 The function completed successfully.
187 .It Dv uuid_s_bad_version
188 The UUID does not have a known version.
189 .It Dv uuid_s_invalid_string_uuid
190 The string representation of a UUID is not valid.
191 .It Dv uuid_s_no_memory
192 Memory could not be allocated for the operation.
201 .Fn uuid_create_nil ,
203 .Fn uuid_from_string ,
208 functions are compatible with the DCE 1.1 RPC specification.
210 The UUID functions first appeared in