Lines Matching refs:sym

48 void menu_add_entry(struct symbol *sym)  in menu_add_entry()  argument
54 menu->sym = sym; in menu_add_entry()
62 if (sym) in menu_add_entry()
63 menu_add_symbol(P_SYMBOL, sym, NULL); in menu_add_entry()
99 if (e->left.sym == &symbol_mod) in rewrite_m()
115 struct symbol *sym = current_entry->sym; in menu_set_type() local
117 if (sym->type == type) in menu_set_type()
119 if (sym->type == S_UNKNOWN) { in menu_set_type()
120 sym->type = type; in menu_set_type()
125 sym->name ? sym->name : "<choice>", in menu_set_type()
126 sym_type_name(sym->type), sym_type_name(type)); in menu_set_type()
144 if (current_entry->sym) { in menu_add_prop()
147 for (propp = &current_entry->sym->prop; in menu_add_prop()
210 void menu_add_symbol(enum prop_type type, struct symbol *sym, struct expr *dep) in menu_add_symbol() argument
212 menu_add_prop(type, expr_alloc_symbol(sym), dep); in menu_add_symbol()
215 static int menu_validate_number(struct symbol *sym, struct symbol *sym2) in menu_validate_number() argument
218 (sym2->type == S_UNKNOWN && sym_string_valid(sym, sym2->name)); in menu_validate_number()
221 static void sym_check_prop(struct symbol *sym) in sym_check_prop() argument
227 for (prop = sym->prop; prop; prop = prop->next) { in sym_check_prop()
230 if ((sym->type == S_STRING || sym->type == S_INT || sym->type == S_HEX) && in sym_check_prop()
234 " must be a single symbol", sym->name); in sym_check_prop()
238 if (sym->type == S_HEX || sym->type == S_INT) { in sym_check_prop()
239 if (!menu_validate_number(sym, sym2)) in sym_check_prop()
242 sym->name); in sym_check_prop()
244 if (sym_is_choice(sym)) { in sym_check_prop()
249 prop_get_symbol(choice_prop) != sym) in sym_check_prop()
259 if (sym->type != S_BOOLEAN && sym->type != S_TRISTATE) in sym_check_prop()
262 "not bool or tristate", sym->name, use); in sym_check_prop()
272 if (sym->type != S_INT && sym->type != S_HEX) in sym_check_prop()
275 if (!menu_validate_number(sym, prop->expr->left.sym) || in sym_check_prop()
276 !menu_validate_number(sym, prop->expr->right.sym)) in sym_check_prop()
288 struct symbol *sym; in menu_finalize() local
292 sym = parent->sym; in menu_finalize()
299 if (sym && sym_is_choice(sym)) { in menu_finalize()
300 if (sym->type == S_UNKNOWN) { in menu_finalize()
304 if (menu->sym && menu->sym->type != S_UNKNOWN) { in menu_finalize()
305 menu_set_type(menu->sym->type); in menu_finalize()
313 if (menu->sym && menu->sym->type == S_UNKNOWN) in menu_finalize()
314 menu_set_type(sym->type); in menu_finalize()
323 parentdep = expr_alloc_symbol(sym); in menu_finalize()
341 if (menu->sym) in menu_finalize()
346 prop = menu->sym->prop; in menu_finalize()
383 if (menu->sym && menu->sym->type != S_TRISTATE) in menu_finalize()
394 expr_alloc_and(expr_alloc_symbol(menu->sym), expr_copy(dep))); in menu_finalize()
398 expr_alloc_and(expr_alloc_symbol(menu->sym), expr_copy(dep))); in menu_finalize()
403 if (sym && sym_is_choice(sym)) in menu_finalize()
412 } else if (sym) { in menu_finalize()
443 if (!expr_contains_symbol(dep, sym)) in menu_finalize()
446 if (expr_depends_symbol(dep, sym)) in menu_finalize()
483 sym->dir_dep.expr = expr_alloc_or(sym->dir_dep.expr, parent->dep); in menu_finalize()
486 if (sym && sym_is_choice(sym) && in menu_finalize()
487 menu->sym && !sym_is_choice_value(menu->sym)) { in menu_finalize()
489 menu->sym->flags |= SYMBOL_CHOICEVAL; in menu_finalize()
492 for (prop = menu->sym->prop; prop; prop = prop->next) { in menu_finalize()
499 prop->menu->parent->sym != sym) in menu_finalize()
508 if (sym->type == S_TRISTATE && menu->sym->type != S_TRISTATE) { in menu_finalize()
509 basedep = expr_alloc_comp(E_EQUAL, sym, &symbol_yes); in menu_finalize()
511 for (prop = menu->sym->prop; prop; prop = prop->next) { in menu_finalize()
518 menu_add_symbol(P_CHOICE, sym, NULL); in menu_finalize()
519 prop = sym_get_choice_prop(sym); in menu_finalize()
523 (*ep)->right.sym = menu->sym; in menu_finalize()
566 if (sym && !(sym->flags & SYMBOL_WARNED)) { in menu_finalize()
567 if (sym->type == S_UNKNOWN) in menu_finalize()
570 if (sym_is_choice(sym) && !parent->prompt) in menu_finalize()
574 sym_check_prop(sym); in menu_finalize()
575 sym->flags |= SYMBOL_WARNED; in menu_finalize()
587 if (sym && !sym_is_optional(sym) && parent->prompt) { in menu_finalize()
588 sym->rev_dep.expr = expr_alloc_or(sym->rev_dep.expr, in menu_finalize()
620 struct symbol *sym; in menu_is_visible() local
631 sym = menu->sym; in menu_is_visible()
632 if (sym) { in menu_is_visible()
633 sym_calc_value(sym); in menu_is_visible()
641 if (!sym || sym_get_tristate_value(menu->sym) == no) in menu_is_visible()
646 if (sym) in menu_is_visible()
647 sym->flags |= SYMBOL_DEF_USER; in menu_is_visible()
659 else if (menu->sym) in menu_get_prompt()
660 return menu->sym->name; in menu_get_prompt()
773 if (menu->sym) { in get_prompt_str()
774 str_printf(r, " (%s [=%s])", menu->sym->name ? in get_prompt_str()
775 menu->sym->name : "<choice>", in get_prompt_str()
776 sym_get_string_value(menu->sym)); in get_prompt_str()
782 static void get_symbol_props_str(struct gstr *r, struct symbol *sym, in get_symbol_props_str() argument
788 for_all_properties(sym, prop, tok) { in get_symbol_props_str()
803 static void get_symbol_str(struct gstr *r, struct symbol *sym, in get_symbol_str() argument
808 if (sym && sym->name) { in get_symbol_str()
809 str_printf(r, "Symbol: %s [=%s]\n", sym->name, in get_symbol_str()
810 sym_get_string_value(sym)); in get_symbol_str()
811 str_printf(r, "Type : %s\n", sym_type_name(sym->type)); in get_symbol_str()
812 if (sym->type == S_INT || sym->type == S_HEX) { in get_symbol_str()
813 prop = sym_get_range_prop(sym); in get_symbol_str()
823 for_all_properties(sym, prop, P_SYMBOL) { in get_symbol_str()
830 for_all_properties(sym, prop, P_SYMBOL) { in get_symbol_str()
837 get_symbol_props_str(r, sym, P_SELECT, "Selects: "); in get_symbol_str()
838 if (sym->rev_dep.expr) { in get_symbol_str()
839 expr_gstr_print_revdep(sym->rev_dep.expr, r, yes, "Selected by [y]:\n"); in get_symbol_str()
840 expr_gstr_print_revdep(sym->rev_dep.expr, r, mod, "Selected by [m]:\n"); in get_symbol_str()
841 expr_gstr_print_revdep(sym->rev_dep.expr, r, no, "Selected by [n]:\n"); in get_symbol_str()
844 get_symbol_props_str(r, sym, P_IMPLY, "Implies: "); in get_symbol_str()
845 if (sym->implied.expr) { in get_symbol_str()
846 expr_gstr_print_revdep(sym->implied.expr, r, yes, "Implied by [y]:\n"); in get_symbol_str()
847 expr_gstr_print_revdep(sym->implied.expr, r, mod, "Implied by [m]:\n"); in get_symbol_str()
848 expr_gstr_print_revdep(sym->implied.expr, r, no, "Implied by [n]:\n"); in get_symbol_str()
856 struct symbol *sym; in get_relations_str() local
860 for (i = 0; sym_arr && (sym = sym_arr[i]); i++) in get_relations_str()
861 get_symbol_str(&res, sym, head); in get_relations_str()
870 struct symbol *sym = menu->sym; in menu_get_ext_help() local
874 if (sym->name) in menu_get_ext_help()
875 str_printf(help, "%s%s:\n\n", CONFIG_, sym->name); in menu_get_ext_help()
879 if (sym) in menu_get_ext_help()
880 get_symbol_str(help, sym, NULL); in menu_get_ext_help()