libGimbal 0.1.0
C17-Based Extended Standard Library and Cross-Language Runtime Framework
Loading...
Searching...
No Matches
GblUuid Struct Reference

#include <gimbal_uuid.h>

Data Fields

union { 
 
   struct { 
 
      uint32_t   time_low 
 
      uint16_t   time_mid 
 
      uint16_t   time_hi_and_version 
 
      uint8_t   clock_seq_hi_and_reserved 
 
      uint8_t   clock_seq_low 
 
      uint8_t   node [6] 
 
   }   private_ 
 
   uint8_t   bytes [16] 
 
};  
 

Related Symbols

(Note that these are not member symbols.)

const char * GblUuid_string (const GblUuid *pSelf, char *pBuffer)
 
int GblUuid_compare (const GblUuid *pSelf, const GblUuid *pOther)
 
unsigned GblUuid_version (const GblUuid *pSelf)
 
GblBool GblUuid_isNil (const GblUuid *pSelf)
 
Initialization

Methods for initializing and setting

GBL_RESULT GblUuid_genV4 (GblUuid *pSelf)
 
GBL_RESULT GblUuid_parse (GblUuid *pSelf, const char *pBuffer)
 
GBL_RESULT GblUuid_setNil (GblUuid *pSelf)
 

Detailed Description

Universally unique identifier.

RFC 4122-based UUID type.

Definition at line 36 of file gimbal_uuid.h.

Friends And Related Symbol Documentation

◆ GblUuid_genV4()

GBL_RESULT GblUuid_genV4 ( GblUuid pSelf)
related

Initializes the given GblUuid structure to a new, randomly generated UUID per RFC 4122 (version 4).

Returns GBL_RESULT_SUCCESS upon success, or GBL_RESULT_ERROR_INVALID_POINTER, if a valid pointer was not passed as pSelf.

Parameters
pSelfpointer to a GblUuid
Returns
success or invalid pointer

◆ GblUuid_parse()

GBL_RESULT GblUuid_parse ( GblUuid pSelf,
const char *  pStrBuffer 
)
related

Initializes the given GblUuid structure by deserializing the string representation given by pStrBuffer.

Returns GBL_RESULT_SUCCESS upon success, or an error if the provided arguments were not valid.

Parameters
pSelfpointer to a GblUuid
pStrBufferStandard 36-char UUID string format (XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX)
Returns
success or error message

◆ GblUuid_setNil()

GBL_RESULT GblUuid_setNil ( GblUuid pSelf)
related

Initializes the given GblUuid structure to a "nil" UUID, per RFC 4122.

Returns GBL_RESULT_SUCCESS upon success, or GBL_RESULT_ERROR_INVALID_POINTER, if a valid pointer was not passed as pSelf.

Parameters
pSelfpointer to a GblUuid
Returns
success or invalid pointer

◆ GblUuid_string()

const char * GblUuid_string ( const GblUuid pSelf,
char *  pStrBuffer 
)
related

Fills in the given 37-byte string buffer with the standardized string representation of the given UUID, also returning it.

Parameters
pSelfpointer to a GblUuid
pStrBufferstring buffer of at least 37 bytes (36 plus NULL terminator)
Returns
pStrBuffer or NULL upon failure

◆ GblUuid_compare()

int GblUuid_compare ( const GblUuid pSelf,
const GblUuid pOther 
)
related

Errors are thrown if either argument is invalid.

Parameters
pSelfpointer to a GblUuid
pOtherpointer to another GblUuid
Returns
0, -1, or 1

◆ GblUuid_version()

unsigned GblUuid_version ( const GblUuid pSelf)
related

Throws an error if the given pointer is invalid.

Parameters
pSelfpointer to a GblUuid
Returns
UUID version

◆ GblUuid_isNil()

GblBool GblUuid_isNil ( const GblUuid pSelf)
related

Throws an error if pSelf is invalid.

Parameters
pSelfpointer to a GblUuid
Returns
whether the given UUID is nil or not

Field Documentation

◆ time_low

uint32_t GblUuid::time_low

Definition at line 39 of file gimbal_uuid.h.

◆ time_mid

uint16_t GblUuid::time_mid

Definition at line 40 of file gimbal_uuid.h.

◆ time_hi_and_version

uint16_t GblUuid::time_hi_and_version

Definition at line 41 of file gimbal_uuid.h.

◆ clock_seq_hi_and_reserved

uint8_t GblUuid::clock_seq_hi_and_reserved

Definition at line 42 of file gimbal_uuid.h.

◆ clock_seq_low

uint8_t GblUuid::clock_seq_low

Definition at line 43 of file gimbal_uuid.h.

◆ node

uint8_t GblUuid::node[6]

Definition at line 44 of file gimbal_uuid.h.

◆ bytes

uint8_t GblUuid::bytes[16]

Definition at line 46 of file gimbal_uuid.h.


The documentation for this struct was generated from the following file: