1 //-< CONFIG.H >------------------------------------------------------*--------*
2 // FastDB                    Version 1.0         (c) 1999  GARRET    *     ?  *
3 // (Post Relational Database Management System)                      *   /\|  *
4 //                                                                   *  /  \  *
5 //                          Created:     21-Jan-2004  K.A. Knizhnik  * / [] \ *
6 //                          Last update: 21-Jan-2004  K.A. Knizhnik  * GARRET *
7 //-------------------------------------------------------------------*--------*
8 // FastDB configuration definitions
9 //-------------------------------------------------------------------*--------*
10 
11 #ifndef __CONFIG_H__
12 #define __CONFIG_H__
13 
14 #ifdef HAVE_CONFIG_H
15 #include "acconfig.h"
16 
17 #else // not HAVE_CONFIG_H
18 
19 #if (defined(_WIN32) || defined(_WINCE)) && (!defined(_CRT_SECURE_NO_DEPRECATE))
20 #define _CRT_SECURE_NO_DEPRECATE true
21 #endif
22 
23 #ifdef VXWORKS
24 #ifndef UNIX
25 #define UNIX 1
26 #endif
27 #endif // VXWORKS
28 
29 // USE_LOCALE_SETTINGS - use C locale for string comparison operations
30 #define USE_LOCALE_SETTINGS 1
31 
32 // FASTDB_DEBUG - debug level
33 //    - DEBUG_NONE - disable any checking and tracing (except asserts)
34 //    - DEBUG_CHECK - disable trace message
35 //    - DEBUG_TRACE_IMPORTANT - enable trace of important messages
36 //    - DEBUG_TRACE_ALL - enable trace of all messages
37 #define FASTDB_DEBUG DEBUG_TRACE_IMPORTANT
38 //#define FASTDB_DEBUG DEBUG_TRACE_ALL
39 
40 // USE_NAMESPACES - place FastDB classes in separate namespace
41 // #define USE_NAMESPACES 1
42 
43 // SECURE_SERVER - enable authentication for remote logins: keep user/password table,
44 //   check password for remote logins
45 //#define SECURE_SERVER 1
46 
47 // USE_QUEUE_MANAGER - use queue manager for internal HTTP server.
48 //   This manager will manage pool of threads assigned for client connections.
49 //   Otherwise all requests will be executed sequnetially in the main loop.
50 //#define USE_QUEUE_MANAGER 1
51 
52 
53 // FASTDB_DLL - create fastdb.dll
54 //#define FASTDB_DLL 1
55 
56 
57 // THROW_EXCEPTION_ON_ERROR - throw C++ exception in case of database error instead of abort()
58 #ifndef _WINCE
59 #define THROW_EXCEPTION_ON_ERROR 1
60 #endif
61 
62 
63 //IGNORE_CASE - perform all string comparisons as case insensitive
64 //#define IGNORE_CASE 1
65 
66 //USE_STD_STRING - accept std::string class as table field type
67 #define USE_STD_STRING 1
68 
69 //AUTOINCREMENT_SUPPORT - support autoincrement fields
70 //  (database built with this flag will be incompatible with database built without it)
71 #define AUTOINCREMENT_SUPPORT 1
72 
73 //CLONE_IDENTIFIERS - do not storef addresses of string constants in symbol table.
74 //  This option is needed if DLL library using FastDB can be unloaded.
75 //#define CLONE_IDENTIFIERS 1
76 
77 #ifdef VXWORKS
78 #define DISKLESS_CONFIGURATION 1
79 #endif // VXWORKS
80 //DISKLESS_CONFIGURATION - only in-memory temporary database
81 //#define DISKLESS_CONFIGURATION 1
82 
83 // RECTANGLE_DIMENSION - dimension of built-in rectangle type
84 #define RECTANGLE_DIMENSION 2
85 
86 // RECTANGLE_COORDINATE_TYPE - type of rectanlge's coordinates
87 #define RECTANGLE_COORDINATE_TYPE int
88 //#define RECTANGLE_COORDINATE_TYPE double
89 
90 // RECTANGLE_AREA_TYPE - type of rectanlge's area
91 #define RECTANGLE_AREA_TYPE db_int8
92 //#define RECTANGLE_AREA_TYPE double
93 
94 //SET_NULL_DACL - use NULL DACL security descriptor for all synchronization objects.
95 //#define SET_NULL_DACL 1
96 
97 //INT8_IS_DEFINED - int8 type is defined at your system, in this case you should use db_int8 type instead
98 //#define INT8_IS_DEFINED 1
99 
100 #ifdef VXWORKS
101 #define USE_POSIX_SEMAPHORES 1
102 #endif // VXWORKS
103 //USE_POSIX_SEMAPHORES use POSIX sem_* sempahores instead of SysV semaphores
104 //     instead of SysV semaphores and shared memory
105 //#define USE_POSIX_SEMAPHORES 1
106 
107 // Use process shared pthread mutexes (PTHREAD_PROCESS_SHARED) instead of Sys-V semaphores.
108 // It provides 3-5 times increase of performance in case of large number of concurrent transactions.
109 // Please notice that process shared semaphreos are not supported by some OSes, for example by Mac OS-X
110 //#define USE_SHARED_PTHREAD_MUTEX 1
111 #if defined(__QNX__) || defined(__linux__)
112 #define USE_SHARED_PTHREAD_MUTEX 1
113 #endif
114 
115 //USE_POSIX_MMAP - if 1 then use Posix mmap for mapping database file and monitor,
116 //  if 0 - use SysV IPC shmem for allocating memory for database file and monitor,
117 //  if not defined - use mmap for mapping database file and shmem for allocating monitor
118 //#define USE_POSIX_MMAP 0
119 
120 //REPLICATION_SUPPORT - fault tolerant version of FastDB
121 //#define REPLICATION_SUPPORT 1
122 
123 #ifdef VXWORKS
124 #define NO_MMAP 1
125 #endif
126 //NO_MMAP do not use OS mappig of file on virtual memory. FastDB will track modification of
127 //  pages itself and save dirty pages in the file. If USE_POSIX_MMAP=0, memory for database is
128 //  allocated using shmat() and database can be shared by several processes,
129 //  otherwise - using valloc() and database can be accessed only by one process.
130 //#define NO_MMAP 1
131 
132 //FUZZY_CHECKPOINT allows to increase application performance, by performing writing to the file in
133 //  in a separate thread. In this case commit will not be blocked until all changes will be actually written to the disk,
134 //  write requests will be just linked into the queue from which them will be taken by writting thread and proceeded
135 //  in the same order as in commit. This apporach provides daatbase consistency in case of fault, but results
136 //  of several recently committed transaction can be lost in this case.
137 //  Fuzzy checkpointing works only in conjunction with NO_MMAP option, it means that data sharing is not allowed
138 //  in this case - database can be accessed only by one application.
139 //#define FUZZY_CHECKPOINT 1
140 
141 
142 //USE_MFC - use MFC (include "afx.h" instead of "windows.h")
143 //#define USE_MFC 1
144 
145 //USE_ATL - use Microsoft ATL
146 //#define USE_ATL 1
147 
148 // LARGE_DATABASE_SUPPORT - support databases with size larger than 4Gb.
149 // If this macro is defined FastDB maximal database size is limited by 1 terrabyte.
150 // Defnining this macro increase iniitial database size and object index size (because
151 // 64-bit offsetss are used instead fo 4-byte offsets). Also FastDB library compiled with
152 // LARGE_DATABASE_SUPPOR will not be able to work with database created by library
153 // built without LARGE_DATABASE_SUPPOR and visa versa.
154 #if !defined(_WIN32) || defined(_WIN64) // most unixes are now 64-bit, while 32-bit windows is still quite popular
155 #define LARGE_DATABASE_SUPPORT
156 #endif
157 
158 // dbDatabaseOidBits number of bits used to represent object identifier.
159 // So the number of objects in database is limited by 2**dbDatabaseOidBits.
160 // Default value of this parameter is 32, so maximal number of objects is limited by 2**32.
161 // The value of this parameter is used to estimate size of bitmap, so do not assign unnecessarily
162 // large values (for example 64)
163 //#define dbDatabaseOidBits 33
164 
165 // Do not use member templates
166 #if defined(__SUNPRO_CC_COMPAT) && __SUNPRO_CC_COMPAT == 4
167 #define  NO_MEMBER_TEMPLATES
168 #endif
169 
170 // Automatically detect and recover crash of one or more database clients.
171 // FastDB will start separate watchdog threads which will check if other processes working with database are
172 // alive.
173 // It is not recommended to use this mode because there are many cases when it works incorrectly.
174 // Preferable way of handling process failure is using of RECOVERABLE_CRITICAL_SECTION.
175 //#define AUTO_DETECT_PROCESS_CRASH 1
176 
177 // Use recoverable critical section (operating system is able to release
178 // critical section in case of crash of the process entered this critical section)
179 //#define RECOVERABLE_CRITICAL_SECTION 1
180 
181 // Do not flush chages to the disk during transaction commit. This option will greatly increase performance
182 // but can cause database corruption in case of crash
183 //#define NO_FLUSH_ON_COMMIT 1
184 
185 // dbDatabaseOidBits number of bits used to represent object identifier.
186 // So the number of objects in database is limited by 2**dbDatabaseOidBits.
187 // Default value of this parameter is 32, so maximal number of objects is limited by 2**32.
188 // Support of larger number of objects is possible only at 64-bit OS
189 // The value of this parameter is used to estimate size of bitmap, so do not assign unnecessarily
190 // large values (for example 64)
191 //#define dbDatabaseOidBits 33
192 
193 // dbDatabaseOffsetBits number of bits used to represent object offset in the storage
194 // So the maximal database size is limited by 2**dbDatabaseOidBits.
195 // Default value of this parameter is 32, so maximal number of objects is limited by 2**32.
196 // Support of larger database size only at 64-bit OS
197 // The value of this parameter is used to estimate size of bitmap, so do not assign unnecessarily
198 // large values (for example 64)
199 //#define dbDatabaseOffsetBits 38
200 
201 // USE_REGEX - use regex library. When this macro is defined FastDB provides
202 // MATCH command. GNU regex or compatible library and headers should be available.
203 //#define USE_REGEX true
204 
205 // Calling convention used for CLI callback functions
206 // You should use stdcall convention if you want to use CSharp CLI API
207 //#define CLI_CALLBACK_CC __stdcall
208 
209 // SOCK_LINGER - set SO_LINGER option. Value of SO_LINGER is specified using LINGER_TIME
210 // #define SOCK_LINGER 1
211 
212 
213 // Use reentrant version of localtime
214 #if !defined(__APPLE__) && !defined(_WIN32) && !defined(VXWORKS)
215 #define HAVE_LOCALTIME_R 1
216 #endif
217 
218 // Use reentrant version of localtime
219 #if !defined(__APPLE__) && !defined(_WIN32) && !defined(_AIX) && !defined(HAVE_GETHOSTBYNAME_R) && !defined(__NetBSD__) && !defined(VXWORKS)
220 #define HAVE_GETHOSTBYNAME_R 1
221 #endif
222 
223 // Protect replica from unintended access (data corruption)
224 //#define PROTECT_DATABASE 1
225 
226 // Wait acknowledgment that transaction is delivered to all slave nodes
227 //#define SYNCHRONOUS_REPLICATION true
228 
229 // PAD_HEADER - add pad field to the database header to make it possible to transfer
230 // file between systems with different alignment rules
231 // This pad field was unconditionally inserted in database header in 3.17 version
232 // of Perst which breaks backward compatibility. Because of the customers concerns
233 // in 3.39 version of Perst the "pad" field was wrapped with the following condition
234 // #if dbDatabaseOffsetBits > 32 && defined(ALIGN_HEADER)
235 // which in turn breaks compatibility with database created with 3.17-3.38 versions.
236 // Finally in 3.44 the condition was repalced with
237 // #if (dbDatabaseOffsetBits > 32 && defined(ALIGN_HEADER)) || defined(PAD_HEADER)
238 // So you should uncomment definition of PAD_HEADER to preserve compatibility with databases
239 // created by FastDB versions 3.17-3.38.
240 //#define PAD_HEADER
241 
242 // ALIGN_HEADER - align each field of dbHeader class on its size
243 // to make it possible to transfer file between systems with different alignment rules
244 //#define ALIGN_HEADER true
245 
246 // DO_NOT_REUSE_OID_WITHIN_SESSION - do not reuse OID of deallocated objects in the current session
247 //#define DO_NOT_REUSE_OID_WITHIN_SESSION true
248 
249 
250 // Use Doug Lea version of malloc instead of standard malloc
251 //#define USE_DLMALLOC true
252 
253 // Invoke dbDatabase::handleError instead of assert for internal errors.
254 // #define HANDLE_ASSERTION_FAILURES
255 
256 // Profile query execution
257 //#define PROFILE
258 
259 // Store information about lock owners
260 #ifndef DEBUG_LOCKS
261 #define DEBUG_LOCKS 0
262 #endif
263 
264 #ifndef STLPORT_WITH_VC6
265 #define STLPORT_WITH_VC6 0
266 #endif
267 
268 #ifndef HAVE_ZLIB
269 #define HAVE_ZLIB 0
270 #endif
271 
272 #endif // not HAVE_CONFIG_H
273 #endif
274 
275