OSDN Git Service

636f08894d3cd5af44e031a9f8571e11adf4dcbd
[linuxjm/LDP_man-pages.git] / original / man3 / insque.3
1 .\" peter memishian -- meem@gnu.ai.mit.edu
2 .\" $Id: insque.3,v 1.2 1996/10/30 21:03:39 meem Exp meem $
3 .\"
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
7 .\"
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
12 .\"
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein.  The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
19 .\" professionally.
20 .\"
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
23 .\"
24 .\" References consulted:
25 .\"   Linux libc source code (5.4.7)
26 .\"   Solaris 2.x, OSF/1, and HP-UX manpages
27 .\"   Curry's "UNIX Systems Programming for SVR4" (O'Reilly & Associates 1996)
28 .\"
29 .\" Changed to POSIX, 2003-08-11, aeb+wh
30 .\"
31 .TH INSQUE 3  2008-07-11 "" "Linux Programmer's Manual"
32 .SH NAME
33 insque, remque \- insert/remove an item from a queue
34 .SH SYNOPSIS
35 .nf
36 .B #include <search.h>
37 .sp
38 .BI "void insque(void *" elem ", void *" prev );
39
40 .BI "void remque(void *" elem );
41 .fi
42 .sp
43 .in -4n
44 Feature Test Macro Requirements for glibc (see
45 .BR feature_test_macros (7)):
46 .in
47 .sp
48 .BR insque (),
49 .BR remque ():
50 _SVID_SOURCE || _XOPEN_SOURCE\ >=\ 500
51 .SH DESCRIPTION
52 .BR insque ()
53 and
54 .BR remque ()
55 are functions for manipulating
56 doubly-linked lists.
57 Each element in the list is a structure of
58 which the first two structure elements are a forward and a
59 backward pointer.
60
61 .BR insque ()
62 inserts the element pointed to by \fIelem\fP
63 immediately after the element pointed to by \fIprev\fP, which must
64 not be NULL.
65
66 .BR remque ()
67 removes the element pointed to by \fIelem\fP from the
68 doubly-linked list.
69 .SH "CONFORMING TO"
70 POSIX.1-2001.
71 .SH "NOTES"
72 Traditionally (e.g., SunOS, Linux libc 4 and libc 5),
73 the arguments of these functions were of type \fIstruct qelem *\fP,
74 defined as:
75
76 .in +4n
77 .nf
78 struct qelem {
79     struct qelem *q_forw;
80     struct qelem *q_back;
81     char          q_data[1];
82 };
83 .fi
84 .in
85
86 This is still what you will get if
87 .B _GNU_SOURCE
88 is defined before
89 including \fI<search.h>\fP.
90
91 The location of the prototypes for these functions differs among several
92 versions of Unix.
93 The above is the POSIX version.
94 Some systems place them in \fI<string.h>\fP.
95 Linux libc4 and libc 5 placed them
96 in \fI<stdlib.h>\fP.