DMU380ZA Series
User’s Manual
________________________________________________________________________
Doc# 7430-3810 Rev.02
Page 101
*******************************************************************************/
int Pop(QUEUE_TYPE *queue_ptr, int numToPop)
{
int i=0;
char tempchar;
for(i=0; i<numToPop; i++)
{
if(!DeleteQueue(&tempchar, queue_ptr))
{
break;
}
}
return i;
}
/*******************************************************************************
* FUNCTION: Size
* ARGUMENTS: queue_ptr is pointer to the queue
* RETURNS:
return the number of items in the queue
*******************************************************************************/
int Size(QUEUE_TYPE *queue_ptr)
{
return queue_ptr->count;
}
/*******************************************************************************
* FUNCTION: Empty
* ARGUMENTS: queue_ptr is pointer to the queue
* RETURNS:
return 1 if empty, 0 if not
*******************************************************************************/
int Empty(QUEUE_TYPE *queue_ptr)
{
return queue_ptr->count <= 0;
}
/*******************************************************************************
* FUNCTION: Full
* ARGUMENTS: queue_ptr is pointer to the queue
* RETURNS:
return 1 if full, 0 if not full
*******************************************************************************/
int Full(QUEUE_TYPE *queue_ptr)
{
return queue_ptr->count >= MAXQUEUE;
}