source: project/wiki/eggref/4/uuid-lib @ 35424

Last change on this file since 35424 was 35424, checked in by kon, 4 months ago

rel 1.5.0

File size: 4.5 KB
Line 
1[[tags: egg]]
2
3== uuid-lib
4
5OSF DCE 1.1 UUID
6
7[[toc:]]
8
9
10== Documentation
11
12Wrapper for {{uuid/uuid.h}} procedures on MacOS X, and Linux.
13
14=== Predicates
15
16==== uuid?
17
18<procedure>(uuid? UUID) -> boolean</procedure>
19
20Is {{UUID}} a uuid?
21
22==== uuid-null?
23
24<procedure>(uuid-null? UUID) -> boolean</procedure>
25
26Is {{UUID}} the null uuid?
27
28==== uuid-compare
29
30<procedure>(uuid-compare UUID1 UUID2) -> fixnum</procedure>
31
32Returns {{-1}}, {{0}}. or {{1}} for the comaprison of {{UUID1}} and {{UUID2}}.
33
34==== uuid=?
35
36<procedure>(uuid=? UUID1 UUID2) -> boolean</procedure>
37
38Are {{UUID1}} and {{UUID2}} equal?
39
40==== uuid<?
41
42<procedure>(uuid<? UUID1 UUID2) -> boolean</procedure>
43
44Does {{UUID1}} order below {{UUID2}}?
45
46==== uuid>?
47
48<procedure>(uuid>? UUID1 UUID2) -> boolean</procedure>
49
50Does {{UUID1}} order above {{UUID2}}?
51
52==== uuid<=?
53
54<procedure>(uuid<=? UUID1 UUID2) -> boolean</procedure>
55
56Does {{UUID1}} order below or the same as {{UUID2}}?
57
58==== uuid>=?
59
60<procedure>(uuid>=? UUID1 UUID2) -> boolean</procedure>
61
62Does {{UUID1}} order above or the same as {{UUID2}}?
63
64=== Operations
65
66==== uuid-clear!
67
68<procedure>(uuid-clear! UUID) -> uuid</procedure>
69
70Returns the {{UUID}} set to the null-uuid.
71
72==== uuid-copy
73
74<procedure>(uuid-copy UUID) -> uuid</procedure>
75
76Returns a copy of the {{UUID}}.
77
78==== make-uuid
79
80<procedure>(make-uuid [VARIANT]) -> uuid</procedure>
81
82Returns a new uuid.
83
84{{VARIANT}} is:
85; {{'V1}} or {{'time}} : DCE Version 1 (MAC address) algorithm.
86; {{'V4}} or {{'random}} : DCE Version 4 (random) algorithm.
87; {{#f}} : The null-uuid. The default.
88
89An invalid {{MODE}} is an error condtion.
90
91==== string->uuid
92
93<procedure>(string->uuid UUID-STRING) -> uuid</procedure>
94
95Returns a new uuid from the external string representation {{UUID-STRING}}.
96
97==== uuid->string
98
99<procedure>(uuid->string UUID) -> string</procedure>
100
101Returns the external string representation of {{UUID}}.
102
103==== uuid-generate
104
105<procedure>(uuid-generate [METHOD]) -> uuid</procedure>
106
107Returns a new uuid.
108
109{{METHOD}} is:
110; {{'random}} : DCE Version 4 (random) algorithm.
111; {{'time}} : DCE Version 1 (MAC address) algorithm.
112; {{#f}} : DCE V4 if a high-quality random device available, otherwise DCE V1. The default.
113
114An invalid {{METHOD}} is an error condtion.
115
116==== uuid-parse
117
118<procedure>(uuid-parse UUID-TEXT) -> uuid</procedure>
119
120Returns a new uuid from the external string representation {{UUID-TEXT}}.
121
122==== uuid-unparse
123
124<procedure>(uuid-unparse UUID [CASE]) -> string</procedure>
125
126Returns the external string representation of {{UUID}}.
127
128{{CASE}} is {{#f}} (the system dependent local default), {{'upper}},
129or {{'lower}}. Default is {{#f}}.
130
131An invalid {{CASE}} is an error condtion.
132
133== Usage
134
135<enscript language=scheme>
136(require-extension uuid-lib)
137</enscript>
138
139
140== Notes
141
142* The {{uuid?}}. {{uuid-null?}}, {{uuid-compare}}, {{uuid=?}},
143{{uuid<?}}, {{uuid>?}}, {{uuid<=?}}, {{uuid>=?}}, {{make-uuid}},
144{{uuid-copy}}, {{uuid-clear!}}, {{string->uuid}}, {{uuid->string}}
145share the same signature as the corresponding routines in the
146''uuid-ossp'' extension.
147
148* When a UUID argument is not of the expected type the routines will
149silently fail by returning {{#f}}, no matter what the declared return
150type. This may change in the future.
151
152
153== Author
154
155[[/users/kon-lovett|Kon Lovett]]
156
157
158== Version history
159
160; 1.5.0 ; Add types.
161; 1.4.1 : Explicit libuuid for linux.
162; 1.4.0 : Added {{make-uuid}}, {{string->uuid}}, {{uuid->string}}. Dropped use of "uuid-lib-c-api.scm" since undocumented. Deprecated {{uuid<>?}}.
163; 1.3.0 : Exposed {{uuid-compare}}.
164; 1.2 : Hello.
165
166
167== License
168
169Copyright (C) 2010 Kon Lovett.  All rights reserved.
170
171Permission is hereby granted, free of charge, to any person obtaining a
172copy of this software and associated documentation files (the Software),
173to deal in the Software without restriction, including without limitation
174the rights to use, copy, modify, merge, publish, distribute, sublicense,
175and/or sell copies of the Software, and to permit persons to whom the
176Software is furnished to do so, subject to the following conditions:
177
178The above copyright notice and this permission notice shall be included
179in all copies or substantial portions of the Software.
180
181THE SOFTWARE IS PROVIDED ASIS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
182IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
183FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
184THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
185OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
186ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
187OTHER DEALINGS IN THE SOFTWARE.
Note: See TracBrowser for help on using the repository browser.