Lines Matching refs:menu

15 struct menu rootmenu;
16 static struct menu **last_entry_ptr;
21 void menu_warn(struct menu *menu, const char *fmt, ...) in menu_warn() argument
25 fprintf(stderr, "%s:%d:warning: ", menu->file->name, menu->lineno); in menu_warn()
49 struct menu *menu; in menu_add_entry() local
51 menu = xmalloc(sizeof(*menu)); in menu_add_entry()
52 memset(menu, 0, sizeof(*menu)); in menu_add_entry()
53 menu->sym = sym; in menu_add_entry()
54 menu->parent = current_menu; in menu_add_entry()
55 menu->file = current_file; in menu_add_entry()
56 menu->lineno = zconf_lineno(); in menu_add_entry()
58 *last_entry_ptr = menu; in menu_add_entry()
59 last_entry_ptr = &menu->next; in menu_add_entry()
60 current_entry = menu; in menu_add_entry()
65 struct menu *menu_add_menu(void) in menu_add_menu()
131 prop->menu = current_entry; in menu_add_prop()
146 struct menu *menu = current_entry; in menu_add_prop() local
148 while ((menu = menu->parent) != NULL) { in menu_add_prop()
151 if (!menu->visibility) in menu_add_prop()
162 dup_expr = expr_copy(menu->visibility); in menu_add_prop()
293 void menu_finalize(struct menu *parent) in menu_finalize()
295 struct menu *menu, *last_menu; in menu_finalize() local
311 for (menu = parent->list; menu; menu = menu->next) { in menu_finalize()
312 if (menu->sym && menu->sym->type != S_UNKNOWN) { in menu_finalize()
313 menu_set_type(menu->sym->type); in menu_finalize()
319 for (menu = parent->list; menu; menu = menu->next) { in menu_finalize()
320 current_entry = menu; in menu_finalize()
321 if (menu->sym && menu->sym->type == S_UNKNOWN) in menu_finalize()
340 for (menu = parent->list; menu; menu = menu->next) { in menu_finalize()
345 basedep = rewrite_m(menu->dep); in menu_finalize()
349 menu->dep = basedep; in menu_finalize()
351 if (menu->sym) in menu_finalize()
356 prop = menu->sym->prop; in menu_finalize()
362 prop = menu->prompt; in menu_finalize()
366 if (prop->menu != menu) in menu_finalize()
393 if (menu->sym && menu->sym->type != S_TRISTATE) in menu_finalize()
404 expr_alloc_and(expr_alloc_symbol(menu->sym), expr_copy(dep))); in menu_finalize()
408 expr_alloc_and(expr_alloc_symbol(menu->sym), expr_copy(dep))); in menu_finalize()
420 for (menu = parent->list; menu; menu = menu->next) in menu_finalize()
421 menu_finalize(menu); in menu_finalize()
451 for (menu = parent->next; menu; menu = menu->next) { in menu_finalize()
452 dep = menu->prompt ? menu->prompt->visible.expr : menu->dep; in menu_finalize()
482 menu_finalize(menu); in menu_finalize()
483 menu->parent = parent; in menu_finalize()
484 last_menu = menu; in menu_finalize()
495 for (menu = parent->list; menu; menu = menu->next) { in menu_finalize()
497 menu->sym && !sym_is_choice_value(menu->sym)) { in menu_finalize()
498 current_entry = menu; in menu_finalize()
499 menu->sym->flags |= SYMBOL_CHOICEVAL; in menu_finalize()
500 if (!menu->prompt) in menu_finalize()
501 menu_warn(menu, "choice value must have a prompt"); in menu_finalize()
502 for (prop = menu->sym->prop; prop; prop = prop->next) { in menu_finalize()
506 if (prop->menu == menu) in menu_finalize()
509 prop->menu->parent->sym != sym) in menu_finalize()
518 if (sym->type == S_TRISTATE && menu->sym->type != S_TRISTATE) { in menu_finalize()
520 menu->dep = expr_alloc_and(basedep, menu->dep); in menu_finalize()
521 for (prop = menu->sym->prop; prop; prop = prop->next) { in menu_finalize()
522 if (prop->menu != menu) in menu_finalize()
533 (*ep)->right.sym = menu->sym; in menu_finalize()
564 if (menu->list && (!menu->prompt || !menu->prompt->text)) { in menu_finalize()
565 for (last_menu = menu->list; ; last_menu = last_menu->next) { in menu_finalize()
570 last_menu->next = menu->next; in menu_finalize()
571 menu->next = menu->list; in menu_finalize()
572 menu->list = NULL; in menu_finalize()
604 bool menu_has_prompt(struct menu *menu) in menu_has_prompt() argument
606 if (!menu->prompt) in menu_has_prompt()
616 bool menu_is_empty(struct menu *menu) in menu_is_empty() argument
618 struct menu *child; in menu_is_empty()
620 for (child = menu->list; child; child = child->next) { in menu_is_empty()
627 bool menu_is_visible(struct menu *menu) in menu_is_visible() argument
629 struct menu *child; in menu_is_visible()
633 if (!menu->prompt) in menu_is_visible()
636 if (menu->visibility) { in menu_is_visible()
637 if (expr_calc_value(menu->visibility) == no) in menu_is_visible()
641 sym = menu->sym; in menu_is_visible()
644 visible = menu->prompt->visible.tri; in menu_is_visible()
646 visible = menu->prompt->visible.tri = expr_calc_value(menu->prompt->visible.expr); in menu_is_visible()
651 if (!sym || sym_get_tristate_value(menu->sym) == no) in menu_is_visible()
654 for (child = menu->list; child; child = child->next) { in menu_is_visible()
665 const char *menu_get_prompt(struct menu *menu) in menu_get_prompt() argument
667 if (menu->prompt) in menu_get_prompt()
668 return menu->prompt->text; in menu_get_prompt()
669 else if (menu->sym) in menu_get_prompt()
670 return menu->sym->name; in menu_get_prompt()
674 struct menu *menu_get_root_menu(struct menu *menu) in menu_get_root_menu() argument
679 struct menu *menu_get_parent_menu(struct menu *menu) in menu_get_parent_menu() argument
683 for (; menu != &rootmenu; menu = menu->parent) { in menu_get_parent_menu()
684 type = menu->prompt ? menu->prompt->type : 0; in menu_get_parent_menu()
688 return menu; in menu_get_parent_menu()
691 bool menu_has_help(struct menu *menu) in menu_has_help() argument
693 return menu->help != NULL; in menu_has_help()
696 const char *menu_get_help(struct menu *menu) in menu_get_help() argument
698 if (menu->help) in menu_get_help()
699 return menu->help; in menu_get_help()
708 struct menu *submenu[8], *menu, *location = NULL; in get_prompt_str() local
712 menu = prop->menu->parent; in get_prompt_str()
713 for (i = 0; menu != &rootmenu && i < 8; menu = menu->parent) { in get_prompt_str()
714 bool accessible = menu_is_visible(menu); in get_prompt_str()
716 submenu[i++] = menu; in get_prompt_str()
718 location = menu; in get_prompt_str()
723 if (menu_is_visible(prop->menu)) { in get_prompt_str()
730 jump->target = prop->menu; in get_prompt_str()
746 menu = submenu[i]; in get_prompt_str()
747 if (jump && menu == location) in get_prompt_str()
750 menu_get_prompt(menu)); in get_prompt_str()
751 if (menu->sym) { in get_prompt_str()
752 str_printf(r, " (%s [=%s])", menu->sym->name ? in get_prompt_str()
753 menu->sym->name : "<choice>", in get_prompt_str()
754 sym_get_string_value(menu->sym)); in get_prompt_str()
817 str_printf(r, " Defined at %s:%d\n", prop->menu->file->name, in get_symbol_str()
818 prop->menu->lineno); in get_symbol_str()
857 void menu_get_ext_help(struct menu *menu, struct gstr *help) in menu_get_ext_help() argument
859 struct symbol *sym = menu->sym; in menu_get_ext_help()
862 if (menu_has_help(menu)) { in menu_get_ext_help()
865 help_text = menu_get_help(menu); in menu_get_ext_help()