1 /***************************************************************************
3 * Copyright (C) Lakshya Solutions Ltd. All rights reserved. *
5 ***************************************************************************/
27 //All the members of the configuration file
28 char logFile
[MAX_FILE_PATH_LEN
];
29 char dbFile
[MAX_FILE_PATH_LEN
];
30 char tableConfigFile
[MAX_FILE_PATH_LEN
];
31 char dsConfigFile
[MAX_FILE_PATH_LEN
];// DSN Config file
32 char stderrFile
[MAX_FILE_PATH_LEN
];
33 char conflResoFile
[MAX_FILE_PATH_LEN
];
60 char dsn
[IDENTIFIER_LENGTH
];
62 long offlineLogFileSize
;
66 int nwResponseTimeout
;
84 strcpy(logFile
, "/tmp/log/log.out");
85 strcpy(dbFile
, "/tmp/csql/db");
86 strcpy(tableConfigFile
, "/tmp/csql/csqltable.conf");
87 strcpy(dsConfigFile
,"/tmp/csql/csqlds.conf"); // DSN Config file
88 strcpy(stderrFile
, "stderr");
89 strcpy(conflResoFile
, "/tmp/csql/ConflResoFile.txt");
93 isCsqlSqlServer
= false;
100 maxSysSize
= 10485760;
101 maxDbSize
= 104857600;
116 strcpy(dsn
,"myodbc3");
118 offlineLogFileSize
= 1048576;
125 asyncMsgMax
= 8192; //default for linux
130 isCacheNoParam
= false;
133 chkptRedoLimit
= 10485760;
142 int readLine(FILE *fp
, char * buffer
);
143 int storeKeyVal(char *key
, char *val
);
144 int validateValues();
147 Config() { isLoaded
= false; }
148 int readAllValues(char *filename
);
151 inline int getPageSize() { return cVal
.pageSize
; }
152 inline int getMaxProcs() { return cVal
.maxProcs
; }
153 inline long getMaxSysDbSize() { return cVal
.maxSysSize
; }
154 inline long getMaxDbSize() { return cVal
.maxDbSize
; }
155 inline int getSysDbKey() { return cVal
.sysDbKey
; }
156 inline int getUserDbKey() { return cVal
.userDbKey
; }
157 inline bool useMmap() { return cVal
.mmap
; }
158 inline char* getLogFile() { return cVal
.logFile
; }
159 inline char* getDbFile() { return cVal
.dbFile
; }
160 inline long getMapAddress() { return cVal
.mapAddr
; }
161 inline int getMutexSecs() { return cVal
.mutexSecs
; }
162 inline int getMutexUSecs() { return cVal
.mutexUSecs
; }
163 inline int getMutexRetries() { return cVal
.mutexRetries
; }
164 inline int getLockSecs() { return cVal
.lockSecs
; }
165 inline int getLockUSecs() { return cVal
.lockUSecs
; }
166 inline int getLockRetries() { return cVal
.lockRetries
; }
167 inline int getSiteID(){ return cVal
.siteID
;}
168 inline bool useCache() { return cVal
.isCache
; }
169 inline int getCacheMode() { return (int) cVal
.mode
; }
170 inline long getOfflineLogFileSize() { return cVal
.offlineLogFileSize
; }
171 inline char* getDSN() { return cVal
.dsn
; }
172 inline char* getDsConfigFile() { return cVal
.dsConfigFile
; }
173 inline char* getTableConfigFile() { return cVal
.tableConfigFile
; }
174 inline char* getStderrFile() { return cVal
.stderrFile
; }
175 inline bool useDurability() { return cVal
.isDurable
; }
176 inline int getDurableMode() { return cVal
.durableMode
; }
177 inline bool useCsqlSqlServer() { return cVal
.isCsqlSqlServer
; }
178 inline int getPort() { return cVal
.port
; }
179 inline char* getConflResoFile() { return cVal
.conflResoFile
; }
180 inline long getMaxQueueLogs() { return cVal
.maxQueueLogs
; }
181 inline int getMsgKey() { return cVal
.msgKey
; }
182 inline int getAsyncMsgMax() { return cVal
.asyncMsgMax
; }
183 inline int getShmIDKey() { return cVal
.shmKeyForId
; }
184 inline int getNetworkResponseTimeout() { return cVal
.nwResponseTimeout
; }
185 inline int getNetworkConnectTimeout() { return cVal
.nwConnectTimeout
; }
186 inline bool useTwoWayCache() { return cVal
.isTwoWay
; }
187 inline int getCacheWaitSecs() { return cVal
.cacheWaitSecs
; }
188 inline int getLogLevel() { return cVal
.logLevel
; }
189 inline int getNoOfProcessors() { return cVal
.noOfProcessors
; }
190 inline int getStmtCacheSize() { return cVal
.stmtCacheSize
; }
191 inline bool useCacheNoParam() { return cVal
.isCacheNoParam
; }
192 inline bool useMonitorServers() { return cVal
.isMonitor
; }
193 inline int getChkptSecs() { return cVal
.chkptSecs
; }
194 inline int getChkptRedoLimit() { return cVal
.chkptRedoLimit
; }
201 static Config config
;
202 static Logger logger
;