Last change
on this file since 999 was 994, checked in by alloc, 11 years ago |
Daodan:
- Fix #80
- Reorganization of file hierarchy
|
File size:
772 bytes
|
Rev | Line | |
---|
[838] | 1 | #ifndef DAODAN_CONFIG_H
|
---|
| 2 | #define DAODAN_CONFIG_H
|
---|
| 3 |
|
---|
| 4 | #include "stdint.h"
|
---|
| 5 |
|
---|
[994] | 6 | typedef void (*cmd_callback)();
|
---|
| 7 |
|
---|
[993] | 8 | typedef enum {
|
---|
[994] | 9 | C_CMD,
|
---|
[993] | 10 | C_BOOL,
|
---|
| 11 | C_INT,
|
---|
| 12 | C_STRING,
|
---|
| 13 | EXT_BOOL
|
---|
| 14 | } OptionType_t;
|
---|
[838] | 15 |
|
---|
[993] | 16 | typedef union {
|
---|
| 17 | int intBoolVal;
|
---|
| 18 | uint8_t* extBoolVal;
|
---|
| 19 | char* stringVal;
|
---|
[994] | 20 | cmd_callback callback;
|
---|
[993] | 21 | } OptionValue_t;
|
---|
[838] | 22 |
|
---|
[993] | 23 | typedef struct {
|
---|
| 24 | char* name;
|
---|
| 25 | char* description;
|
---|
| 26 | OptionType_t type;
|
---|
| 27 | OptionValue_t defaultValue;
|
---|
| 28 | OptionValue_t value;
|
---|
| 29 | } ConfigOption_t;
|
---|
[838] | 30 |
|
---|
[993] | 31 | typedef struct {
|
---|
| 32 | char* name;
|
---|
| 33 | char* description;
|
---|
| 34 | ConfigOption_t options[50];
|
---|
| 35 | } ConfigSection_t;
|
---|
[838] | 36 |
|
---|
[993] | 37 |
|
---|
| 38 | void DDrConfig(int argc, char* argv[]);
|
---|
| 39 |
|
---|
| 40 | ConfigOption_t* DDrConfig_GetOptOfType(const char* fullOptName, OptionType_t type);
|
---|
| 41 | const char* DDrConfig_GetOptionTypeName(OptionType_t type);
|
---|
| 42 |
|
---|
[838] | 43 | #endif
|
---|
Note:
See
TracBrowser
for help on using the repository browser.