c_qprev - Retrieve the previous object in the queue

SYNTAX

long FUNCTION c_qprev(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 previous object in the queue. ptr is set to NULL if there is no previous object (i.e., the current position is at the beginning of the queue).

DESCRIPTION

The c_qprev() routine is used to access the previous object in a queue. ptr is set to point to the previous object in the queue, so the application should not free this memory. If the beginning of the queue is encountered, ptr is set to NULL.

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

RETURN VALUE

c_qprev() returns

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