diff options
author | millert <> | 2003-05-08 23:26:30 +0000 |
---|---|---|
committer | millert <> | 2003-05-08 23:26:30 +0000 |
commit | cc7ac4251d9e79f59912cefe0a1327534890ca07 (patch) | |
tree | 1c26f297e22f3f1fe18f87a223c6bdff66a0e471 /src/lib/libc/stdlib/insque.3 | |
parent | 904702870b8643c3707b8b8747e4c6814f2afa54 (diff) | |
download | openbsd-cc7ac4251d9e79f59912cefe0a1327534890ca07.tar.gz openbsd-cc7ac4251d9e79f59912cefe0a1327534890ca07.tar.bz2 openbsd-cc7ac4251d9e79f59912cefe0a1327534890ca07.zip |
move insque(3) and remque(3) from libcompat -> libc; they are now POSIX
Diffstat (limited to 'src/lib/libc/stdlib/insque.3')
-rw-r--r-- | src/lib/libc/stdlib/insque.3 | 100 |
1 files changed, 100 insertions, 0 deletions
diff --git a/src/lib/libc/stdlib/insque.3 b/src/lib/libc/stdlib/insque.3 new file mode 100644 index 0000000000..b87adb87bc --- /dev/null +++ b/src/lib/libc/stdlib/insque.3 | |||
@@ -0,0 +1,100 @@ | |||
1 | .\" $OpenBSD: insque.3,v 1.1 2003/05/08 23:26:30 millert Exp $ | ||
2 | .\" Copyright (c) 1993 John Brezak | ||
3 | .\" All rights reserved. | ||
4 | .\" | ||
5 | .\" Redistribution and use in source and binary forms, with or without | ||
6 | .\" modification, are permitted provided that the following conditions | ||
7 | .\" are met: | ||
8 | .\" 1. Redistributions of source code must retain the above copyright | ||
9 | .\" notice, this list of conditions and the following disclaimer. | ||
10 | .\" 2. Redistributions in binary form must reproduce the above copyright | ||
11 | .\" notice, this list of conditions and the following disclaimer in the | ||
12 | .\" documentation and/or other materials provided with the distribution. | ||
13 | .\" 3. The name of the author may be used to endorse or promote products | ||
14 | .\" derived from this software without specific prior written permission. | ||
15 | .\" | ||
16 | .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR `AS IS'' AND | ||
17 | .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
18 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
19 | .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE | ||
20 | .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
21 | .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
22 | .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
23 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
24 | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
25 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
26 | .\" SUCH DAMAGE. | ||
27 | .\" | ||
28 | .\" | ||
29 | .Dd August 12, 1993 | ||
30 | .Dt INSQUE 3 | ||
31 | .Os | ||
32 | .Sh NAME | ||
33 | .Nm insque , | ||
34 | .Nm remque | ||
35 | .Nd insert/remove element from a queue | ||
36 | .Sh SYNOPSIS | ||
37 | .Fd #include <search.h> | ||
38 | .Ft void | ||
39 | .Fn insque "void *elem" "void *pred" | ||
40 | .Ft void | ||
41 | .Fn remque "void *elem" | ||
42 | .Sh DESCRIPTION | ||
43 | .Bf -symbolic | ||
44 | These interfaces have been superceded by the | ||
45 | .Xr queue 3 | ||
46 | macros and are provided for compatibility with legacy code. | ||
47 | .Ef | ||
48 | .Pp | ||
49 | .Fn insque | ||
50 | and | ||
51 | .Fn remque | ||
52 | manipulate queues built from doubly linked lists. | ||
53 | The queue can be either circular or linear. | ||
54 | Each element in the queue must be of the following form: | ||
55 | .Bd -literal | ||
56 | struct qelem { | ||
57 | struct qelem *q_forw; | ||
58 | struct qelem *q_back; | ||
59 | char q_data[]; | ||
60 | }; | ||
61 | .Ed | ||
62 | .Pp | ||
63 | The first two elements in the struct must be pointers of the | ||
64 | same type that point to the previous and next elements in | ||
65 | the queue respectively. | ||
66 | Any subsequent data in the struct is application-dependent. | ||
67 | .Pp | ||
68 | The | ||
69 | .Fn insque | ||
70 | function inserts | ||
71 | .Fa elem | ||
72 | into a queue immediately after | ||
73 | .Fa pred . | ||
74 | .Pp | ||
75 | The | ||
76 | .Fn remque | ||
77 | function removes | ||
78 | .Fa elem | ||
79 | from the queue. | ||
80 | .Sh DIAGNOSTICS | ||
81 | These functions are not atomic unless that machine architecture allows it. | ||
82 | .Sh SEE ALSO | ||
83 | .Xr queue 3 | ||
84 | .Sh STANDARDS | ||
85 | The | ||
86 | .Fn lsearch | ||
87 | and | ||
88 | .Fn lfind | ||
89 | functions conform to the | ||
90 | .St -p1003.1-01 | ||
91 | and | ||
92 | .St -xpg4.3 . | ||
93 | specifications. | ||
94 | .Sh HISTORY | ||
95 | The | ||
96 | .Fn insque | ||
97 | and | ||
98 | .Fn remque | ||
99 | functions are derived from the insque and remque instructions on a | ||
100 | .Tn VAX . | ||