00001 //-< CONFIG.H >------------------------------------------------------*--------* 00002 // FastDB Version 1.0 (c) 1999 GARRET * ? * 00003 // (Post Relational Database Management System) * /\| * 00004 // * / \ * 00005 // Created: 21-Jan-2004 K.A. Knizhnik * / [] \ * 00006 // Last update: 21-Jan-2004 K.A. Knizhnik * GARRET * 00007 //-------------------------------------------------------------------*--------* 00008 // FastDB configuration definitions 00009 //-------------------------------------------------------------------*--------* 00010 00011 #ifndef __CONFIG_H__ 00012 #define __CONFIG_H__ 00013 00014 #if (defined(_WIN32) || defined(_WINCE)) && (!defined(_CRT_SECURE_NO_DEPRECATE)) 00015 #define _CRT_SECURE_NO_DEPRECATE true 00016 #endif 00017 00018 // USE_LOCALE_SETTINGS - use C locale for string comparison operations 00019 #define USE_LOCALE_SETTINGS 1 00020 00021 // FASTDB_DEBUG - debug level 00022 // - DEBUG_NONE - disable any checking and tracing (except asserts) 00023 // - DEBUG_CHECK - disable trace message 00024 // - DEBUG_TRACE_IMPORTANT - enable trace of important messages 00025 // - DEBUG_TRACE_ALL - enable trace of all messages 00026 #define FASTDB_DEBUG DEBUG_TRACE_IMPORTANT 00027 //#define FASTDB_DEBUG DEBUG_TRACE_ALL 00028 00029 // USE_NAMESPACES - place FastDB classes in separate namespace 00030 //#define USE_NAMESPACES 1 00031 00032 // SECURE_SERVER - enable authentication for remote logins: keep user/password table, 00033 // check password for remote logins 00034 //#define SECURE_SERVER 1 00035 00036 // USE_QUEUE_MANAGER - use queue manager for internal HTTP server. 00037 // This manager will manage pool of threads assigned for client connections. 00038 // Otherwise all requests will be executed sequnetially in the main loop. 00039 //#define USE_QUEUE_MANAGER 1 00040 00041 00042 // FASTDB_DLL - create fastdb.dll 00043 //#define FASTDB_DLL 1 00044 00045 00046 // THROW_EXCEPTION_ON_ERROR - throw C++ exception in case of database error instead of abort() 00047 #ifndef _WINCE 00048 #define THROW_EXCEPTION_ON_ERROR 1 00049 #endif 00050 00051 00052 //IGNORE_CASE - perform all string comparisons as case insensitive 00053 //#define IGNORE_CASE 1 00054 00055 //USE_STD_STRING - accept std::string class as table field type 00056 #ifdef _WIN32 00057 #define USE_STD_STRING 1 00058 #endif 00059 00060 //AUTOINCREMENT_SUPPORT - support autoincrement fields 00061 // (database built with this flag will be incompatible with database built without it) 00062 #define AUTOINCREMENT_SUPPORT 1 00063 00064 //CLONE_IDENTIFIERS - do not storef addresses of string constants in symbol table. 00065 // This option is needed if DLL library using FastDB can be unloaded. 00066 //#define CLONE_IDENTIFIERS 1 00067 00068 //DISKLESS_CONFIGURATION - only in-memory temporary database 00069 //#define DISKLESS_CONFIGURATION 1 00070 00071 // RECTANGLE_DIMENSION - dimension of built-in rectangle type 00072 #define RECTANGLE_DIMENSION 2 00073 00074 // RECTANGLE_COORDINATE_TYPE - type of rectanlge's coordinates 00075 #define RECTANGLE_COORDINATE_TYPE int 00076 //#define RECTANGLE_COORDINATE_TYPE double 00077 00078 // RECTANGLE_AREA_TYPE - type of rectanlge's area 00079 #define RECTANGLE_AREA_TYPE db_int8 00080 //#define RECTANGLE_AREA_TYPE double 00081 00082 //SET_NULL_DACL - use NULL DACL security descriptor for all synchronization objects. 00083 //#define SET_NULL_DACL 1 00084 00085 //INT8_IS_DEFINED - int8 type is defined at your system, in this case you should use db_int8 type instead 00086 //#define INT8_IS_DEFINED 1 00087 00088 //USE_POSIX_SEMAPHORES use POSIX sem_* sempahores instead of SysV semaphores 00089 // instead of SysV semaphores and shared memory 00090 //#define USE_POSIX_SEMAPHORES 1 00091 00092 00093 //USE_POSIX_MMAP - if 1 then use Posix mmap for mapping database file and monitor, 00094 // if 0 - use SysV IPC shmem for allocating memory for database file and monitor, 00095 // if not defined - use mmap for mapping database file and shmem for allocating monitor 00096 //#define USE_POSIX_MMAP 0 00097 00098 //REPLICATION_SUPPORT - fault tolerant version of FastDB 00099 //#define REPLICATION_SUPPORT 1 00100 00101 //NO_MMAP do not use OS mappig of file on virtual memory. FastDB will track modification of 00102 // pages itself and save dirty pages in the file. If USE_POSIX_MMAP=0, memory for database is 00103 // allocated using shmat() and database can be shared by several processes, 00104 // otherwise - using valloc() and database can be accessed only by one process. 00105 //#define NO_MMAP 1 00106 00107 //FUZZY_CHECKPOINT allows to increase application performance, by performing writing to the file in 00108 // in a separate thread. In this case commit will not be blocked until all changes will be actually written to the disk, 00109 // write requests will be just linked into the queue from which them will be taken by writting thread and proceeded 00110 // in the same order as in commit. This apporach provides daatbase consistency in case of fault, but results 00111 // of several recently committed transaction can be lost in this case. 00112 // Fuzzy checkpointing works only in conjunction with NO_MMAP option, it means that data sharing is not allowed 00113 // in this case - database can be accessed only by one application. 00114 //#define FUZZY_CHECKPOINT 1 00115 00116 00117 //USE_MFC - use MFC (include "afx.h" instead of "windows.h") 00118 //#define USE_MFC 1 00119 00120 //USE_ATL - use Microsoft ATL 00121 //#define USE_ATL 1 00122 00123 // Do not use member templates 00124 #if defined(__SUNPRO_CC_COMPAT) && __SUNPRO_CC_COMPAT == 4 00125 #define NO_MEMBER_TEMPLATES 00126 #endif 00127 00128 // Automatically detect and recover crash of one or more database clients. 00129 // FastDB will start separate watchdog threads which will check if other processes working with database are 00130 // alive. 00131 // It is not recommended to use this mode because there are many cases whern it works incorrectly. 00132 // Preferable way of handling process failure is using of RECOVERABLE_CRITICAL_SECTION. 00133 //#define AUTO_DETECT_PROCESS_CRASH 1 00134 00135 // Use recoverable critical section (operating system is able to release 00136 // critical section in case of crash of the process entered this critical section) 00137 //#define RECOVERABLE_CRITICAL_SECTION 1 00138 00139 // Do not flush chafges to the disk during transaction commit. This option will greatly increase performance 00140 // but can cause database corruption in case of crash 00141 //#define NO_FLUSH_ON_COMMIT 1 00142 00143 // dbDatabaseOidBits number of bits used to represent object identifier. 00144 // So the number of objects in database is limited by 2**dbDatabaseOidBits. 00145 // Default value of this parameter is 32, so maximal number of objects is limited by 2**32. 00146 // Support of larger number of objects is possible only at 64-bit OS 00147 // The value of this parameter is used to estimate size of bitmap, so do not assign unnecessarily 00148 // large values (for example 64) 00149 //#define dbDatabaseOidBits 33 00150 00151 // dbDatabaseOffsetBits number of bits used to represent object offset in the storage 00152 // So the maximal database size is limited by 2**dbDatabaseOidBits. 00153 // Default value of this parameter is 32, so maximal number of objects is limited by 2**32. 00154 // Support of larger database size only at 64-bit OS 00155 // The value of this parameter is used to estimate size of bitmap, so do not assign unnecessarily 00156 // large values (for example 64) 00157 //#define dbDatabaseOffsetBits 38 00158 00159 // USE_REGEX - use regex library. When this macro is defined GigaBASE provides 00160 // MATCH command. GNU regex or compatible library and headers should be available. 00161 //#define USE_REGEX true 00162 00163 // Calling convention used for CLI callback functions 00164 // You should use stdcall convention if you want to use CSharp CLI API 00165 //#define CLI_CALLBACK_CC __stdcall 00166 00167 // SOCK_LINGER - set SO_LINGER option. Value of SO_LINGER is specified using LINGER_TIME 00168 // #define SOCK_LINGER 1 00169 00170 00171 // Use reentrant version of localtime 00172 #if !defined(__APPLE__) && !defined(_WIN32) 00173 #define HAVE_LOCALTIME_R 00174 #endif 00175 00176 // Use reentrant version of localtime 00177 #if !defined(__APPLE__) && !defined(_WIN32) && !defined(_AIX) 00178 #define HAVE_GETHOSTBYNAME_R 00179 #endif 00180 00181 // Protect replica from unintended access (data corruption) 00182 //#define PROTECT_DATABASE 1 00183 00184 // Wait acknowledgment that transaction is delivered to all slave nodes 00185 //#define SYNCHRONOUS_REPLICATION true 00186 00187 // PAD_HEADER - add pad field to the database header to make it possible to transfer 00188 // file between systems with different alignment rules 00189 // This pad field was unconditionally inserted in database header in 3.17 version 00190 // of Perst which breaks backward compatibility. Because of the customers concerns 00191 // in 3.39 version of Perst the "pad" field was wrapped with the following condition 00192 // #if dbDatabaseOffsetBits > 32 && defined(ALIGN_HEADER) 00193 // which in turn breaks compatibility with database created with 3.17-3.38 versions. 00194 // Finally in 3.44 the condition was repalced with 00195 // #if (dbDatabaseOffsetBits > 32 && defined(ALIGN_HEADER)) || defined(PAD_HEADER) 00196 // So you should uncomment definition of PAD_HEADER to preserve compatibility with databases 00197 // created by FastDB versions 3.17-3.38. 00198 //#define PAD_HEADER 00199 00200 // ALIGN_HEADER - align each field of dbHeader class on its page boudary 00201 // to make it possible to transfer file between systems with different alignment rules 00202 //#define ALIGN_HEADER true 00203 00204 // DO_NOT_REUSE_OID_WITHIN_SESSION - do not reuse OID of deallocated objects in the current session 00205 //#define DO_NOT_REUSE_OID_WITHIN_SESSION true 00206 00207 00208 // Use Doug Lea version of malloc instead of standard malloc 00209 //#define USE_DLMALLOC true 00210 00211 // Invoke dbDatabase::handleError instead of assert for internal errors. 00212 // #define HANDLE_ASSERTION_FAILURES 00213 00214 #endif 00215