28 lines
611 B
C
28 lines
611 B
C
#ifndef VIETER_HEAP
|
|
#define VIETER_HEAP
|
|
|
|
#include <stddef.h>
|
|
#include <stdint.h>
|
|
|
|
typedef struct vieter_heap vieter_heap;
|
|
|
|
typedef enum vieter_heap_error {
|
|
vieter_heap_ok = 0,
|
|
vieter_heap_empty = 1
|
|
} vieter_heap_error;
|
|
|
|
vieter_heap *vieter_heap_init();
|
|
|
|
void vieter_heap_free(vieter_heap *heap);
|
|
|
|
uint64_t vieter_heap_size(vieter_heap *heap);
|
|
|
|
vieter_heap_error vieter_heap_insert(vieter_heap *heap, uint64_t key,
|
|
void *data);
|
|
|
|
vieter_heap_error vieter_heap_pop(void **out, vieter_heap *heap);
|
|
|
|
vieter_heap_error vieter_heap_peek(void **out, vieter_heap *heap);
|
|
|
|
#endif
|