65 #ifndef _LIBUTIL_HEAP_H_ 66 #define _LIBUTIL_HEAP_H_ 71 #include <sphinxbase/sphinxbase_export.h> SPHINXBASE_EXPORT int heap_destroy(heap_t *heap)
Destroy the given heap; free the heap nodes.
SPHINXBASE_EXPORT heap_t * heap_new(void)
Allocate a new heap and return handle to it.
SPHINXBASE_EXPORT int heap_remove(heap_t *heap, void *data)
Remove an item from the heap.
Basic type definitions used in Sphinx.
SPHINXBASE_EXPORT int heap_insert(heap_t *heap, void *data, int32 val)
Insert a new item into the given heap.
SPHINXBASE_EXPORT int heap_pop(heap_t *heap, void **data, int32 *val)
Like heap_top but also pop the top item off the heap.
SPHINXBASE_EXPORT size_t heap_size(heap_t *heap)
Return the number of items in the heap.
SPHINXBASE_EXPORT int heap_top(heap_t *heap, void **data, int32 *val)
Return the topmost item in the heap.
Internal heap data structure.