return top item of the heap
| 247 | |
| 248 | // return top item of the heap |
| 249 | void *Heap_peek |
| 250 | ( |
| 251 | const heap_t *hp |
| 252 | ) { |
| 253 | if(0 == Heap_count(hp)) { |
| 254 | return NULL; |
| 255 | } |
| 256 | |
| 257 | return hp->array[0]; |
| 258 | } |
| 259 | |
| 260 | // clear all items |
| 261 | // note: does not free items |