Update to latest lmdb.c/h from OpenLDAP repo (a05d9910ab2a68806206b00caf71176ada943440 git://git.openldap.org/openldap.git)
This commit is contained in:
parent
b0680972a5
commit
e1fd403018
2 changed files with 931 additions and 851 deletions
1749
c_src/lmdb.c
1749
c_src/lmdb.c
File diff suppressed because it is too large
Load diff
33
c_src/lmdb.h
33
c_src/lmdb.h
|
@ -144,6 +144,16 @@ typedef int mdb_mode_t;
|
|||
typedef mode_t mdb_mode_t;
|
||||
#endif
|
||||
|
||||
/** An abstraction for a file handle.
|
||||
* On POSIX systems file handles are small integers. On Windows
|
||||
* they're opaque pointers.
|
||||
*/
|
||||
#ifdef _WIN32
|
||||
typedef void *mdb_filehandle_t;
|
||||
#else
|
||||
typedef int mdb_filehandle_t;
|
||||
#endif
|
||||
|
||||
/** @defgroup mdb MDB API
|
||||
* @{
|
||||
* @brief OpenLDAP Lightning Memory-Mapped Database Manager
|
||||
|
@ -240,9 +250,9 @@ typedef void (MDB_rel_func)(MDB_val *item, void *oldptr, void *newptr, void *rel
|
|||
* @{
|
||||
*/
|
||||
/** mmap at a fixed address (experimental) */
|
||||
#define MDB_FIXEDMAP 0x01
|
||||
#define MDB_FIXEDMAP 0x01
|
||||
/** no environment directory */
|
||||
#define MDB_NOSUBDIR 0x4000
|
||||
#define MDB_NOSUBDIR 0x4000
|
||||
/** don't fsync after commit */
|
||||
#define MDB_NOSYNC 0x10000
|
||||
/** read only */
|
||||
|
@ -325,13 +335,11 @@ typedef enum MDB_cursor_op {
|
|||
Only for #MDB_DUPSORT */
|
||||
MDB_NEXT_MULTIPLE, /**< Return all duplicate data items at the next
|
||||
cursor position. Only for #MDB_DUPFIXED */
|
||||
MDB_NEXT_NODUP, /**< Position at first data item of next key.
|
||||
Only for #MDB_DUPSORT */
|
||||
MDB_NEXT_NODUP, /**< Position at first data item of next key */
|
||||
MDB_PREV, /**< Position at previous data item */
|
||||
MDB_PREV_DUP, /**< Position at previous data item of current key.
|
||||
Only for #MDB_DUPSORT */
|
||||
MDB_PREV_NODUP, /**< Position at last data item of previous key.
|
||||
Only for #MDB_DUPSORT */
|
||||
MDB_PREV_NODUP, /**< Position at last data item of previous key */
|
||||
MDB_SET, /**< Position at specified key */
|
||||
MDB_SET_KEY, /**< Position at specified key, return key + data */
|
||||
MDB_SET_RANGE /**< Position at first key greater than or equal to specified key. */
|
||||
|
@ -535,6 +543,17 @@ int mdb_env_open(MDB_env *env, const char *path, unsigned int flags, mdb_mode_t
|
|||
*/
|
||||
int mdb_env_copy(MDB_env *env, const char *path);
|
||||
|
||||
/** @brief Copy an MDB environment to the specified file descriptor.
|
||||
*
|
||||
* This function may be used to make a backup of an existing environment.
|
||||
* @param[in] env An environment handle returned by #mdb_env_create(). It
|
||||
* must have already been opened successfully.
|
||||
* @param[in] fd The filedescriptor to write the copy to. It must
|
||||
* have already been opened for Write access.
|
||||
* @return A non-zero error value on failure and 0 on success.
|
||||
*/
|
||||
int mdb_env_copyfd(MDB_env *env, mdb_filehandle_t fd);
|
||||
|
||||
/** @brief Return statistics about the MDB environment.
|
||||
*
|
||||
* @param[in] env An environment handle returned by #mdb_env_create()
|
||||
|
@ -1266,5 +1285,3 @@ int mdb_dcmp(MDB_txn *txn, MDB_dbi dbi, const MDB_val *a, const MDB_val *b);
|
|||
}
|
||||
#endif
|
||||
#endif /* _LMDB_H_ */
|
||||
|
||||
/* * http://gitorious.org/mdb/mdb/blobs/raw/b389341b4b2413804726276d01676a6a9d05346f/libraries/liblmdb/lmdb.h */
|
||||
|
|
Loading…
Reference in a new issue