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