.TH "idls" 3 "Mon Jul 16 2018" "LMDB" \" -*- nroff -*- .ad l .nh .SH NAME idls .SH SYNOPSIS .br .PP .SS "Data Structures" .in +1c .ti -1c .RI "struct \fBMDB_ID2\fP" .br .in -1c .SS "Macros" .in +1c .ti -1c .RI "#define \fBMDB_IDL_LOGN\fP 16 /* DB_SIZE is 2^16, UM_SIZE is 2^17 */" .br .ti -1c .RI "#define \fBMDB_IDL_DB_SIZE\fP (1< (y) )" .br .ti -1c .RI "#define \fBSMALL\fP 8" .br .ti -1c .RI "#define \fBMIDL_SWAP\fP(a, b) { itmp=(a); (a)=(b); (b)=itmp; }" .br .in -1c .SS "Typedefs" .in +1c .ti -1c .RI "typedef size_t \fBMDB_ID\fP" .br .ti -1c .RI "typedef \fBMDB_ID\fP * \fBMDB_IDL\fP" .br .ti -1c .RI "typedef \fBMDB_ID2\fP * \fBMDB_ID2L\fP" .br .in -1c .SS "Functions" .in +1c .ti -1c .RI "unsigned \fBmdb_midl_search\fP (\fBMDB_IDL\fP ids, \fBMDB_ID\fP id)" .br .ti -1c .RI "\fBMDB_IDL\fP \fBmdb_midl_alloc\fP (int num)" .br .ti -1c .RI "void \fBmdb_midl_free\fP (\fBMDB_IDL\fP ids)" .br .ti -1c .RI "void \fBmdb_midl_shrink\fP (\fBMDB_IDL\fP *idp)" .br .ti -1c .RI "int \fBmdb_midl_need\fP (\fBMDB_IDL\fP *idp, unsigned num)" .br .ti -1c .RI "int \fBmdb_midl_append\fP (\fBMDB_IDL\fP *idp, \fBMDB_ID\fP id)" .br .ti -1c .RI "int \fBmdb_midl_append_list\fP (\fBMDB_IDL\fP *idp, \fBMDB_IDL\fP app)" .br .ti -1c .RI "int \fBmdb_midl_append_range\fP (\fBMDB_IDL\fP *idp, \fBMDB_ID\fP id, unsigned n)" .br .ti -1c .RI "void \fBmdb_midl_xmerge\fP (\fBMDB_IDL\fP idl, \fBMDB_IDL\fP merge)" .br .ti -1c .RI "void \fBmdb_midl_sort\fP (\fBMDB_IDL\fP ids)" .br .ti -1c .RI "unsigned \fBmdb_mid2l_search\fP (\fBMDB_ID2L\fP ids, \fBMDB_ID\fP id)" .br .ti -1c .RI "int \fBmdb_mid2l_insert\fP (\fBMDB_ID2L\fP ids, \fBMDB_ID2\fP *id)" .br .ti -1c .RI "int \fBmdb_mid2l_append\fP (\fBMDB_ID2L\fP ids, \fBMDB_ID2\fP *id)" .br .ti -1c .RI "static int \fBmdb_midl_grow\fP (\fBMDB_IDL\fP *idp, int num)" .br .in -1c .SH "Detailed Description" .PP .SH "Data Structure Documentation" .PP .SH "struct MDB_ID2" .PP An ID2 is an ID/pointer pair\&. .PP .in -1c .RI "\fBData Fields\fP" .in +1c .in +1c .ti -1c .RI "\fBMDB_ID\fP \fBmid\fP" .br .ti -1c .RI "void * \fBmptr\fP" .br .in -1c .SH "Field Documentation" .PP .SS "\fBMDB_ID\fP MDB_ID2::mid" The ID .SS "void* MDB_ID2::mptr" The pointer .SH "Macro Definition Documentation" .PP .SS "#define MDB_IDL_ALLOCLEN(ids) ( (ids)[\-1] )" Current max length of an \fBmdb_midl_alloc()\fPed IDL .SS "#define mdb_midl_xappend(idl, id)" \fBValue:\fP .PP .nf do { \ MDB_ID *xidl = (idl), xlen = ++(xidl[0]); \ xidl[xlen] = (id); \ } while (0) .fi Append ID to IDL\&. The IDL must be big enough\&. .SH "Typedef Documentation" .PP .SS "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\&. .SS "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\&. .SS "typedef \fBMDB_ID2\fP* \fBMDB_ID2L\fP" An ID2L is an ID2 List, a sorted array of ID2s\&. The first element's \fBmid\fP member is a count of how many actual elements are in the array\&. The \fBmptr\fP member of the first element is unused\&. The array is sorted in ascending order by \fBmid\fP\&. .SH "Function Documentation" .PP .SS "unsigned mdb_midl_search (\fBMDB_IDL\fP ids, \fBMDB_ID\fP id)" Search for an ID in an IDL\&. .PP \fBParameters:\fP .RS 4 \fIids\fP The IDL to search\&. .br \fIid\fP The ID to search for\&. .RE .PP \fBReturns:\fP .RS 4 The index of the first ID greater than or equal to \fBid\fP\&. .RE .PP .SS "\fBMDB_IDL\fP mdb_midl_alloc (int num)" Allocate an IDL\&. Allocates memory for an IDL of the given size\&. .PP \fBReturns:\fP .RS 4 IDL on success, NULL on failure\&. .RE .PP .SS "void mdb_midl_free (\fBMDB_IDL\fP ids)" Free an IDL\&. .PP \fBParameters:\fP .RS 4 \fIids\fP The IDL to free\&. .RE .PP .SS "void mdb_midl_shrink (\fBMDB_IDL\fP * idp)" Shrink an IDL\&. Return the IDL to the default size if it has grown larger\&. .PP \fBParameters:\fP .RS 4 \fIidp\fP Address of the IDL to shrink\&. .RE .PP .SS "int mdb_midl_need (\fBMDB_IDL\fP * idp, unsigned num)" Make room for num additional elements in an IDL\&. .PP \fBParameters:\fP .RS 4 \fIidp\fP Address of the IDL\&. .br \fInum\fP Number of elements to make room for\&. .RE .PP \fBReturns:\fP .RS 4 0 on success, ENOMEM on failure\&. .RE .PP .SS "int mdb_midl_append (\fBMDB_IDL\fP * idp, \fBMDB_ID\fP id)" Append an ID onto an IDL\&. .PP \fBParameters:\fP .RS 4 \fIidp\fP Address of the IDL to append to\&. .br \fIid\fP The ID to append\&. .RE .PP \fBReturns:\fP .RS 4 0 on success, ENOMEM if the IDL is too large\&. .RE .PP .SS "int mdb_midl_append_list (\fBMDB_IDL\fP * idp, \fBMDB_IDL\fP app)" Append an IDL onto an IDL\&. .PP \fBParameters:\fP .RS 4 \fIidp\fP Address of the IDL to append to\&. .br \fIapp\fP The IDL to append\&. .RE .PP \fBReturns:\fP .RS 4 0 on success, ENOMEM if the IDL is too large\&. .RE .PP .SS "int mdb_midl_append_range (\fBMDB_IDL\fP * idp, \fBMDB_ID\fP id, unsigned n)" Append an ID range onto an IDL\&. .PP \fBParameters:\fP .RS 4 \fIidp\fP Address of the IDL to append to\&. .br \fIid\fP The lowest ID to append\&. .br \fIn\fP Number of IDs to append\&. .RE .PP \fBReturns:\fP .RS 4 0 on success, ENOMEM if the IDL is too large\&. .RE .PP .SS "void mdb_midl_xmerge (\fBMDB_IDL\fP idl, \fBMDB_IDL\fP merge)" Merge an IDL onto an IDL\&. The destination IDL must be big enough\&. .PP \fBParameters:\fP .RS 4 \fIidl\fP The IDL to merge into\&. .br \fImerge\fP The IDL to merge\&. .RE .PP .SS "void mdb_midl_sort (\fBMDB_IDL\fP ids)" Sort an IDL\&. .PP \fBParameters:\fP .RS 4 \fIids\fP The IDL to sort\&. .RE .PP .SS "unsigned mdb_mid2l_search (\fBMDB_ID2L\fP ids, \fBMDB_ID\fP id)" Search for an ID in an ID2L\&. .PP \fBParameters:\fP .RS 4 \fIids\fP The ID2L to search\&. .br \fIid\fP The ID to search for\&. .RE .PP \fBReturns:\fP .RS 4 The index of the first ID2 whose \fBmid\fP member is greater than or equal to \fBid\fP\&. .RE .PP .SS "int mdb_mid2l_insert (\fBMDB_ID2L\fP ids, \fBMDB_ID2\fP * id)" Insert an ID2 into a ID2L\&. .PP \fBParameters:\fP .RS 4 \fIids\fP The ID2L to insert into\&. .br \fIid\fP The ID2 to insert\&. .RE .PP \fBReturns:\fP .RS 4 0 on success, -1 if the ID was already present in the ID2L\&. .RE .PP .SS "int mdb_mid2l_append (\fBMDB_ID2L\fP ids, \fBMDB_ID2\fP * id)" Append an ID2 into a ID2L\&. .PP \fBParameters:\fP .RS 4 \fIids\fP The ID2L to append into\&. .br \fIid\fP The ID2 to append\&. .RE .PP \fBReturns:\fP .RS 4 0 on success, -2 if the ID2L is too big\&. .RE .PP .SH "Author" .PP Generated automatically by Doxygen for LMDB from the source code\&.