| 691 | enum output_n { OUTPUT_N, OUTPUT_N_AS_UNSET, OUTPUT_N_NONE }; |
| 692 | |
| 693 | static void __print_symbol(FILE *fp, struct symbol *sym, enum output_n output_n, |
| 694 | bool escape_string) |
| 695 | { |
| 696 | const char *val; |
| 697 | char *escaped = NULL; |
| 698 | |
| 699 | if (sym->type == S_UNKNOWN) |
| 700 | return; |
| 701 | |
| 702 | val = sym_get_string_value(sym); |
| 703 | |
| 704 | if ((sym->type == S_BOOLEAN || sym->type == S_TRISTATE) && |
| 705 | output_n != OUTPUT_N && *val == 'n') { |
| 706 | if (output_n == OUTPUT_N_AS_UNSET) |
| 707 | fprintf(fp, "# %s%s is not set\n", CONFIG_, sym->name); |
| 708 | return; |
| 709 | } |
| 710 | |
| 711 | if (sym->type == S_STRING && escape_string) { |
| 712 | escaped = escape_string_value(val); |
| 713 | val = escaped; |
| 714 | } |
| 715 | |
| 716 | fprintf(fp, "%s%s=%s\n", CONFIG_, sym->name, val); |
| 717 | |
| 718 | free(escaped); |
| 719 | } |
| 720 | |
| 721 | static void print_symbol_for_dotconfig(FILE *fp, struct symbol *sym) |
| 722 | { |
no test coverage detected