XROAD
xroad_heap.h
Go to the documentation of this file.
1 #pragma once
2 
8 #include "xroad_common_fwd.h"
9 #include "xroad_common_types.h"
10 #include <stdint.h>
11 #include <stdlib.h>
12 
13 #ifdef __cplusplus
14 extern "C"
15 {
16 #endif
17 
21 typedef void (*xroad_heap_free_func_t)(void*);
22 
26 typedef int32_t (*xroad_heap_cmp_func_t)(void*, void*);
27 
36  size_t entry_size, size_t capacity, xroad_heap_cmp_func_t cmp, xroad_heap_free_func_t free_func);
37 
44 
49 size_t xroad_heap_get_size(const xroad_heap_t* heap);
50 
57 int32_t xroad_heap_insert(xroad_heap_t* heap, void* val);
58 
65 
71 
78 
79 #ifdef __cplusplus
80 }
81 #endif
struct xroad_heap_s xroad_heap_t
see common/xroad_heap.h for details
Definition: xroad_common_fwd.h:48
void(* xroad_heap_free_func_t)(void *)
Definition: xroad_heap.h:21
void xroad_heap_destroy(xroad_heap_t *heap)
void xroad_heap_pop(xroad_heap_t *heap, xroad_heap_free_func_t free_func)
void xroad_heap_clear(xroad_heap_t *heap)
void * xroad_heap_get_root(xroad_heap_t *heap)
int32_t xroad_heap_insert(xroad_heap_t *heap, void *val)
int32_t(* xroad_heap_cmp_func_t)(void *, void *)
Definition: xroad_heap.h:26
size_t xroad_heap_get_size(const xroad_heap_t *heap)
xroad_heap_t * xroad_heap_create(size_t entry_size, size_t capacity, xroad_heap_cmp_func_t cmp, xroad_heap_free_func_t free_func)