scripts/kconfig/confdata.c
Source file repositories/reference/linux-study-clean/scripts/kconfig/confdata.c
File Facts
- System
- Linux kernel
- Corpus path
scripts/kconfig/confdata.c- Extension
.c- Size
- 22318 bytes
- Lines
- 1144
- Domain
- Support Tooling And Documentation
- Bucket
- scripts
- Inferred role
- Support Tooling And Documentation: implementation source
- Status
- source implementation candidate
Why This File Exists
Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
sys/mman.hsys/stat.hsys/types.hctype.herrno.hfcntl.hlimits.hstdarg.hstdbool.hstdio.hstdlib.hstring.htime.hunistd.hxalloc.hinternal.hlkc.h
Detected Declarations
struct comment_styleenum output_nfunction is_presentfunction is_dirfunction is_samefunction make_parent_dirfunction conf_touch_depfunction conf_errorsfunction conf_warningfunction conf_default_message_callbackfunction conf_set_message_callbackfunction conf_messagefunction conf_set_sym_valfunction getline_strippedfunction conf_read_simplefunction conf_readfunction for_all_symbolsfunction conf_write_headingfunction __print_symbolfunction print_symbol_for_dotconfigfunction print_symbol_for_autoconffunction print_symbol_for_listconfigfunction print_symbol_for_cfunction print_symbol_for_rustccfgfunction conf_write_defconfigfunction menu_for_each_entryfunction conf_writefunction conf_write_autoconf_cmdfunction conf_touch_depsfunction for_all_symbolsfunction __conf_write_autoconffunction conf_write_autoconffunction conf_set_changedfunction conf_get_changedfunction conf_set_changed_callback
Annotated Snippet
struct comment_style {
const char *decoration;
const char *prefix;
const char *postfix;
};
static const struct comment_style comment_style_pound = {
.decoration = "#",
.prefix = "#",
.postfix = "#",
};
static const struct comment_style comment_style_c = {
.decoration = " *",
.prefix = "/*",
.postfix = " */",
};
static void conf_write_heading(FILE *fp, const struct comment_style *cs)
{
if (!cs)
return;
fprintf(fp, "%s\n", cs->prefix);
fprintf(fp, "%s Automatically generated file; DO NOT EDIT.\n",
cs->decoration);
fprintf(fp, "%s %s\n", cs->decoration, rootmenu.prompt->text);
fprintf(fp, "%s\n", cs->postfix);
}
/* The returned pointer must be freed on the caller side */
static char *escape_string_value(const char *in)
{
const char *p;
char *out;
size_t len;
len = strlen(in) + strlen("\"\"") + 1;
p = in;
while (1) {
p += strcspn(p, "\"\\");
if (p[0] == '\0')
break;
len++;
p++;
}
out = xmalloc(len);
out[0] = '\0';
strcat(out, "\"");
p = in;
while (1) {
len = strcspn(p, "\"\\");
strncat(out, p, len);
p += len;
if (p[0] == '\0')
break;
strcat(out, "\\");
strncat(out, p++, 1);
}
strcat(out, "\"");
return out;
}
enum output_n { OUTPUT_N, OUTPUT_N_AS_UNSET, OUTPUT_N_NONE };
static void __print_symbol(FILE *fp, struct symbol *sym, enum output_n output_n,
bool escape_string)
{
const char *val;
char *escaped = NULL;
if (sym->type == S_UNKNOWN)
return;
val = sym_get_string_value(sym);
if ((sym->type == S_BOOLEAN || sym->type == S_TRISTATE) &&
Annotation
- Immediate include surface: `sys/mman.h`, `sys/stat.h`, `sys/types.h`, `ctype.h`, `errno.h`, `fcntl.h`, `limits.h`, `stdarg.h`.
- Detected declarations: `struct comment_style`, `enum output_n`, `function is_present`, `function is_dir`, `function is_same`, `function make_parent_dir`, `function conf_touch_dep`, `function conf_errors`, `function conf_warning`, `function conf_default_message_callback`.
- Atlas domain: Support Tooling And Documentation / scripts.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.