1e866f279Sdrochner.\" Copyright (c) 1993 John Brezak 2e866f279Sdrochner.\" All rights reserved. 3e866f279Sdrochner.\" 4e866f279Sdrochner.\" Redistribution and use in source and binary forms, with or without 5e866f279Sdrochner.\" modification, are permitted provided that the following conditions 6e866f279Sdrochner.\" are met: 7e866f279Sdrochner.\" 1. Redistributions of source code must retain the above copyright 8e866f279Sdrochner.\" notice, this list of conditions and the following disclaimer. 9e866f279Sdrochner.\" 2. Redistributions in binary form must reproduce the above copyright 10e866f279Sdrochner.\" notice, this list of conditions and the following disclaimer in the 11e866f279Sdrochner.\" documentation and/or other materials provided with the distribution. 12e866f279Sdrochner.\" 3. The name of the author may be used to endorse or promote products 13e866f279Sdrochner.\" derived from this software without specific prior written permission. 14e866f279Sdrochner.\" 15e866f279Sdrochner.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR `AS IS'' AND 16e866f279Sdrochner.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17e866f279Sdrochner.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18e866f279Sdrochner.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE 19e866f279Sdrochner.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20e866f279Sdrochner.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21e866f279Sdrochner.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22e866f279Sdrochner.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23e866f279Sdrochner.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24e866f279Sdrochner.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25e866f279Sdrochner.\" SUCH DAMAGE. 26e866f279Sdrochner.\" 27*a293ac8fSjruoho.\" $NetBSD: insque.3,v 1.5 2010/04/30 10:24:02 jruoho Exp $ 28e866f279Sdrochner.\" 29*a293ac8fSjruoho.Dd April 30, 2010 30e866f279Sdrochner.Dt INSQUE 3 31edc0d6c1Sjoerg.Os 32e866f279Sdrochner.Sh NAME 33e866f279Sdrochner.Nm insque , 34e866f279Sdrochner.Nm remque 35e866f279Sdrochner.Nd insert/remove element from a queue 36e866f279Sdrochner.Sh LIBRARY 37e866f279Sdrochner.Lb libc 38e866f279Sdrochner.Sh SYNOPSIS 39e866f279Sdrochner.In search.h 40e866f279Sdrochner.Ft void 41e866f279Sdrochner.Fn insque "void *elem" "void *pred" 42e866f279Sdrochner.Ft void 43e866f279Sdrochner.Fn remque "void *elem" 44e866f279Sdrochner.Sh DESCRIPTION 45e866f279Sdrochner.Fn insque 46e866f279Sdrochnerand 47e866f279Sdrochner.Fn remque 48e866f279Sdrochnermanipulate queues built from doubly linked lists. 4945ec6e45SdrochnerThe queue can be either circular or linear. 5045ec6e45SdrochnerThe functions expect their 5145ec6e45Sdrochnerarguments to point to a structure whose first and second members are 5245ec6e45Sdrochnerpointers to the next and previous element, respectively. 5345ec6e45SdrochnerThe 5445ec6e45Sdrochner.Fn insque 5545ec6e45Sdrochnerfunction also allows the 5645ec6e45Sdrochner.Fa pred 5745ec6e45Sdrochnerargument to be a 5845ec6e45Sdrochner.Dv NULL 5945ec6e45Sdrochnerpointer for the initialization of a new linear list's 6045ec6e45Sdrochnerhead element. 6145ec6e45Sdrochner.Sh STANDARDS 6245ec6e45SdrochnerThe 6345ec6e45Sdrochner.Fn insque 6445ec6e45Sdrochnerand 6545ec6e45Sdrochner.Fn remque 6645ec6e45Sdrochnerfunctions conform to 6745ec6e45Sdrochner.St -p1003.1-2001 . 68e866f279Sdrochner.Sh HISTORY 69*a293ac8fSjruohoThe 70*a293ac8fSjruoho.Fn insque 71*a293ac8fSjruohoand 72*a293ac8fSjruoho.Fn remque 73*a293ac8fSjruohoare derived from the 74*a293ac8fSjruoho.Sq insque 75*a293ac8fSjruohoand 76*a293ac8fSjruoho.Sq remque 77*a293ac8fSjruohoinstructions on the 78*a293ac8fSjruoho.Tn VAX . 79*a293ac8fSjruohoThey first appeared in 80*a293ac8fSjruoho.Bx 4.2 . 81