lkc.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. /*
  2. * Copyright (C) 2002 Roman Zippel <zippel@linux-m68k.org>
  3. * Released under the terms of the GNU GPL v2.0.
  4. */
  5. #ifndef LKC_H
  6. #define LKC_H
  7. #include "expr.h"
  8. #ifdef __cplusplus
  9. extern "C" {
  10. #endif
  11. #ifdef LKC_DIRECT_LINK
  12. #define P(name,type,arg) extern type name arg
  13. #else
  14. #include "lkc_defs.h"
  15. #define P(name,type,arg) extern type (*name ## _p) arg
  16. #endif
  17. #include "lkc_proto.h"
  18. #undef P
  19. void symbol_end(char *help);
  20. int zconfparse(void);
  21. void zconfdump(FILE *out);
  22. extern int zconfdebug;
  23. void zconf_starthelp(void);
  24. void zconf_initscan(const char *name);
  25. void zconf_nextfile(const char *name);
  26. int zconf_lineno(void);
  27. char *zconf_curname(void);
  28. /* confdata.c */
  29. extern const char conf_def_filename[];
  30. extern char conf_filename[];
  31. char *conf_get_default_confname(void);
  32. /* kconfig_load.c */
  33. void kconfig_load(void);
  34. /* menu.c */
  35. void menu_init(void);
  36. void menu_add_menu(void);
  37. void menu_end_menu(void);
  38. void menu_add_entry(struct symbol *sym);
  39. void menu_end_entry(void);
  40. struct property *create_prop(enum prop_type type);
  41. void menu_add_dep(struct expr *dep);
  42. struct property *menu_add_prop(int token, char *prompt, struct symbol *def, struct expr *dep);
  43. void menu_finalize(struct menu *parent);
  44. void menu_set_type(int type);
  45. struct file *file_lookup(const char *name);
  46. int file_write_dep(const char *name);
  47. extern struct menu *current_entry;
  48. extern struct menu *current_menu;
  49. /* symbol.c */
  50. void sym_init(void);
  51. void sym_clear_all_valid(void);
  52. static inline tristate sym_get_tristate_value(struct symbol *sym)
  53. {
  54. return S_TRI(sym->curr);
  55. }
  56. static inline struct symbol *sym_get_choice_value(struct symbol *sym)
  57. {
  58. return (struct symbol *)S_VAL(sym->curr);
  59. }
  60. static inline bool sym_set_choice_value(struct symbol *ch, struct symbol *chval)
  61. {
  62. return sym_set_tristate_value(chval, yes);
  63. }
  64. static inline bool sym_is_choice(struct symbol *sym)
  65. {
  66. return sym->flags & SYMBOL_CHOICE ? true : false;
  67. }
  68. static inline bool sym_is_choice_value(struct symbol *sym)
  69. {
  70. return sym->flags & SYMBOL_CHOICEVAL ? true : false;
  71. }
  72. static inline bool sym_is_optional(struct symbol *sym)
  73. {
  74. return sym->flags & SYMBOL_OPTIONAL ? true : false;
  75. }
  76. static inline bool sym_has_value(struct symbol *sym)
  77. {
  78. //return S_VAL(sym->def) != NULL;
  79. return sym->flags & SYMBOL_NEW ? false : true;
  80. }
  81. #ifdef __cplusplus
  82. }
  83. #endif
  84. #endif /* LKC_H */