Lines Matching +full:tri +full:- +full:default
1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org>
103 tmp[sizeof(tmp) - 1] = 0; in make_parent_dir()
121 return -1; in make_parent_dir()
141 return -1; in conf_touch_dep()
146 if (fd == -1) in conf_touch_dep()
147 return -1; in conf_touch_dep()
241 switch (sym->type) { in conf_set_sym_val()
244 sym->def[def].tri = mod; in conf_set_sym_val()
245 sym->flags |= def_flags; in conf_set_sym_val()
251 sym->def[def].tri = yes; in conf_set_sym_val()
252 sym->flags |= def_flags; in conf_set_sym_val()
256 sym->def[def].tri = no; in conf_set_sym_val()
257 sym->flags |= def_flags; in conf_set_sym_val()
262 p, sym->name); in conf_set_sym_val()
285 sym->def[def].val = xstrdup(p); in conf_set_sym_val()
286 sym->flags |= def_flags; in conf_set_sym_val()
290 p, sym->name); in conf_set_sym_val()
294 default: in conf_set_sym_val()
307 if (len > 0 && (*lineptr)[len - 1] == '\n') { in getline_stripped()
308 len--; in getline_stripped()
311 if (len > 0 && (*lineptr)[len - 1] == '\r') { in getline_stripped()
312 len--; in getline_stripped()
388 sym->flags &= ~(def_flags|SYMBOL_VALID); in conf_read_simple()
389 switch (sym->type) { in conf_read_simple()
393 free(sym->def[def].val); in conf_read_simple()
395 default: in conf_read_simple()
396 sym->def[def].val = NULL; in conf_read_simple()
397 sym->def[def].tri = no; in conf_read_simple()
403 while (getline_stripped(&line, &line_asize, in) != -1) { in conf_read_simple()
461 if (sym->flags & def_flags) in conf_read_simple()
462 conf_warning("override: reassigning to symbol %s", sym->name); in conf_read_simple()
474 list_move(&sym->choice_link, &choice->choice_members); in conf_read_simple()
499 if (sym_has_value(sym) && (sym->flags & SYMBOL_WRITE)) { in conf_read()
501 switch (sym->type) { in conf_read()
504 if (sym->def[S_DEF_USER].tri == sym_get_tristate_value(sym)) in conf_read()
507 default: in conf_read()
508 if (!strcmp(sym->curr.val, sym->def[S_DEF_USER].val)) in conf_read()
512 } else if (!sym_has_value(sym) && !(sym->flags & SYMBOL_WRITE)) in conf_read()
548 fprintf(fp, "%s\n", cs->prefix); in conf_write_heading()
551 cs->decoration); in conf_write_heading()
553 fprintf(fp, "%s %s\n", cs->decoration, rootmenu.prompt->text); in conf_write_heading()
555 fprintf(fp, "%s\n", cs->postfix); in conf_write_heading()
609 if (sym->type == S_UNKNOWN) in __print_symbol()
614 if ((sym->type == S_BOOLEAN || sym->type == S_TRISTATE) && in __print_symbol()
617 fprintf(fp, "# %s%s is not set\n", CONFIG_, sym->name); in __print_symbol()
621 if (sym->type == S_STRING && escape_string) { in __print_symbol()
626 fprintf(fp, "%s%s=%s\n", CONFIG_, sym->name, val); in __print_symbol()
653 if (sym->type == S_UNKNOWN) in print_symbol_for_c()
658 switch (sym->type) { in print_symbol_for_c()
667 default: in print_symbol_for_c()
678 default: in print_symbol_for_c()
682 fprintf(fp, "#define %s%s%s %s%s\n", CONFIG_, sym->name, sym_suffix, in print_symbol_for_c()
696 if (sym->type == S_UNKNOWN) in print_symbol_for_rustccfg()
701 switch (sym->type) { in print_symbol_for_rustccfg()
713 * we provide an empty `--cfg CONFIG_X` here in both `y` in print_symbol_for_rustccfg()
717 * a `--cfg CONFIG_X="y"` or `--cfg CONFIG_X="m"`, which can in print_symbol_for_rustccfg()
720 fprintf(fp, "--cfg=%s%s\n", CONFIG_, sym->name); in print_symbol_for_rustccfg()
726 default: in print_symbol_for_rustccfg()
737 /* All values get escaped: the `--cfg` option only takes strings */ in print_symbol_for_rustccfg()
741 fprintf(fp, "--cfg=%s%s=%s\n", CONFIG_, sym->name, val); in print_symbol_for_rustccfg()
749 * All values that has default values are skipped as this is redundant.
766 sym = menu->sym; in conf_write_defconfig()
772 if (!(sym->flags & SYMBOL_WRITE)) in conf_write_defconfig()
774 sym->flags &= ~SYMBOL_WRITE; in conf_write_defconfig()
778 /* Skip symbols that are equal to the default */ in conf_write_defconfig()
782 /* Skip choice values that are equal to the default */ in conf_write_defconfig()
812 return -1; in conf_write()
817 return -1; in conf_write()
821 return -1; in conf_write()
842 sym = menu->sym; in conf_write()
853 !(sym->flags & SYMBOL_WRITTEN)) { in conf_write()
855 if (!(sym->flags & SYMBOL_WRITE)) in conf_write()
861 sym->flags |= SYMBOL_WRITTEN; in conf_write()
866 if (menu->list) { in conf_write()
867 menu = menu->list; in conf_write()
872 if (!menu->sym && menu_is_visible(menu) && menu != &rootmenu && in conf_write()
873 menu->prompt->type == P_MENU) { in conf_write()
878 if (menu->next) { in conf_write()
879 menu = menu->next; in conf_write()
881 menu = menu->parent; in conf_write()
889 sym->flags &= ~SYMBOL_WRITTEN; in conf_write()
921 return -1; in conf_write_autoconf_cmd()
924 return -1; in conf_write_autoconf_cmd()
928 return -1; in conf_write_autoconf_cmd()
933 return -1; in conf_write_autoconf_cmd()
944 return -1; in conf_write_autoconf_cmd()
948 return -1; in conf_write_autoconf_cmd()
962 depfile_prefix_len = tmp ? tmp - name + 1 : 0; in conf_touch_deps()
964 return -1; in conf_touch_deps()
976 if (sym->flags & SYMBOL_WRITE) { in conf_touch_deps()
977 if (sym->flags & SYMBOL_DEF_AUTO) { in conf_touch_deps()
982 switch (sym->type) { in conf_touch_deps()
986 sym->def[S_DEF_AUTO].tri) in conf_touch_deps()
993 sym->def[S_DEF_AUTO].val)) in conf_touch_deps()
996 default: in conf_touch_deps()
1004 switch (sym->type) { in conf_touch_deps()
1010 default: in conf_touch_deps()
1014 } else if (!(sym->flags & SYMBOL_DEF_AUTO)) in conf_touch_deps()
1023 res = conf_touch_dep(sym->name); in conf_touch_deps()
1041 return -1; in __conf_write_autoconf()
1045 return -1; in __conf_write_autoconf()
1050 return -1; in __conf_write_autoconf()
1056 if ((sym->flags & SYMBOL_WRITE) && sym->name) in __conf_write_autoconf()
1064 return -1; in __conf_write_autoconf()
1068 return -1; in __conf_write_autoconf()
1085 return -1; in conf_write_autoconf()