2.4.1.4 Searching¶
-
ZixStatus
zix_btree_find
(const ZixBTree *t, const void *e, ZixBTreeIter *ti)¶ Set
ti
to an element exactly equal toe
int
.If no such item exists,
ti
is set to the end.- Returns
ZixStatus.ZIX_STATUS_SUCCESS
on success, orZixStatus.ZIX_STATUS_NOT_FOUND
.
-
ZixStatus
zix_btree_lower_bound
(const ZixBTree *t, ZixBTreeCompareFunc compare_key, const void *compare_key_data, const void *key, ZixBTreeIter *ti)¶ Set
ti
to the smallest element int
that is not less thane
.The given comparator must be compatible with the tree comparator, that is, any two values must have the same ordering according to both. Within this constraint, it may implement fuzzier searching by handling special search key values, for example with wildcards.
If the search key
e
compares equal to many values in the tree, thenti
will be set to the least such element.The comparator is always called with an actual value in the tree as the first argument, and
key
as the second argument.- Returns