scripts/kconfig/nconf.c
Source file repositories/reference/linux-study-clean/scripts/kconfig/nconf.c
File Facts
- System
- Linux kernel
- Corpus path
scripts/kconfig/nconf.c- Extension
.c- Size
- 39290 bytes
- Lines
- 1561
- 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
locale.hstring.hstrings.hstdlib.hlist.hxalloc.hlkc.hmnconf-common.hnconf.hctype.h
Detected Declarations
struct mitemstruct function_keysstruct match_statefunction print_function_linefunction handle_f1function handle_f2function handle_f3function handle_f4function handle_f5function handle_f6function handle_f7function handle_f8function handle_f9function process_special_keysfunction clean_itemsfunction get_mext_matchfunction item_makefunction item_add_strfunction item_tagfunction curses_item_indexfunction item_is_tagfunction set_config_filenamefunction do_exitfunction search_conffunction build_conffunction reset_menufunction center_itemfunction show_menufunction adj_match_dirfunction do_matchfunction conffunction selected_conffunction conf_message_callbackfunction show_helpfunction conf_choicefunction conf_stringfunction conf_loadfunction conf_savefunction setup_windowsfunction main
Annotated Snippet
struct mitem {
char str[256];
char tag;
void *usrptr;
int is_visible;
};
#define MAX_MENU_ITEMS 4096
static int show_all_items;
static int indent;
static struct menu *current_menu;
static int child_count;
static int single_menu_mode;
/* the window in which all information appears */
static WINDOW *main_window;
/* the largest size of the menu window */
static int mwin_max_lines;
static int mwin_max_cols;
/* the window in which we show option buttons */
static MENU *curses_menu;
static ITEM *curses_menu_items[MAX_MENU_ITEMS];
static struct mitem k_menu_items[MAX_MENU_ITEMS];
static unsigned int items_num;
static int global_exit;
/* the currently selected button */
static const char *current_instructions = menu_instructions;
static char *dialog_input_result;
static int dialog_input_result_len;
static void selected_conf(struct menu *menu, struct menu *active_menu);
static void conf(struct menu *menu);
static void conf_choice(struct menu *menu);
static void conf_string(struct menu *menu);
static void conf_load(void);
static void conf_save(void);
static void show_help(struct menu *menu);
static int do_exit(void);
static void setup_windows(void);
static void search_conf(void);
typedef void (*function_key_handler_t)(int *key, struct menu *menu);
static void handle_f1(int *key, struct menu *current_item);
static void handle_f2(int *key, struct menu *current_item);
static void handle_f3(int *key, struct menu *current_item);
static void handle_f4(int *key, struct menu *current_item);
static void handle_f5(int *key, struct menu *current_item);
static void handle_f6(int *key, struct menu *current_item);
static void handle_f7(int *key, struct menu *current_item);
static void handle_f8(int *key, struct menu *current_item);
static void handle_f9(int *key, struct menu *current_item);
struct function_keys {
const char *key_str;
const char *func;
function_key key;
function_key_handler_t handler;
};
static const int function_keys_num = 9;
static struct function_keys function_keys[] = {
{
.key_str = "F1",
.func = "Help",
.key = F_HELP,
.handler = handle_f1,
},
{
.key_str = "F2",
.func = "SymInfo",
.key = F_SYMBOL,
.handler = handle_f2,
},
{
.key_str = "F3",
.func = "Help 2",
.key = F_INSTS,
.handler = handle_f3,
},
{
.key_str = "F4",
.func = "ShowAll",
.key = F_CONF,
.handler = handle_f4,
},
{
.key_str = "F5",
.func = "Back",
.key = F_BACK,
.handler = handle_f5,
Annotation
- Immediate include surface: `locale.h`, `string.h`, `strings.h`, `stdlib.h`, `list.h`, `xalloc.h`, `lkc.h`, `mnconf-common.h`.
- Detected declarations: `struct mitem`, `struct function_keys`, `struct match_state`, `function print_function_line`, `function handle_f1`, `function handle_f2`, `function handle_f3`, `function handle_f4`, `function handle_f5`, `function handle_f6`.
- 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.