MCPcopy Create free account
hub / github.com/Entware/Entware / menu_is_visible

Function menu_is_visible

scripts/config/menu.c:617–653  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

615}
616
617bool menu_is_visible(struct menu *menu)
618{
619 struct menu *child;
620 struct symbol *sym;
621 tristate visible;
622
623 if (!menu->prompt)
624 return false;
625
626 if (menu->visibility) {
627 if (expr_calc_value(menu->visibility) == no)
628 return false;
629 }
630
631 sym = menu->sym;
632 if (sym) {
633 sym_calc_value(sym);
634 visible = menu->prompt->visible.tri;
635 } else
636 visible = menu->prompt->visible.tri = expr_calc_value(menu->prompt->visible.expr);
637
638 if (visible != no)
639 return true;
640
641 if (!sym || sym_get_tristate_value(menu->sym) == no)
642 return false;
643
644 for (child = menu->list; child; child = child->next) {
645 if (menu_is_visible(child)) {
646 if (sym)
647 sym->flags |= SYMBOL_DEF_USER;
648 return true;
649 }
650 }
651
652 return false;
653}
654
655const char *menu_get_prompt(struct menu *menu)
656{

Callers 15

createEditorMethod · 0.85
menuSkipMethod · 0.85
updateListMethod · 0.85
updateMenuListMethod · 0.85
searchMethod · 0.85
item_makeFunction · 0.85
build_confFunction · 0.85
selected_confFunction · 0.85
conf_choiceFunction · 0.85
conf_write_defconfigFunction · 0.85
conf_writeFunction · 0.85
build_confFunction · 0.85

Calls 3

expr_calc_valueFunction · 0.85
sym_calc_valueFunction · 0.85
sym_get_tristate_valueFunction · 0.85

Tested by

no test coverage detected