2.4.1.5 Searching — Zix 0.8.2 documentation

# 2.4.1.5 Searching

ZixStatus zix_btree_find(const ZixBTree *t, const void *e, ZixBTreeIter *ti)

  Set `ti` to an element exactly equal to `e` in `t`.

  If no such item exists, `ti` is set to the end.

  Returns:

    `ZixStatus.ZIX_STATUS_SUCCESS` on success, or `ZixStatus.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 in `t` that is not less than `e`.

  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, then `ti` 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:

    `ZixStatus.ZIX_STATUS_SUCCESS`.