config.h 728 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #ifndef CONFIG_H
  2. #define CONFIG_H
  3. #ifdef __cplusplus
  4. extern "C"{
  5. #endif
  6. #define CONFIG_FILE "\\\\fls0\\EIGEN.CONF"
  7. typedef enum {
  8. CHECK_BOX, FUNCTION_CALL,
  9. } Menu_Item_Type;
  10. typedef struct {
  11. char* str;
  12. Menu_Item_Type type;
  13. union { //The item can act on a variable or call a function
  14. struct {
  15. int* value;
  16. void (*save_function)(void);
  17. } val;
  18. void (*function)(void);
  19. } action;
  20. } Menu_Item;
  21. typedef struct {
  22. Menu_Item** items;
  23. int items_number;
  24. } Menu;
  25. void draw_menu(Menu* menu);
  26. void menu_setup();
  27. void menu_about();
  28. Menu_Item* menu_create_item(const char* str, Menu_Item_Type type, void* other, void* save_func);
  29. void save_config();
  30. void load_config();
  31. #ifdef __cplusplus
  32. }
  33. #endif
  34. #endif // CONFIG_H