6 #include "got_compat.h"
9 int32_t uuid_equal(struct uuid
* a
, struct uuid
* b
, uint32_t* unused
)
11 return (uuid_compare(*(uuid_t
*)a
, *(uuid_t
*)b
) == 0);
13 int32_t uuid_is_nil(struct uuid
* uuid
, uint32_t* unused
)
15 return uuid_is_null(*(uuid_t
*)uuid
);
17 void uuid_create(uuid_t
*uuid
, uint32_t* status
)
20 return uuid_generate(*(uuid_t
*)uuid
);
22 void uuid_create_nil(struct uuid
* uuid
, uint32_t* unused
)
24 return uuid_clear(*(uuid_t
*)uuid
);
26 void uuid_from_string(const char* s
, uuid_t
*uuid
, uint32_t *status
)
28 *status
= uuid_parse(s
, *(uuid_t
*)uuid
);
30 void uuid_to_string(uuid_t
*uuid
, char** s
, uint32_t *status
)
32 *s
= malloc(36 + 1); /* 36 byte uuid plus '\0' */
34 fprintf(stderr
, "uuid_to_string: fatal: malloc\n");
37 uuid_unparse(*(uuid_t
*)uuid
, *s
);