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
;
78 strcpy(logFile
, "/tmp/log/log.out");
79 strcpy(dbFile
, "/tmp/csql/db");
80 strcpy(tableConfigFile
, "/tmp/csql/csqltable.conf");
81 strcpy(dsConfigFile
,"/tmp/csql/csqlds.conf"); // DSN Config file
82 strcpy(stderrFile
, "stderr");
83 strcpy(conflResoFile
, "/tmp/csql/ConflResoFile.txt");
87 isCsqlSqlServer
= false;
94 maxSysSize
= 10485760;
95 maxDbSize
= 104857600;
110 strcpy(dsn
,"myodbc3");
118 asyncMsgMax
= 8192; //default for linux
123 isCacheNoParam
= false;
132 int readLine(FILE *fp
, char * buffer
);
133 int storeKeyVal(char *key
, char *val
);
134 int validateValues();
137 Config() { isLoaded
= false; }
138 int readAllValues(char *filename
);
141 inline int getPageSize() { return cVal
.pageSize
; }
142 inline int getMaxProcs() { return cVal
.maxProcs
; }
143 inline long getMaxSysDbSize() { return cVal
.maxSysSize
; }
144 inline long getMaxDbSize() { return cVal
.maxDbSize
; }
145 inline int getSysDbKey() { return cVal
.sysDbKey
; }
146 inline int getUserDbKey() { return cVal
.userDbKey
; }
147 inline bool useMmap() { return cVal
.mmap
; }
148 inline char* getLogFile() { return cVal
.logFile
; }
149 inline char* getDbFile() { return cVal
.dbFile
; }
150 inline long getMapAddress() { return cVal
.mapAddr
; }
151 inline int getMutexSecs() { return cVal
.mutexSecs
; }
152 inline int getMutexUSecs() { return cVal
.mutexUSecs
; }
153 inline int getMutexRetries() { return cVal
.mutexRetries
; }
154 inline int getLockSecs() { return cVal
.lockSecs
; }
155 inline int getLockUSecs() { return cVal
.lockUSecs
; }
156 inline int getLockRetries() { return cVal
.lockRetries
; }
157 inline int getSiteID(){ return cVal
.siteID
;}
158 inline bool useCache() { return cVal
.isCache
; }
159 inline int getCacheMode() { return (int) cVal
.mode
; }
160 inline char* getDSN() { return cVal
.dsn
; }
161 inline char* getDsConfigFile() { return cVal
.dsConfigFile
; }
162 inline char* getTableConfigFile() { return cVal
.tableConfigFile
; }
163 inline char* getStderrFile() { return cVal
.stderrFile
; }
164 inline bool useDurability() { return cVal
.isDurable
; }
165 inline int getDurableMode() { return cVal
.durableMode
; }
166 inline bool useCsqlSqlServer() { return cVal
.isCsqlSqlServer
; }
167 inline int getPort() { return cVal
.port
; }
168 inline char* getConflResoFile() { return cVal
.conflResoFile
; }
169 inline long getMaxQueueLogs() { return cVal
.maxQueueLogs
; }
170 inline int getMsgKey() { return cVal
.msgKey
; }
171 inline int getAsyncMsgMax() { return cVal
.asyncMsgMax
; }
172 inline int getShmIDKey() { return cVal
.shmKeyForId
; }
173 inline int getNetworkResponseTimeout() { return cVal
.nwResponseTimeout
; }
174 inline int getNetworkConnectTimeout() { return cVal
.nwConnectTimeout
; }
175 inline bool useTwoWayCache() { return cVal
.isTwoWay
; }
176 inline int getCacheWaitSecs() { return cVal
.cacheWaitSecs
; }
177 inline int getLogLevel() { return cVal
.logLevel
; }
178 inline int getNoOfProcessors() { return cVal
.noOfProcessors
; }
179 inline int getStmtCacheSize() { return cVal
.stmtCacheSize
; }
180 inline bool useCacheNoParam() { return cVal
.isCacheNoParam
; }
187 static Config config
;
188 static Logger logger
;