summaryrefslogtreecommitdiffstats
path: root/include/zix/tree.h
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2022-11-02 16:30:44 -0400
committerDavid Robillard <d@drobilla.net>2022-11-02 17:31:55 -0400
commitdedf8b645ad676e7947c83f320198d43f4341570 (patch)
treed0bb9cf6033437020e8e75aa8f7d6bbe8b4b51c0 /include/zix/tree.h
parent4f454ff117cac82c4ce86fc22d37fd317e925a18 (diff)
downloadzix-dedf8b645ad676e7947c83f320198d43f4341570.tar.gz
zix-dedf8b645ad676e7947c83f320198d43f4341570.tar.bz2
zix-dedf8b645ad676e7947c83f320198d43f4341570.zip
Remove function_types.h
Diffstat (limited to 'include/zix/tree.h')
-rw-r--r--include/zix/tree.h22
1 files changed, 15 insertions, 7 deletions
diff --git a/include/zix/tree.h b/include/zix/tree.h
index 8114c97..1b5c4ec 100644
--- a/include/zix/tree.h
+++ b/include/zix/tree.h
@@ -6,7 +6,6 @@
#include "zix/allocator.h"
#include "zix/attributes.h"
-#include "zix/function_types.h"
#include "zix/status.h"
#include <stdbool.h>
@@ -26,15 +25,24 @@ typedef struct ZixTreeImpl ZixTree;
/// An iterator over a @ref ZixTree
typedef struct ZixTreeNodeImpl ZixTreeIter;
+/// Function for comparing two Tree elements
+typedef int (*ZixTreeCompareFunc)(const void* ZIX_UNSPECIFIED a,
+ const void* ZIX_UNSPECIFIED b,
+ const void* ZIX_UNSPECIFIED user_data);
+
+/// Function to destroy a Tree element
+typedef void (*ZixTreeDestroyFunc)(void* ZIX_UNSPECIFIED ptr,
+ const void* ZIX_UNSPECIFIED user_data);
+
/// Create a new (empty) tree
ZIX_API
ZixTree* ZIX_ALLOCATED
-zix_tree_new(ZixAllocator* ZIX_NULLABLE allocator,
- bool allow_duplicates,
- ZixCompareFunc ZIX_NONNULL cmp,
- void* ZIX_UNSPECIFIED cmp_data,
- ZixDestroyFunc ZIX_NULLABLE destroy,
- const void* ZIX_NULLABLE destroy_user_data);
+zix_tree_new(ZixAllocator* ZIX_NULLABLE allocator,
+ bool allow_duplicates,
+ ZixTreeCompareFunc ZIX_NONNULL cmp,
+ void* ZIX_UNSPECIFIED cmp_data,
+ ZixTreeDestroyFunc ZIX_NULLABLE destroy,
+ const void* ZIX_NULLABLE destroy_user_data);
/// Free `t`
ZIX_API