kconf_id.c 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. static struct kconf_id kconf_id_array[] = {
  2. { "mainmenu", T_MAINMENU, TF_COMMAND },
  3. { "menu", T_MENU, TF_COMMAND },
  4. { "endmenu", T_ENDMENU, TF_COMMAND },
  5. { "source", T_SOURCE, TF_COMMAND },
  6. { "choice", T_CHOICE, TF_COMMAND },
  7. { "endchoice", T_ENDCHOICE, TF_COMMAND },
  8. { "comment", T_COMMENT, TF_COMMAND },
  9. { "config", T_CONFIG, TF_COMMAND },
  10. { "menuconfig", T_MENUCONFIG, TF_COMMAND },
  11. { "help", T_HELP, TF_COMMAND },
  12. { "---help---", T_HELP, TF_COMMAND },
  13. { "if", T_IF, TF_COMMAND|TF_PARAM },
  14. { "endif", T_ENDIF, TF_COMMAND },
  15. { "depends", T_DEPENDS, TF_COMMAND },
  16. { "optional", T_OPTIONAL, TF_COMMAND },
  17. { "default", T_DEFAULT, TF_COMMAND, S_UNKNOWN },
  18. { "prompt", T_PROMPT, TF_COMMAND },
  19. { "tristate", T_TYPE, TF_COMMAND, S_TRISTATE },
  20. { "def_tristate", T_DEFAULT, TF_COMMAND, S_TRISTATE },
  21. { "bool", T_TYPE, TF_COMMAND, S_BOOLEAN },
  22. { "boolean", 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. #define KCONF_ID_ARRAY_SIZE (sizeof(kconf_id_array)/sizeof(struct kconf_id))
  39. static const struct kconf_id *kconf_id_lookup(register const char *str, register unsigned int len)
  40. {
  41. int i;
  42. for (i = 0; i < KCONF_ID_ARRAY_SIZE; i++) {
  43. struct kconf_id *id = kconf_id_array+i;
  44. int l = strlen(id->name);
  45. if (len == l && !memcmp(str, id->name, len))
  46. return id;
  47. }
  48. return NULL;
  49. }