summaryrefslogtreecommitdiff
path: root/libshouldbeinlibc/argp.h
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1996-10-24 21:36:32 +0000
committerMiles Bader <miles@gnu.org>1996-10-24 21:36:32 +0000
commit77fc211733d427b568c100101b159282483ac007 (patch)
treeb5eb971351116a873110d47e9b8162a2aa002b64 /libshouldbeinlibc/argp.h
parentd3be92a4e59b7efd4b6086e04144acf37819d3b7 (diff)
(struct argp):
Change type of CHILDREN field to `struct argp_child *'. (struct argp_child): New type.
Diffstat (limited to 'libshouldbeinlibc/argp.h')
-rw-r--r--libshouldbeinlibc/argp.h39
1 files changed, 33 insertions, 6 deletions
diff --git a/libshouldbeinlibc/argp.h b/libshouldbeinlibc/argp.h
index 8da5e10b..c46dcb20 100644
--- a/libshouldbeinlibc/argp.h
+++ b/libshouldbeinlibc/argp.h
@@ -81,6 +81,7 @@ struct argp_option
struct argp; /* fwd declare this type */
struct argp_state; /* " */
+struct argp_child; /* " */
/* The type of a pointer to an argp parsing function. */
typedef error_t (*argp_parser_t)(int key, char *arg, struct argp_state *state);
@@ -158,12 +159,38 @@ struct argp
help message, if it is non-NULL. */
const char *doc;
- /* A NULL terminated list of other argp structures that should be parsed
- with this one. Any conflicts are resolved in favor of this argp, or
- early argps in the CHILDREN list. This field is useful if you use
- libraries that supply their own argp structure, which you want to use in
- conjunction with your own. */
- const struct argp **children;
+ /* A vector of argp_children structures, terminated by a member with a 0
+ argp field, pointing to child argps should be parsed with this one. Any
+ conflicts are resolved in favor of this argp, or early argps in the
+ CHILDREN list. This field is useful if you use libraries that supply
+ their own argp structure, which you want to use in conjunction with your
+ own. */
+ const struct argp_child *children;
+};
+
+/* When an argp has a non-zero CHILDREN field, it should point to a vector of
+ argp_child structures, each of which describes a subsidiary argp. */
+struct argp_child
+{
+ /* The child parser. */
+ const struct argp *argp;
+
+ /* Flags for this child. */
+ int flags;
+
+ /* If non-zero, an optional header to be printed in help output before the
+ child options. As a side-effect, a non-zero value forces the child
+ options to be grouped together; to achieve this effect without actually
+ printing a header string, use a value of "". */
+ const char *header;
+
+ /* Where to group the child options relative to the other (`consolidated')
+ options in the parent argp; the values are the same as the GROUP field
+ in argp_option structs, but all child-groupings follow parent options at
+ a particular group level. If both this field and HEADER are zero, then
+ they aren't grouped at all, but rather merged with the parent options
+ (merging the child's grouping levels with the parents). */
+ int group;
};
/* Parsing state. This is provided to parsing functions called by argp,