add 'reset to defaults' to menuconfig
git-svn-id: svn://svn.openwrt.org/openwrt/branches/buildroot-ng/openwrt@4080 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
parent
16237fb8e1
commit
6a1be27011
3 changed files with 29 additions and 0 deletions
|
@ -83,6 +83,29 @@ char *conf_get_default_confname(void)
|
|||
return name;
|
||||
}
|
||||
|
||||
void conf_reset(void)
|
||||
{
|
||||
struct symbol *sym;
|
||||
int i;
|
||||
|
||||
for_all_symbols(i, sym) {
|
||||
sym->flags |= SYMBOL_NEW | SYMBOL_CHANGED;
|
||||
if (sym_is_choice(sym))
|
||||
sym->flags &= ~SYMBOL_NEW;
|
||||
sym->flags &= ~SYMBOL_VALID;
|
||||
switch (sym->type) {
|
||||
case S_INT:
|
||||
case S_HEX:
|
||||
case S_STRING:
|
||||
if (sym->user.val)
|
||||
free(sym->user.val);
|
||||
default:
|
||||
sym->user.val = NULL;
|
||||
sym->user.tri = no;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int conf_read_simple(const char *name)
|
||||
{
|
||||
FILE *in = NULL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue