]> git.ozlabs.org Git - ccan/blobdiff - ccan/avl/avl.h
avl: Use definitions from order module
[ccan] / ccan / avl / avl.h
index 4cbe08b1a285e0bce6deb4546178597b322e9096..304de7c2b12266e56194034f6c4e6cd88b3e1938 100644 (file)
 #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);
@@ -106,7 +106,7 @@ void avl_iter_next(AvlIter *iter);
 /***************** Internal data structures ******************/
 
 struct AVL {
-       AvlCompare  compare;
+       total_order_noctx_cb compare;
        AvlNode    *root;
        size_t      count;
 };