other versions
- jessie 0.9.14-1
- jessie-backports 0.9.18-1~bpo80+1
- stretch 0.9.18-5
- testing 0.9.22-1
- unstable 0.9.22-1
ID List Management(3) | Library Functions Manual | ID List Management(3) |
NAME¶
ID List Management -Data Structures¶
struct MDB_ID2
Macros¶
#define MDB_IDL_LOGN 16 /* DB_SIZE is 2^16, UM_SIZE is 2^17 */
Typedefs¶
typedef size_t MDB_ID
Functions¶
unsigned mdb_midl_search (MDB_IDL ids, MDB_ID id)
Detailed Description¶
Data Structure Documentation¶
struct MDB_ID2¶
An ID2 is an ID/pointer pair.Data Fields
MDB_ID mid
Field Documentation¶
MDB_ID MDB_ID2::mid¶
The IDvoid* MDB_ID2::mptr¶
The pointerMacro 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 MDB_ID¶
A generic unsigned ID number. These were entryIDs in back-bdb. Preferably it should have the same size as a pointer.typedef MDB_ID* MDB_IDL¶
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 MDB_ID2* MDB_ID2L¶
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 ( MDB_IDLids, MDB_IDid)¶
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.
MDB_IDL 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 ( MDB_IDLids)¶
Free an IDL. Parameters:ids The IDL to free.
void mdb_midl_shrink ( MDB_IDL *idp)¶
Shrink an IDL. Return the IDL to the default size if it has grown larger. Parameters:idp Address of the IDL to shrink.
int mdb_midl_need ( MDB_IDL *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 ( MDB_IDL *idp, MDB_IDid)¶
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 ( MDB_IDL *idp, MDB_IDLapp)¶
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 ( MDB_IDL *idp, MDB_IDid, 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 ( MDB_IDLidl, MDB_IDLmerge)¶
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 ( MDB_IDLids)¶
Sort an IDL. Parameters:ids The IDL to sort.
unsigned mdb_mid2l_search ( MDB_ID2Lids, MDB_IDid)¶
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 ( MDB_ID2Lids, MDB_ID2 *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 ( MDB_ID2Lids, MDB_ID2 *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.Wed May 18 2016 | LMDB |