52 #define binaryheap_empty(h) ((h)->bh_size == 0)
void binaryheap_replace_first(binaryheap *heap, Datum d)
static int compare(const void *arg1, const void *arg2)
struct binaryheap binaryheap
void binaryheap_reset(binaryheap *heap)
binaryheap_comparator bh_compare
int(* binaryheap_comparator)(Datum a, Datum b, void *arg)
Datum binaryheap_remove_first(binaryheap *heap)
void binaryheap_add(binaryheap *heap, Datum d)
binaryheap * binaryheap_allocate(int capacity, binaryheap_comparator compare, void *arg)
Datum binaryheap_first(binaryheap *heap)
void binaryheap_free(binaryheap *heap)
Datum bh_nodes[FLEXIBLE_ARRAY_MEMBER]
bool bh_has_heap_property
void binaryheap_add_unordered(binaryheap *heap, Datum d)
void binaryheap_build(binaryheap *heap)