LMDB  1.0
Modules | Data Structures | Typedefs
LMDB API

Symas Lightning Memory-Mapped Database Manager. More...

Modules

 Version Macros
 
 Environment Flags
 
 Database Flags
 
 Write Flags
 

Data Structures

struct  MDB_val
 Generic structure used for passing keys and data in and out of the database. More...
 

Typedefs

typedef unsigned int MDB_dbi
 A handle for an individual database in the DB environment.
 
typedef int() MDB_cmp_func(const MDB_val *a, const MDB_val *b)
 A callback function used to compare two keys in a database.
 
typedef void() MDB_rel_func(MDB_val *item, void *oldptr, void *newptr, void *relctx)
 A callback function used to relocate a position-dependent data item in a fixed-address database. More...
 
typedef int() MDB_enc_func(const MDB_val *src, MDB_val *dst, const MDB_val *key, int encdec)
 A callback function used to encrypt/decrypt pages in the env. More...
 
typedef void() MDB_sum_func(const MDB_val *src, MDB_val *dst, const MDB_val *key)
 A callback function used to checksum pages in the env. More...
 

Detailed Description

Symas Lightning Memory-Mapped Database Manager.


Data Structure Documentation

◆ MDB_val

struct MDB_val

Generic structure used for passing keys and data in and out of the database.

Values returned from the database are valid only until a subsequent update operation, or the end of the transaction. Do not modify or free them, they commonly point into the database itself.

Key sizes must be between 1 and mdb_env_get_maxkeysize() inclusive. The same applies to data sizes in databases with the MDB_DUPSORT flag. Other data items can in theory be from 0 to 0xffffffff bytes long.

Data Fields

size_t mv_size
 
void * mv_data
 

Typedef Documentation

◆ MDB_rel_func

typedef void() MDB_rel_func(MDB_val *item, void *oldptr, void *newptr, void *relctx)

A callback function used to relocate a position-dependent data item in a fixed-address database.

The newptr gives the item's desired address in the memory map, and oldptr gives its previous address. The item's actual data resides at the address in item. This callback is expected to walk through the fields of the record in item and modify any values based at the oldptr address to be relative to the newptr address.

Parameters
[in,out]itemThe item that is to be relocated.
[in]oldptrThe previous address.
[in]newptrThe new address to relocate to.
[in]relctxAn application-provided context, set by mdb_set_relctx().
Todo:
This feature is currently unimplemented.

◆ MDB_enc_func

typedef int() MDB_enc_func(const MDB_val *src, MDB_val *dst, const MDB_val *key, int encdec)

A callback function used to encrypt/decrypt pages in the env.

Encrypt or decrypt the data in src and store the result in dst using the provided key. The result must be the same number of bytes as the input.

Parameters
[in]srcThe input data to be transformed.
[out]dstStorage for the result.
[in]keyAn array of three values: key[0] is the encryption key, key[1] is the initialization vector, and key[2] is the authentication data, if any.
[in]encdec1 to encrypt, 0 to decrypt.
Returns
A non-zero error value on failure and 0 on success.

◆ MDB_sum_func

typedef void() MDB_sum_func(const MDB_val *src, MDB_val *dst, const MDB_val *key)

A callback function used to checksum pages in the env.

Compute the checksum of the data in src and store the result in dst, An optional key may be used with keyed hash algorithms.

Parameters
[in]srcThe input data to be transformed.
[out]dstStorage for the result.
[in]keyAn encryption key, if encryption was configured. This parameter will be NULL if there is no key.