Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

insque, remque - Insert element in queue or remove element from queue

&pagelevel(4)&pagelevel

Syntax

#include <search.h>

void insque(void *element, void *pred);

void remque(void *element);

Description

insque() and remque() modify queues which are generated from double-concatenated elements. The queue can be concatenated in linear or ring form. For the insque() and remque() functions to be used, a structure must be defined in the application that first/initially contains two pointers to this structure. The other components of the structure are application-specific. The first pointer of the structure references the next entry in the queue. The second pointer references the previous entry in the queue. If the queue is linear, it is completed by null pointers. The names of the structure and the pointers it contains are freely selectable.

insque() inserts the element pointed to by element in a queue directly after pred.

remque() removes the element pointed to by element from a queue.

The call insque(&element, NULL), where element is the first element in the queue, serves to initialize a linear list. Both pointers of element are occupied by null pointers.

To build up a ring-concatenated list, the application must first enter the address of the start element of the queue in both pointers of the start element.