c_qfirst - Get the first object in a queue

SYNTAX

long FUNCTION c_qfirst(q, ptr)

     long q;
     void **ptr;

PARAMETERS

q (long, input)

The number of the queue from which to retrieve objects. This number is returned by c_qcreate().

ptr (void **, output)

A pointer to a pointer to the first object in the queue. ptr will be set to NULL if the queue is empty.

DESCRIPTION

This routine is used to retrieve the first object in a queue. The first entry in the queue is determined by the order used in the q_create() call. If the queue is not empty, ptr will point to the first object in the queue, not a copy; therefore, the application should not free this memory. If the queue is empty, ptr will be NULL.

The current position in the queue is set to the first object in the queue.

RETURN VALUE

c_qfirst() returns

      0 --> Successful completion.  First object found or queue is empty.
     -1 --> Operation failed.  No such queue exists.