Manage UUIDs. More...
Go to the source code of this file.
Classes | |
struct | anonymous_namespace{uuid.cpp}::uuid_state |
Data type for UUID generator persistent state. More... | |
Macros | |
#define | CHECK(f1, f2) |
Macro to compare times. | |
Functions | |
void | anonymous_namespace{uuid.cpp}::format_uuid_v1 (uuid_upnp *uid, uint16_t clock_seq, uuid_time_t timestamp, uuid_node_t node) |
Make a UUID from the timestamp, clockseq, and node ID. | |
int | anonymous_namespace{uuid.cpp}::read_state (uint16_t *clockseq, uuid_time_t *timestamp, uuid_node_t *node) |
Read UUID generator state from non-volatile store. | |
void | anonymous_namespace{uuid.cpp}::write_state (uint16_t clockseq, uuid_time_t timestamp, uuid_node_t node) |
Save UUID generator state back to non-volatile storage. | |
void | anonymous_namespace{uuid.cpp}::get_current_time (uuid_time_t *timestamp) |
Get time as 60 bit 100ns ticks since whenever. | |
uint16_t | anonymous_namespace{uuid.cpp}::true_random () |
generate a crypto-quality random number. This sample doesn't do that. | |
void | anonymous_namespace{uuid.cpp}::format_uuid_v3 (uuid_upnp *uid, unsigned char hash[16]) |
Make a UUID from a (pseudo)random 128 bit number. | |
void | uuidMutexInit () |
Initialize mutex for synchronizing the uuid creation process. | |
int | uuidMutexDestroy () |
Destroy mutex for synchronizing the uuid creation process. | |
int | uuid_create (uuid_upnp *uid) |
Generate a UUID. | |
void | upnp_uuid_unpack (uuid_upnp *u, char *out) |
Unpack a UUID. | |
void | uuid_create_from_name (uuid_upnp *uid, uuid_upnp nsid, void *name, int namelen) |
Create a UUID using a "name" from a "name space". | |
int | uuid_compare (uuid_upnp *u1, uuid_upnp *u2) |
Compare two UUID's "lexically". | |
Variables | |
pthread_mutex_t | anonymous_namespace{uuid.cpp}::uuid_mutex |
Mutex to synchronize the uuid creation process. | |
uuid_state | anonymous_namespace{uuid.cpp}::st |
UUID generator persistent state. | |
int | anonymous_namespace{uuid.cpp}::stateInited {0} |
Flag if UUID generator persistent state is initiated. | |
Manage UUIDs.
Definition in file uuid.cpp.
struct anonymous_namespace{uuid.cpp}::uuid_state |
Class Members | ||
---|---|---|
uuid_time_t | ts |
Saved timestamp. |
uuid_node_t | node |
Saved node ID. |
uint16_t | cs |
Saved clock sequence. |
#define CHECK | ( | f1, | |
f2 | |||
) |
void uuidMutexInit | ( | ) |
int uuidMutexDestroy | ( | ) |
int uuid_create | ( | uuid_upnp * | uid | ) |
void upnp_uuid_unpack | ( | uuid_upnp * | u, |
char * | out | ||
) |
Create a UUID using a "name" from a "name space".
uid | resulting UUID. |
nsid | UUID to serve as context, so identical names from different name spaces generate different UUIDs. |
name | The name from which to generate a UUID. |
namelen | The length of the name. |
Definition at line 250 of file uuid.cpp.