void fm_select_begin(fm_select_t *sel, void *set, size_t size, int capacity, fm_rank_fn rank, fm_page_dir_t dir, const void *key)
Start choosing one page into set.
Definition fm_select.c:93
int fm_select_end(fm_select_t *sel, fm_rank_fn show, int *ahead)
End the walk: sort the page for display and say where it stands.
Definition fm_select.c:156
int fm_select_keep(void *set, size_t size, int count, int capacity, const void *cand, fm_rank_fn rank)
Offer cand to a set of count entries in rank order, which keeps the capacity entries that rank first.
Definition fm_select.c:87
void fm_select_offer(fm_select_t *sel, const void *cand)
Offer one entry of the folder.
Definition fm_select.c:119
int(*) fm_rank_fn(const void *a, const void *b)
The order of two entries, as qsort() takes it.
Definition fm_select.h:62
fm_page_dir_t
Which side of the key a page holds.
Definition fm_select.h:42
@ FM_PAGE_AFTER
The first entries that rank behind the key: the next page. With no key, the first page.
Definition fm_select.h:48
@ FM_PAGE_BEFORE
The last entries that rank ahead of the key: the page before. With no key, the last entries of all: t...
Definition fm_select.h:52
@ FM_PAGE_FROM
The first entries that rank with the key or behind it. With no key, the first page.
Definition fm_select.h:45
One page being chosen while a folder is read. Filled by fm_select_begin(); the fields are the walk's,...
Definition fm_select.h:68
fm_page_dir_t dir
Definition fm_select.h:73
size_t size
Definition fm_select.h:70
void * set
Definition fm_select.h:69
int outside
Definition fm_select.h:77
int inside
Definition fm_select.h:76
int held
Definition fm_select.h:75
int capacity
Definition fm_select.h:71
fm_rank_fn rank
Definition fm_select.h:72
const void * key
Definition fm_select.h:74