Lines Matching refs:sym
54 struct symbol *sym; in conf_expand_value() local
68 sym = sym_lookup(name, 0); in conf_expand_value()
69 sym_calc_value(sym); in conf_expand_value()
70 strcat(res_value, sym_get_string_value(sym)); in conf_expand_value()
99 struct symbol *sym; in conf_read_simple() local
119 name = conf_expand_value(prop->expr->left.sym->name); in conf_read_simple()
139 for_all_symbols(i, sym) { in conf_read_simple()
140 sym->flags |= SYMBOL_CHANGED; in conf_read_simple()
141 sym->flags &= ~(def_flags|SYMBOL_VALID); in conf_read_simple()
142 if (sym_is_choice(sym)) in conf_read_simple()
143 sym->flags |= def_flags; in conf_read_simple()
144 switch (sym->type) { in conf_read_simple()
148 if (sym->def[def].val) in conf_read_simple()
149 free(sym->def[def].val); in conf_read_simple()
151 sym->def[def].val = NULL; in conf_read_simple()
152 sym->def[def].tri = no; in conf_read_simple()
158 sym = NULL; in conf_read_simple()
172 sym = sym_find(line + 2 + strlen(CONFIG_PREFIX)); in conf_read_simple()
173 if (!sym) { in conf_read_simple()
178 sym = sym_lookup(line + 9, 0); in conf_read_simple()
179 if (sym->type == S_UNKNOWN) in conf_read_simple()
180 sym->type = S_BOOLEAN; in conf_read_simple()
182 if (sym->flags & def_flags) { in conf_read_simple()
183 conf_warning("trying to reassign symbol %s", sym->name); in conf_read_simple()
186 switch (sym->type) { in conf_read_simple()
189 sym->def[def].tri = no; in conf_read_simple()
190 sym->flags |= def_flags; in conf_read_simple()
212 sym = sym_find(line + strlen(CONFIG_PREFIX)); in conf_read_simple()
213 if (!sym) { in conf_read_simple()
218 sym = sym_lookup(line + strlen(CONFIG_PREFIX), 0); in conf_read_simple()
219 if (sym->type == S_UNKNOWN) in conf_read_simple()
220 sym->type = S_OTHER; in conf_read_simple()
222 if (sym->flags & def_flags) { in conf_read_simple()
223 conf_warning("trying to reassign symbol %s", sym->name); in conf_read_simple()
226 switch (sym->type) { in conf_read_simple()
229 sym->def[def].tri = mod; in conf_read_simple()
230 sym->flags |= def_flags; in conf_read_simple()
235 sym->def[def].tri = yes; in conf_read_simple()
236 sym->flags |= def_flags; in conf_read_simple()
240 sym->def[def].tri = no; in conf_read_simple()
241 sym->flags |= def_flags; in conf_read_simple()
244 conf_warning("symbol value '%s' invalid for %s", p, sym->name); in conf_read_simple()
250 sym->type = S_STRING; in conf_read_simple()
270 if (sym_string_valid(sym, p)) { in conf_read_simple()
271 sym->def[def].val = strdup(p); in conf_read_simple()
272 sym->flags |= def_flags; in conf_read_simple()
274 conf_warning("symbol value '%s' invalid for %s", p, sym->name); in conf_read_simple()
289 if (sym && sym_is_choice_value(sym)) { in conf_read_simple()
290 struct symbol *cs = prop_get_symbol(sym_get_choice_prop(sym)); in conf_read_simple()
291 switch (sym->def[def].tri) { in conf_read_simple()
296 conf_warning("%s creates inconsistent choice state", sym->name); in conf_read_simple()
302 conf_warning("%s creates inconsistent choice state", sym->name); in conf_read_simple()
305 cs->def[def].val = sym; in conf_read_simple()
308 cs->def[def].tri = E_OR(cs->def[def].tri, sym->def[def].tri); in conf_read_simple()
320 struct symbol *sym; in conf_read() local
330 for_all_symbols(i, sym) { in conf_read()
331 sym_calc_value(sym); in conf_read()
332 if (sym_is_choice(sym) || (sym->flags & SYMBOL_AUTO)) in conf_read()
334 if (sym_has_value(sym) && (sym->flags & SYMBOL_WRITE)) { in conf_read()
336 switch (sym->type) { in conf_read()
339 if (sym->def[S_DEF_USER].tri != sym_get_tristate_value(sym)) in conf_read()
341 if (!sym_is_choice(sym)) in conf_read()
344 if (!strcmp(sym->curr.val, sym->def[S_DEF_USER].val)) in conf_read()
348 } else if (!sym_has_value(sym) && !(sym->flags & SYMBOL_WRITE)) in conf_read()
354 if (sym_has_value(sym) && !sym_is_choice_value(sym)) { in conf_read()
355 if (sym->visible == no) in conf_read()
356 sym->flags &= ~SYMBOL_DEF_USER; in conf_read()
357 switch (sym->type) { in conf_read()
361 if (!sym_string_within_range(sym, sym->def[S_DEF_USER].val)) in conf_read()
362 sym->flags &= ~(SYMBOL_VALID|SYMBOL_DEF_USER); in conf_read()
367 if (!sym_is_choice(sym)) in conf_read()
369 prop = sym_get_choice_prop(sym); in conf_read()
370 flags = sym->flags; in conf_read()
372 if (e->right.sym->visible != no) in conf_read()
373 flags &= e->right.sym->flags; in conf_read()
374 sym->flags &= flags | ~SYMBOL_DEF_USER; in conf_read()
400 struct symbol *sym; in conf_write() local
444 sym = sym_lookup("KCONFIG_VERSION", 0); in conf_write()
445 sym_calc_value(sym); in conf_write()
456 sym_get_string_value(sym), in conf_write()
466 if (menu->sym) menu->sym->flags |= SYMBOL_FORCEWRITE; in conf_write()
476 sym = menu->sym; in conf_write()
477 if (!sym) { in conf_write()
485 } else if (!(sym->flags & SYMBOL_CHOICE)) { in conf_write()
486 sym_calc_value(sym); in conf_write()
487 if (!(sym->flags & writetype)) in conf_write()
489 sym->flags &= ~writetype; in conf_write()
490 type = sym->type; in conf_write()
499 switch (sym_get_tristate_value(sym)) { in conf_write()
501 fprintf(out, "# "CONFIG_PREFIX"%s is not set\n", sym->name); in conf_write()
504 fprintf(out, CONFIG_PREFIX"%s=m\n", sym->name); in conf_write()
507 fprintf(out, CONFIG_PREFIX"%s=y\n", sym->name); in conf_write()
512 str = sym_get_string_value(sym); in conf_write()
513 fprintf(out, CONFIG_PREFIX"%s=\"", sym->name); in conf_write()
527 str = sym_get_string_value(sym); in conf_write()
529 fprintf(out, CONFIG_PREFIX"%s=%s\n", sym->name, *str ? str : "0"); in conf_write()
533 str = sym_get_string_value(sym); in conf_write()
534 fprintf(out, CONFIG_PREFIX"%s=%s\n", sym->name, *str ? str : "0"); in conf_write()
579 struct symbol *sym; in conf_split_config() local
592 for_all_symbols(i, sym) { in conf_split_config()
593 sym_calc_value(sym); in conf_split_config()
594 if ((sym->flags & SYMBOL_AUTO) || !sym->name) in conf_split_config()
596 if (sym->flags & SYMBOL_WRITE) { in conf_split_config()
597 if (sym->flags & SYMBOL_DEF_AUTO) { in conf_split_config()
602 switch (sym->type) { in conf_split_config()
605 if (sym_get_tristate_value(sym) == in conf_split_config()
606 sym->def[S_DEF_AUTO].tri) in conf_split_config()
612 if (!strcmp(sym_get_string_value(sym), in conf_split_config()
613 sym->def[S_DEF_AUTO].val)) in conf_split_config()
624 switch (sym->type) { in conf_split_config()
627 if (sym_get_tristate_value(sym) == no) in conf_split_config()
634 } else if (!(sym->flags & SYMBOL_DEF_AUTO)) in conf_split_config()
644 s = sym->name; in conf_split_config()
690 struct symbol *sym; in conf_write_autoconf() local
714 sym = sym_lookup("KCONFIG_VERSION", 0); in conf_write_autoconf()
715 sym_calc_value(sym); in conf_write_autoconf()
722 sym_get_string_value(sym), ctime(&now)); in conf_write_autoconf()
729 , sym_get_string_value(sym), ctime(&now)); in conf_write_autoconf()
731 for_all_symbols(i, sym) { in conf_write_autoconf()
732 sym_calc_value(sym); in conf_write_autoconf()
733 if (!(sym->flags & SYMBOL_WRITE) || !sym->name) in conf_write_autoconf()
735 switch (sym->type) { in conf_write_autoconf()
738 switch (sym_get_tristate_value(sym)) { in conf_write_autoconf()
742 fprintf(out, CONFIG_PREFIX"%s=m\n", sym->name); in conf_write_autoconf()
743 fprintf(out_h, "#define CONFIG_%s_MODULE 1\n", sym->name); in conf_write_autoconf()
746 fprintf(out, CONFIG_PREFIX"%s=y\n", sym->name); in conf_write_autoconf()
747 fprintf(out_h, "#define "CONFIG_PREFIX"%s 1\n", sym->name); in conf_write_autoconf()
752 str = sym_get_string_value(sym); in conf_write_autoconf()
753 fprintf(out, CONFIG_PREFIX"%s=\"", sym->name); in conf_write_autoconf()
754 fprintf(out_h, "#define "CONFIG_PREFIX"%s \"", sym->name); in conf_write_autoconf()
772 str = sym_get_string_value(sym); in conf_write_autoconf()
774 fprintf(out, CONFIG_PREFIX"%s=%s\n", sym->name, str); in conf_write_autoconf()
775 fprintf(out_h, "#define "CONFIG_PREFIX"%s 0x%s\n", sym->name, str); in conf_write_autoconf()
779 str = sym_get_string_value(sym); in conf_write_autoconf()
780 fprintf(out, CONFIG_PREFIX"%s=%s\n", sym->name, str); in conf_write_autoconf()
781 fprintf(out_h, "#define "CONFIG_PREFIX"%s %s\n", sym->name, str); in conf_write_autoconf()