uuid.h File Reference

UUID types and functions. More...

Data Structures

struct  spdk_uuid
 

Macros

#define SPDK_UUID_STRING_LEN   37 /* 36 characters + null terminator */
 

Functions

 SPDK_STATIC_ASSERT (sizeof(struct spdk_uuid)==16, "Incorrect size")
 
int spdk_uuid_parse (struct spdk_uuid *uuid, const char *uuid_str)
 Convert UUID in textual format into a spdk_uuid. More...
 
int spdk_uuid_fmt_lower (char *uuid_str, size_t uuid_str_size, const struct spdk_uuid *uuid)
 Convert UUID in spdk_uuid into lowercase textual format. More...
 
int spdk_uuid_compare (const struct spdk_uuid *u1, const struct spdk_uuid *u2)
 Compare two UUIDs. More...
 
void spdk_uuid_generate (struct spdk_uuid *uuid)
 Generate a new UUID. More...
 
void spdk_uuid_copy (struct spdk_uuid *dst, const struct spdk_uuid *src)
 Copy a UUID. More...
 

Detailed Description

UUID types and functions.

Function Documentation

◆ spdk_uuid_compare()

int spdk_uuid_compare ( const struct spdk_uuid u1,
const struct spdk_uuid u2 
)

Compare two UUIDs.

Parameters
u1UUID 1.
u2UUID 2.
Returns
0 if u1 == u2, less than 0 if u1 < u2, greater than 0 if u1 > u2.

◆ spdk_uuid_copy()

void spdk_uuid_copy ( struct spdk_uuid dst,
const struct spdk_uuid src 
)

Copy a UUID.

Parameters
srcSource UUID to copy from.
dstDestination UUID to store.

◆ spdk_uuid_fmt_lower()

int spdk_uuid_fmt_lower ( char *  uuid_str,
size_t  uuid_str_size,
const struct spdk_uuid uuid 
)

Convert UUID in spdk_uuid into lowercase textual format.

Parameters
uuid_strUser-provided string buffer to write the textual format into.
uuid_str_sizeSize of uuid_str buffer. Must be at least SPDK_UUID_STRING_LEN.
uuidUUID to convert to textual format.
Returns
0 on success, or negative errno on failure.

◆ spdk_uuid_generate()

void spdk_uuid_generate ( struct spdk_uuid uuid)

Generate a new UUID.

Parameters
[out]uuidUser-provided UUID buffer to fill.

◆ spdk_uuid_parse()

int spdk_uuid_parse ( struct spdk_uuid uuid,
const char *  uuid_str 
)

Convert UUID in textual format into a spdk_uuid.

Parameters
[out]uuidUser-provided UUID buffer.
uuid_strUUID in textual format in C string.
Returns
0 on success, or negative errno on failure.