* gl/lib/heap.c (struct heap): Move this here...
* gl/lib/heap.h (struct heap): ... from here, as outside code no
longer needs to access any of these members.
static void heapify_up (void **, size_t,
int (*) (void const *, void const *));
+struct heap
+{
+ void **array; /* array[0] is not used */
+ size_t capacity; /* Array size */
+ size_t count; /* Used as index to last element. Also is num of items. */
+ int (*compare) (void const *, void const *);
+};
/* Allocate memory for the heap. */
#include <stddef.h>
-struct heap
-{
- void **array; /* array[0] is not used */
- size_t capacity; /* Array size */
- size_t count; /* Used as index to last element. Also is num of items. */
- int (*compare) (void const *, void const *);
-};
-
struct heap *heap_alloc (int (*) (void const *, void const *), size_t);
void heap_free (struct heap *);
int heap_insert (struct heap *heap, void *item);