.TH "Compatibility Macros" 3 "Mon Oct 13 2014" "LMDB" \" -*- nroff -*- .ad l .nh .SH NAME Compatibility Macros \- .SS "Macros" .in +1c .ti -1c .RI "#define \fBMDB_DEVEL\fP 0" .br .ti -1c .RI "#define \fBmdb_func_\fP ''" .br .ti -1c .RI "#define \fBTHREAD_RET\fP void *" .br .ti -1c .RI "#define \fBTHREAD_CREATE\fP(thr, start, arg) pthread_create(&thr,NULL,start,arg)" .br .ti -1c .RI "#define \fBTHREAD_FINISH\fP(thr) pthread_join(thr,NULL)" .br .ti -1c .RI "#define \fBZ\fP 'z'" .br .ti -1c .RI "#define \fBMDB_PIDLOCK\fP 1" .br .ti -1c .RI "#define \fBLOCK_MUTEX_R\fP(env) pthread_mutex_lock(&(env)->me_txns->mti_mutex)" .br .ti -1c .RI "#define \fBUNLOCK_MUTEX_R\fP(env) pthread_mutex_unlock(&(env)->me_txns->mti_mutex)" .br .ti -1c .RI "#define \fBLOCK_MUTEX_W\fP(env) pthread_mutex_lock(&(env)->me_txns->mti_wmutex)" .br .ti -1c .RI "#define \fBUNLOCK_MUTEX_W\fP(env) pthread_mutex_unlock(&(env)->me_txns->mti_wmutex)" .br .ti -1c .RI "#define \fBErrCode\fP() errno" .br .ti -1c .RI "#define \fBHANDLE\fP int" .br .ti -1c .RI "#define \fBINVALID_HANDLE_VALUE\fP (-1)" .br .ti -1c .RI "#define \fBGET_PAGESIZE\fP(x) ((x) = sysconf(_SC_PAGE_SIZE))" .br .ti -1c .RI "#define \fBMNAME_LEN\fP (sizeof(pthread_mutex_t))" .br .in -1c .SH "Detailed Description" .PP A bunch of macros to minimize the amount of platform-specific ifdefs needed throughout the rest of the code\&. When the features this library needs are similar enough to POSIX to be hidden in a one-or-two line replacement, this macro approach is used\&. .SH "Macro Definition Documentation" .PP .SS "#define MDB_DEVEL 0" Features under development .SS "#define mdb_func_ ''" Wrapper around \fBfunc\fP, which is a C99 feature .SS "#define Z 'z'" printf format modifier for size_t .SS "#define MDB_PIDLOCK 1" For MDB_LOCK_FORMAT: True if readers take a pid lock in the lockfile .SS "#define LOCK_MUTEX_R(env) pthread_mutex_lock(&(env)->me_txns->mti_mutex)" Lock the reader mutex\&. .SS "#define UNLOCK_MUTEX_R(env) pthread_mutex_unlock(&(env)->me_txns->mti_mutex)" Unlock the reader mutex\&. .SS "#define LOCK_MUTEX_W(env) pthread_mutex_lock(&(env)->me_txns->mti_wmutex)" Lock the writer mutex\&. Only a single write transaction is allowed at a time\&. Other writers will block waiting for this mutex\&. .SS "#define UNLOCK_MUTEX_W(env) pthread_mutex_unlock(&(env)->me_txns->mti_wmutex)" Unlock the writer mutex\&. .SS "#define ErrCode() errno" Get the error code for the last failed system function\&. .SS "#define HANDLE int" An abstraction for a file handle\&. On POSIX systems file handles are small integers\&. On Windows they're opaque pointers\&. .SS "#define INVALID_HANDLE_VALUE (-1)" A value for an invalid file handle\&. Mainly used to initialize file variables and signify that they are unused\&. .SS "#define GET_PAGESIZE(x) ((x) = sysconf(_SC_PAGE_SIZE))" Get the size of a memory page for the system\&. This is the basic size that the platform's memory manager uses, and is fundamental to the use of memory-mapped files\&. .SH "Author" .PP Generated automatically by Doxygen for LMDB from the source code\&.