The Record Iteration Group contains the API for iterating over records in an MDBM. More...
Classes | |
struct | mdbm_page_info |
struct | mdbm_entry_info |
struct | mdbm_iterate_info |
Macros | |
#define | MDBM_ENTRY_DELETED 0x1 |
#define | MDBM_ENTRY_LARGE_OBJECT 0x2 |
#define | MDBM_ITERATE_ENTRIES 0x01 |
Iterate over page entries. More... | |
#define | MDBM_ITERATE_NOLOCK 0x80 |
Iterate without locking. More... | |
Typedefs | |
typedef struct mdbm_page_info | mdbm_page_info_t |
typedef struct mdbm_entry_info | mdbm_entry_info_t |
typedef struct mdbm_iterate_info | mdbm_iterate_info_t |
typedef int(* | mdbm_iterate_func_t )(void *user, const mdbm_iterate_info_t *info, const kvpair *kv) |
Functions | |
kvpair | mdbm_first (MDBM *db) |
Returns the first key/value pair from the database. More... | |
kvpair | mdbm_first_r (MDBM *db, MDBM_ITER *iter) |
Fetches the first record in an MDBM. More... | |
kvpair | mdbm_next (MDBM *db) |
Returns the next key/value pair from the database. More... | |
kvpair | mdbm_next_r (MDBM *db, MDBM_ITER *iter) |
Fetches the next record in an MDBM. More... | |
datum | mdbm_firstkey (MDBM *db) |
Returns the first key from the database. More... | |
datum | mdbm_firstkey_r (MDBM *db, MDBM_ITER *iter) |
Fetches the first key in an MDBM. More... | |
datum | mdbm_nextkey (MDBM *db) |
Returns the next key pair from the database. More... | |
datum | mdbm_nextkey_r (MDBM *db, MDBM_ITER *iter) |
Fetches the next key in an MDBM. More... | |
int | mdbm_iterate (MDBM *db, int pagenum, mdbm_iterate_func_t func, int flags, void *user) |
Iterates through all keys starting on page pagenum and continuing through the rest of the database. More... | |
The Record Iteration Group contains the API for iterating over records in an MDBM.
#define MDBM_ENTRY_DELETED 0x1 |
#define MDBM_ENTRY_LARGE_OBJECT 0x2 |
#define MDBM_ITERATE_ENTRIES 0x01 |
Iterate over page entries.
#define MDBM_ITERATE_NOLOCK 0x80 |
Iterate without locking.
typedef struct mdbm_page_info mdbm_page_info_t |
typedef struct mdbm_entry_info mdbm_entry_info_t |
typedef struct mdbm_iterate_info mdbm_iterate_info_t |
typedef int(* mdbm_iterate_func_t)(void *user, const mdbm_iterate_info_t *info, const kvpair *kv) |
Returns the first key/value pair from the database.
The order that records are returned is not specified.
[in,out] | db | Database handle |
Fetches the first record in an MDBM.
Initializes the iterator, and returns the first key/value pair from the db. Subsequent calls to mdbm_next_r or mdbm_nextkey_r with this iterator will loop through the entire db.
[in,out] | db | Database handle |
[in,out] | iter | MDBM iterator |
Returns the next key/value pair from the database.
The order that records are returned is not specified.
[in,out] | db | Database handle |
Fetches the next record in an MDBM.
Returns the next key/value pair from the db, based on the iterator.
[in,out] | db | Database handle |
[in,out] | iter | MDBM iterator |
Returns the first key from the database.
The order that records are returned is not specified.
[in,out] | db | Database handle |
Fetches the first key in an MDBM.
Initializes the iterator, and returns the first key from the db. Subsequent calls to mdbm_next_r or mdbm_nextkey_r with this iterator will loop through the entire db.
[in,out] | db | Database handle |
[in,out] | iter | MDBM iterator |
Returns the next key pair from the database.
The order that records are returned is not specified.
[in,out] | db | Database handle |
Fetches the next key in an MDBM.
Returns the next key from the db. Subsequent calls to mdbm_next_r or mdbm_nextkey_r with this iterator will loop through the entire db.
[in,out] | db | Database handle |
[in,out] | iter | MDBM iterator |
int mdbm_iterate | ( | MDBM * | db, |
int | pagenum, | ||
mdbm_iterate_func_t | func, | ||
int | flags, | ||
void * | user | ||
) |
Iterates through all keys starting on page pagenum and continuing through the rest of the database.
If flags contains MDBM_ITERATE_ENTRIES, function func is invoked for each record. If flag does not have MDBM_ITERATE_ENTRIES set, then func is invoke once per page with kv set to NULL.
[in,out] | db | Database handle |
[in] | pagenum | Starting page number |
[in] | func | Function to invoke for each key |
[in] | flags | iteration control (below) |
[in] | user | User-supplied opaque pointer to pass to func |
-1 | Error |
0 | Success |
Values for flags mask: