MCPcopy Create free account
hub / github.com/coreboot/coreboot / conf_choice

Function conf_choice

util/kconfig/mconf.c:630–689  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

628}
629
630static void conf_choice(struct menu *menu)
631{
632 const char *prompt = menu_get_prompt(menu);
633 struct menu *child;
634 struct symbol *active;
635
636 active = sym_get_choice_value(menu->sym);
637 while (1) {
638 int res;
639 int selected;
640 item_reset();
641
642 current_menu = menu;
643 for (child = menu->list; child; child = child->next) {
644 if (!menu_is_visible(child))
645 continue;
646 if (child->sym)
647 item_make("%s", menu_get_prompt(child));
648 else {
649 item_make("*** %s ***", menu_get_prompt(child));
650 item_set_tag(':');
651 }
652 item_set_data(child);
653 if (child->sym == active)
654 item_set_selected(1);
655 if (child->sym == sym_get_choice_value(menu->sym))
656 item_set_tag('X');
657 }
658 dialog_clear();
659 res = dialog_checklist(prompt ? prompt : "Main Menu",
660 radiolist_instructions,
661 MENUBOX_HEIGTH_MIN,
662 MENUBOX_WIDTH_MIN,
663 CHECKLIST_HEIGTH_MIN);
664 selected = item_activate_selected();
665 switch (res) {
666 case 0:
667 if (selected) {
668 child = item_data();
669 if (!child->sym)
670 break;
671
672 sym_set_tristate_value(child->sym, yes);
673 }
674 return;
675 case 1:
676 if (selected) {
677 child = item_data();
678 show_help(child);
679 active = child->sym;
680 } else
681 show_help(menu);
682 break;
683 case KEY_ESC:
684 return;
685 case -ERRDISPLAYTOOSMALL:
686 return;
687 }

Callers 1

confFunction · 0.70

Calls 14

menu_get_promptFunction · 0.85
sym_get_choice_valueFunction · 0.85
item_resetFunction · 0.85
menu_is_visibleFunction · 0.85
item_set_tagFunction · 0.85
item_set_dataFunction · 0.85
item_set_selectedFunction · 0.85
dialog_clearFunction · 0.85
dialog_checklistFunction · 0.85
item_activate_selectedFunction · 0.85
sym_set_tristate_valueFunction · 0.85
item_makeFunction · 0.70

Tested by

no test coverage detected