Lines Matching refs:sym
68 void menu_add_entry(struct symbol *sym) in menu_add_entry() argument
74 menu->sym = sym; in menu_add_entry()
82 if (sym) in menu_add_entry()
83 list_add_tail(&menu->link, &sym->menus); in menu_add_entry()
120 if (e->left.sym == &symbol_mod) in rewrite_m()
136 struct symbol *sym = current_entry->sym; in menu_set_type() local
138 if (sym->type == type) in menu_set_type()
140 if (sym->type == S_UNKNOWN) { in menu_set_type()
141 sym->type = type; in menu_set_type()
146 sym->name ? sym->name : "<choice>", in menu_set_type()
147 sym_type_name(sym->type), sym_type_name(type)); in menu_set_type()
165 if (current_entry->sym) { in menu_add_prop()
168 for (propp = ¤t_entry->sym->prop; in menu_add_prop()
221 void menu_add_symbol(enum prop_type type, struct symbol *sym, struct expr *dep) in menu_add_symbol() argument
223 menu_add_prop(type, expr_alloc_symbol(sym), dep); in menu_add_symbol()
226 static int menu_validate_number(struct symbol *sym, struct symbol *sym2) in menu_validate_number() argument
229 (sym2->type == S_UNKNOWN && sym_string_valid(sym, sym2->name)); in menu_validate_number()
232 static void sym_check_prop(struct symbol *sym) in sym_check_prop() argument
238 for (prop = sym->prop; prop; prop = prop->next) { in sym_check_prop()
241 if ((sym->type == S_STRING || sym->type == S_INT || sym->type == S_HEX) && in sym_check_prop()
245 " must be a single symbol", sym->name); in sym_check_prop()
249 if (sym->type == S_HEX || sym->type == S_INT) { in sym_check_prop()
250 if (!menu_validate_number(sym, sym2)) in sym_check_prop()
253 sym->name); in sym_check_prop()
255 if (sym_is_choice(sym)) { in sym_check_prop()
258 if (!choice || choice->sym != sym) in sym_check_prop()
268 if (sym->type != S_BOOLEAN && sym->type != S_TRISTATE) in sym_check_prop()
271 "not bool or tristate", sym->name, use); in sym_check_prop()
281 if (sym->type != S_INT && sym->type != S_HEX) in sym_check_prop()
284 if (!menu_validate_number(sym, prop->expr->left.sym) || in sym_check_prop()
285 !menu_validate_number(sym, prop->expr->right.sym)) in sym_check_prop()
297 struct symbol *sym; in _menu_finalize() local
301 sym = parent->sym; in _menu_finalize()
320 if (menu->sym) in _menu_finalize()
325 prop = menu->sym->prop; in _menu_finalize()
371 expr_alloc_and(expr_alloc_symbol(menu->sym), dep)); in _menu_finalize()
375 expr_alloc_and(expr_alloc_symbol(menu->sym), dep)); in _menu_finalize()
385 _menu_finalize(menu, sym && sym_is_choice(sym)); in _menu_finalize()
386 } else if (!inside_choice && sym) { in _menu_finalize()
417 if (!expr_contains_symbol(dep, sym)) in _menu_finalize()
420 if (expr_depends_symbol(dep, sym)) in _menu_finalize()
453 sym->dir_dep.expr = expr_alloc_or(sym->dir_dep.expr, parent->dep); in _menu_finalize()
496 if (sym && !(sym->flags & SYMBOL_WARNED)) { in _menu_finalize()
497 if (sym->type == S_UNKNOWN) in _menu_finalize()
501 sym_check_prop(sym); in _menu_finalize()
502 sym->flags |= SYMBOL_WARNED; in _menu_finalize()
537 struct symbol *sym; in menu_is_visible() local
548 sym = menu->sym; in menu_is_visible()
549 if (sym) { in menu_is_visible()
550 sym_calc_value(sym); in menu_is_visible()
558 if (!sym || sym_get_tristate_value(menu->sym) == no) in menu_is_visible()
572 else if (menu->sym) in menu_get_prompt()
573 return menu->sym->name; in menu_get_prompt()
660 if (menu->sym) { in get_prompt_str()
661 str_printf(r, " (%s [=%s])", menu->sym->name ? in get_prompt_str()
662 menu->sym->name : "<choice>", in get_prompt_str()
663 sym_get_string_value(menu->sym)); in get_prompt_str()
669 static void get_symbol_props_str(struct gstr *r, struct symbol *sym, in get_symbol_props_str() argument
675 for_all_properties(sym, prop, tok) { in get_symbol_props_str()
690 static void get_symbol_str(struct gstr *r, struct symbol *sym, in get_symbol_str() argument
696 if (sym && sym->name) { in get_symbol_str()
697 str_printf(r, "Symbol: %s [=%s]\n", sym->name, in get_symbol_str()
698 sym_get_string_value(sym)); in get_symbol_str()
699 str_printf(r, "Type : %s\n", sym_type_name(sym->type)); in get_symbol_str()
700 if (sym->type == S_INT || sym->type == S_HEX) { in get_symbol_str()
701 prop = sym_get_range_prop(sym); in get_symbol_str()
711 list_for_each_entry(menu, &sym->menus, link) { in get_symbol_str()
718 list_for_each_entry(menu, &sym->menus, link) { in get_symbol_str()
725 get_symbol_props_str(r, sym, P_SELECT, "Selects: "); in get_symbol_str()
726 if (sym->rev_dep.expr) { in get_symbol_str()
727 expr_gstr_print_revdep(sym->rev_dep.expr, r, yes, "Selected by [y]:\n"); in get_symbol_str()
728 expr_gstr_print_revdep(sym->rev_dep.expr, r, mod, "Selected by [m]:\n"); in get_symbol_str()
729 expr_gstr_print_revdep(sym->rev_dep.expr, r, no, "Selected by [n]:\n"); in get_symbol_str()
732 get_symbol_props_str(r, sym, P_IMPLY, "Implies: "); in get_symbol_str()
733 if (sym->implied.expr) { in get_symbol_str()
734 expr_gstr_print_revdep(sym->implied.expr, r, yes, "Implied by [y]:\n"); in get_symbol_str()
735 expr_gstr_print_revdep(sym->implied.expr, r, mod, "Implied by [m]:\n"); in get_symbol_str()
736 expr_gstr_print_revdep(sym->implied.expr, r, no, "Implied by [n]:\n"); in get_symbol_str()
744 struct symbol *sym; in get_relations_str() local
748 for (i = 0; sym_arr && (sym = sym_arr[i]); i++) in get_relations_str()
749 get_symbol_str(&res, sym, head); in get_relations_str()
758 struct symbol *sym = menu->sym; in menu_get_ext_help() local
762 if (sym->name) in menu_get_ext_help()
763 str_printf(help, "%s%s:\n\n", CONFIG_, sym->name); in menu_get_ext_help()
767 if (sym) in menu_get_ext_help()
768 get_symbol_str(help, sym, NULL); in menu_get_ext_help()