Functions | |
void | rdm_uuidInit (RDM_UUID_FACTORY_T *factory, uint32_t seed) |
void | rdm_uuidTerm (RDM_UUID_FACTORY_T *factory) |
void | rdm_uuidCreate (RDM_UUID_FACTORY_T *factory, RDM_UUID_T *uuid) |
RDM_RETCODE | rdm_uuidFromString (const char *str, RDM_UUID_T *uuid) |
size_t | rdm_uuidStrLen (const RDM_UUID_T *uuid, RDM_BOOL_T braces) |
RDM_RETCODE | rdm_uuidToString (const RDM_UUID_T *uuid, char *str, size_t len, RDM_BOOL_T braces) |
The RDM uuid datatype API. The functions here are located in RDM Base Functionality. Linker option:
-lrdmbase
The UUID/GUID types represent 128-bit unique identifiers. The implementation of UUID/GUID is represented by the RFC 4122 standard
void rdm_uuidCreate | ( | RDM_UUID_FACTORY_T * | factory, |
RDM_UUID_T * | uuid | ||
) |
#include <rdmuuidapi.h>
Create a Universally Unique Identifier (UUID)
This function is able to create a universally unique identifier with a very high probability.
[in] | factory | The factory to use for creating UUIDs |
[out] | uuid | The Universally Unique Identifier to be creasted |
RDM_RETCODE rdm_uuidFromString | ( | const char * | str, |
RDM_UUID_T * | uuid | ||
) |
#include <rdmuuidapi.h>
Convert a string to a Universally Unique Identifier (UUID)
Convert a string to a Universally Unique Identifier (UUID).
sOKAY | Normal, successful return. |
ePSP_INVUUID | Invalid UUID in the PSP library. |
[in] | str | The UUID in string form that is to be converted |
[out] | uuid | The converted UUID |
void rdm_uuidInit | ( | RDM_UUID_FACTORY_T * | factory, |
uint32_t | seed | ||
) |
#include <rdmuuidapi.h>
Create a Universally Unique Identifier (UUID)
This function sets up a factory for creating universally unique identifier with a very high probability of being unique. One factory is very unlikely to generate two identical UUIDs.
The initial state of the factory is based on a seed and some information from the PSP layer such as the current time, the process ID, and the MAC address. Excactly which information is being used depend on the PSP and is therefor platform dependent.
Care should be taken to not use more than one factory for UUIDs that need to be unique. There is never an absolute guarantee that the generated UUIDs will be unique even with a single factory.
[in] | factory | The factory to use for creating UUIDs |
[in] | seed | A seed that will be combined with other information from the PSP |
size_t rdm_uuidStrLen | ( | const RDM_UUID_T * | uuid, |
RDM_BOOL_T | braces | ||
) |
#include <rdmuuidapi.h>
Get the string length of a Universally Unique Identifier (UUID)
Get the string length of a Universally Unique Identifier if it were to be converted to a string.
[in] | uuid | The UUID we want the string length off if converted to a string |
[in] | braces | Whether the converted string should include braces |
void rdm_uuidTerm | ( | RDM_UUID_FACTORY_T * | factory | ) |
#include <rdmuuidapi.h>
Create a Universally Unique Identifier (UUID)
This function terminates a factory for creating universally unique identifier
[in] | factory | The factory to be terminated |
RDM_RETCODE rdm_uuidToString | ( | const RDM_UUID_T * | uuid, |
char * | str, | ||
size_t | len, | ||
RDM_BOOL_T | braces | ||
) |
#include <rdmuuidapi.h>
Convert a Universally Unique Identifier (UUID) to a string
Convert a Universally Unique Identifier (UUID) to a string. The string buffer provided should be big enough to hold at least 36 characters, plus the optional braces, and a null terminator.
sOKAY | Normal, successful return. |
sTRUNCATE | Result is truncated. |
[in] | uuid | The UUID that is to be converted |
[out] | str | The string buffer for the converted UUID |
[in] | len | The lengt of the provided string buffer measured in number of characters |
[in] | braces | Whether the converted string should include braces |