1 |
#ifndef DAODAN_CONFIG_H |
2 |
#define DAODAN_CONFIG_H |
3 |
|
4 |
#include "stdint.h" |
5 |
|
6 |
typedef enum { |
7 |
C_BOOL, |
8 |
C_INT, |
9 |
C_STRING, |
10 |
EXT_BOOL |
11 |
} OptionType_t; |
12 |
|
13 |
typedef union { |
14 |
int intBoolVal; |
15 |
uint8_t* extBoolVal; |
16 |
char* stringVal; |
17 |
} OptionValue_t; |
18 |
|
19 |
typedef struct { |
20 |
char* name; |
21 |
char* description; |
22 |
OptionType_t type; |
23 |
OptionValue_t defaultValue; |
24 |
OptionValue_t value; |
25 |
} ConfigOption_t; |
26 |
|
27 |
typedef struct { |
28 |
char* name; |
29 |
char* description; |
30 |
ConfigOption_t options[50]; |
31 |
} ConfigSection_t; |
32 |
|
33 |
|
34 |
void DDrConfig(int argc, char* argv[]); |
35 |
|
36 |
ConfigOption_t* DDrConfig_GetOptOfType(const char* fullOptName, OptionType_t type); |
37 |
const char* DDrConfig_GetOptionTypeName(OptionType_t type); |
38 |
|
39 |
#endif |