add item an error will occur if there isn't enough space for this item return 0 on success; -1 on error
| 210 | // an error will occur if there isn't enough space for this item |
| 211 | // return 0 on success; -1 on error |
| 212 | int Heap_offerx |
| 213 | ( |
| 214 | heap_t *hp, // item The item to be added |
| 215 | void *item |
| 216 | ) { |
| 217 | if(hp->count == hp->size) { |
| 218 | return -1; |
| 219 | } |
| 220 | |
| 221 | __Heap_offerx(hp, item); |
| 222 | |
| 223 | return 0; |
| 224 | } |
| 225 | |
| 226 | // remove the item with the top priority |
| 227 | // return top item |
nothing calls this directly
no test coverage detected