aboutsummaryrefslogtreecommitdiff
path: root/util/uuid.c
diff options
context:
space:
mode:
authorRyan Farley <ryan.farley@gmx.com>2021-04-07 13:10:43 -0500
committerSimon Ser <contact@emersion.fr>2021-04-11 19:09:36 +0200
commitb29ac8fbaceeac7f902fc75bb94a13b9cd9a0465 (patch)
treea47bd9bb8d4265386c3abb5ad7be6a7a397bbfb0 /util/uuid.c
parent5a178c4a2398de612b7a4cb39d060ec62eec666b (diff)
util/uuid: replace with util/token, remove libuuid
Use 128-bit hexadecimal string tokens generated with /dev/urandom instead of UUIDs for xdg-foreign handles, removing the libuuid dependency. Update readme and CI. Closes #2830. build: remove xdg-foreign feature With no external dependencies required, there's no reason not to always build it. Remove WLR_HAS_XDG_FOREIGN as well.
Diffstat (limited to 'util/uuid.c')
-rw-r--r--util/uuid.c34
1 files changed, 0 insertions, 34 deletions
diff --git a/util/uuid.c b/util/uuid.c
deleted file mode 100644
index 82e310b9..00000000
--- a/util/uuid.c
+++ /dev/null
@@ -1,34 +0,0 @@
-#include <uuid.h>
-#include "util/uuid.h"
-
-#if HAS_LIBUUID
-bool generate_uuid(char out[static 37]) {
- uuid_t uuid;
- uuid_generate_random(uuid);
- uuid_unparse(uuid, out);
- return true;
-}
-#else
-#include <assert.h>
-#include <string.h>
-#include <stdlib.h>
-
-bool generate_uuid(char out[static 37]) {
- uuid_t uuid;
- uint32_t status;
- uuid_create(&uuid, &status);
- if (status != uuid_s_ok) {
- return false;
- }
- char *str;
- uuid_to_string(&uuid, &str, &status);
- if (status != uuid_s_ok) {
- return false;
- }
-
- assert(strlen(str) + 1 == 37);
- memcpy(out, str, 37);
- free(str);
- return true;
-}
-#endif