UUID: add nil value for UUIDs

Add `BLI_uuid_nil()` that returns the nil UUID (used to indicate "not
set") and `BLI_uuid_is_nil(uuid)` to do an equality test with the nil
value.
This commit is contained in:
2021-09-20 12:15:37 +02:00
parent 07b482c2ff
commit 029d042e85
3 changed files with 32 additions and 0 deletions

View File

@@ -37,6 +37,14 @@ extern "C" {
* This function is not thread-safe. */
UUID BLI_uuid_generate_random(void);
/**
* Return the UUID nil value, consisting of all-zero fields.
*/
UUID BLI_uuid_nil(void);
/** Return true iff this is the nil UUID. */
bool BLI_uuid_is_nil(UUID uuid);
/** Compare two UUIDs, return true if they are equal. */
bool BLI_uuid_equal(UUID uuid1, UUID uuid2);