Section: libcprops - cp_heap (3)
Updated: JULY 2006
Return to Main Contents
cp_heap_push, cp_heap_pop - push / pop an item on / from a heap
void *cp_heap_push(cp_heap *heap, void *item);
void *cp_heap_pop(cp_heap *heap);
cp_heap_push inserts the given item to the heap. If
COLLECTION_MODE_COPY is set and the heap was initialized with a non-null copy
function, the copy of the item obtained by invoking the copy function is
inserted rather than the item itself.
cp_heap_pop returns the minimum item from the heap as determined using the heap
compare function set at initialization. If the COLLECTION_MODE_DEEP mode bit is
set and the heap was initialized with a non-null item destructor function, the
destructor function in called on the item being removed.
cp_heap_push returns the affected item on success or NULL on allocation failure.
cp_heap_pop returns the minimum item or NULL if the heap is empty.
- RETURN VALUE
- SEE ALSO
This document was created by
using the manual pages.
Time: 10:58:20 GMT, July 29, 2006