]>
Commit | Line | Data |
---|---|---|
fea681da MK |
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 2003-08-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 | .BI "void remque(void *" elem ); | |
40 | .SH DESCRIPTION | |
63aa9df0 | 41 | \fBinsque\fP() and \fBremque\fP() are functions for manipulating |
fea681da MK |
42 | doubly-linked lists. Each element in the list is a structure of |
43 | which the first two structure elements are a forward and a | |
44 | backward pointer. | |
45 | ||
63aa9df0 | 46 | \fBinsque\fP() inserts the element pointed to by \fIelem\fP |
fea681da MK |
47 | immediately after the element pointed to by \fIprev\fP, which must |
48 | not be NULL. | |
49 | ||
63aa9df0 | 50 | \fBremque\fP() removes the element pointed to by \fIelem\fP from the |
fea681da MK |
51 | doubly-linked list. |
52 | .SH "CONFORMING TO" | |
68e1685c | 53 | POSIX.1-2001 |
fea681da MK |
54 | .SH "HISTORICAL NOTES" |
55 | Traditionally (e.g. SunOS, Linux libc 4,5) the parameters of these | |
ef0b8171 | 56 | functions were of type \fIstruct qelem *\fP, where the struct |
fea681da MK |
57 | is defined as |
58 | ||
59 | .RS | |
60 | .nf | |
61 | struct qelem { | |
62 | struct qelem *q_forw; | |
63 | struct qelem *q_back; | |
64 | char q_data[1]; | |
65 | }; | |
66 | .fi | |
67 | .RE | |
68 | ||
69 | This is still what you will get if _GNU_SOURCE is defined before | |
70 | including <search.h>. | |
71 | ||
72 | The location of the prototypes for these functions differs among several | |
73 | versions of UNIX. The above is the POSIX version. | |
74 | Some systems place them in <string.h>. Linux libc4,5 placed them | |
75 | in <stdlib.h>. |