]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: tools: add a generic struct "name_desc" for name-description pairs
authorWilly Tarreau <w@1wt.eu>
Thu, 29 Aug 2019 07:32:21 +0000 (09:32 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 29 Aug 2019 07:34:53 +0000 (09:34 +0200)
In prompts on the CLI we now commonly need to propose a keyword name
and a description and it doesn't make sense to define a new struct for
each such pairs. Let's simply have a generic "name_desc" for this.

include/common/standard.h

index 0b8a32726690ddb5cbc9784775d80f8c0808f152..69d760dd8bfbc4f494744b512d9a1af037eb55c4 100644 (file)
@@ -87,6 +87,12 @@ struct split_url {
        int host_len;
 };
 
+/* generic structure associating a name and a value, for use in arrays */
+struct name_desc {
+       const char *name;
+       const char *desc;
+};
+
 extern THREAD_LOCAL int itoa_idx; /* index of next itoa_str to use */
 
 /*