c_qposition - Retrieve the object at a specified position in a queue

SYNTAX

long FUNCTION c_qposition(q, pos, ptr)

     long q;
     long pos;
     void **ptr;

PARAMETERS

q (long, input)

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

pos (long, input)

The position of the object to retrieve.

ptr (void **, output)

A pointer to the specified object in the queue. ptr will be NULL if the specified position does not exist in the queue.

DESCRIPTION

The c_qposition() routine is used to retrieve an object at a specified position in a queue. ptr is set to point to the actual object; the application should not free this memory. If the specified position is not found, ptr will be set to NULL.

The current position in the queue is set to the specified position.

RETURN VALUE

c_qposition() returns

      0 --> Successful completion.  The object was found.
     -1 --> Operation failed.  No such queue exists, or the queue 
	    contains fewer than pos objects.