ViewVC Help
View File | Revision Log | View Changeset | Root Listing
root/Oni2/Daodan/src/Daodan_Config.h
Revision: 1000
Committed: Sun May 4 18:17:11 2014 UTC (11 years, 5 months ago) by alloc
Content type: text/x-chdr
File size: 945 byte(s)
Log Message:
Daodan 3.7

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_STRING,
13 EXT_BOOL
14 } OptionType_t;
15
16 typedef union {
17 int intBoolVal;
18 uint8_t* extBoolVal;
19 char* stringVal;
20 cmd_callback callback;
21 } OptionValue_t;
22
23 typedef struct {
24 char* name;
25 char* description;
26 OptionType_t type;
27 OptionValue_t defaultValue;
28 OptionValue_t value;
29 } ConfigOption_t;
30
31 typedef struct {
32 char* name;
33 char* description;
34 ConfigOption_t options[20];
35 } ConfigSection_t;
36
37
38 void DDrConfig(int argc, char* argv[]);
39 void DDrConfig_WriteIni();
40
41 ConfigOption_t* DDrConfig_GetOptOfType(const char* fullOptName, OptionType_t type);
42 const char* DDrConfig_GetOptionTypeName(OptionType_t type);
43 const char* DDrConfig_GetOptionValueString(ConfigOption_t* opt, char printdefault);
44 char DDrConfig_NonDefaultOptionValue(ConfigOption_t* opt);
45
46 #endif