1
2
3
4
5
6
7
8
9enum e_token
10{
11 token_UNKNOWN,
12 token_bool,
13 token_choice_header,
14 token_choice_item,
15 token_comment,
16 token_define_bool,
17 token_define_hex,
18 token_define_int,
19 token_define_string,
20 token_define_tristate,
21 token_dep_bool,
22 token_dep_mbool,
23 token_dep_tristate,
24 token_else,
25 token_endmenu,
26 token_fi,
27 token_hex,
28 token_if,
29 token_int,
30 token_mainmenu_name,
31 token_mainmenu_option,
32 token_source,
33 token_string,
34 token_then,
35 token_tristate,
36 token_unset,
37};
38
39
40
41
42
43enum operator
44{
45 op_eq,
46 op_neq,
47 op_and,
48 op_and1,
49 op_or,
50 op_bang,
51 op_lparen,
52 op_rparen,
53 op_constant,
54 op_variable,
55 op_true,
56 op_false,
57 op_nuked
58};
59
60
61
62
63
64
65
66
67
68
69
70
71
72struct condition
73{
74 struct condition * next;
75 enum operator op;
76 const char * str;
77 int nameindex;
78};
79
80
81
82
83
84struct dependency
85{
86 char * name;
87 struct dependency * next;
88};
89
90
91
92
93
94struct kconfig
95{
96 struct kconfig * next;
97 enum e_token token;
98 int nameindex;
99 char * label;
100 char * value;
101 struct condition * cond;
102 struct dependency * depend;
103 struct kconfig * cfg_parent;
104
105
106 int menu_number;
107 int menu_line;
108 struct kconfig * menu_next;
109};
110
111struct variable
112{
113 char * name;
114 char defined;
115 char global_written;
116};
117
118extern struct variable *vartable;
119extern int max_varnum;
120
121
122
123
124
125extern void fix_conditionals ( struct kconfig * scfg );
126extern void dump_tk_script ( struct kconfig * scfg );
127extern int get_varnum ( char * name );
128