]>
git.ipfire.org Git - thirdparty/systemd.git/blob - src/libsystemd/sd-id128/id128-util.h
1 /* SPDX-License-Identifier: LGPL-2.1+ */
8 #include "hash-funcs.h"
11 char *id128_to_uuid_string(sd_id128_t id
, char s
[37]);
13 /* Like SD_ID128_FORMAT_STR, but formats as UUID, not in plain format */
14 #define ID128_UUID_FORMAT_STR "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x"
16 bool id128_is_valid(const char *s
) _pure_
;
18 typedef enum Id128Format
{
20 ID128_PLAIN
, /* formatted as 32 hex chars as-is */
21 ID128_UUID
, /* formatted as 36 character uuid string */
25 int id128_read_fd(int fd
, Id128Format f
, sd_id128_t
*ret
);
26 int id128_read(const char *p
, Id128Format f
, sd_id128_t
*ret
);
28 int id128_write_fd(int fd
, Id128Format f
, sd_id128_t id
, bool do_sync
);
29 int id128_write(const char *p
, Id128Format f
, sd_id128_t id
, bool do_sync
);
31 void id128_hash_func(const sd_id128_t
*p
, struct siphash
*state
);
32 int id128_compare_func(const sd_id128_t
*a
, const sd_id128_t
*b
) _pure_
;
33 extern const struct hash_ops id128_hash_ops
;