41 for (iItem = 0; iItem <= pheap->
index; iItem++) {
42 pfnCancelItem(pheap, &pheap->
pnode[iItem]);
64 while (i != 1 && key < pheap->pnode[i / 2].key) {
81 if (pheap->
index == 0)
84 *pnoderet = pheap->
pnode[1];
91 while (ichild <= pheap->index) {
92 if (ichild < pheap->index &&
103 pheap->
pnode[iparent] = temp;
122 while (i != 1 && key > pheap->
pnode[i / 2].
key) {
137 long iparent, ichild;
139 if (pheap->
index == 0)
142 *pnoderet = pheap->
pnode[1];
149 while (ichild <= pheap->index) {
150 if (ichild < pheap->index &&
161 pheap->
pnode[iparent] = temp;
void dglHeapInit(dglHeap_s *pheap)
int dglHeapInsertMin(dglHeap_s *pheap, long key, unsigned char flags, dglHeapData_u value)
void dglHeapFree(dglHeap_s *pheap, dglHeapCancelItem_fn pfnCancelItem)
int dglHeapExtractMax(dglHeap_s *pheap, dglHeapNode_s *pnoderet)
int dglHeapInsertMax(dglHeap_s *pheap, long key, unsigned char flags, dglHeapData_u value)
int dglHeapExtractMin(dglHeap_s *pheap, dglHeapNode_s *pnoderet)
void(* dglHeapCancelItem_fn)(dglHeap_s *pheap, dglHeapNode_s *pitem)