PebbleOS
Loading...
Searching...
No Matches
Data Structures | Macros | Functions
uuid.h File Reference
#include <pbl/util/list.h>
#include <stdint.h>
#include <stdbool.h>
#include <pbl/kernel/compiler.h>

Data Structures

struct  Uuid
 A 128-bit UUID, with its bytes in the order they are written in string form. More...
 

Macros

#define UUID_SIZE   16
 Size of a UUID, in bytes.
 
#define UUID_SYSTEM   {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
 Initializer of the all-zero UUID that identifies the system.
 
#define UUID_INVALID_INIT    {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff}
 Initializer of the all-ones invalid UUID.
 
#define UUID_INVALID   ((const Uuid)UUID_INVALID_INIT)
 The invalid UUID, all bytes 0xff.
 
#define UuidMake(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15)    ((Uuid){p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15})
 Make a Uuid object from sixteen bytes.
 
#define UuidMakeFromBEBytes(b)
 Creates a Uuid from an array of bytes with 16 bytes in Big Endian order.
 
#define UuidMakeFromLEBytes(b)
 Creates a Uuid from an array of bytes with 16 bytes in Little Endian order.
 
#define UUID_STRING_BUFFER_LENGTH   (32 + 4 + 2 + 1)
 The minimum required length of a string used to hold a uuid (including null).
 

Functions

bool uuid_equal (const Uuid *uu1, const Uuid *uu2)
 Compares two UUIDs.
 
void uuid_generate (Uuid *uuid_out)
 Generate a random (version 4) UUID.
 
bool uuid_is_system (const Uuid *uuid)
 Check whether a UUID is the system UUID (all zeros).
 
bool uuid_is_invalid (const Uuid *uuid)
 Check whether a UUID is invalid.
 
void uuid_to_string (const Uuid *uuid, char *buffer)
 Writes UUID in a string form into buffer that looks like the following... {12345678-1234-5678-1234-567812345678} or {NULL UUID} if NULL was passed.