xref: /freebsd/lib/libc/stdlib/insque.3 (revision 51e235148a4becba94e824a44bd69687644a7f56)
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.Dd October 10, 2002
10.Dt INSQUE 3
11.Os
12.Sh NAME
13.Nm insque ,
14.Nm remque
15.Nd doubly-linked list management
16.Sh LIBRARY
17.Lb libc
18.Sh SYNOPSIS
19.In search.h
20.Ft void
21.Fn insque "void *element1" "void *pred"
22.Ft void
23.Fn remque "void *element"
24.Sh DESCRIPTION
25The
26.Fn insque
27and
28.Fn remque
29functions encapsulate the ever-repeating task of doing insertion and
30removal operations on doubly linked lists.
31The functions expect their
32arguments to point to a structure whose first and second members are
33pointers to the next and previous element, respectively.
34The
35.Fn insque
36function also allows the
37.Fa pred
38argument to be a
39.Dv NULL
40pointer for the initialization of a new list's
41head element.
42.Sh STANDARDS
43The
44.Fn insque
45and
46.Fn remque
47functions conform to
48.St -p1003.1-2001 .
49.Sh HISTORY
50The
51.Fn insque
52and
53.Fn remque
54functions appeared in
55.Bx 4.2 .
56In
57.Fx 5.0 ,
58they reappeared conforming to
59.St -p1003.1-2001 .
60