|
libtcod
|
Internal heap queue module. More...
Go to the source code of this file.
Classes | |
| struct | TCOD_Heap |
Functions | |
| int | TCOD_heap_init (struct TCOD_Heap *heap, size_t data_size) |
| Initialize a heap with the given data_size. | |
| void | TCOD_heap_uninit (struct TCOD_Heap *heap) |
| Clear a heap and free its data. | |
| void | TCOD_heap_clear (struct TCOD_Heap *heap) |
| Clear all elements from this heap. | |
| int | TCOD_minheap_push (struct TCOD_Heap *minheap, int priority, const void *data) |
| Push an element onto this minumum heap. | |
| void | TCOD_minheap_pop (struct TCOD_Heap *minheap, void *out) |
| Remove the smallest element from the heap and keep it sorted. | |
| void | TCOD_minheap_heapify (struct TCOD_Heap *minheap) |
| Sort the heap elements into a valid heap. | |
Internal heap queue module.
| void TCOD_heap_clear | ( | struct TCOD_Heap * | heap | ) |
Clear all elements from this heap.
| heap | A TCOD_Heap pointer. |
| int TCOD_heap_init | ( | struct TCOD_Heap * | heap, |
| size_t | data_size ) |
Initialize a heap with the given data_size.
| heap | A pointer to an existing TCOD_Heap struct. |
| data_size | The size of the user data in bytes. |
| void TCOD_heap_uninit | ( | struct TCOD_Heap * | heap | ) |
Clear a heap and free its data.
| heap | A pointer to a TCOD_Heap struct, the struct itself is not freed. |
| void TCOD_minheap_heapify | ( | struct TCOD_Heap * | minheap | ) |
Sort the heap elements into a valid heap.
| minheap | A TCOD_Heap pointer. |
| void TCOD_minheap_pop | ( | struct TCOD_Heap * | minheap, |
| void * | out ) |
Remove the smallest element from the heap and keep it sorted.
| minheap | A TCOD_Heap pointer. |
| out | An optional pointer to store the data from the removed element. |
| int TCOD_minheap_push | ( | struct TCOD_Heap * | minheap, |
| int | priority, | ||
| const void * | data ) |
Push an element onto this minumum heap.
| minheap | A TCOD_Heap pointer. |
| priority | The priority of the new element. |
| data | The data to push onto the heap. Can not be NULL. |