|
@@ -11,10 +11,10 @@ FILE_LICENCE ( GPL2_OR_LATER );
|
11
|
11
|
|
12
|
12
|
#include <stdint.h>
|
13
|
13
|
#include <stddef.h>
|
|
14
|
+#include <ipxe/settings.h>
|
14
|
15
|
|
15
|
16
|
struct net_device;
|
16
|
17
|
struct menu;
|
17
|
|
-struct settings;
|
18
|
18
|
|
19
|
19
|
/** A command-line option descriptor */
|
20
|
20
|
struct option_descriptor {
|
|
@@ -115,6 +115,14 @@ struct command_descriptor {
|
115
|
115
|
.usage = _usage, \
|
116
|
116
|
}
|
117
|
117
|
|
|
118
|
+/** A parsed named setting */
|
|
119
|
+struct named_setting {
|
|
120
|
+ /** Settings block */
|
|
121
|
+ struct settings *settings;
|
|
122
|
+ /** Setting */
|
|
123
|
+ struct setting setting;
|
|
124
|
+};
|
|
125
|
+
|
118
|
126
|
extern int parse_string ( char *text, char **value );
|
119
|
127
|
extern int parse_integer ( char *text, unsigned int *value );
|
120
|
128
|
extern int parse_netdev ( char *text, struct net_device **netdev );
|
|
@@ -122,6 +130,12 @@ extern int parse_menu ( char *text, struct menu **menu );
|
122
|
130
|
extern int parse_flag ( char *text __unused, int *flag );
|
123
|
131
|
extern int parse_key ( char *text, unsigned int *key );
|
124
|
132
|
extern int parse_settings ( char *text, struct settings **settings );
|
|
133
|
+extern int parse_setting ( char *text, struct named_setting *setting,
|
|
134
|
+ get_child_settings_t get_child );
|
|
135
|
+extern int parse_existing_setting ( char *text, struct named_setting *setting );
|
|
136
|
+extern int parse_autovivified_setting ( char *text,
|
|
137
|
+ struct named_setting *setting );
|
|
138
|
+extern void print_usage ( struct command_descriptor *cmd, char **argv );
|
125
|
139
|
extern int reparse_options ( int argc, char **argv,
|
126
|
140
|
struct command_descriptor *cmd, void *opts );
|
127
|
141
|
extern int parse_options ( int argc, char **argv,
|