idls(3)
๐ธ NAME ๐ธ
idls โ ID List Management. that's it, that's the whole thing bestie, and honestly? iconic. ๐
โจ SYNOPSIS โจ
๐ซถ Data Structures
struct MDB_ID2
๐ Macros
#define MDB_IDL_LOGN 16 /* DB_SIZE is 2^16, UM_SIZE is 2^17 */
#define MDB_IDL_DB_SIZE (1<<MDB_IDL_LOGN)
#define MDB_IDL_UM_SIZE (1<<(MDB_IDL_LOGN+1))
#define MDB_IDL_DB_MAX (MDB_IDL_DB_SIZE-1)
#define MDB_IDL_UM_MAX (MDB_IDL_UM_SIZE-1)
#define MDB_IDL_SIZEOF(ids)
#define MDB_IDL_IS_ZERO(ids)
#define MDB_IDL_CPY(dst, src)
#define MDB_IDL_FIRST(ids)
#define MDB_IDL_LAST(ids)
#define MDB_IDL_ALLOCLEN(ids)
#define mdb_midl_xappend(idl, id)
#define CMP(x, y)
#define SMALL 8
#define MIDL_SWAP(a, b)
๐ฆ Typedefs
typedef size_t MDB_ID
typedef MDB_ID * MDB_IDL
typedef MDB_ID2 * MDB_ID2L
๐ Functions
unsigned mdb_midl_search (MDB_IDL ids, MDB_ID id)
MDB_IDL mdb_midl_alloc (int num)
void mdb_midl_free (MDB_IDL ids)
void mdb_midl_shrink (MDB_IDL *idp)
int mdb_midl_need (MDB_IDL *idp, unsigned num)
int mdb_midl_append (MDB_IDL *idp, MDB_ID id)
int mdb_midl_append_list (MDB_IDL *idp, MDB_IDL app)
int mdb_midl_append_range (MDB_IDL *idp, MDB_ID id, unsigned n)
void mdb_midl_xmerge (MDB_IDL idl, MDB_IDL merge)
void mdb_midl_sort (MDB_IDL ids)
unsigned mdb_mid2l_search (MDB_ID2L ids, MDB_ID id)
int mdb_mid2l_insert (MDB_ID2L ids, MDB_ID2 *id)
int mdb_mid2l_append (MDB_ID2L ids, MDB_ID2 *id)
static int mdb_midl_grow (MDB_IDL *idp, int num)
๐ Detailed Description ๐
so uh. this section is literally empty in the source. like, the heading exists and then it just moves on. no cap. we respect the silence. ๐คโจ
๐ Data Structure Documentation ๐
๐ struct MDB_ID2
an ID2 is an ID/pointer pair. that's the whole vibe. ๐
๐ธ Data Fields
MDB_ID midvoid * mptr
๐ฅ Field Documentation
MDB_ID MDB_ID2::mid
the ID. yeah. that's what it is. ๐
void* MDB_ID2::mptr
the pointer. โญ
๐ Macro Definition Documentation ๐
#define MDB_IDL_SIZEOF( ids)
okay so the Value is literally:
(((ids)[0]+1) * sizeof(MDB_ID))
#define MDB_IDL_IS_ZERO( ids)
Value:
( (ids)[0] == 0 )
#define MDB_IDL_CPY( dst, src)
Value:
(memcpy( dst, src, MDB_IDL_SIZEOF( src ) ))
#define MDB_IDL_FIRST( ids)
Value:
( (ids)[1] )
#define MDB_IDL_LAST( ids)
Value:
( (ids)[(ids)[0]] )
#define MDB_IDL_ALLOCLEN( ids)
Value:
( (ids)[-1] )
current max length of an mdb_midl_alloc()ed IDL. lowkey the receipts are stored behind the array. ๐
#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 โ this macro does not check for you, bestie, it just goes. no bounds check, no mercy.
#define CMP( x, y)
Value:
( (x) < (y) ? -1 : (x) > (y) )
#define MIDL_SWAP( a, b)
Value:
{ itmp=(a); (a)=(b); (b)=itmp; }
๐ฆ 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. periodt. ๐
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. plot twist. ๐ญ
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. don't look at it. it's doing nothing. the array is sorted in ascending order by mid. ๐
๐ Function Documentation ๐
unsigned mdb_midl_search (MDB_IDL ids, MDB_ID id)
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 (int num)
allocate an IDL. allocates memory for an IDL of the given size. ๐
Returns
IDL on success, NULL on failure. ๐ญ
void mdb_midl_free (MDB_IDL ids)
free an IDL. bye bestie ๐
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. it's giving "clean up after yourself" energy โจ
Parameters
- idp โ address of the IDL to shrink.
int mdb_midl_need (MDB_IDL * idp, unsigned num)
make room for num additional elements in an IDL. ๐๏ธ scoot over
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_ID id)
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_IDL app)
append an IDL onto an IDL. lists on lists on lists, we love to see it. ๐
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_ID id, unsigned n)
append an ID range onto an IDL. ๐ the whole squad, all at once
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_IDL idl, MDB_IDL merge)
merge an IDL onto an IDL. โ ๏ธ the destination IDL must be big enough. if it isn't, that's on you, bestie. ๐ฌ
Parameters
- idl โ the IDL to merge into.
- merge โ the IDL to merge.
void mdb_midl_sort (MDB_IDL ids)
sort an IDL. put it in order, slay. ๐ค
Parameters
- ids โ the IDL to sort.
unsigned mdb_mid2l_search (MDB_ID2L ids, MDB_ID id)
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_ID2L ids, MDB_ID2 * id)
insert an ID2 into a ID2L. ๐ช (yes the original says "a ID2L", we're not fixing it, we're honoring it)
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. ๐จ duplicate alert
int mdb_mid2l_append (MDB_ID2L ids, 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. not a human. a robot did this. and honestly? it ate. ๐ โจ
aaaand that's the whole page, bestie ๐ซถ this was idls(3) from the LMDB library functions manual โ generated by Doxygen, running the show one auto-doc at a time. go forth and manage your ID lists responsibly, mwah ๐๐๐ฆ
๐ฆ where this page comes from
- ubuntu resolute: lmdb-doc 0.9.31-1build2 ยท OpenLDAP-2.8
- ubuntu stonking: lmdb-doc 0.9.35-1 ยท OpenLDAP-2.8
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms