コード例 #1
0
void menu_add_expr(enum prop_type type, struct expr *expr, struct expr *dep)
{
	menu_add_prop(type, NULL, expr, dep);
}
コード例 #2
0
void menu_add_symbol(enum prop_type type, struct symbol *sym, struct expr *dep)
{
	menu_add_prop(type, NULL, expr_alloc_symbol(sym), dep);
}
コード例 #3
0
struct property *menu_add_prompt(enum prop_type type, char *prompt, struct expr *dep)
{
	return menu_add_prop(type, prompt, NULL, dep);
}
コード例 #4
0
ファイル: menu.c プロジェクト: vovan888/linux-on-sx1
void
menu_finalize(struct menu *parent)
{
    struct menu *menu, *last_menu;
    struct symbol *sym;
    struct property *prop;
    struct expr *parentdep, *basedep, *dep, *dep2;

    sym = parent->sym;
    if (parent->list) {
	if (sym && sym_is_choice(sym)) {
	    /* find the first choice value and find out choice type */
	    for (menu = parent->list; menu; menu = menu->next) {
		if (menu->sym) {
		    current_entry = parent;
		    menu_set_type(menu->sym->type);
		    current_entry = menu;
		    menu_set_type(sym->type);
		    break;
		}
	    }
	    parentdep = expr_alloc_symbol(sym);
	} else if (parent->prompt)
	    parentdep = E_EXPR(parent->prompt->visible);
	else
	    parentdep = parent->dep;

	for (menu = parent->list; menu; menu = menu->next) {
	    basedep = expr_transform(menu->dep);
	    basedep = expr_alloc_and(expr_copy(parentdep), basedep);
	    basedep = expr_eliminate_dups(basedep);
	    menu->dep = basedep;
	    if (menu->sym)
		prop = menu->sym->prop;
	    else
		prop = menu->prompt;
	    for (; prop; prop = prop->next) {
		if (prop->menu != menu)
		    continue;
		dep = expr_transform(E_EXPR(prop->visible));
		dep = expr_alloc_and(expr_copy(basedep), dep);
		dep = expr_eliminate_dups(dep);
		if (menu->sym && menu->sym->type != S_TRISTATE)
		    dep = expr_trans_bool(dep);
		E_EXPR(prop->visible) = dep;
	    }
	}
	for (menu = parent->list; menu; menu = menu->next)
	    menu_finalize(menu);
    } else if (sym && parent->prompt) {
	basedep = E_EXPR(parent->prompt->visible);
	basedep = expr_trans_compare(basedep, E_UNEQUAL, &symbol_no);
	basedep = expr_eliminate_dups(expr_transform(basedep));
	last_menu = NULL;
	for (menu = parent->next; menu; menu = menu->next) {
	    dep = menu->prompt ? E_EXPR(menu->prompt->visible) : menu->dep;
	    if (!expr_contains_symbol(dep, sym))
		break;
	    if (expr_depends_symbol(dep, sym))
		goto next;
	    dep = expr_trans_compare(dep, E_UNEQUAL, &symbol_no);
	    dep = expr_eliminate_dups(expr_transform(dep));
	    dep2 = expr_copy(basedep);
	    expr_eliminate_eq(&dep, &dep2);
	    expr_free(dep);
	    if (!expr_is_yes(dep2)) {
		expr_free(dep2);
		break;
	    }
	    expr_free(dep2);
	  next:
	    menu_finalize(menu);
	    menu->parent = parent;
	    last_menu = menu;
	}
	if (last_menu) {
	    parent->list = parent->next;
	    parent->next = last_menu->next;
	    last_menu->next = NULL;
	}
    }
    for (menu = parent->list; menu; menu = menu->next) {
	if (sym && sym_is_choice(sym) && menu->sym) {
	    menu->sym->flags |= SYMBOL_CHOICEVAL;
	    current_entry = menu;
	    menu_set_type(sym->type);
	    menu_add_prop(P_CHOICE, NULL, parent->sym, NULL);
	    prop = sym_get_choice_prop(parent->sym);
	    //dep = expr_alloc_one(E_CHOICE, dep);
	    //dep->right.sym = menu->sym;
	    prop->dep = expr_alloc_one(E_CHOICE, prop->dep);
	    prop->dep->right.sym = menu->sym;
	}
	if (menu->list && (!menu->prompt || !menu->prompt->text)) {
	    for (last_menu = menu->list;; last_menu = last_menu->next) {
		last_menu->parent = parent;
		if (!last_menu->next)
		    break;
	    }
	    last_menu->next = menu->next;
	    menu->next = menu->list;
	    menu->list = NULL;
	}
    }
}
コード例 #5
0
ファイル: menu.c プロジェクト: vovan888/linux-on-sx1
void
menu_add_default(int token, struct symbol *def, struct expr *dep)
{
    current_entry->prompt = menu_add_prop(token, NULL, def, dep);
}
コード例 #6
0
ファイル: menu.c プロジェクト: vovan888/linux-on-sx1
void
menu_add_prompt(int token, char *prompt, struct expr *dep)
{
    current_entry->prompt = menu_add_prop(token, prompt, NULL, dep);
}
コード例 #7
0
ファイル: menu.c プロジェクト: Voskrese/mipsonqemu
void menu_add_prompt(enum prop_type type, char *prompt, struct expr *dep)
{
	menu_add_prop(type, prompt, NULL, dep);
}