source: Daodan/src/Daodan_Config.h@ 1172

Last change on this file since 1172 was 1162, checked in by rossy, 3 years ago

Daodan: Add float-type config options

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