Lines Matching +full:tri +full:- +full:default
1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org>
99 tmp[sizeof(tmp) - 1] = 0; in make_parent_dir()
117 return -1; in make_parent_dir()
137 return -1; in conf_touch_dep()
142 if (fd == -1) in conf_touch_dep()
143 return -1; in conf_touch_dep()
237 switch (sym->type) { in conf_set_sym_val()
240 sym->def[def].tri = mod; in conf_set_sym_val()
241 sym->flags |= def_flags; in conf_set_sym_val()
247 sym->def[def].tri = yes; in conf_set_sym_val()
248 sym->flags |= def_flags; in conf_set_sym_val()
252 sym->def[def].tri = no; in conf_set_sym_val()
253 sym->flags |= def_flags; in conf_set_sym_val()
258 p, sym->name); in conf_set_sym_val()
281 sym->def[def].val = xstrdup(p); in conf_set_sym_val()
282 sym->flags |= def_flags; in conf_set_sym_val()
286 p, sym->name); in conf_set_sym_val()
290 default: in conf_set_sym_val()
302 new_size += LINE_GROWTH - 1; in add_byte()
306 return -1; in add_byte()
336 return -1; in compat_getline()
338 default: in compat_getline()
346 line[slen-1] = '\0'; in compat_getline()
348 return -1; in compat_getline()
419 sym->flags |= SYMBOL_CHANGED; in conf_read_simple()
420 sym->flags &= ~(def_flags|SYMBOL_VALID); in conf_read_simple()
422 sym->flags |= def_flags; in conf_read_simple()
423 switch (sym->type) { in conf_read_simple()
427 if (sym->def[def].val) in conf_read_simple()
428 free(sym->def[def].val); in conf_read_simple()
430 default: in conf_read_simple()
431 sym->def[def].val = NULL; in conf_read_simple()
432 sym->def[def].tri = no; in conf_read_simple()
436 while (compat_getline(&line, &line_asize, in) != -1) { in conf_read_simple()
462 *p2-- = 0; in conf_read_simple()
493 if (sym->flags & def_flags) in conf_read_simple()
494 conf_warning("override: reassigning to symbol %s", sym->name); in conf_read_simple()
501 switch (sym->def[def].tri) { in conf_read_simple()
505 if (cs->def[def].tri == yes) { in conf_read_simple()
506 conf_warning("%s creates inconsistent choice state", sym->name); in conf_read_simple()
507 cs->flags &= ~def_flags; in conf_read_simple()
511 if (cs->def[def].tri != no) in conf_read_simple()
512 conf_warning("override: %s changes choice state", sym->name); in conf_read_simple()
513 cs->def[def].val = sym; in conf_read_simple()
516 cs->def[def].tri = EXPR_OR(cs->def[def].tri, sym->def[def].tri); in conf_read_simple()
542 if (sym_is_choice(sym) || (sym->flags & SYMBOL_NO_WRITE)) in conf_read()
544 if (sym_has_value(sym) && (sym->flags & SYMBOL_WRITE)) { in conf_read()
546 switch (sym->type) { in conf_read()
549 if (sym->def[S_DEF_USER].tri == sym_get_tristate_value(sym)) in conf_read()
552 default: in conf_read()
553 if (!strcmp(sym->curr.val, sym->def[S_DEF_USER].val)) in conf_read()
557 } else if (!sym_has_value(sym) && !(sym->flags & SYMBOL_WRITE)) in conf_read()
571 if (sym->visible == no && !conf_unsaved) in conf_read()
572 sym->flags &= ~SYMBOL_DEF_USER; in conf_read()
573 switch (sym->type) { in conf_read()
578 if (sym_string_within_range(sym, sym->def[S_DEF_USER].val)) in conf_read()
580 sym->flags &= ~(SYMBOL_VALID|SYMBOL_DEF_USER); in conf_read()
583 default: in conf_read()
618 fprintf(fp, "%s\n", cs->prefix); in conf_write_heading()
621 cs->decoration); in conf_write_heading()
623 fprintf(fp, "%s %s\n", cs->decoration, rootmenu.prompt->text); in conf_write_heading()
625 fprintf(fp, "%s\n", cs->postfix); in conf_write_heading()
679 if (sym->type == S_UNKNOWN) in __print_symbol()
684 if ((sym->type == S_BOOLEAN || sym->type == S_TRISTATE) && in __print_symbol()
687 fprintf(fp, "# %s%s is not set\n", CONFIG_, sym->name); in __print_symbol()
691 if (sym->type == S_STRING && escape_string) { in __print_symbol()
696 fprintf(fp, "%s%s=%s\n", CONFIG_, sym->name, val); in __print_symbol()
723 if (sym->type == S_UNKNOWN) in print_symbol_for_c()
728 switch (sym->type) { in print_symbol_for_c()
737 default: in print_symbol_for_c()
748 default: in print_symbol_for_c()
752 fprintf(fp, "#define %s%s%s %s%s\n", CONFIG_, sym->name, sym_suffix, in print_symbol_for_c()
766 if (sym->type == S_UNKNOWN) in print_symbol_for_rustccfg()
771 switch (sym->type) { in print_symbol_for_rustccfg()
783 * we provide an empty `--cfg CONFIG_X` here in both `y` in print_symbol_for_rustccfg()
787 * a `--cfg CONFIG_X="y"` or `--cfg CONFIG_X="m"`, which can in print_symbol_for_rustccfg()
790 fprintf(fp, "--cfg=%s%s\n", CONFIG_, sym->name); in print_symbol_for_rustccfg()
796 default: in print_symbol_for_rustccfg()
807 /* All values get escaped: the `--cfg` option only takes strings */ in print_symbol_for_rustccfg()
811 fprintf(fp, "--cfg=%s%s=%s\n", CONFIG_, sym->name, val); in print_symbol_for_rustccfg()
819 * All values that has default values are skipped as this is redundant.
838 sym = menu->sym; in conf_write_defconfig()
844 if (!(sym->flags & SYMBOL_WRITE)) in conf_write_defconfig()
846 sym->flags &= ~SYMBOL_WRITE; in conf_write_defconfig()
847 /* If we cannot change the symbol - skip */ in conf_write_defconfig()
850 /* If symbol equals to default value - skip */ in conf_write_defconfig()
856 * default for a choice - skip. in conf_write_defconfig()
868 if ((sym->type == S_BOOLEAN) && in conf_write_defconfig()
876 if (menu->list != NULL) { in conf_write_defconfig()
877 menu = menu->list; in conf_write_defconfig()
879 else if (menu->next != NULL) { in conf_write_defconfig()
880 menu = menu->next; in conf_write_defconfig()
882 while ((menu = menu->parent)) { in conf_write_defconfig()
883 if (menu->next != NULL) { in conf_write_defconfig()
884 menu = menu->next; in conf_write_defconfig()
910 return -1; in conf_write()
915 return -1; in conf_write()
919 return -1; in conf_write()
940 sym = menu->sym; in conf_write()
950 } else if (!(sym->flags & SYMBOL_CHOICE) && in conf_write()
951 !(sym->flags & SYMBOL_WRITTEN)) { in conf_write()
953 if (!(sym->flags & SYMBOL_WRITE)) in conf_write()
959 sym->flags |= SYMBOL_WRITTEN; in conf_write()
964 if (menu->list) { in conf_write()
965 menu = menu->list; in conf_write()
970 if (!menu->sym && menu_is_visible(menu) && menu != &rootmenu && in conf_write()
971 menu->prompt->type == P_MENU) { in conf_write()
976 if (menu->next) { in conf_write()
977 menu = menu->next; in conf_write()
979 menu = menu->parent; in conf_write()
987 sym->flags &= ~SYMBOL_WRITTEN; in conf_write()
1020 return -1; in conf_write_autoconf_cmd()
1023 return -1; in conf_write_autoconf_cmd()
1027 return -1; in conf_write_autoconf_cmd()
1032 return -1; in conf_write_autoconf_cmd()
1036 for (file = file_list; file; file = file->next) in conf_write_autoconf_cmd()
1037 fprintf(out, "\t%s \\\n", file->name); in conf_write_autoconf_cmd()
1049 return -1; in conf_write_autoconf_cmd()
1053 return -1; in conf_write_autoconf_cmd()
1067 depfile_prefix_len = tmp ? tmp - name + 1 : 0; in conf_touch_deps()
1069 return -1; in conf_touch_deps()
1079 if ((sym->flags & SYMBOL_NO_WRITE) || !sym->name) in conf_touch_deps()
1081 if (sym->flags & SYMBOL_WRITE) { in conf_touch_deps()
1082 if (sym->flags & SYMBOL_DEF_AUTO) { in conf_touch_deps()
1087 switch (sym->type) { in conf_touch_deps()
1091 sym->def[S_DEF_AUTO].tri) in conf_touch_deps()
1098 sym->def[S_DEF_AUTO].val)) in conf_touch_deps()
1101 default: in conf_touch_deps()
1109 switch (sym->type) { in conf_touch_deps()
1115 default: in conf_touch_deps()
1119 } else if (!(sym->flags & SYMBOL_DEF_AUTO)) in conf_touch_deps()
1128 res = conf_touch_dep(sym->name); in conf_touch_deps()
1146 return -1; in __conf_write_autoconf()
1150 return -1; in __conf_write_autoconf()
1155 return -1; in __conf_write_autoconf()
1161 if ((sym->flags & SYMBOL_WRITE) && sym->name) in __conf_write_autoconf()
1169 return -1; in __conf_write_autoconf()
1173 return -1; in __conf_write_autoconf()
1190 return -1; in conf_write_autoconf()
1256 * Set all non-assinged choice values to no in set_all_choice_values()
1258 expr_list_for_each_sym(prop->expr, e, sym) { in set_all_choice_values()
1260 sym->def[S_DEF_USER].tri = no; in set_all_choice_values()
1262 csym->flags |= SYMBOL_DEF_USER; in set_all_choice_values()
1264 csym->flags &= ~(SYMBOL_VALID | SYMBOL_NEED_SET_CHOICE_VALUES); in set_all_choice_values()