]> git.saurik.com Git - apple/libc.git/blobdiff - stdlib/bsearch.3
Libc-594.1.4.tar.gz
[apple/libc.git] / stdlib / bsearch.3
index dc91d91d2d7d92d879e1954b60d7e7dd3c5de773..5eeac32389921fad1a0eea91941adac6aaded5ba 100644 (file)
 .\"     @(#)bsearch.3  8.3 (Berkeley) 4/19/94
 .\" $FreeBSD: src/lib/libc/stdlib/bsearch.3,v 1.8 2001/09/07 14:46:35 asmodai Exp $
 .\"
-.Dd April 19, 1994
+.Dd May 20, 2008
 .Dt BSEARCH 3
 .Os
 .Sh NAME
+#ifdef UNIFDEF_BLOCKS
+.Nm bsearch ,
+.Nm bsearch_b
+#else
 .Nm bsearch
+#endif
 .Nd binary search of a sorted table
-.Sh LIBRARY
-.Lb libc
 .Sh SYNOPSIS
 .In stdlib.h
 .Ft void *
 .Fn bsearch "const void *key" "const void *base" "size_t nel" "size_t width" "int (*compar) (const void *, const void *)"
+#ifdef UNIFDEF_BLOCKS
+.Ft void *
+.Fn bsearch_b "const void *key" "const void *base" "size_t nel" "size_t width" "int (^compar) (const void *, const void *)"
+#endif
 .Sh DESCRIPTION
 The
 .Fn bsearch
@@ -76,10 +83,27 @@ less than, equal to, or greater than zero if the
 .Fa key
 object is found, respectively, to be less than, to match, or be
 greater than the array member.
+#ifdef UNIFDEF_BLOCKS
+.Pp
+The
+.Fn bsearch_b
+function is like
+.Fn bsearch
+except the callback
+.Fa compar
+is a block pointer instead of a function pointer.
+#endif
 .Sh RETURN VALUES
 The
 .Fn bsearch
-function returns a pointer to a matching member of the array, or a null
+#ifdef UNIFDEF_BLOCKS
+and
+.Fn bsearch_b
+functions
+#else
+function
+#endif
+returns a pointer to a matching member of the array, or a null
 pointer if no match is found.
 If two members compare as equal, which member is matched is unspecified.
 .Sh SEE ALSO