insque(S)
insque, remque --
insert/remove element from a queue
Synopsis
include <search.h>
extern void insque(void element, void pred);
extern void remque(void element);
Description
insque and remque
manipulate queues built from doubly linked lists.
The queue can be either circular or linear.
The application must define a structure in which the first two members
of the structure are pointers to the same type of structure, and any
further members are application-specific.
The first member points forward to the next entry, the second points
back to the previous entry.
A linear queue is terminated with null pointers.
insque
inserts element
in a queue immediately after
pred.
remque
removes an entry
element
from a queue.
If the queue is to be used as a linear list,
invoking insque(&element, NULL,
where element is the initial element of the queue, will
initialize the forward and backward pointers of element to null
pointers.
If the queue is to be used as a circular list, the application must
initialize the forward and backward pointers of the initial queue
element to the element's address.
Notices
It is the caller's responsibility never to insert or delete a member before
the first member of the list or after the last member of the list.
The first and last members of the list must remain in place for the
duration of the use of the list.
© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 - 01 June 2005