c_qnext - Retrieve the next object in the queue

SYNTAX

long FUNCTION c_qnext(q, ptr)

     long q;	
     void **ptr;

PARAMETERS

q (long, input)

The number of the queue to access. This number is returned by c_qcreate().

ptr (void **, output)

A pointer to the next object in the queue. ptr will be set to NULL if the queue is empty, or if the end of the queue is reached.

DESCRIPTION

This routine is used to access the next object in a queue. ptr is set to point to the next object in the queue, so the application should not free this memory. If the end of the queue is encountered, ptr is set to NULL.

After calling this function the current position in the queue is advanced by one.

RETURN VALUE

c_qnext() returns

      0 --> Successful completion.  The next object was found, or the 
	    queue is empty or at the end.
     -1 --> Operation failed.  No such queue exists.