xref: /freebsd/lib/libc/stdlib/insque.3 (revision 1669d8afc64812c8d2d1d147ae1fd42ff441e1b1)
1.\"
2.\" Initial implementation:
3.\" Copyright (c) 2002 Robert Drehmel
4.\" All rights reserved.
5.\"
6.\" As long as the above copyright statement and this notice remain
7.\" unchanged, you can do what ever you want with this file.
8.\"
9.\" $FreeBSD$
10.\"
11.Dd October 10, 2002
12.Dt INSQUE 3
13.Os
14.Sh NAME
15.Nm insque ,
16.Nm remque
17.Nd doubly-linked list management
18.Sh LIBRARY
19.Lb libc
20.Sh SYNOPSIS
21.In search.h
22.Ft void
23.Fn insque "void *element1" "void *pred"
24.Ft void
25.Fn remque "void *element"
26.Sh DESCRIPTION
27The
28.Fn insque
29and
30.Fn remque
31functions encapsulate the ever-repeating task of doing insertion and
32removal operations on doubly linked lists.
33The functions expect their
34arguments to point to a structure whose first and second members are
35pointers to the next and previous element, respectively.
36The
37.Fn insque
38function also allows the
39.Fa pred
40argument to be a
41.Dv NULL
42pointer for the initialization of a new list's
43head element.
44.Sh STANDARDS
45The
46.Fn insque
47and
48.Fn remque
49functions conform to
50.St -p1003.1-2001 .
51.Sh HISTORY
52The
53.Fn insque
54and
55.Fn remque
56functions appeared in
57.Bx 4.2 .
58In
59.Fx 5.0 ,
60they reappeared conforming to
61.St -p1003.1-2001 .
62