Lines Matching refs:sym

226 static int conf_set_sym_val(struct symbol *sym, int def, int def_flags, char *p)
230 switch (sym->type) {
233 sym->def[def].tri = mod;
234 sym->flags |= def_flags;
240 sym->def[def].tri = yes;
241 sym->flags |= def_flags;
245 sym->def[def].tri = no;
246 sym->flags |= def_flags;
251 p, sym->name);
273 if (sym_string_valid(sym, p)) {
274 sym->def[def].val = xstrdup(p);
275 sym->flags |= def_flags;
279 p, sym->name);
350 struct symbol *sym;
411 for_all_symbols(i, sym) {
412 sym->flags |= SYMBOL_CHANGED;
413 sym->flags &= ~(def_flags|SYMBOL_VALID);
414 if (sym_is_choice(sym))
415 sym->flags |= def_flags;
416 switch (sym->type) {
420 if (sym->def[def].val)
421 free(sym->def[def].val);
424 sym->def[def].val = NULL;
425 sym->def[def].tri = no;
431 sym = NULL;
442 sym = sym_find(line + 2 + strlen(CONFIG_));
443 if (!sym) {
452 sym = sym_lookup(line + 2 + strlen(CONFIG_), 0);
453 if (sym->type == S_UNKNOWN)
454 sym->type = S_BOOLEAN;
456 if (sym->flags & def_flags) {
457 conf_warning("override: reassigning to symbol %s", sym->name);
459 switch (sym->type) {
462 sym->def[def].tri = no;
463 sym->flags |= def_flags;
480 sym = sym_find(line + strlen(CONFIG_));
481 if (!sym) {
500 if (sym->flags & def_flags) {
501 conf_warning("override: reassigning to symbol %s", sym->name);
503 if (conf_set_sym_val(sym, def, def_flags, p))
513 if (sym && sym_is_choice_value(sym)) {
514 struct symbol *cs = prop_get_symbol(sym_get_choice_prop(sym));
515 switch (sym->def[def].tri) {
520 conf_warning("%s creates inconsistent choice state", sym->name);
526 conf_warning("override: %s changes choice state", sym->name);
527 cs->def[def].val = sym;
530 cs->def[def].tri = EXPR_OR(cs->def[def].tri, sym->def[def].tri);
544 struct symbol *sym;
557 for_all_symbols(i, sym) {
558 sym_calc_value(sym);
559 if (sym_is_choice(sym) || (sym->flags & SYMBOL_NO_WRITE))
561 if (sym_has_value(sym) && (sym->flags & SYMBOL_WRITE)) {
563 switch (sym->type) {
566 if (sym->def[S_DEF_USER].tri == sym_get_tristate_value(sym))
570 if (!strcmp(sym->curr.val, sym->def[S_DEF_USER].val))
574 } else if (!sym_has_value(sym) && !(sym->flags & SYMBOL_WRITE))
581 for_all_symbols(i, sym) {
582 if (sym_has_value(sym) && !sym_is_choice_value(sym)) {
588 if (sym->visible == no && !conf_unsaved)
589 sym->flags &= ~SYMBOL_DEF_USER;
590 switch (sym->type) {
595 if (sym_string_within_range(sym, sym->def[S_DEF_USER].val))
597 sym->flags &= ~(SYMBOL_VALID|SYMBOL_DEF_USER);
690 static void __print_symbol(FILE *fp, struct symbol *sym, enum output_n output_n,
696 if (sym->type == S_UNKNOWN)
699 val = sym_get_string_value(sym);
701 if ((sym->type == S_BOOLEAN || sym->type == S_TRISTATE) &&
704 fprintf(fp, "# %s%s is not set\n", CONFIG_, sym->name);
708 if (sym->type == S_STRING && escape_string) {
713 fprintf(fp, "%s%s=%s\n", CONFIG_, sym->name, val);
718 static void print_symbol_for_dotconfig(FILE *fp, struct symbol *sym)
720 __print_symbol(fp, sym, OUTPUT_N_AS_UNSET, true);
723 static void print_symbol_for_autoconf(FILE *fp, struct symbol *sym)
725 __print_symbol(fp, sym, OUTPUT_N_NONE, false);
728 void print_symbol_for_listconfig(struct symbol *sym)
730 __print_symbol(stdout, sym, OUTPUT_N, true);
733 static void print_symbol_for_c(FILE *fp, struct symbol *sym)
740 if (sym->type == S_UNKNOWN)
743 val = sym_get_string_value(sym);
745 switch (sym->type) {
769 fprintf(fp, "#define %s%s%s %s%s\n", CONFIG_, sym->name, sym_suffix,
775 static void print_symbol_for_rustccfg(FILE *fp, struct symbol *sym)
783 if (sym->type == S_UNKNOWN)
786 val = sym_get_string_value(sym);
788 switch (sym->type) {
807 fprintf(fp, "--cfg=%s%s\n", CONFIG_, sym->name);
828 fprintf(fp, "--cfg=%s%s=%s\n", CONFIG_, sym->name, val);
840 struct symbol *sym;
855 sym = menu->sym;
856 if (sym == NULL) {
859 } else if (!sym_is_choice(sym)) {
860 sym_calc_value(sym);
861 if (!(sym->flags & SYMBOL_WRITE))
863 sym->flags &= ~SYMBOL_WRITE;
865 if (!sym_is_changeable(sym))
868 if (strcmp(sym_get_string_value(sym), sym_get_string_default(sym)) == 0)
878 if (sym_is_choice_value(sym)) {
882 cs = prop_get_symbol(sym_get_choice_prop(sym));
884 if (!sym_is_optional(cs) && sym == ds) {
885 if ((sym->type == S_BOOLEAN) &&
886 sym_get_tristate_value(sym) == yes)
890 print_symbol_for_dotconfig(out, sym);
914 struct symbol *sym;
957 sym = menu->sym;
958 if (!sym) {
967 } else if (!(sym->flags & SYMBOL_CHOICE) &&
968 !(sym->flags & SYMBOL_WRITTEN)) {
969 sym_calc_value(sym);
970 if (!(sym->flags & SYMBOL_WRITE))
976 sym->flags |= SYMBOL_WRITTEN;
977 print_symbol_for_dotconfig(out, sym);
987 if (!menu->sym && menu_is_visible(menu) && menu != &rootmenu &&
1003 for_all_symbols(i, sym)
1004 sym->flags &= ~SYMBOL_WRITTEN;
1079 struct symbol *sym;
1094 for_all_symbols(i, sym) {
1095 sym_calc_value(sym);
1096 if ((sym->flags & SYMBOL_NO_WRITE) || !sym->name)
1098 if (sym->flags & SYMBOL_WRITE) {
1099 if (sym->flags & SYMBOL_DEF_AUTO) {
1104 switch (sym->type) {
1107 if (sym_get_tristate_value(sym) ==
1108 sym->def[S_DEF_AUTO].tri)
1114 if (!strcmp(sym_get_string_value(sym),
1115 sym->def[S_DEF_AUTO].val))
1126 switch (sym->type) {
1129 if (sym_get_tristate_value(sym) == no)
1136 } else if (!(sym->flags & SYMBOL_DEF_AUTO))
1145 res = conf_touch_dep(sym->name);
1159 struct symbol *sym;
1177 for_all_symbols(i, sym)
1178 if ((sym->flags & SYMBOL_WRITE) && sym->name)
1179 print_symbol(file, sym);
1198 struct symbol *sym;
1212 for_all_symbols(i, sym)
1213 sym_calc_value(sym);
1267 struct symbol *sym;
1275 expr_list_for_each_sym(prop->expr, e, sym) {
1276 if (!sym_has_value(sym))
1277 sym->def[S_DEF_USER].tri = no;