43 for (iItem = 0; iItem <= pheap->
index; iItem++) {
44 pfnCancelItem(pheap, &pheap->
pnode[iItem]);
67 while (i != 1 && key < pheap->pnode[i / 2].key) {
84 if (pheap->
index == 0)
87 *pnoderet = pheap->
pnode[1];
94 while (ichild <= pheap->index) {
95 if (ichild < pheap->index &&
106 pheap->
pnode[iparent] = temp;
119 realloc(pheap->
pnode,
126 while (i != 1 && key > pheap->
pnode[i / 2].
key) {
141 long iparent, ichild;
143 if (pheap->
index == 0)
146 *pnoderet = pheap->
pnode[1];
153 while (ichild <= pheap->index) {
154 if (ichild < pheap->index &&
165 pheap->
pnode[iparent] = temp;
void dglHeapFree(dglHeap_s *pheap, dglHeapCancelItem_fn pfnCancelItem)
void(* dglHeapCancelItem_fn)(dglHeap_s *pheap, dglHeapNode_s *pitem)
void dglHeapInit(dglHeap_s *pheap)
int dglHeapInsertMax(dglHeap_s *pheap, long key, unsigned char flags, dglHeapData_u value)
int dglHeapInsertMin(dglHeap_s *pheap, long key, unsigned char flags, dglHeapData_u value)
int dglHeapExtractMin(dglHeap_s *pheap, dglHeapNode_s *pnoderet)
int dglHeapExtractMax(dglHeap_s *pheap, dglHeapNode_s *pnoderet)