summaryrefslogtreecommitdiffstats
path: root/zix/btree.h
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2014-09-23 03:13:38 +0000
committerDavid Robillard <d@drobilla.net>2014-09-23 03:13:38 +0000
commit2dade41afd1f3178396ab7086fbf29d4e2d4ab0b (patch)
treeb149138a2b1762ca6b7da36f9e0965b77047405b /zix/btree.h
parent624b19b492df58075e64572bb0630693f447f2ce (diff)
downloadzix-2dade41afd1f3178396ab7086fbf29d4e2d4ab0b.tar.gz
zix-2dade41afd1f3178396ab7086fbf29d4e2d4ab0b.tar.bz2
zix-2dade41afd1f3178396ab7086fbf29d4e2d4ab0b.zip
Add zix_btree_lower_bound with wildcard support.
git-svn-id: http://svn.drobilla.net/zix/trunk@86 df6676b4-ccc9-40e5-b5d6-7c4628a128e3
Diffstat (limited to 'zix/btree.h')
-rw-r--r--zix/btree.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/zix/btree.h b/zix/btree.h
index d8b11c7..0cd549a 100644
--- a/zix/btree.h
+++ b/zix/btree.h
@@ -78,10 +78,10 @@ ZIX_API ZixStatus
zix_btree_insert(ZixBTree* t, void* e);
/**
- Remove the value `e` from `t`.
+ Remove the value `e` from `t`, set `removed` to the removed pointer.
*/
ZIX_API ZixStatus
-zix_btree_remove(ZixBTree* t, const void* e);
+zix_btree_remove(ZixBTree* t, const void* e, void** removed);
/**
Set `ti` to an element equal to `e` in `t`.
@@ -91,6 +91,16 @@ ZIX_API ZixStatus
zix_btree_find(const ZixBTree* t, const void* e, ZixBTreeIter** ti);
/**
+ Set `ti` to the smallest element in `t` that is not less than `e`.
+
+ Wildcards are supported, so if the search key `e` compares equal to many
+ values in the tree, `ti` will be set to the least such element. The search
+ key `e` is always passed as the second argument to the comparator.
+*/
+ZIX_API ZixStatus
+zix_btree_lower_bound(const ZixBTree* t, const void* e, ZixBTreeIter** ti);
+
+/**
Return the data associated with the given tree item.
*/
ZIX_API void*