Lines Matching refs:sym
47 void menu_add_entry(struct symbol *sym) in menu_add_entry() argument
53 menu->sym = sym; in menu_add_entry()
61 if (sym) in menu_add_entry()
62 menu_add_symbol(P_SYMBOL, sym, NULL); in menu_add_entry()
97 if (e->left.sym == &symbol_mod) in rewrite_m()
113 struct symbol *sym = current_entry->sym; in menu_set_type() local
115 if (sym->type == type) in menu_set_type()
117 if (sym->type == S_UNKNOWN) { in menu_set_type()
118 sym->type = type; in menu_set_type()
123 sym->name ? sym->name : "<choice>", in menu_set_type()
124 sym_type_name(sym->type), sym_type_name(type)); in menu_set_type()
129 struct property *prop = prop_alloc(type, current_entry->sym); in menu_add_prop()
193 void menu_add_symbol(enum prop_type type, struct symbol *sym, struct expr *dep) in menu_add_symbol() argument
195 menu_add_prop(type, NULL, expr_alloc_symbol(sym), dep); in menu_add_symbol()
205 current_entry->sym->name, in menu_add_option()
208 modules_sym = current_entry->sym; in menu_add_option()
212 sym_defconfig_list = current_entry->sym; in menu_add_option()
213 else if (sym_defconfig_list != current_entry->sym) in menu_add_option()
221 current_entry->sym->flags |= SYMBOL_ALLNOCONFIG_Y; in menu_add_option()
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()
260 prop_get_symbol(choice_prop) != sym) in sym_check_prop()
270 if (sym->type != S_BOOLEAN && sym->type != S_TRISTATE) in sym_check_prop()
273 "not bool or tristate", sym->name, use); in sym_check_prop()
283 if (sym->type != S_INT && sym->type != S_HEX) in sym_check_prop()
286 if (!menu_validate_number(sym, prop->expr->left.sym) || in sym_check_prop()
287 !menu_validate_number(sym, prop->expr->right.sym)) in sym_check_prop()
299 struct symbol *sym; in menu_finalize() local
303 sym = parent->sym; in menu_finalize()
310 if (sym && sym_is_choice(sym)) { in menu_finalize()
311 if (sym->type == S_UNKNOWN) { in menu_finalize()
315 if (menu->sym && menu->sym->type != S_UNKNOWN) { in menu_finalize()
316 menu_set_type(menu->sym->type); in menu_finalize()
324 if (menu->sym && menu->sym->type == S_UNKNOWN) in menu_finalize()
325 menu_set_type(sym->type); in menu_finalize()
334 parentdep = expr_alloc_symbol(sym); in menu_finalize()
354 if (menu->sym) in menu_finalize()
359 prop = menu->sym->prop; in menu_finalize()
396 if (menu->sym && menu->sym->type != S_TRISTATE) in menu_finalize()
407 expr_alloc_and(expr_alloc_symbol(menu->sym), expr_copy(dep))); in menu_finalize()
411 expr_alloc_and(expr_alloc_symbol(menu->sym), expr_copy(dep))); in menu_finalize()
416 if (sym && sym_is_choice(sym)) in menu_finalize()
425 } else if (sym) { in menu_finalize()
456 if (!expr_contains_symbol(dep, sym)) in menu_finalize()
459 if (expr_depends_symbol(dep, sym)) in menu_finalize()
496 sym->dir_dep.expr = expr_alloc_or(sym->dir_dep.expr, parent->dep); in menu_finalize()
499 if (sym && sym_is_choice(sym) && in menu_finalize()
500 menu->sym && !sym_is_choice_value(menu->sym)) { in menu_finalize()
502 menu->sym->flags |= SYMBOL_CHOICEVAL; in menu_finalize()
505 for (prop = menu->sym->prop; prop; prop = prop->next) { in menu_finalize()
512 prop->menu->parent->sym != sym) in menu_finalize()
521 if (sym->type == S_TRISTATE && menu->sym->type != S_TRISTATE) { in menu_finalize()
522 basedep = expr_alloc_comp(E_EQUAL, sym, &symbol_yes); in menu_finalize()
524 for (prop = menu->sym->prop; prop; prop = prop->next) { in menu_finalize()
531 menu_add_symbol(P_CHOICE, sym, NULL); in menu_finalize()
532 prop = sym_get_choice_prop(sym); in menu_finalize()
536 (*ep)->right.sym = menu->sym; in menu_finalize()
579 if (sym && !(sym->flags & SYMBOL_WARNED)) { in menu_finalize()
580 if (sym->type == S_UNKNOWN) in menu_finalize()
583 if (sym_is_choice(sym) && !parent->prompt) in menu_finalize()
587 sym_check_prop(sym); in menu_finalize()
588 sym->flags |= SYMBOL_WARNED; in menu_finalize()
600 if (sym && !sym_is_optional(sym) && parent->prompt) { in menu_finalize()
601 sym->rev_dep.expr = expr_alloc_or(sym->rev_dep.expr, in menu_finalize()
633 struct symbol *sym; in menu_is_visible() local
644 sym = menu->sym; in menu_is_visible()
645 if (sym) { in menu_is_visible()
646 sym_calc_value(sym); in menu_is_visible()
654 if (!sym || sym_get_tristate_value(menu->sym) == no) in menu_is_visible()
659 if (sym) in menu_is_visible()
660 sym->flags |= SYMBOL_DEF_USER; in menu_is_visible()
672 else if (menu->sym) in menu_get_prompt()
673 return menu->sym->name; in menu_get_prompt()
754 if (menu->sym) { in get_prompt_str()
755 str_printf(r, " (%s [=%s])", menu->sym->name ? in get_prompt_str()
756 menu->sym->name : _("<choice>"), in get_prompt_str()
757 sym_get_string_value(menu->sym)); in get_prompt_str()
767 static struct property *get_symbol_prop(struct symbol *sym) in get_symbol_prop() argument
771 for_all_properties(sym, prop, P_SYMBOL) in get_symbol_prop()
776 static void get_symbol_props_str(struct gstr *r, struct symbol *sym, in get_symbol_props_str() argument
782 for_all_properties(sym, prop, tok) { in get_symbol_props_str()
797 static void get_symbol_str(struct gstr *r, struct symbol *sym, in get_symbol_str() argument
802 if (sym && sym->name) { in get_symbol_str()
803 str_printf(r, "Symbol: %s [=%s]\n", sym->name, in get_symbol_str()
804 sym_get_string_value(sym)); in get_symbol_str()
805 str_printf(r, "Type : %s\n", sym_type_name(sym->type)); in get_symbol_str()
806 if (sym->type == S_INT || sym->type == S_HEX) { in get_symbol_str()
807 prop = sym_get_range_prop(sym); in get_symbol_str()
815 for_all_prompts(sym, prop) in get_symbol_str()
818 prop = get_symbol_prop(sym); in get_symbol_str()
829 get_symbol_props_str(r, sym, P_SELECT, _(" Selects: ")); in get_symbol_str()
830 if (sym->rev_dep.expr) { in get_symbol_str()
831 expr_gstr_print_revdep(sym->rev_dep.expr, r, yes, " Selected by [y]:\n"); in get_symbol_str()
832 expr_gstr_print_revdep(sym->rev_dep.expr, r, mod, " Selected by [m]:\n"); in get_symbol_str()
833 expr_gstr_print_revdep(sym->rev_dep.expr, r, no, " Selected by [n]:\n"); in get_symbol_str()
836 get_symbol_props_str(r, sym, P_IMPLY, _(" Implies: ")); in get_symbol_str()
837 if (sym->implied.expr) { in get_symbol_str()
838 expr_gstr_print_revdep(sym->implied.expr, r, yes, " Implied by [y]:\n"); in get_symbol_str()
839 expr_gstr_print_revdep(sym->implied.expr, r, mod, " Implied by [m]:\n"); in get_symbol_str()
840 expr_gstr_print_revdep(sym->implied.expr, r, no, " Implied by [n]:\n"); in get_symbol_str()
848 struct symbol *sym; in get_relations_str() local
852 for (i = 0; sym_arr && (sym = sym_arr[i]); i++) in get_relations_str()
853 get_symbol_str(&res, sym, head); in get_relations_str()
862 struct symbol *sym = menu->sym; in menu_get_ext_help() local
866 if (sym->name) in menu_get_ext_help()
867 str_printf(help, "%s%s:\n\n", CONFIG_, sym->name); in menu_get_ext_help()
871 if (sym) in menu_get_ext_help()
872 get_symbol_str(help, sym, NULL); in menu_get_ext_help()