diff options
author | Michael Brown <mcb30@ipxe.org> | 2013-07-18 16:11:39 +0100 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2013-07-22 16:30:44 +0100 |
commit | 1625a8c05fe72b7c53cff049c646e913d6dab362 (patch) | |
tree | c937d5c72c1eb2b7a74c821165debc3bd5a50f25 /src/include/ipxe/parseopt.h | |
parent | 46433f9b5eb917e6ad90ffaa169febdfcf78270f (diff) | |
download | ipxe-1625a8c05fe72b7c53cff049c646e913d6dab362.zip ipxe-1625a8c05fe72b7c53cff049c646e913d6dab362.tar.gz ipxe-1625a8c05fe72b7c53cff049c646e913d6dab362.tar.bz2 |
[parseopt] Add parse_setting()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include/ipxe/parseopt.h')
-rw-r--r-- | src/include/ipxe/parseopt.h | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/include/ipxe/parseopt.h b/src/include/ipxe/parseopt.h index 8aeed97..2e38d23 100644 --- a/src/include/ipxe/parseopt.h +++ b/src/include/ipxe/parseopt.h @@ -11,10 +11,10 @@ FILE_LICENCE ( GPL2_OR_LATER ); #include <stdint.h> #include <stddef.h> +#include <ipxe/settings.h> struct net_device; struct menu; -struct settings; /** A command-line option descriptor */ struct option_descriptor { @@ -115,6 +115,14 @@ struct command_descriptor { .usage = _usage, \ } +/** A parsed named setting */ +struct named_setting { + /** Settings block */ + struct settings *settings; + /** Setting */ + struct setting setting; +}; + extern int parse_string ( char *text, char **value ); extern int parse_integer ( char *text, unsigned int *value ); extern int parse_netdev ( char *text, struct net_device **netdev ); @@ -122,6 +130,12 @@ extern int parse_menu ( char *text, struct menu **menu ); extern int parse_flag ( char *text __unused, int *flag ); extern int parse_key ( char *text, unsigned int *key ); extern int parse_settings ( char *text, struct settings **settings ); +extern int parse_setting ( char *text, struct named_setting *setting, + get_child_settings_t get_child ); +extern int parse_existing_setting ( char *text, struct named_setting *setting ); +extern int parse_autovivified_setting ( char *text, + struct named_setting *setting ); +extern void print_usage ( struct command_descriptor *cmd, char **argv ); extern int reparse_options ( int argc, char **argv, struct command_descriptor *cmd, void *opts ); extern int parse_options ( int argc, char **argv, |