scripts/kconfig/mconf.c
Source file repositories/reference/linux-study-clean/scripts/kconfig/mconf.c
File Facts
- System
- Linux kernel
- Corpus path
scripts/kconfig/mconf.c- Extension
.c- Size
- 25963 bytes
- Lines
- 967
- 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
ctype.herrno.hfcntl.hlimits.hlocale.hstdarg.hstdlib.hstring.hstrings.hsignal.hunistd.hlist.hxalloc.hlkc.hlxdialog/dialog.hmnconf-common.h
Detected Declarations
struct subtitle_partfunction set_config_filenamefunction set_subtitlefunction reset_subtitlefunction show_textbox_extfunction show_textboxfunction show_helptextfunction show_helpfunction search_conffunction build_conffunction conf_choicefunction conf_stringfunction conf_loadfunction conf_savefunction conffunction conf_message_callbackfunction handle_exitfunction sig_handlerfunction main
Annotated Snippet
struct subtitle_part {
struct list_head entries;
const char *text;
};
static LIST_HEAD(trail);
static struct subtitle_list *subtitles;
static void set_subtitle(void)
{
struct subtitle_part *sp;
struct subtitle_list *pos, *tmp;
for (pos = subtitles; pos != NULL; pos = tmp) {
tmp = pos->next;
free(pos);
}
subtitles = NULL;
list_for_each_entry(sp, &trail, entries) {
if (sp->text) {
if (pos) {
pos->next = xcalloc(1, sizeof(*pos));
pos = pos->next;
} else {
subtitles = pos = xcalloc(1, sizeof(*pos));
}
pos->text = sp->text;
}
}
set_dialog_subtitles(subtitles);
}
static void reset_subtitle(void)
{
struct subtitle_list *pos, *tmp;
for (pos = subtitles; pos != NULL; pos = tmp) {
tmp = pos->next;
free(pos);
}
subtitles = NULL;
set_dialog_subtitles(subtitles);
}
static int show_textbox_ext(const char *title, const char *text, int r, int c,
int *vscroll, int *hscroll,
int (*extra_key_cb)(int, size_t, size_t, void *),
void *data)
{
dialog_clear();
return dialog_textbox(title, text, r, c, vscroll, hscroll,
extra_key_cb, data);
}
static void show_textbox(const char *title, const char *text, int r, int c)
{
show_textbox_ext(title, text, r, c, NULL, NULL, NULL, NULL);
}
static void show_helptext(const char *title, const char *text)
{
show_textbox(title, text, 0, 0);
}
static void show_help(struct menu *menu)
{
struct gstr help = str_new();
help.max_width = getmaxx(stdscr) - 10;
menu_get_ext_help(menu, &help);
show_helptext(menu_get_prompt(menu), str_get(&help));
str_free(&help);
}
static void search_conf(void)
{
struct symbol **sym_arr;
struct gstr res;
struct gstr title;
char *dialog_input;
int dres, vscroll = 0, hscroll = 0;
bool again;
struct gstr sttext;
struct subtitle_part stpart;
title = str_new();
str_printf( &title, "Enter (sub)string or regexp to search for "
"(with or without \"%s\")", CONFIG_);
Annotation
- Immediate include surface: `ctype.h`, `errno.h`, `fcntl.h`, `limits.h`, `locale.h`, `stdarg.h`, `stdlib.h`, `string.h`.
- Detected declarations: `struct subtitle_part`, `function set_config_filename`, `function set_subtitle`, `function reset_subtitle`, `function show_textbox_ext`, `function show_textbox`, `function show_helptext`, `function show_help`, `function search_conf`, `function build_conf`.
- 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.