45 lines
727 B
C
45 lines
727 B
C
#ifndef CONFIG_H
|
|
|
|
#define CONFIG_H
|
|
|
|
#ifdef __cplusplus
|
|
extern "C"{
|
|
#endif
|
|
|
|
#define CONFIG_FILE "\\\\fls0\\EIGEN.cfg"
|
|
|
|
typedef enum {
|
|
CHECK_BOX, FUNCTION_CALL,
|
|
} Menu_Item_Type;
|
|
|
|
typedef struct {
|
|
char* str;
|
|
Menu_Item_Type type;
|
|
union { //The item can act on a variable or call a function
|
|
struct {
|
|
int* value;
|
|
void (*save_function)(void);
|
|
} val;
|
|
void (*function)(void);
|
|
} action;
|
|
} Menu_Item;
|
|
|
|
typedef struct {
|
|
Menu_Item** items;
|
|
int items_number;
|
|
} Menu;
|
|
|
|
|
|
void draw_menu(Menu* menu);
|
|
void menu_setup();
|
|
void menu_about();
|
|
Menu_Item* menu_create_item(const char* str, Menu_Item_Type type, void* other, void* save_func);
|
|
|
|
void save_config();
|
|
void load_config();
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif // CONFIG_H
|