Universally Unique Identifier Library Functions
uuidclear(3UID)
NAME
uuidclear, uuidcompare, uuidcopy, uuidgenerate,
uuidgeneraterandom, uuidgeneratetime, uuidisnull,
uuidparse, uuidtime, uuidunparse - universally unique
identifier (UID) operations
SYNOPSIS
cc [ flag ... ] file... -luuid [ library ... ]
#include
void uuidclear(uuidt uu);
int uuidcompare(uuidt uu1, uuidt uu2);
void uuidcopy(uuidt dst, uuidt src);
void uuidgenerate(uuidt out);
void uuidgeneraterandom(uuidt out);
void uuidgeneratetime(uuidt out);
int uuidisnull(uuidt uu);
int uuidparse(char *in, uuidt uu);
timet uuidtime(uuidt uu, struct timeval *rettv);
void uuidunparse(uuidt uu, char *out);
DESCRIPTION
The uuidclear() function sets the value of the specified
universally unique identifier (UID) variable uu to the NUL
value.
The uuidcompare() function compares the two specified UID
variables uu1 and uu2 to each other. It returns an integer
less than, equal to, or greater than zero if uu1 is found to
be, respectively, lexicographically less than, equal, or
greater than uu2.
SunOS 5.11 Last change: 16 Jan 2006 1
Universally Unique Identifier Library Functions
uuidclear(3UID)
The uuidcopy() function copies the UID variable src to
dst.
The uuidgenerate() function creates a new UID that is gen-
erated based on high-quality randomness from /dev/urandom,
if available. If /dev/urandom is not available,
uuidgenerate() calls uuidgeneratetime(). Because the use
of this algorithm provides information about when and where
the UID was generated, it could cause privacy problems for
some applications.
The uuidgeneraterandom() function produces a UID with a
random or pseudo-randomly generated time and Ethernet MAC
address that corresponds to a DCE version 4 UID.
The uuidgeneratetime() function uses the current time and
the local Ethernet MAC address (if available, otherwise a
MAC address is fabricated) that corresponds to a DCE version
1 UID. If the UID is not guaranteed to be unique, the mul-
ticast bit is set (the high-order bit of octet number 10).
The uuidisnull() function compares the value of the speci-
fied UID variable uu to the NUL value. If the value is
equal to the NUL UID, 1 is returned. Otherwise 0 is
returned.
The uuidparse() function converts the UID string specified
by in to the internal uuidt format. The input UID is a
string of the form cefa7a9c-1dd2-11b2-8350-880020adbeef. In
printf(3C) format, the string is "%08x-%04x-%04x-%04x-
%012x", 36 bytes plus the trailing null character. If the
input string is parsed successfully, 0 is returned and the
UID is stored in the location pointed to by uu. Otherwise
-1 is returned.
The uuidtime() function extracts the time at which the
specified UID uu was created. Since the UID creation time
is encoded within the UID, this function can reasonably be
expected to extract the creation time only for UIDs created
with the uuidgeneratetime() function. The time at which
the UID was created, in seconds since January 1, 1970 GMT
(the epoch), is returned (see time(2)). The time at which
the UID was created, in seconds and microseconds since the
epoch is also stored in the location pointed to by rettv
(see gettimeofday(3C)).
SunOS 5.11 Last change: 16 Jan 2006 2
Universally Unique Identifier Library Functions
uuidclear(3UID)
The uuidunparse() function converts the specified UID uu
from the internal binary format to a string of the length
defined in the uuid.h macro, UIDPRINTABLESTRINGLENGTH,
which includes the trailing null character. The resulting
value is stored in the character string pointed to by out.
ATRIBUTES
See attributes(5) for descriptions of the following attri-
butes:
ATRIBUTE TYPE ATRIBUTE VALUE
Interface Stability Evolving
MT-Level Safe
SEE ALSO
inetd(1M), time(2), gettimeofday(3C), libuuid(3LIB),
printf(3C), attributes(5)
SunOS 5.11 Last change: 16 Jan 2006 3
Universally Unique Identifier Library Functions
uuidclear(3UID)
SunOS 5.11 Last change: 16 Jan 2006 4
|