insque or remque Subroutine

Purpose

Inserts or removes an element in a queue.

Library

Standard C Library (libc.a)

Syntax

#include <search.h>

insque ( Element,  Pred)
void *Element, *Pred;

remque (Element)
void *Element;

Description

The insque and remque subroutines manipulate queues built from double-linked lists. Each element in the queue must be in the form of a qelem structure. The next and prev elements of that structure must point to the elements in the queue immediately before and after the element to be inserted or deleted.

The insque subroutine inserts the element pointed to by the Element parameter into a queue immediately after the element pointed to by the Pred parameter.

The remque subroutine removes the element defined by the Element parameter from a queue.

Parameters

Item Description
Pred Points to the element in the queue immediately before the element to be inserted or deleted.
Element Points to the element in the queue immediately after the element to be inserted or deleted.