#include <stdbool.h>
#include <stddef.h>
+#include <ccan/order/order.h>
+
typedef struct AVL AVL;
typedef struct AvlNode AvlNode;
typedef struct AvlIter AvlIter;
-typedef int (*AvlCompare)(const void *, const void *);
-
-AVL *avl_new(AvlCompare compare);
+AVL *avl_new(total_order_noctx_cb compare);
/* Create a new AVL tree sorted with the given comparison function. */
void avl_free(AVL *avl);
/***************** Internal data structures ******************/
struct AVL {
- AvlCompare compare;
+ total_order_noctx_cb compare;
AvlNode *root;
size_t count;
};