Eugeniu Rosca | e91610d | 2018-05-19 14:13:50 +0200 | [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 | { "def_bool", T_DEFAULT, TF_COMMAND, S_BOOLEAN }, |
| 24 | { "int", T_TYPE, TF_COMMAND, S_INT }, |
| 25 | { "hex", T_TYPE, TF_COMMAND, S_HEX }, |
| 26 | { "string", T_TYPE, TF_COMMAND, S_STRING }, |
| 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 }, |
| 34 | { "defconfig_list", T_OPT_DEFCONFIG_LIST, TF_OPTION }, |
| 35 | { "env", T_OPT_ENV, TF_OPTION }, |
| 36 | { "allnoconfig_y", T_OPT_ALLNOCONFIG_Y, TF_OPTION }, |
| 37 | }; |
| 38 | |
| 39 | #define KCONF_ID_ARRAY_SIZE (sizeof(kconf_id_array)/sizeof(struct kconf_id)) |
| 40 | |
| 41 | static const struct kconf_id *kconf_id_lookup(register const char *str, register unsigned int len) |
| 42 | { |
| 43 | int i; |
| 44 | |
| 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); |
| 48 | |
| 49 | if (len == l && !memcmp(str, id->name, len)) |
| 50 | return id; |
| 51 | } |
| 52 | return NULL; |
| 53 | } |