| 704 | enum output_n { OUTPUT_N, OUTPUT_N_AS_UNSET, OUTPUT_N_NONE }; |
| 705 | |
| 706 | static void __print_symbol(FILE *fp, struct symbol *sym, enum output_n output_n, |
| 707 | bool escape_string) |
| 708 | { |
| 709 | const char *val; |
| 710 | char *escaped = NULL; |
| 711 | |
| 712 | if (sym->type == S_UNKNOWN) |
| 713 | return; |
| 714 | |
| 715 | val = sym_get_string_value(sym); |
| 716 | |
| 717 | if ((sym->type == S_BOOLEAN || sym->type == S_TRISTATE) && |
| 718 | output_n != OUTPUT_N && *val == 'n') { |
| 719 | if (output_n == OUTPUT_N_AS_UNSET) |
| 720 | fprintf(fp, "# %s%s is not set\n", CONFIG_, sym->name); |
| 721 | return; |
| 722 | } |
| 723 | |
| 724 | if (sym->type == S_STRING && escape_string) { |
| 725 | escaped = escape_string_value(val); |
| 726 | val = escaped; |
| 727 | } |
| 728 | |
| 729 | fprintf(fp, "%s%s=%s\n", CONFIG_, sym->name, val); |
| 730 | |
| 731 | free(escaped); |
| 732 | } |
| 733 | |
| 734 | static void print_symbol_for_dotconfig(FILE *fp, struct symbol *sym) |
| 735 | { |
no test coverage detected