hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/scripts/kconfig/lkc.h
....@@ -1,6 +1,6 @@
1
+/* SPDX-License-Identifier: GPL-2.0 */
12 /*
23 * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org>
3
- * Released under the terms of the GNU GPL v2.0.
44 */
55
66 #ifndef LKC_H
....@@ -30,27 +30,14 @@
3030 #undef CONFIG_
3131 #define CONFIG_ CONFIG_prefix()
3232
33
-#define TF_COMMAND 0x0001
34
-#define TF_PARAM 0x0002
35
-#define TF_OPTION 0x0004
36
-
3733 enum conf_def_mode {
3834 def_default,
3935 def_yes,
4036 def_mod,
37
+ def_y2m,
38
+ def_m2y,
4139 def_no,
4240 def_random
43
-};
44
-
45
-#define T_OPT_MODULES 1
46
-#define T_OPT_DEFCONFIG_LIST 2
47
-#define T_OPT_ALLNOCONFIG_Y 4
48
-
49
-struct kconf_id {
50
- const char *name;
51
- int token;
52
- unsigned int flags;
53
- enum symbol_type stype;
5441 };
5542
5643 extern int yylineno;
....@@ -64,11 +51,10 @@
6451
6552 /* confdata.c */
6653 const char *conf_get_configname(void);
67
-const char *conf_get_autoconfig_name(void);
68
-char *conf_get_default_confname(void);
6954 void sym_set_change_count(int count);
7055 void sym_add_change_count(int count);
7156 bool conf_set_all_new_symbols(enum conf_def_mode mode);
57
+void conf_rewrite_mod_or_yes(enum conf_def_mode mode);
7258 void set_all_choice_values(struct symbol *csym);
7359
7460 /* confdata.c and expr.c */
....@@ -80,21 +66,6 @@
8066 fprintf(stderr, "Error in writing or end of file.\n");
8167 }
8268
83
-/* menu.c */
84
-void _menu_init(void);
85
-void menu_warn(struct menu *menu, const char *fmt, ...);
86
-struct menu *menu_add_menu(void);
87
-void menu_end_menu(void);
88
-void menu_add_entry(struct symbol *sym);
89
-void menu_add_dep(struct expr *dep);
90
-void menu_add_visibility(struct expr *dep);
91
-struct property *menu_add_prompt(enum prop_type type, char *prompt, struct expr *dep);
92
-void menu_add_expr(enum prop_type type, struct expr *expr, struct expr *dep);
93
-void menu_add_symbol(enum prop_type type, struct symbol *sym, struct expr *dep);
94
-void menu_add_option(int token, char *arg);
95
-void menu_finalize(struct menu *parent);
96
-void menu_set_type(int type);
97
-
9869 /* util.c */
9970 struct file *file_lookup(const char *name);
10071 void *xmalloc(size_t size);
....@@ -102,6 +73,9 @@
10273 void *xrealloc(void *p, size_t size);
10374 char *xstrdup(const char *s);
10475 char *xstrndup(const char *s, size_t n);
76
+
77
+/* lexer.l */
78
+int yylex(void);
10579
10680 struct gstr {
10781 size_t len;
....@@ -118,12 +92,42 @@
11892 void str_printf(struct gstr *gs, const char *fmt, ...);
11993 const char *str_get(struct gstr *gs);
12094
95
+/* menu.c */
96
+void _menu_init(void);
97
+void menu_warn(struct menu *menu, const char *fmt, ...);
98
+struct menu *menu_add_menu(void);
99
+void menu_end_menu(void);
100
+void menu_add_entry(struct symbol *sym);
101
+void menu_add_dep(struct expr *dep);
102
+void menu_add_visibility(struct expr *dep);
103
+struct property *menu_add_prompt(enum prop_type type, char *prompt, struct expr *dep);
104
+void menu_add_expr(enum prop_type type, struct expr *expr, struct expr *dep);
105
+void menu_add_symbol(enum prop_type type, struct symbol *sym, struct expr *dep);
106
+void menu_add_option_modules(void);
107
+void menu_add_option_defconfig_list(void);
108
+void menu_add_option_allnoconfig_y(void);
109
+void menu_finalize(struct menu *parent);
110
+void menu_set_type(int type);
111
+
112
+extern struct menu rootmenu;
113
+
114
+bool menu_is_empty(struct menu *menu);
115
+bool menu_is_visible(struct menu *menu);
116
+bool menu_has_prompt(struct menu *menu);
117
+const char *menu_get_prompt(struct menu *menu);
118
+struct menu *menu_get_root_menu(struct menu *menu);
119
+struct menu *menu_get_parent_menu(struct menu *menu);
120
+bool menu_has_help(struct menu *menu);
121
+const char *menu_get_help(struct menu *menu);
122
+struct gstr get_relations_str(struct symbol **sym_arr, struct list_head *head);
123
+void menu_get_ext_help(struct menu *menu, struct gstr *help);
124
+
121125 /* symbol.c */
122126 void sym_clear_all_valid(void);
123127 struct symbol *sym_choice_default(struct symbol *sym);
128
+struct property *sym_get_range_prop(struct symbol *sym);
124129 const char *sym_get_string_default(struct symbol *sym);
125130 struct symbol *sym_check_deps(struct symbol *sym);
126
-struct property *prop_alloc(enum prop_type type, struct symbol *sym);
127131 struct symbol *prop_get_symbol(struct property *prop);
128132
129133 static inline tristate sym_get_tristate_value(struct symbol *sym)