tkparse.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. enum token {
  2. tok_menuname,
  3. tok_menuoption,
  4. tok_comment,
  5. tok_bool,
  6. tok_tristate,
  7. tok_dep_tristate,
  8. tok_nop,
  9. tok_if,
  10. tok_else,
  11. tok_fi,
  12. tok_int,
  13. tok_hex,
  14. tok_make,
  15. tok_define,
  16. tok_choose,
  17. tok_choice,
  18. tok_endmenu,
  19. tok_unknown
  20. };
  21. enum operator {
  22. op_eq,
  23. op_neq,
  24. op_and,
  25. op_and1,
  26. op_or,
  27. op_bang,
  28. op_lparen,
  29. op_rparen,
  30. op_variable,
  31. op_kvariable,
  32. op_shellcmd,
  33. op_constant,
  34. op_nuked
  35. };
  36. union var
  37. {
  38. char * str;
  39. struct kconfig * cfg;
  40. };
  41. struct condition
  42. {
  43. struct condition * next;
  44. enum operator op;
  45. union var variable;
  46. };
  47. #define GLOBAL_WRITTEN 1
  48. #define CFG_DUP 2
  49. #define UNSAFE 4
  50. struct kconfig
  51. {
  52. struct kconfig * next;
  53. int flags;
  54. enum token tok;
  55. char menu_number;
  56. char menu_line;
  57. char submenu_start;
  58. char submenu_end;
  59. char * optionname;
  60. char * label;
  61. char * value;
  62. int choice_value;
  63. struct kconfig * choice_label;
  64. union var depend;
  65. struct condition * cond;
  66. };
  67. extern struct kconfig * config;
  68. extern struct kconfig * clast;
  69. extern struct kconfig * koption;
  70. /*
  71. * Prototypes
  72. */
  73. void fix_conditionals(struct kconfig * scfg); /* tkcond.c */
  74. void dump_tk_script(struct kconfig *scfg); /* tkgen.c */