source: Daodan/src/Daodan_Config.h@ 1190

Last change on this file since 1190 was 1162, checked in by rossy, 3 years ago

Daodan: Add float-type config options

File size: 974 bytes
Line 
1#ifndef DAODAN_CONFIG_H
2#define DAODAN_CONFIG_H
3
4#include "stdint.h"
5
6typedef void (*cmd_callback)();
7
8typedef enum {
9 C_CMD,
10 C_BOOL,
11 C_INT,
12 C_FLOAT,
13 C_STRING,
14 EXT_BOOL
15} OptionType_t;
16
17typedef union {
18 int intBoolVal;
19 float floatVal;
20 uint8_t* extBoolVal;
21 char* stringVal;
22 cmd_callback callback;
23} OptionValue_t;
24
25typedef struct {
26 char* name;
27 char* description;
28 OptionType_t type;
29 OptionValue_t defaultValue;
30 OptionValue_t value;
31} ConfigOption_t;
32
33typedef struct {
34 char* name;
35 char* description;
36 ConfigOption_t options[20];
37} ConfigSection_t;
38
39
40void DDrConfig(int argc, char* argv[]);
41void DDrConfig_WriteIni();
42
43ConfigOption_t* DDrConfig_GetOptOfType(const char* fullOptName, OptionType_t type);
44const char* DDrConfig_GetOptionTypeName(OptionType_t type);
45const char* DDrConfig_GetOptionValueString(ConfigOption_t* opt, char printdefault);
46char DDrConfig_NonDefaultOptionValue(ConfigOption_t* opt);
47
48#endif
Note: See TracBrowser for help on using the repository browser.