[settings] Eliminate settings "tag magic"

Create an explicit concept of "settings scope" and eliminate the magic
values used for numerical setting tags.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2013-05-01 19:52:12 +01:00
parent b4ec6a6a68
commit 15d2f947f5
11 changed files with 82 additions and 170 deletions
+4 -2
View File
@@ -195,7 +195,8 @@ static int nvo_save ( struct nvo_block *nvo ) {
int nvo_applies ( struct settings *settings __unused,
struct setting *setting ) {
return dhcpopt_applies ( setting->tag );
return ( ( setting->scope == NULL ) &&
dhcpopt_applies ( setting->tag ) );
}
/**
@@ -274,7 +275,8 @@ void nvo_init ( struct nvo_block *nvo, struct nvs_device *nvs,
nvo->len = len;
nvo->resize = resize;
dhcpopt_init ( &nvo->dhcpopts, NULL, 0, nvo_realloc_dhcpopt );
settings_init ( &nvo->settings, &nvo_settings_operations, refcnt, 0 );
settings_init ( &nvo->settings, &nvo_settings_operations,
refcnt, NULL );
}
/**