- gbServer_RunInBackground = Config_GetValue_Bool("daemonise", 0);
- gsCokebankPath = Config_GetValue("cokebank_database", 0);
- gsDoor_SerialPort = Config_GetValue("door_serial_port", 0);
- gsCoke_ModbusAddress = Config_GetValue("coke_modbus_address", 0);
- giServer_Port = Config_GetValue_Int("server_port", 0);
- gsItemListFile = Config_GetValue("items_file", 0);
+ {
+ bool rv = true;
+ #define REQ_CFG(variable, type, name) rv = Config_GetValue_##type(name, &variable) && rv
+ #define OPT_CFG(variable, type, name) Config_GetValue_##type(name, &variable)
+ OPT_CFG(gbServer_RunInBackground, Bool, "daemonise");
+ OPT_CFG(giServer_Port, Int, "server_port");
+
+ REQ_CFG(gsCokebankPath, Str, "cokebank_database");
+ REQ_CFG(gsItemListFile, Str, "items_file");