first version
[build-config.git] / src / lxrgmr / kconf_id.c
blob4638ef5a533445af54c16af740337db16d1f6c20
2 static struct kconf_id kconf_id_array[] = {
3 { "mainmenu", T_MAINMENU, TF_COMMAND },
4 { "menu", T_MENU, TF_COMMAND },
5 { "endmenu", T_ENDMENU, TF_COMMAND },
6 { "source", T_SOURCE, TF_COMMAND },
7 { "choice", T_CHOICE, TF_COMMAND },
8 { "endchoice", T_ENDCHOICE, TF_COMMAND },
9 { "comment", T_COMMENT, TF_COMMAND },
10 { "config", T_CONFIG, TF_COMMAND },
11 { "menuconfig", T_MENUCONFIG, TF_COMMAND },
12 { "help", T_HELP, TF_COMMAND },
13 { "---help---", T_HELP, TF_COMMAND },
14 { "if", T_IF, TF_COMMAND|TF_PARAM },
15 { "endif", T_ENDIF, TF_COMMAND },
16 { "depends", T_DEPENDS, TF_COMMAND },
17 { "optional", T_OPTIONAL, TF_COMMAND },
18 { "default", T_DEFAULT, TF_COMMAND, S_UNKNOWN },
19 { "prompt", T_PROMPT, TF_COMMAND },
20 { "tristate", T_TYPE, TF_COMMAND, S_TRISTATE }, // T_TRISTATE => T_TYPE
21 { "def_tristate", T_DEFAULT, TF_COMMAND, S_TRISTATE }, // T_DEF_TRISTATE => T_DEFAULT
22 { "bool", T_TYPE, TF_COMMAND, S_BOOLEAN }, // T_BOOL => T_TYPE
23 { "def_bool", T_DEFAULT, TF_COMMAND, S_BOOLEAN }, // T_DEF_BOOL => T_DEFAULT
24 { "int", T_TYPE, TF_COMMAND, S_INT }, // T_INT => T_TYPE
25 { "hex", T_TYPE, TF_COMMAND, S_HEX }, // T_HEX => T_TYPE
26 { "string", T_TYPE, TF_COMMAND, S_STRING }, // T_INT => T_TYPE
27 { "select", T_SELECT, TF_COMMAND },
28 { "imply", T_IMPLY, TF_COMMAND },
29 { "range", T_RANGE, TF_COMMAND },
30 { "visible", T_VISIBLE, TF_COMMAND },
31 { "option", T_OPTION, TF_COMMAND },
32 { "on", T_ON, TF_PARAM },
33 { "modules", T_OPT_MODULES, TF_OPTION }, // T_MODULES => T_OPT_MODULES
34 { "defconfig_list", T_OPT_DEFCONFIG_LIST, TF_OPTION }, // T_DEFCONFIG_LIST => T_OPT_DEFCONFIG_LIST
35 { "env", T_OPT_ENV, TF_OPTION }, // extend reserved word?
36 { "allnoconfig_y", T_OPT_ALLNOCONFIG_Y, TF_OPTION }, // T_ALLNOCONFIG_Y => T_OPT_ALLNOCONFIG_Y
39 #define KCONF_ID_ARRAY_SIZE (sizeof(kconf_id_array)/sizeof(struct kconf_id))
41 static const struct kconf_id *kconf_id_lookup(register const char *str, register unsigned int len)
43 int i;
45 for (i = 0; i < KCONF_ID_ARRAY_SIZE; i++) {
46 struct kconf_id *id = kconf_id_array+i;
47 int l = strlen(id->name);
49 if (len == l && !memcmp(str, id->name, len))
50 return id;
52 return NULL;