kconf_id.c 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. { "def_bool", T_DEFAULT, TF_COMMAND, S_BOOLEAN },
  23. { "int", T_TYPE, TF_COMMAND, S_INT },
  24. { "hex", T_TYPE, TF_COMMAND, S_HEX },
  25. { "string", T_TYPE, TF_COMMAND, S_STRING },
  26. { "select", T_SELECT, TF_COMMAND },
  27. { "imply", T_IMPLY, TF_COMMAND },
  28. { "range", T_RANGE, TF_COMMAND },
  29. { "visible", T_VISIBLE, TF_COMMAND },
  30. { "option", T_OPTION, TF_COMMAND },
  31. { "on", T_ON, TF_PARAM },
  32. { "modules", T_OPT_MODULES, TF_OPTION },
  33. { "defconfig_list", T_OPT_DEFCONFIG_LIST, TF_OPTION },
  34. { "allnoconfig_y", T_OPT_ALLNOCONFIG_Y, TF_OPTION },
  35. };
  36. #define KCONF_ID_ARRAY_SIZE (sizeof(kconf_id_array)/sizeof(struct kconf_id))
  37. static const struct kconf_id *kconf_id_lookup(register const char *str, register unsigned int len)
  38. {
  39. int i;
  40. for (i = 0; i < KCONF_ID_ARRAY_SIZE; i++) {
  41. struct kconf_id *id = kconf_id_array+i;
  42. int l = strlen(id->name);
  43. if (len == l && !memcmp(str, id->name, len))
  44. return id;
  45. }
  46. return NULL;
  47. }