diff options
author | 2011-01-18 10:31:47 +0000 | |
---|---|---|
committer | 2011-01-18 10:31:47 +0000 | |
commit | f3ac110d763782bd804157769efae6190d8caef7 (patch) | |
tree | 722eaacee9c71c336b2bd82e73d71b71e57b862e /src/lib | |
parent | db4f44350b31a778e85848b451f5d53139e6feae (diff) |
Added new flag for options OPTION_DRIVER_ONLY, and marked bios and ramsize as such, since they do not need to be loaded from parent drivers since those are quite driver dependent (no whatsnew)
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/util/options.c | 17 | ||||
-rw-r--r-- | src/lib/util/options.h | 4 |
2 files changed, 21 insertions, 0 deletions
diff --git a/src/lib/util/options.c b/src/lib/util/options.c index 2d53f86aa39..d2d88e77174 100644 --- a/src/lib/util/options.c +++ b/src/lib/util/options.c @@ -250,6 +250,23 @@ void options_revert(core_options *opts, int priority) } } +/*------------------------------------------------- + options_revert_driver_only - revert options + that are marked as driver only and are under + priority level +-------------------------------------------------*/ + +void options_revert_driver_only(core_options *opts, int priority) +{ + options_data *data; + + /* iterate over options and revert to defaults if below the given priority */ + for (data = opts->datalist; data != NULL; data = data->next) + if ((data->flags & OPTION_DRIVER_ONLY) && (data->priority < priority)) { + astring_cpy(data->data, data->defdata); + data->priority = OPTION_PRIORITY_DEFAULT; + } +} /*------------------------------------------------- options_copy - copy options from one core_options diff --git a/src/lib/util/options.h b/src/lib/util/options.h index 0d8f9c4a751..51a740666b8 100644 --- a/src/lib/util/options.h +++ b/src/lib/util/options.h @@ -60,6 +60,7 @@ #define OPTION_HEADER 0x0008 /* text-only header */ #define OPTION_INTERNAL 0x0010 /* option is internal-only */ #define OPTION_REPEATS 0x0020 /* unadorned option repeats */ +#define OPTION_DRIVER_ONLY 0x0040 /* remove value if found in lower levels */ /* option priorities */ #define OPTION_PRIORITY_DEFAULT 0 /* defaults are at 0 priority */ @@ -138,6 +139,9 @@ void options_set_output_callback(core_options *opts, options_message msgtype, vo /* revert options at or below a certain priority back to their defaults */ void options_revert(core_options *opts, int priority); +/* revert options that are marked as driver only */ +void options_revert_driver_only(core_options *opts, int priority); + /* copy one collection of options into another */ int options_copy(core_options *dest_opts, core_options *src_opts); |