mirror of
git://projects.qi-hardware.com/openwrt-xburst.git
synced 2025-04-21 12:27:27 +03:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user