void * napr_heap_extract(napr_heap_t *heap)
Removes and returns the element at the top of the heap (the min or max element).
napr_heap_t * napr_heap_make(apr_pool_t *pool, napr_heap_cmp_callback_fn_t *cmp)
Creates a new heap.
int napr_heap_insert(napr_heap_t *heap, void *datum)
Inserts an element into the heap, maintaining the heap property.
napr_heap_t * napr_heap_make_r(apr_pool_t *pool, napr_heap_cmp_callback_fn_t *cmp)
Creates a new thread-safe heap.
struct napr_heap_t napr_heap_t
Opaque heap structure.
unsigned int napr_heap_size(const napr_heap_t *heap)
Gets the current number of elements in the heap.
int() napr_heap_cmp_callback_fn_t(const void *, const void *)
Callback function to compare two elements in the heap.
void * napr_heap_get_nth(const napr_heap_t *heap, unsigned int n)
Gets the element at a specific index in the heap's internal array.
int napr_heap_insert_r(napr_heap_t *heap, void *datum)
Inserts an element into a thread-safe heap.
void() napr_heap_del_callback_fn_t(void *)
Optional callback function to delete/deallocate an element when not using APR pools.