ViewVC Help
View File | Revision Log | View Changeset | Root Listing
root/Oni2/Daodan/src/Daodan_Config.h
Revision: 1162
Committed: Sun Oct 24 02:50:32 2021 UTC (3 years, 11 months ago) by rossy
Content type: text/x-chdr
File size: 974 byte(s)
Log Message:
Daodan: Add float-type config options

File Contents

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