2023-03-07 12:43:31 +01:00
|
|
|
#ifndef VIETER_CAT_HEAP
|
|
|
|
#define VIETER_CAT_HEAP
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
typedef struct vieter_cat_heap vieter_cat_heap;
|
|
|
|
|
|
|
|
typedef enum vieter_cat_heap_error {
|
|
|
|
vieter_cat_heap_ok = 0,
|
|
|
|
vieter_cat_heap_arch_empty = 1,
|
|
|
|
vieter_cat_heap_arch_not_found = 2
|
|
|
|
} vieter_cat_heap_error;
|
|
|
|
|
|
|
|
vieter_cat_heap *vieter_cat_heap_init();
|
|
|
|
|
2023-04-01 17:04:40 +02:00
|
|
|
void vieter_cat_heap_free(vieter_cat_heap *cheap);
|
2023-03-07 12:43:31 +01:00
|
|
|
|
|
|
|
uint64_t vieter_cat_heap_size(vieter_cat_heap *cheap);
|
|
|
|
|
|
|
|
vieter_cat_heap_error vieter_cat_heap_insert(vieter_cat_heap *cheap,
|
|
|
|
char *category, uint64_t key,
|
|
|
|
void *data);
|
|
|
|
|
|
|
|
vieter_cat_heap_error vieter_cat_heap_pop(void **out, vieter_cat_heap *cheap,
|
|
|
|
char *category);
|
|
|
|
|
|
|
|
vieter_cat_heap_error vieter_cat_heap_peek(void **out, vieter_cat_heap *cheap,
|
|
|
|
char *category);
|
|
|
|
|
|
|
|
#endif
|