Lines Matching refs:menu
12 struct menu rootmenu;
13 static struct menu **last_entry_ptr;
18 static void menu_warn(struct menu *menu, const char *fmt, ...) in menu_warn() argument
22 fprintf(stderr, "%s:%d:warning: ", menu->file->name, menu->lineno); in menu_warn()
46 struct menu *menu; in menu_add_entry() local
48 menu = malloc(sizeof(*menu)); in menu_add_entry()
49 memset(menu, 0, sizeof(*menu)); in menu_add_entry()
50 menu->sym = sym; in menu_add_entry()
51 menu->parent = current_menu; in menu_add_entry()
52 menu->file = current_file; in menu_add_entry()
53 menu->lineno = zconf_lineno(); in menu_add_entry()
55 *last_entry_ptr = menu; in menu_add_entry()
56 last_entry_ptr = &menu->next; in menu_add_entry()
57 current_entry = menu; in menu_add_entry()
64 struct menu *menu_add_menu(void) in menu_add_menu()
126 prop->menu = current_entry; in menu_add_prop()
228 void menu_finalize(struct menu *parent) in menu_finalize()
230 struct menu *menu, *last_menu; in menu_finalize() local
239 for (menu = parent->list; menu; menu = menu->next) { in menu_finalize()
240 if (menu->sym) { in menu_finalize()
242 menu_set_type(menu->sym->type); in menu_finalize()
243 current_entry = menu; in menu_finalize()
254 for (menu = parent->list; menu; menu = menu->next) { in menu_finalize()
255 basedep = expr_transform(menu->dep); in menu_finalize()
258 menu->dep = basedep; in menu_finalize()
259 if (menu->sym) in menu_finalize()
260 prop = menu->sym->prop; in menu_finalize()
262 prop = menu->prompt; in menu_finalize()
264 if (prop->menu != menu) in menu_finalize()
269 if (menu->sym && menu->sym->type != S_TRISTATE) in menu_finalize()
275 expr_alloc_and(expr_alloc_symbol(menu->sym), expr_copy(dep))); in menu_finalize()
279 for (menu = parent->list; menu; menu = menu->next) in menu_finalize()
280 menu_finalize(menu); in menu_finalize()
286 for (menu = parent->next; menu; menu = menu->next) { in menu_finalize()
287 dep = menu->prompt ? menu->prompt->visible.expr : menu->dep; in menu_finalize()
303 menu_finalize(menu); in menu_finalize()
304 menu->parent = parent; in menu_finalize()
305 last_menu = menu; in menu_finalize()
313 for (menu = parent->list; menu; menu = menu->next) { in menu_finalize()
314 if (sym && sym_is_choice(sym) && menu->sym) { in menu_finalize()
315 menu->sym->flags |= SYMBOL_CHOICEVAL; in menu_finalize()
316 if (!menu->prompt) in menu_finalize()
317 menu_warn(menu, "choice value must have a prompt"); in menu_finalize()
318 for (prop = menu->sym->prop; prop; prop = prop->next) { in menu_finalize()
319 if (prop->type == P_PROMPT && prop->menu != menu) { in menu_finalize()
328 current_entry = menu; in menu_finalize()
335 (*ep)->right.sym = menu->sym; in menu_finalize()
337 if (menu->list && (!menu->prompt || !menu->prompt->text)) { in menu_finalize()
338 for (last_menu = menu->list; ; last_menu = last_menu->next) { in menu_finalize()
343 last_menu->next = menu->next; in menu_finalize()
344 menu->next = menu->list; in menu_finalize()
345 menu->list = NULL; in menu_finalize()
368 bool menu_is_visible(struct menu *menu) in menu_is_visible() argument
370 struct menu *child; in menu_is_visible()
374 if (!menu->prompt) in menu_is_visible()
376 sym = menu->sym; in menu_is_visible()
379 visible = menu->prompt->visible.tri; in menu_is_visible()
381 visible = menu->prompt->visible.tri = expr_calc_value(menu->prompt->visible.expr); in menu_is_visible()
385 if (!sym || sym_get_tristate_value(menu->sym) == no) in menu_is_visible()
388 for (child = menu->list; child; child = child->next) in menu_is_visible()
394 const char *menu_get_prompt(struct menu *menu) in menu_get_prompt() argument
396 if (menu->prompt) in menu_get_prompt()
397 return _(menu->prompt->text); in menu_get_prompt()
398 else if (menu->sym) in menu_get_prompt()
399 return _(menu->sym->name); in menu_get_prompt()
403 struct menu *menu_get_root_menu(struct menu *menu) in menu_get_root_menu() argument
408 struct menu *menu_get_parent_menu(struct menu *menu) in menu_get_parent_menu() argument
412 for (; menu != &rootmenu; menu = menu->parent) { in menu_get_parent_menu()
413 type = menu->prompt ? menu->prompt->type : 0; in menu_get_parent_menu()
417 return menu; in menu_get_parent_menu()