summaryrefslogtreecommitdiffstats
path: root/src/btree.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2022-10-20 21:34:22 -0400
committerDavid Robillard <d@drobilla.net>2022-10-21 12:45:39 -0400
commit2ff624eae24742faf17889f858dbdaa6d4a064ea (patch)
tree63fff58c10051292e82bb0b031f41d8769e56629 /src/btree.c
parentd072adfbe40e15715e2065f1900f8d5a76491c5f (diff)
downloadzix-2ff624eae24742faf17889f858dbdaa6d4a064ea.tar.gz
zix-2ff624eae24742faf17889f858dbdaa6d4a064ea.tar.bz2
zix-2ff624eae24742faf17889f858dbdaa6d4a064ea.zip
Split up common header
Diffstat (limited to 'src/btree.c')
-rw-r--r--src/btree.c52
1 files changed, 26 insertions, 26 deletions
diff --git a/src/btree.c b/src/btree.c
index 0725612..30a1538 100644
--- a/src/btree.c
+++ b/src/btree.c
@@ -25,11 +25,11 @@ typedef uint16_t ZixShort;
#define ZIX_BTREE_INODE_VALS (ZIX_BTREE_LEAF_VALS / 2U)
struct ZixBTreeImpl {
- ZixAllocator* allocator;
- ZixBTreeNode* root;
- ZixComparator cmp;
- const void* cmp_data;
- size_t size;
+ ZixAllocator* allocator;
+ ZixBTreeNode* root;
+ ZixCompareFunc cmp;
+ const void* cmp_data;
+ size_t size;
};
struct ZixBTreeNodeImpl {
@@ -88,9 +88,9 @@ zix_btree_child(const ZixBTreeNode* const node, const unsigned i)
}
ZixBTree*
-zix_btree_new(ZixAllocator* const allocator,
- const ZixComparator cmp,
- const void* const cmp_data)
+zix_btree_new(ZixAllocator* const allocator,
+ const ZixCompareFunc cmp,
+ const void* const cmp_data)
{
#if !((defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || \
(defined(__cplusplus) && __cplusplus >= 201103L))
@@ -263,11 +263,11 @@ zix_btree_split_child(ZixAllocator* const allocator,
#ifdef ZIX_BTREE_SORTED_CHECK
/// Check that `n` is sorted with respect to search key `e`
static bool
-zix_btree_node_is_sorted_with_respect_to(const ZixComparator compare,
- const void* const compare_user_data,
- void* const* const values,
- const unsigned n_values,
- const void* const key)
+zix_btree_node_is_sorted_with_respect_to(const ZixCompareFunc compare,
+ const void* const compare_user_data,
+ void* const* const values,
+ const unsigned n_values,
+ const void* const key)
{
if (n_values <= 1U) {
return true;
@@ -288,12 +288,12 @@ zix_btree_node_is_sorted_with_respect_to(const ZixComparator compare,
#endif
static unsigned
-zix_btree_find_value(const ZixComparator compare,
- const void* const compare_user_data,
- void* const* const values,
- const unsigned n_values,
- const void* const key,
- bool* const equal)
+zix_btree_find_value(const ZixCompareFunc compare,
+ const void* const compare_user_data,
+ void* const* const values,
+ const unsigned n_values,
+ const void* const key,
+ bool* const equal)
{
unsigned first = 0U;
unsigned count = n_values;
@@ -323,12 +323,12 @@ zix_btree_find_value(const ZixComparator compare,
}
static unsigned
-zix_btree_find_pattern(const ZixComparator compare_key,
- const void* const compare_key_user_data,
- void* const* const values,
- const unsigned n_values,
- const void* const key,
- bool* const equal)
+zix_btree_find_pattern(const ZixCompareFunc compare_key,
+ const void* const compare_key_user_data,
+ void* const* const values,
+ const unsigned n_values,
+ const void* const key,
+ bool* const equal)
{
#ifdef ZIX_BTREE_SORTED_CHECK
assert(zix_btree_node_is_sorted_with_respect_to(
@@ -854,7 +854,7 @@ zix_btree_find(const ZixBTree* const t,
ZixStatus
zix_btree_lower_bound(const ZixBTree* const t,
- const ZixComparator compare_key,
+ const ZixCompareFunc compare_key,
const void* const compare_key_user_data,
const void* const key,
ZixBTreeIter* const ti)