config
 All Data Structures Files Functions Variables Enumerations Enumerator Macros Pages
config.h
Go to the documentation of this file.
1 #ifndef CONFIG_H
2 #define CONFIG_H
3 
18 #include <map.h>
19 #include <inipars.h>
20 
26 #define MRSYSTEM_CONFIG_FILE "/etc/mrsystem"
27 
31 #define MRSYSTEM_CFG_PROTO_MOTOROLA 0x01
32 #define MRSYSTEM_CFG_PROTO_MFX 0x02
33 #define MRSYSTEM_CFG_PROTO_DCC 0x04
34 
35 #define MRSYSTEM_CFG_SYSTEM_START "start"
36 #define MRSYSTEM_CFG_SYSTEM_STOP "stop"
37 #define MRSYSTEM_CFG_SYSTEM_HIDE "hide"
38 #define MRSYSTEM_CFG_SYSTEM_UNHIDE "unhide"
39 
40 #define MRSYSTEM_CFG_SYNC_PERIODIC 0x01
41 #define MRSYSTEM_CFG_SYNC_KEYBD 0x02
42 #define MRSYSTEM_CFG_SYNC_LAYOUT 0x04
43 #define MRSYSTEM_CFG_SYNC_MEM 0x08
44 #define MRSYSTEM_CFG_SYNC_CONTR 0x10
45 
46 #define DISABLE_WAKEUP_S88 "0"
47 
61 typedef struct {
62  Map *Config;
63  IniParsStruct *Parser;
64 } ConfigStruct;
65 
69 #define ConfigSetConfig(Data, Val) (Data)->Config=Val
70 #define ConfigSetParser(Data, Val) (Data)->Parser=Val
71 #define ConfigGetConfig(Data) (Data)->Config
72 #define ConfigGetParser(Data) (Data)->Parser
73 
75 void ConfigDestroy(ConfigStruct *Data);
76 void ConfigInit(ConfigStruct *Data, char *IniFile);
77 void ConfigExit(ConfigStruct *Data);
78 void ConfigReadfile(ConfigStruct *Data);
79 int ConfigCmdLine(ConfigStruct *Data, char *optstr, int argc, char *argv[]);
80 int ConfigGetIntVal(ConfigStruct *Data, CfgIntValues Value);
81 char *ConfigGetStrVal(ConfigStruct *Data, CfgStrValues Value);
82 void ConfigAddIntVal(ConfigStruct *Data, CfgIntValues ValueTyp, int Value);
83 void ConfigAddStrVal(ConfigStruct *Data, CfgStrValues ValueTyp, char *Value);
84 
85 #endif