Last change
on this file since 1171 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 |
|
---|
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
|
---|
Note:
See
TracBrowser
for help on using the repository browser.