#include "xroad_common_fwd.h"
#include "xroad_common_types.h"
#include <stdint.h>
#include <stdlib.h>
Go to the source code of this file.
◆ xroad_heap_cmp_func_t
typedef int32_t(* xroad_heap_cmp_func_t) (void *, void *) |
heap entry compare function
◆ xroad_heap_free_func_t
typedef void(* xroad_heap_free_func_t) (void *) |
◆ xroad_heap_clear()
remove all position from heap
- Parameters
-
[in] | heap | - pointer to heap container |
◆ xroad_heap_create()
create new heap container
- Parameters
-
[in] | entry_size | - the size of entry |
[in] | capacity | - the initial capacity of heap |
[in] | free_func | - function for free heap entries data, NULL - no free performed |
- Returns
- heap object
◆ xroad_heap_destroy()
destroy heap container
- Parameters
-
[in] | heap | - container to destroy. If NULL, nothing happened |
[in] | free_func | - function for free heap entries data, NULL - no free performed |
◆ xroad_heap_get_root()
get first elem from container
- Parameters
-
[in] | heap | - pointer to heap container |
- Returns
- heap entry
◆ xroad_heap_get_size()
return heap size
- Parameters
-
[in] | heap | - pointer to heap container |
◆ xroad_heap_insert()
int32_t xroad_heap_insert |
( |
xroad_heap_t * |
heap, |
|
|
void * |
val |
|
) |
| |
insert value into heap
- Parameters
-
[in] | heap | - pointer to heap container |
[in] | val | - pointer to inserted value return 1 - if root has been changed |
◆ xroad_heap_pop()
delete root entry from heap
- Parameters
-
[in] | heap | - pointer to heap container |
[in] | free_func | - function for free heap entries data, NULL - no free performed |