Detailed Description

Data Structure Documentation

struct MDB_ID2

An ID2 is an ID/pointer pair.

Data Fields

MDB_ID mid

void * mptr

Field Documentation

\fBMDB_ID\fP MDB_ID2::mid

The ID

void* MDB_ID2::mptr

The pointer

Macro Definition Documentation

#define MDB_IDL_ALLOCLEN(ids) ( (ids)[-1] )

Current max length of an mdb_midl_alloc()ed IDL

#define mdb_midl_xappend(idl, id)

Value:

do { \
		MDB_ID *xidl = (idl), xlen = ++(xidl[0]);          xidl[xlen] = (id);      } while (0)

Append ID to IDL. The IDL must be big enough.

Typedef Documentation

typedef size_t \fBMDB_ID\fP

A generic unsigned ID number. These were entryIDs in back-bdb. Preferably it should have the same size as a pointer.

typedef \fBMDB_ID\fP* \fBMDB_IDL\fP

An IDL is an ID List, a sorted array of IDs. The first element of the array is a counter for how many actual IDs are in the list. In the original back-bdb code, IDLs are sorted in ascending order. For libmdb IDLs are sorted in descending order.

typedef \fBMDB_ID2\fP* \fBMDB_ID2L\fP

An ID2L is an ID2 List, a sorted array of ID2s. The first element's mid member is a count of how many actual elements are in the array. The mptr member of the first element is unused. The array is sorted in ascending order by mid.

Function Documentation

unsigned mdb_midl_search (\fBMDB_IDL\fPids, \fBMDB_ID\fPid)

Search for an ID in an IDL.

Parameters:

ids The IDL to search.

id The ID to search for.

Returns:

The index of the first ID greater than or equal to id.

\fBMDB_IDL\fP mdb_midl_alloc (intnum)

Allocate an IDL. Allocates memory for an IDL of the given size.

Returns:

IDL on success, NULL on failure.

void mdb_midl_free (\fBMDB_IDL\fPids)

Free an IDL.

Parameters:

ids The IDL to free.

int mdb_midl_shrink (\fBMDB_IDL\fP *idp)

Shrink an IDL. Return the IDL to the default size if it has grown larger.

Parameters:

idp Address of the IDL to shrink.

Returns:

0 on no change, non-zero if shrunk.

int mdb_midl_need (\fBMDB_IDL\fP *idp, unsignednum)

Make room for num additional elements in an IDL.

Parameters:

idp Address of the IDL.

num Number of elements to make room for.

Returns:

0 on success, ENOMEM on failure.

int mdb_midl_append (\fBMDB_IDL\fP *idp, \fBMDB_ID\fPid)

Append an ID onto an IDL.

Parameters:

idp Address of the IDL to append to.

id The ID to append.

Returns:

0 on success, ENOMEM if the IDL is too large.

int mdb_midl_append_list (\fBMDB_IDL\fP *idp, \fBMDB_IDL\fPapp)

Append an IDL onto an IDL.

Parameters:

idp Address of the IDL to append to.

app The IDL to append.

Returns:

0 on success, ENOMEM if the IDL is too large.

int mdb_midl_append_range (\fBMDB_IDL\fP *idp, \fBMDB_ID\fPid, unsignedn)

Append an ID range onto an IDL.

Parameters:

idp Address of the IDL to append to.

id The lowest ID to append.

n Number of IDs to append.

Returns:

0 on success, ENOMEM if the IDL is too large.

void mdb_midl_xmerge (\fBMDB_IDL\fPidl, \fBMDB_IDL\fPmerge)

Merge an IDL onto an IDL. The destination IDL must be big enough.

Parameters:

idl The IDL to merge into.

merge The IDL to merge.

void mdb_midl_sort (\fBMDB_IDL\fPids)

Sort an IDL.

Parameters:

ids The IDL to sort.

unsigned mdb_mid2l_search (\fBMDB_ID2L\fPids, \fBMDB_ID\fPid)

Search for an ID in an ID2L.

Parameters:

ids The ID2L to search.

id The ID to search for.

Returns:

The index of the first ID2 whose mid member is greater than or equal to id.

int mdb_mid2l_insert (\fBMDB_ID2L\fPids, \fBMDB_ID2\fP *id)

Insert an ID2 into a ID2L.

Parameters:

ids The ID2L to insert into.

id The ID2 to insert.

Returns:

0 on success, -1 if the ID was already present in the ID2L.

int mdb_mid2l_append (\fBMDB_ID2L\fPids, \fBMDB_ID2\fP *id)

Append an ID2 into a ID2L.

Parameters:

ids The ID2L to append into.

id The ID2 to append.

Returns:

0 on success, -2 if the ID2L is too big.

Author

Generated automatically by Doxygen for LMDB from the source code.