summaryrefslogtreecommitdiffstats
path: root/src/hci/commands
diff options
context:
space:
mode:
authorMichael Brown2008-03-20 22:01:32 +0100
committerMichael Brown2008-03-20 22:01:32 +0100
commit260b93bb72ab31881669cb3e393816a6156c92b7 (patch)
tree04ba222fa088af8035eaa82423caebf9cb5b07b1 /src/hci/commands
parent[Settings] Start revamping the configuration settings API. (diff)
downloadipxe-260b93bb72ab31881669cb3e393816a6156c92b7.tar.gz
ipxe-260b93bb72ab31881669cb3e393816a6156c92b7.tar.xz
ipxe-260b93bb72ab31881669cb3e393816a6156c92b7.zip
[Settings] Add settings hierarchy
Add the notion of the settings hierarchy, complete with register/unregister routines. Rename set->store and get->fetch to avoid naming conflicts with get/put as used in reference counting.
Diffstat (limited to 'src/hci/commands')
-rw-r--r--src/hci/commands/config_cmd.c4
-rw-r--r--src/hci/commands/nvo_cmd.c5
2 files changed, 4 insertions, 5 deletions
diff --git a/src/hci/commands/config_cmd.c b/src/hci/commands/config_cmd.c
index 49cc41e7..5a34cea2 100644
--- a/src/hci/commands/config_cmd.c
+++ b/src/hci/commands/config_cmd.c
@@ -5,7 +5,7 @@
#include <gpxe/settings_ui.h>
static int config_exec ( int argc, char **argv ) {
- struct settings *settings;
+ struct settings *settings = NULL;
int rc;
if ( argc > 2 ) {
@@ -20,8 +20,6 @@ static int config_exec ( int argc, char **argv ) {
printf ( "No such scope \"%s\"\n", argv[1] );
return 1;
}
- } else {
- settings = &interactive_settings;
}
if ( ( rc = settings_ui ( settings ) ) != 0 ) {
diff --git a/src/hci/commands/nvo_cmd.c b/src/hci/commands/nvo_cmd.c
index 255e9795..e2fdd8fb 100644
--- a/src/hci/commands/nvo_cmd.c
+++ b/src/hci/commands/nvo_cmd.c
@@ -16,7 +16,8 @@ static int show_exec ( int argc, char **argv ) {
return 1;
}
- if ( ( rc = get_named_setting ( argv[1], buf, sizeof ( buf ) ) ) < 0 ){
+ if ( ( rc = fetch_named_setting ( argv[1], buf,
+ sizeof ( buf ) ) ) < 0 ){
printf ( "Could not find \"%s\": %s\n",
argv[1], strerror ( rc ) );
return 1;
@@ -34,7 +35,7 @@ static int set_exec ( int argc, char **argv ) {
return 1;
}
- if ( ( rc = set_named_setting ( argv[1], argv[2] ) ) != 0 ) {
+ if ( ( rc = store_named_setting ( argv[1], argv[2] ) ) != 0 ) {
printf ( "Could not set \"%s\"=\"%s\": %s\n",
argv[1], argv[2], strerror ( rc ) );
return 1;