]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: guid: add guid_get() helper
authorAurelien DARRAGON <adarragon@haproxy.com>
Mon, 14 Apr 2025 13:05:23 +0000 (15:05 +0200)
committerAurelien DARRAGON <adarragon@haproxy.com>
Thu, 7 Aug 2025 20:26:52 +0000 (22:26 +0200)
guid_get() is a convenient function to get the actual key string
associated to a given guid_node struct

include/haproxy/guid.h

index 691936ffe35a1eb036499d4816b5688e474c4151..42f758ba6ed45c03531e6aee4cb3137a8865d94f 100644 (file)
@@ -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 <guid> 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);