1 /* SPDX-License-Identifier: GPL-2.0-only */
10 #define UUID_STRLEN 36
13 * Parses a canonical UUID string into the common byte representation
14 * where the first three words are interpreted as little endian:
17 * "00112233-4455-6677-8899-aabbccddeeff"
19 * 33 22 11 00 55 44 77 66 88 99 aa bb cc dd ee ff
21 * Returns negative value on error, 0 on success.
23 int parse_uuid(uint8_t *uuid
, const char *uuid_str
);
29 #define GUID_INIT(a, b, c, d0, d1, d2, d3, d4, d5, d6, d7) \
31 {{ (a) & 0xff, ((a) >> 8) & 0xff, ((a) >> 16) & 0xff, ((a) >> 24) & 0xff, \
32 (b) & 0xff, ((b) >> 8) & 0xff, \
33 (c) & 0xff, ((c) >> 8) & 0xff, \
34 (d0), (d1), (d2), (d3), (d4), (d5), (d6), (d7) } })
36 static inline int guidcmp(const guid_t
*guid1
, const guid_t
*guid2
)
38 return memcmp(guid1
, guid2
, sizeof(guid_t
));
41 static inline guid_t
*guidcpy(guid_t
*dest
, const guid_t
*src
)
43 return (guid_t
*)memcpy(dest
, src
, sizeof(guid_t
));