Lines Matching +full:tri +full:- +full:state
1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org>
97 tmp[sizeof(tmp) - 1] = 0; in make_parent_dir()
115 return -1; in make_parent_dir()
137 return -1; in conf_touch_dep()
148 if (fd == -1) { in conf_touch_dep()
150 return -1; in conf_touch_dep()
158 if (fd == -1) in conf_touch_dep()
159 return -1; in conf_touch_dep()
238 switch (sym->type) { in conf_set_sym_val()
241 sym->def[def].tri = mod; in conf_set_sym_val()
242 sym->flags |= def_flags; in conf_set_sym_val()
248 sym->def[def].tri = yes; in conf_set_sym_val()
249 sym->flags |= def_flags; in conf_set_sym_val()
253 sym->def[def].tri = no; in conf_set_sym_val()
254 sym->flags |= def_flags; in conf_set_sym_val()
259 p, sym->name); in conf_set_sym_val()
280 sym->def[def].val = xstrdup(p); in conf_set_sym_val()
281 sym->flags |= def_flags; in conf_set_sym_val()
285 p, sym->name); in conf_set_sym_val()
301 new_size += LINE_GROWTH - 1; in add_byte()
305 return -1; in add_byte()
335 return -1; in compat_getline()
345 line[slen-1] = '\0'; in compat_getline()
347 return -1; in compat_getline()
373 if (expr_calc_value(prop->visible.expr) == no || in conf_read_simple()
374 prop->expr->type != E_SYMBOL) in conf_read_simple()
376 sym_calc_value(prop->expr->left.sym); in conf_read_simple()
377 name = sym_get_string_value(prop->expr->left.sym); in conf_read_simple()
396 sym->flags |= SYMBOL_CHANGED; in conf_read_simple()
397 sym->flags &= ~(def_flags|SYMBOL_VALID); in conf_read_simple()
399 sym->flags |= def_flags; in conf_read_simple()
400 switch (sym->type) { in conf_read_simple()
404 if (sym->def[def].val) in conf_read_simple()
405 free(sym->def[def].val); in conf_read_simple()
408 sym->def[def].val = NULL; in conf_read_simple()
409 sym->def[def].tri = no; in conf_read_simple()
413 while (compat_getline(&line, &line_asize, in) != -1) { in conf_read_simple()
433 if (sym->type == S_UNKNOWN) in conf_read_simple()
434 sym->type = S_BOOLEAN; in conf_read_simple()
436 if (sym->flags & def_flags) { in conf_read_simple()
437 conf_warning("override: reassigning to symbol %s", sym->name); in conf_read_simple()
439 switch (sym->type) { in conf_read_simple()
442 sym->def[def].tri = no; in conf_read_simple()
443 sym->flags |= def_flags; in conf_read_simple()
455 *p2-- = 0; in conf_read_simple()
475 if (sym->flags & def_flags) { in conf_read_simple()
476 conf_warning("override: reassigning to symbol %s", sym->name); in conf_read_simple()
490 switch (sym->def[def].tri) { in conf_read_simple()
494 if (cs->def[def].tri == yes) { in conf_read_simple()
495 conf_warning("%s creates inconsistent choice state", sym->name); in conf_read_simple()
496 cs->flags &= ~def_flags; in conf_read_simple()
500 if (cs->def[def].tri != no) in conf_read_simple()
501 conf_warning("override: %s changes choice state", sym->name); in conf_read_simple()
502 cs->def[def].val = sym; in conf_read_simple()
505 cs->def[def].tri = EXPR_OR(cs->def[def].tri, sym->def[def].tri); in conf_read_simple()
530 if (sym_is_choice(sym) || (sym->flags & SYMBOL_NO_WRITE)) in conf_read()
532 if (sym_has_value(sym) && (sym->flags & SYMBOL_WRITE)) { in conf_read()
534 switch (sym->type) { in conf_read()
537 if (sym->def[S_DEF_USER].tri == sym_get_tristate_value(sym)) in conf_read()
541 if (!strcmp(sym->curr.val, sym->def[S_DEF_USER].val)) in conf_read()
545 } else if (!sym_has_value(sym) && !(sym->flags & SYMBOL_WRITE)) in conf_read()
559 if (sym->visible == no && !conf_unsaved) in conf_read()
560 sym->flags &= ~SYMBOL_DEF_USER; in conf_read()
561 switch (sym->type) { in conf_read()
566 if (sym_string_within_range(sym, sym->def[S_DEF_USER].val)) in conf_read()
568 sym->flags &= ~(SYMBOL_VALID|SYMBOL_DEF_USER); in conf_read()
587 * passing a non-NULL argument to the printer.
594 switch (sym->type) { in kconfig_print_symbol()
602 CONFIG_, sym->name); in kconfig_print_symbol()
610 fprintf(fp, "%s%s=%s\n", CONFIG_, sym->name, value); in kconfig_print_symbol()
648 switch (sym->type) { in header_print_symbol()
661 CONFIG_, sym->name, suffix); in header_print_symbol()
671 CONFIG_, sym->name, prefix, value); in header_print_symbol()
677 CONFIG_, sym->name, value); in header_print_symbol()
718 switch (sym->type) { in conf_write_symbol()
724 printer->print_symbol(fp, sym, str, printer_arg); in conf_write_symbol()
729 printer->print_symbol(fp, sym, str, printer_arg); in conf_write_symbol()
742 rootmenu.prompt->text); in conf_write_heading()
744 printer->print_comment(fp, buf, printer_arg); in conf_write_heading()
768 sym = menu->sym; in conf_write_defconfig()
774 if (!(sym->flags & SYMBOL_WRITE)) in conf_write_defconfig()
776 sym->flags &= ~SYMBOL_WRITE; in conf_write_defconfig()
777 /* If we cannot change the symbol - skip */ in conf_write_defconfig()
780 /* If symbol equals to default value - skip */ in conf_write_defconfig()
786 * default for a choice - skip. in conf_write_defconfig()
798 if ((sym->type == S_BOOLEAN) && in conf_write_defconfig()
806 if (menu->list != NULL) { in conf_write_defconfig()
807 menu = menu->list; in conf_write_defconfig()
809 else if (menu->next != NULL) { in conf_write_defconfig()
810 menu = menu->next; in conf_write_defconfig()
812 while ((menu = menu->parent)) { in conf_write_defconfig()
813 if (menu->next != NULL) { in conf_write_defconfig()
814 menu = menu->next; in conf_write_defconfig()
840 return -1; in conf_write()
845 return -1; in conf_write()
849 return -1; in conf_write()
870 sym = menu->sym; in conf_write()
880 } else if (!(sym->flags & SYMBOL_CHOICE) && in conf_write()
881 !(sym->flags & SYMBOL_WRITTEN)) { in conf_write()
883 if (!(sym->flags & SYMBOL_WRITE)) in conf_write()
889 sym->flags |= SYMBOL_WRITTEN; in conf_write()
894 if (menu->list) { in conf_write()
895 menu = menu->list; in conf_write()
898 if (menu->next) in conf_write()
899 menu = menu->next; in conf_write()
900 else while ((menu = menu->parent)) { in conf_write()
901 if (!menu->sym && menu_is_visible(menu) && in conf_write()
907 if (menu->next) { in conf_write()
908 menu = menu->next; in conf_write()
916 sym->flags &= ~SYMBOL_WRITTEN; in conf_write()
949 for (file = file_list; file; file = file->next) { in conf_write_dep()
950 if (file->next) in conf_write_dep()
951 fprintf(out, "\t%s \\\n", file->name); in conf_write_dep()
953 fprintf(out, "\t%s\n", file->name); in conf_write_dep()
977 depfile_prefix_len = tmp ? tmp - name + 1 : 0; in conf_touch_deps()
979 return -1; in conf_touch_deps()
989 if ((sym->flags & SYMBOL_NO_WRITE) || !sym->name) in conf_touch_deps()
991 if (sym->flags & SYMBOL_WRITE) { in conf_touch_deps()
992 if (sym->flags & SYMBOL_DEF_AUTO) { in conf_touch_deps()
997 switch (sym->type) { in conf_touch_deps()
1001 sym->def[S_DEF_AUTO].tri) in conf_touch_deps()
1008 sym->def[S_DEF_AUTO].val)) in conf_touch_deps()
1019 switch (sym->type) { in conf_touch_deps()
1029 } else if (!(sym->flags & SYMBOL_DEF_AUTO)) in conf_touch_deps()
1038 res = conf_touch_dep(sym->name); in conf_touch_deps()
1077 if (!(sym->flags & SYMBOL_WRITE) || !sym->name) in conf_write_autoconf()
1143 * and if no then no-one. in randomize_choice_values()
1146 if (csym->curr.tri != yes) in randomize_choice_values()
1153 expr_list_for_each_sym(prop->expr, e, sym) in randomize_choice_values()
1163 expr_list_for_each_sym(prop->expr, e, sym) { in randomize_choice_values()
1165 sym->def[S_DEF_USER].tri = yes; in randomize_choice_values()
1166 csym->def[S_DEF_USER].val = sym; in randomize_choice_values()
1169 sym->def[S_DEF_USER].tri = no; in randomize_choice_values()
1171 sym->flags |= SYMBOL_DEF_USER; in randomize_choice_values()
1173 sym->flags &= ~SYMBOL_VALID; in randomize_choice_values()
1175 csym->flags |= SYMBOL_DEF_USER; in randomize_choice_values()
1177 csym->flags &= ~(SYMBOL_VALID); in randomize_choice_values()
1191 * Set all non-assinged choice values to no in set_all_choice_values()
1193 expr_list_for_each_sym(prop->expr, e, sym) { in set_all_choice_values()
1195 sym->def[S_DEF_USER].tri = no; in set_all_choice_values()
1197 csym->flags |= SYMBOL_DEF_USER; in set_all_choice_values()
1199 csym->flags &= ~(SYMBOL_VALID | SYMBOL_NEED_SET_CHOICE_VALUES); in set_all_choice_values()
1210 pby = 50; pty = ptm = 33; /* can't go as the default in switch-case in conf_set_all_new_symbols()
1212 * -Wmaybe-uninitialized */ in conf_set_all_new_symbols()
1234 pby = p[0]; ptm = pby/2; pty = pby-ptm; in conf_set_all_new_symbols()
1253 if (sym_has_value(sym) || (sym->flags & SYMBOL_VALID)) in conf_set_all_new_symbols()
1261 sym->def[S_DEF_USER].tri = yes; in conf_set_all_new_symbols()
1264 sym->def[S_DEF_USER].tri = mod; in conf_set_all_new_symbols()
1267 if (sym->flags & SYMBOL_ALLNOCONFIG_Y) in conf_set_all_new_symbols()
1268 sym->def[S_DEF_USER].tri = yes; in conf_set_all_new_symbols()
1270 sym->def[S_DEF_USER].tri = no; in conf_set_all_new_symbols()
1273 sym->def[S_DEF_USER].tri = no; in conf_set_all_new_symbols()
1275 if (sym->type == S_TRISTATE) { in conf_set_all_new_symbols()
1277 sym->def[S_DEF_USER].tri = yes; in conf_set_all_new_symbols()
1279 sym->def[S_DEF_USER].tri = mod; in conf_set_all_new_symbols()
1281 sym->def[S_DEF_USER].tri = yes; in conf_set_all_new_symbols()
1287 sym->flags |= SYMBOL_DEF_USER; in conf_set_all_new_symbols()
1299 * If curr.tri equals to mod then we can select several in conf_set_all_new_symbols()
1302 * If curr.tri equals yes then only one symbol can be in conf_set_all_new_symbols()
1310 csym->flags |= SYMBOL_NEED_SET_CHOICE_VALUES; in conf_set_all_new_symbols()
1339 sym->def[S_DEF_USER].tri == old_val) in conf_rewrite_mod_or_yes()
1340 sym->def[S_DEF_USER].tri = new_val; in conf_rewrite_mod_or_yes()