summaryrefslogtreecommitdiff
path: root/src/lib/libc/stdlib/bsearch.3
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libc/stdlib/bsearch.3')
-rw-r--r--src/lib/libc/stdlib/bsearch.319
1 files changed, 8 insertions, 11 deletions
diff --git a/src/lib/libc/stdlib/bsearch.3 b/src/lib/libc/stdlib/bsearch.3
index 1622c96c6b..9bb9d4ece4 100644
--- a/src/lib/libc/stdlib/bsearch.3
+++ b/src/lib/libc/stdlib/bsearch.3
@@ -1,5 +1,5 @@
1.\" Copyright (c) 1990, 1991 The Regents of the University of California. 1.\" Copyright (c) 1990, 1991, 1993, 1994
2.\" All rights reserved. 2.\" The Regents of the University of California. All rights reserved.
3.\" 3.\"
4.\" This code is derived from software contributed to Berkeley by 4.\" This code is derived from software contributed to Berkeley by
5.\" the American National Standards Committee X3, on Information 5.\" the American National Standards Committee X3, on Information
@@ -33,10 +33,9 @@
33.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34.\" SUCH DAMAGE. 34.\" SUCH DAMAGE.
35.\" 35.\"
36.\" from: @(#)bsearch.3 5.6 (Berkeley) 6/29/91 36.\" $OpenBSD: bsearch.3,v 1.5 2000/04/20 13:50:01 aaron Exp $
37.\" $Id: bsearch.3,v 1.1.1.1 1995/10/18 08:42:16 deraadt Exp $
38.\" 37.\"
39.Dd June 29, 1991 38.Dd April 19, 1994
40.Dt BSEARCH 3 39.Dt BSEARCH 3
41.Os 40.Os
42.Sh NAME 41.Sh NAME
@@ -51,12 +50,12 @@ The
51.Fn bsearch 50.Fn bsearch
52function searches an array of 51function searches an array of
53.Fa nmemb 52.Fa nmemb
54objects, the initial member of which is 53objects, the initial member of which is
55pointed to by 54pointed to by
56.Fa base , 55.Fa base ,
57for a member that matches the object pointed to by 56for a member that matches the object pointed to by
58.Fa key . 57.Fa key .
59The size of each member of the array is specified by 58The size of each member of the array is specified by
60.Fa size . 59.Fa size .
61.Pp 60.Pp
62The contents of the array should be in ascending sorted order according 61The contents of the array should be in ascending sorted order according
@@ -64,9 +63,7 @@ to the comparison function referenced by
64.Fa compar . 63.Fa compar .
65The 64The
66.Fa compar 65.Fa compar
67routine 66routine is expected to have two arguments which point to the
68is expected to have two
69two arguments which point to the
70.Fa key 67.Fa key
71object and to an array member, in that order, and should return an integer 68object and to an array member, in that order, and should return an integer
72less than, equal to, or greater than zero if the 69less than, equal to, or greater than zero if the
@@ -83,7 +80,7 @@ If two members compare as equal, which member is matched is unspecified.
83.Xr db 3 , 80.Xr db 3 ,
84.Xr lsearch 3 , 81.Xr lsearch 3 ,
85.Xr qsort 3 , 82.Xr qsort 3 ,
86.\" .Xr tsearch 3 83.Xr tsearch 3
87.Sh STANDARDS 84.Sh STANDARDS
88The 85The
89.Fn bsearch 86.Fn bsearch