1 /***************************************************************************
3 * Copyright (C) Lakshya Solutions Ltd. All rights reserved. *
5 ***************************************************************************/
24 class DllExport ConfigValues
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
];
63 long offlineLogFileSize
;
67 int nwResponseTimeout
;
85 strcpy(logFile
, "/tmp/log/log.out");
86 strcpy(dbFile
, "/tmp/csql/db");
87 strcpy(tableConfigFile
, "/tmp/csql/csqltable.conf");
88 strcpy(dsConfigFile
,"/tmp/csql/csqlds.conf"); // DSN Config file
89 strcpy(stderrFile
, "stderr");
90 strcpy(conflResoFile
, "/tmp/csql/ConflResoFile.txt");
94 isCsqlSqlServer
= false;
101 maxSysSize
= 10485760;
102 maxDbSize
= 104857600;
117 strcpy(dsn
,"myodbc3");
120 offlineLogFileSize
= 1048576;
127 asyncMsgMax
= 8192; //default for linux
132 isCacheNoParam
= false;
135 chkptRedoLimit
= 10485760;
140 class DllExport Config
144 int readLine(FILE *fp
, char * buffer
);
145 int storeKeyVal(char *key
, char *val
);
146 int validateValues();
149 Config() { isLoaded
= false; }
150 int readAllValues(char *filename
);
153 inline int getPageSize() { return cVal
.pageSize
; }
154 inline int getMaxProcs() { return cVal
.maxProcs
; }
155 inline long getMaxSysDbSize() { return cVal
.maxSysSize
; }
156 inline long getMaxDbSize() { return cVal
.maxDbSize
; }
157 inline int getSysDbKey() { return cVal
.sysDbKey
; }
158 inline int getUserDbKey() { return cVal
.userDbKey
; }
159 inline bool useMmap() { return cVal
.mmap
; }
160 inline char* getLogFile() { return cVal
.logFile
; }
161 inline char* getDbFile() { return cVal
.dbFile
; }
162 inline long getMapAddress() { return cVal
.mapAddr
; }
163 inline int getMutexSecs() { return cVal
.mutexSecs
; }
164 inline int getMutexUSecs() { return cVal
.mutexUSecs
; }
165 inline int getMutexRetries() { return cVal
.mutexRetries
; }
166 inline int getLockSecs() { return cVal
.lockSecs
; }
167 inline int getLockUSecs() { return cVal
.lockUSecs
; }
168 inline int getLockRetries() { return cVal
.lockRetries
; }
169 inline int getSiteID(){ return cVal
.siteID
;}
170 inline bool useCache() { return cVal
.isCache
; }
171 inline int getCacheMode() { return (int) cVal
.mode
; }
172 inline long getOfflineLogFileSize() { return cVal
.offlineLogFileSize
; }
173 inline char* getDSN() { return cVal
.dsn
; }
174 inline int getNoOfRowsToFetchFromTDB() { return cVal
.nRowsToFetch
; }
175 inline char* getDsConfigFile() { return cVal
.dsConfigFile
; }
176 inline char* getTableConfigFile() { return cVal
.tableConfigFile
; }
177 inline char* getStderrFile() { return cVal
.stderrFile
; }
178 inline bool useDurability() { return cVal
.isDurable
; }
179 inline int getDurableMode() { return cVal
.durableMode
; }
180 inline bool useCsqlSqlServer() { return cVal
.isCsqlSqlServer
; }
181 inline int getPort() { return cVal
.port
; }
182 inline char* getConflResoFile() { return cVal
.conflResoFile
; }
183 inline long getMaxQueueLogs() { return cVal
.maxQueueLogs
; }
184 inline int getMsgKey() { return cVal
.msgKey
; }
185 inline int getAsyncMsgMax() { return cVal
.asyncMsgMax
; }
186 inline int getShmIDKey() { return cVal
.shmKeyForId
; }
187 inline int getNetworkResponseTimeout() { return cVal
.nwResponseTimeout
; }
188 inline int getNetworkConnectTimeout() { return cVal
.nwConnectTimeout
; }
189 inline bool useTwoWayCache() { return cVal
.isTwoWay
; }
190 inline int getCacheWaitSecs() { return cVal
.cacheWaitSecs
; }
191 inline int getLogLevel() { return cVal
.logLevel
; }
192 inline int getNoOfProcessors() { return cVal
.noOfProcessors
; }
193 inline int getStmtCacheSize() { return cVal
.stmtCacheSize
; }
194 inline bool useCacheNoParam() { return cVal
.isCacheNoParam
; }
195 inline bool useMonitorServers() { return cVal
.isMonitor
; }
196 inline int getChkptSecs() { return cVal
.chkptSecs
; }
197 inline int getChkptRedoLimit() { return cVal
.chkptRedoLimit
; }
204 static Config config
;
205 static Logger logger
;