From ce1dd0c0de3f4f8cd0c3a7b8c28f5bdc06d36dd3 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Thu, 27 May 2021 09:22:14 +0200 Subject: [PATCH] glib-aux: add nm_uuid_is_valid_full() to have a non-static, non-inline variant --- src/libnm-glib-aux/nm-uuid.c | 12 ++++++++++++ src/libnm-glib-aux/nm-uuid.h | 2 ++ 2 files changed, 14 insertions(+) diff --git a/src/libnm-glib-aux/nm-uuid.c b/src/libnm-glib-aux/nm-uuid.c index e8fcc094e6..977a9e79a9 100644 --- a/src/libnm-glib-aux/nm-uuid.c +++ b/src/libnm-glib-aux/nm-uuid.c @@ -129,6 +129,18 @@ nm_uuid_generate_random(NMUuid *out_uuid) /*****************************************************************************/ +gboolean +nm_uuid_is_valid_full(const char *str) +{ + /* The only reason why this exists is that nm_uuid_is_valid() is an inline function. + * If you need to forward declare the function, that won't work. + * + * Usually, you wouldn't use this variant! */ + return nm_uuid_is_valid(str); +} + +/*****************************************************************************/ + /** * nm_uuid_is_valid_nmlegacy() * @str: the string to check whether it's a valid UUID. diff --git a/src/libnm-glib-aux/nm-uuid.h b/src/libnm-glib-aux/nm-uuid.h index afa16891ce..0ead364090 100644 --- a/src/libnm-glib-aux/nm-uuid.h +++ b/src/libnm-glib-aux/nm-uuid.h @@ -33,6 +33,8 @@ gboolean nm_uuid_is_null(const NMUuid *uuid); /*****************************************************************************/ +gboolean nm_uuid_is_valid_full(const char *str); + static inline gboolean nm_uuid_is_valid(const char *str) {