Lines Matching refs:sym

48 void menu_add_entry(struct symbol *sym)
54 menu->sym = sym;
62 if (sym)
63 menu_add_symbol(P_SYMBOL, sym, NULL);
99 if (e->left.sym == &symbol_mod)
115 struct symbol *sym = current_entry->sym;
117 if (sym->type == type)
119 if (sym->type == S_UNKNOWN) {
120 sym->type = type;
125 sym->name ? sym->name : "<choice>",
126 sym_type_name(sym->type), sym_type_name(type));
144 if (current_entry->sym) {
147 for (propp = &current_entry->sym->prop;
210 void menu_add_symbol(enum prop_type type, struct symbol *sym, struct expr *dep)
212 menu_add_prop(type, expr_alloc_symbol(sym), dep);
215 static int menu_validate_number(struct symbol *sym, struct symbol *sym2)
218 (sym2->type == S_UNKNOWN && sym_string_valid(sym, sym2->name));
221 static void sym_check_prop(struct symbol *sym)
227 for (prop = sym->prop; prop; prop = prop->next) {
230 if ((sym->type == S_STRING || sym->type == S_INT || sym->type == S_HEX) &&
234 " must be a single symbol", sym->name);
238 if (sym->type == S_HEX || sym->type == S_INT) {
239 if (!menu_validate_number(sym, sym2))
242 sym->name);
244 if (sym_is_choice(sym)) {
249 prop_get_symbol(choice_prop) != sym)
259 if (sym->type != S_BOOLEAN && sym->type != S_TRISTATE)
262 "not bool or tristate", sym->name, use);
272 if (sym->type != S_INT && sym->type != S_HEX)
275 if (!menu_validate_number(sym, prop->expr->left.sym) ||
276 !menu_validate_number(sym, prop->expr->right.sym))
288 struct symbol *sym;
292 sym = parent->sym;
299 if (sym && sym_is_choice(sym)) {
300 if (sym->type == S_UNKNOWN) {
304 if (menu->sym && menu->sym->type != S_UNKNOWN) {
305 menu_set_type(menu->sym->type);
313 if (menu->sym && menu->sym->type == S_UNKNOWN)
314 menu_set_type(sym->type);
323 parentdep = expr_alloc_symbol(sym);
341 if (menu->sym)
346 prop = menu->sym->prop;
383 if (menu->sym && menu->sym->type != S_TRISTATE)
394 expr_alloc_and(expr_alloc_symbol(menu->sym), expr_copy(dep)));
398 expr_alloc_and(expr_alloc_symbol(menu->sym), expr_copy(dep)));
403 if (sym && sym_is_choice(sym))
412 } else if (sym) {
414 * Automatic submenu creation. If sym is a symbol and A, B, C,
416 * all depend on sym, then the following menu structure is
419 * sym
428 * sym
439 /* Examine consecutive elements after sym */
443 if (!expr_contains_symbol(dep, sym))
446 if (expr_depends_symbol(dep, sym))
451 * Also consider it a dependency on sym if our
452 * dependencies contain sym and are a "superset" of
453 * sym's dependencies, e.g. '(sym || Q) && R' when sym
483 sym->dir_dep.expr = expr_alloc_or(sym->dir_dep.expr, parent->dep);
486 if (sym && sym_is_choice(sym) &&
487 menu->sym && !sym_is_choice_value(menu->sym)) {
489 menu->sym->flags |= SYMBOL_CHOICEVAL;
492 for (prop = menu->sym->prop; prop; prop = prop->next) {
499 prop->menu->parent->sym != sym)
508 if (sym->type == S_TRISTATE && menu->sym->type != S_TRISTATE) {
509 basedep = expr_alloc_comp(E_EQUAL, sym, &symbol_yes);
511 for (prop = menu->sym->prop; prop; prop = prop->next) {
518 menu_add_symbol(P_CHOICE, sym, NULL);
519 prop = sym_get_choice_prop(sym);
523 (*ep)->right.sym = menu->sym;
566 if (sym && !(sym->flags & SYMBOL_WARNED)) {
567 if (sym->type == S_UNKNOWN)
570 if (sym_is_choice(sym) && !parent->prompt)
574 sym_check_prop(sym);
575 sym->flags |= SYMBOL_WARNED;
587 if (sym && !sym_is_optional(sym) && parent->prompt) {
588 sym->rev_dep.expr = expr_alloc_or(sym->rev_dep.expr,
620 struct symbol *sym;
631 sym = menu->sym;
632 if (sym) {
633 sym_calc_value(sym);
641 if (!sym || sym_get_tristate_value(menu->sym) == no)
646 if (sym)
647 sym->flags |= SYMBOL_DEF_USER;
659 else if (menu->sym)
660 return menu->sym->name;
759 if (menu->sym) {
760 str_printf(r, " (%s [=%s])", menu->sym->name ?
761 menu->sym->name : "<choice>",
762 sym_get_string_value(menu->sym));
768 static void get_symbol_props_str(struct gstr *r, struct symbol *sym,
774 for_all_properties(sym, prop, tok) {
789 static void get_symbol_str(struct gstr *r, struct symbol *sym,
794 if (sym && sym->name) {
795 str_printf(r, "Symbol: %s [=%s]\n", sym->name,
796 sym_get_string_value(sym));
797 str_printf(r, "Type : %s\n", sym_type_name(sym->type));
798 if (sym->type == S_INT || sym->type == S_HEX) {
799 prop = sym_get_range_prop(sym);
809 for_all_properties(sym, prop, P_SYMBOL) {
816 for_all_properties(sym, prop, P_SYMBOL) {
823 get_symbol_props_str(r, sym, P_SELECT, "Selects: ");
824 if (sym->rev_dep.expr) {
825 expr_gstr_print_revdep(sym->rev_dep.expr, r, yes, "Selected by [y]:\n");
826 expr_gstr_print_revdep(sym->rev_dep.expr, r, mod, "Selected by [m]:\n");
827 expr_gstr_print_revdep(sym->rev_dep.expr, r, no, "Selected by [n]:\n");
830 get_symbol_props_str(r, sym, P_IMPLY, "Implies: ");
831 if (sym->implied.expr) {
832 expr_gstr_print_revdep(sym->implied.expr, r, yes, "Implied by [y]:\n");
833 expr_gstr_print_revdep(sym->implied.expr, r, mod, "Implied by [m]:\n");
834 expr_gstr_print_revdep(sym->implied.expr, r, no, "Implied by [n]:\n");
842 struct symbol *sym;
846 for (i = 0; sym_arr && (sym = sym_arr[i]); i++)
847 get_symbol_str(&res, sym, head);
856 struct symbol *sym = menu->sym;
860 if (sym->name)
861 str_printf(help, "%s%s:\n\n", CONFIG_, sym->name);
865 if (sym)
866 get_symbol_str(help, sym, NULL);