1 /* CC0 license (public domain) - see LICENSE file for details */
8 #include <ccan/typesafe_cb/typesafe_cb.h>
10 typedef int (*_total_order_cb)(const void *, const void *, void *);
11 typedef int (*total_order_noctx_cb)(const void *, const void *);
13 #define total_order_cb(_name, _item, _ctx) \
14 int (*_name)(const __typeof__(_item) *, \
15 const __typeof__(_item) *, \
18 #define total_order_cast(cmp, item, ctx) \
19 typesafe_cb_cast(_total_order_cb, total_order_cb(, item, ctx), \
27 #define total_order(_name, _item, _ctx) \
29 total_order_cb(cb, _item, _ctx); \
33 #endif /* CCAN_ORDER_H */