diff options
author | Lennart Poettering <lennart@poettering.net> | 2022-02-14 14:54:24 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2022-02-14 15:14:03 +0100 |
commit | 75a505c6006f9ddf536b426941ace1f87b263399 (patch) | |
tree | 8fc3102d92c2bcb91cf3efbf6767c16a6eb90789 /src/libsystemd/sd-id128/id128-util.h | |
parent | b74163607b4e513288d38b7f16e230f5a61400c0 (diff) | |
download | systemd-75a505c6006f9ddf536b426941ace1f87b263399.tar.gz |
id128-util: add new helper id128_equal_string()
Quite often we compare uuids/id128 formatted as strings with specific
values. So far we usually used streq() for that. let's add a new
explicit helper for this in id128_equal_string() that compares a string
with an sd_id128_t and is more robust than a simple string comparison.
Moreover, we can mroe easily reuse the various defines we have for
specific UUIDs, for example those from gpt.h.
Diffstat (limited to 'src/libsystemd/sd-id128/id128-util.h')
-rw-r--r-- | src/libsystemd/sd-id128/id128-util.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libsystemd/sd-id128/id128-util.h b/src/libsystemd/sd-id128/id128-util.h index 17b180c10c..65a278c8ee 100644 --- a/src/libsystemd/sd-id128/id128-util.h +++ b/src/libsystemd/sd-id128/id128-util.h @@ -34,3 +34,5 @@ extern const struct hash_ops id128_hash_ops; sd_id128_t id128_make_v4_uuid(sd_id128_t id); int id128_get_product(sd_id128_t *ret); + +int id128_equal_string(const char *s, sd_id128_t id); |