From: Aurelien DARRAGON Date: Mon, 14 Apr 2025 13:05:23 +0000 (+0200) Subject: MINOR: guid: add guid_get() helper X-Git-Tag: v3.3-dev7~58 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7c529645913be630c9f9a04f4f9aa195129b0560;p=thirdparty%2Fhaproxy.git 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 --- 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);