diff options
Diffstat (limited to 'src/lib/libc/stdlib/insque.3')
| -rw-r--r-- | src/lib/libc/stdlib/insque.3 | 106 |
1 files changed, 106 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..dcb2b0d158 --- /dev/null +++ b/src/lib/libc/stdlib/insque.3 | |||
| @@ -0,0 +1,106 @@ | |||
| 1 | .\" $OpenBSD: insque.3,v 1.7 2007/05/31 19:19:31 jmc 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 $Mdocdate: May 31 2007 $ | ||
| 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 -offset indent | ||
| 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 | .Pp | ||
| 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 insque | ||
| 87 | and | ||
| 88 | .Fn remque | ||
| 89 | functions conform to the | ||
| 90 | .St -p1003.1-2001 | ||
| 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 | ||
| 100 | .Li insque | ||
| 101 | and | ||
| 102 | .Li remque | ||
| 103 | instructions on the | ||
| 104 | .Tn VAX . | ||
| 105 | They first appeared in | ||
| 106 | .Bx 4.2 . | ||
