Linus Torvalds | bb3290d | 2017-08-19 10:17:02 -0700 | [diff] [blame] | 1 | |
| 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 }, |
| 21 | { "def_tristate", T_DEFAULT, TF_COMMAND, S_TRISTATE }, |
| 22 | { "bool", T_TYPE, TF_COMMAND, S_BOOLEAN }, |
| 23 | { "boolean", T_TYPE, TF_COMMAND, S_BOOLEAN }, |
| 24 | { "def_bool", T_DEFAULT, TF_COMMAND, S_BOOLEAN }, |
| 25 | { "int", T_TYPE, TF_COMMAND, S_INT }, |
| 26 | { "hex", T_TYPE, TF_COMMAND, S_HEX }, |
| 27 | { "string", T_TYPE, TF_COMMAND, S_STRING }, |
| 28 | { "select", T_SELECT, TF_COMMAND }, |
| 29 | { "imply", T_IMPLY, TF_COMMAND }, |
| 30 | { "range", T_RANGE, TF_COMMAND }, |
| 31 | { "visible", T_VISIBLE, TF_COMMAND }, |
| 32 | { "option", T_OPTION, TF_COMMAND }, |
| 33 | { "on", T_ON, TF_PARAM }, |
| 34 | { "modules", T_OPT_MODULES, TF_OPTION }, |
| 35 | { "defconfig_list", T_OPT_DEFCONFIG_LIST, TF_OPTION }, |
| 36 | { "env", T_OPT_ENV, TF_OPTION }, |
| 37 | { "allnoconfig_y", T_OPT_ALLNOCONFIG_Y, TF_OPTION }, |
| 38 | }; |
| 39 | |
| 40 | #define KCONF_ID_ARRAY_SIZE (sizeof(kconf_id_array)/sizeof(struct kconf_id)) |
| 41 | |
| 42 | static const struct kconf_id *kconf_id_lookup(register const char *str, register unsigned int len) |
| 43 | { |
| 44 | int i; |
| 45 | |
| 46 | for (i = 0; i < KCONF_ID_ARRAY_SIZE; i++) { |
| 47 | struct kconf_id *id = kconf_id_array+i; |
| 48 | int l = strlen(id->name); |
| 49 | |
| 50 | if (len == l && !memcmp(str, id->name, len)) |
| 51 | return id; |
| 52 | } |
| 53 | return NULL; |
| 54 | } |