Open System Services Library Calls Reference Manual (G06.27+, H06.04+)

OSS Library Calls (i - m) insque(3)
NAME
insque, remque - Inserts or removes an element in a queue
LIBRARY
G-series native OSS processes: /G/system/sysnn/zosshsrl
H-series OSS processes: /G/system/sysnn/zosshdll
SYNOPSIS
#include <search.h>
void insque(
void *element,
void *pred);
void remque(
void *lement);
PARAMETERS
element Is a pointer to an element to be inserted in or removed from a doubly linked list.
pred Is a pointer to an item in a doubly linked list.
DESCRIPTION
The insque() and remque() functions insert and remove, respectively, an element in a queue
constructed from a doubly linked list. The calling application must dene a structure that will be
the type for all elements in the list. The rst two elds of the structure must be pointers to the
same type of structure: the rst eld points forward to the next element in the queue and the
second eld points back to the previous element in the queue. The other elds of the structure
are application-dependent.
The queue can be either circular or linear. A linear queue is terminated at both ends by null
pointers. In a circular queue, the rst element points back to the last element as the previous ele-
ment in the queue and the last element points forward to the rst element as the next element in
the queue.
The insque() function inserts the element pointed to by the element parameter into a queue
immediately after the element pointed to by the pred parameter.
The remque() function removes the element pointed to by the element parameter from a queue.
When the element pointed to by element is the last to be removed from the queue, the remque()
function sets both its forward and backward pointers to element.
For a linear queue, calling this function as insque (&element, NULL), where lement is the rst
element of the queue, initializes the forward and backward pointers of element to null pointers.
When creating a circular queue, the application must initialize both the forward and backward
pointers of the initial element to that elements own address.
NOTES
The insque() and remque() functions can be called by native processes only.
RETURN VALUES
Neither the insque( ) function nor the remque() function return a value.
ERRORS
None. These functions do not set errno.
527187-004 Hewlett-Packard Company 427