From 7c529645913be630c9f9a04f4f9aa195129b0560 Mon Sep 17 00:00:00 2001 From: Aurelien DARRAGON Date: Mon, 14 Apr 2025 15:05:23 +0200 Subject: [PATCH] MINOR: guid: add guid_get() helper guid_get() is a convenient function to get the actual key string associated to a given guid_node struct --- include/haproxy/guid.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/haproxy/guid.h b/include/haproxy/guid.h index 691936ffe..42f758ba6 100644 --- a/include/haproxy/guid.h +++ b/include/haproxy/guid.h @@ -12,6 +12,14 @@ int guid_insert(enum obj_type *obj_type, const char *uid, char **errmsg); void guid_remove(struct guid_node *guid); struct guid_node *guid_lookup(const char *uid); +/* Returns the actual text key associated to node or NULL if not + * set + */ +static inline const char *guid_get(const struct guid_node *guid) +{ + return guid->node.key; +} + int guid_is_valid_fmt(const char *uid, char **errmsg); char *guid_name(const struct guid_node *guid); -- 2.47.3