X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=config%2Fmenu.c;h=b9701010de8ccb7de97417bf474d1eea2ff41b3d;hb=3fca42f4136e83767565133088c35bd1e586901f;hp=fd3f0180e08fbafb537e128c9e46641288c68774;hpb=6cbac37e1eefd4d5f75879136cff03cdfd6c2e01;p=carl9170fw.git diff --git a/config/menu.c b/config/menu.c index fd3f018..b970101 100644 --- a/config/menu.c +++ b/config/menu.c @@ -197,12 +197,15 @@ void menu_add_symbol(enum prop_type type, struct symbol *sym, struct expr *dep) void menu_add_option(int token, char *arg) { - struct property *prop; - switch (token) { case T_OPT_MODULES: - prop = prop_alloc(P_DEFAULT, modules_sym); - prop->expr = expr_alloc_symbol(current_entry->sym); + if (modules_sym) + zconf_error("symbol '%s' redefines option 'modules'" + " already defined by symbol '%s'", + current_entry->sym->name, + modules_sym->name + ); + modules_sym = current_entry->sym; break; case T_OPT_DEFCONFIG_LIST: if (!sym_defconfig_list) @@ -443,6 +446,22 @@ bool menu_has_prompt(struct menu *menu) return true; } +/* + * Determine if a menu is empty. + * A menu is considered empty if it contains no or only + * invisible entries. + */ +bool menu_is_empty(struct menu *menu) +{ + struct menu *child; + + for (child = menu->list; child; child = child->next) { + if (menu_is_visible(child)) + return(false); + } + return(true); +} + bool menu_is_visible(struct menu *menu) { struct menu *child; @@ -578,7 +597,7 @@ static void get_prompt_str(struct gstr *r, struct property *prop, } /* - * get peoperty of type P_SYMBOL + * get property of type P_SYMBOL */ static struct property *get_symbol_prop(struct symbol *sym) {