int qPriDeltaInfo ( Q_PRI_HEAD *pQPriHead, /* priority queue to gather list for */ FAST int nodeArray[], /* array of node pointers to be filled in */ FAST int maxNodes /* max node pointers nodeArray can accomodate */ ) { FAST Q_PRI_NODE *pQNode = (Q_PRI_NODE *) DLL_FIRST (pQPriHead); FAST int *pElement = nodeArray; if (nodeArray == NULL) /* NULL node array means return count */ return (dllCount (pQPriHead)); while ((pQNode != NULL) && (--maxNodes >= 0)) { *(pElement++) = (int)pQNode; /* fill in table */ pQNode = (Q_PRI_NODE *) DLL_NEXT (&pQNode->node); /* next node */ } return (pElement - nodeArray); /* return count of active tasks */ }
int qFifoInfo ( Q_FIFO_HEAD *pQFifoHead, /* FIFO queue to gather list for */ FAST int nodeArray[], /* array of node pointers to be filled in */ FAST int maxNodes /* max node pointers nodeArray can accomodate */ ) { FAST DL_NODE *pNode = DLL_FIRST (pQFifoHead); FAST int *pElement = nodeArray; if (nodeArray == NULL) /* NULL node array means return count */ return (dllCount (pQFifoHead)); while ((pNode != NULL) && (--maxNodes >= 0)) { *(pElement++) = (int)pNode; /* fill in table */ pNode = DLL_NEXT (pNode); /* next node */ } return (pElement - nodeArray); /* return count of active tasks */ }
LOCAL int qFifoInfo( Q_FIFO_HEAD *pQFifoHead, int nodeArray[], int maxNodes ) { DL_NODE *pNode; int *pElement; int count; /* If null array just return number of nodes */ if (nodeArray == NULL) { count = dllCount((DL_LIST *) pQFifoHead); } else { /* Get first node */ pNode = (DL_NODE *) DLL_HEAD((DL_LIST *) pQFifoHead); /* Set element pointer */ pElement = nodeArray; /* While node in list or maxNodex GE 0*/ while ((pNode != NULL) && (--maxNodes >= 0)) { *(pElement++) = (int) pNode; pNode = DLL_NEXT(pNode); } /* Return numbder of nodes read */ count = pElement - nodeArray; } return count; }