1 --- bsearch.3.bsdnew 2009-11-13 14:11:47.000000000 -0800
2 +++ bsearch.3 2009-11-13 14:11:48.000000000 -0800
4 .\" @(#)bsearch.3 8.3 (Berkeley) 4/19/94
5 .\" $FreeBSD: src/lib/libc/stdlib/bsearch.3,v 1.9 2007/01/09 00:28:09 imp Exp $
12 +#ifdef UNIFDEF_BLOCKS
18 .Nd binary search of a sorted table
24 -.Fn bsearch "const void *key" "const void *base" "size_t nmemb" "size_t size" "int (*compar) (const void *, const void *)"
25 +.Fn bsearch "const void *key" "const void *base" "size_t nel" "size_t width" "int (*compar) (const void *, const void *)"
26 +#ifdef UNIFDEF_BLOCKS
28 +.Fn bsearch_b "const void *key" "const void *base" "size_t nel" "size_t width" "int (^compar) (const void *, const void *)"
33 function searches an array of
36 objects, the initial member of which is
39 for a member that matches the object pointed to by
41 -The size of each member of the array is specified by
43 +The size (in bytes) of each member of the array is specified by
46 The contents of the array should be in ascending sorted order according
47 to the comparison function referenced by
48 @@ -66,15 +73,33 @@ routine
50 two arguments which point to the
52 -object and to an array member, in that order, and should return an integer
53 +object and to an array member, in that order.
54 +It should return an integer which is
55 less than, equal to, or greater than zero if the
57 object is found, respectively, to be less than, to match, or be
58 greater than the array member.
59 +#ifdef UNIFDEF_BLOCKS
67 +is a block pointer instead of a function pointer.
72 -function returns a pointer to a matching member of the array, or a null
73 +#ifdef UNIFDEF_BLOCKS
80 +returns a pointer to a matching member of the array, or a null
81 pointer if no match is found.
82 If two members compare as equal, which member is matched is unspecified.