MCPcopy Create free account
hub / github.com/coreboot/coreboot / __print_symbol

Function __print_symbol

util/kconfig/confdata.c:706–732  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

704enum output_n { OUTPUT_N, OUTPUT_N_AS_UNSET, OUTPUT_N_NONE };
705
706static 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
734static void print_symbol_for_dotconfig(FILE *fp, struct symbol *sym)
735{

Callers 3

Calls 4

sym_get_string_valueFunction · 0.85
fprintfFunction · 0.85
escape_string_valueFunction · 0.85
freeFunction · 0.50

Tested by

no test coverage detected