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