28 |
* SUCH DAMAGE. |
* SUCH DAMAGE. |
29 |
*/ |
*/ |
30 |
|
|
31 |
|
/* |
32 |
|
|
33 |
|
@deftypefn Supplemental void* bsearch (const void *@var{key}, const void *@var{base}, size_t @var{nmemb}, size_t @var{size}, int (*@var{compar})(const void *, const void *)) |
34 |
|
|
35 |
|
Performs a search over an array of @var{nmemb} elements pointed to by |
36 |
|
@var{base} for a member that matches the object pointed to by @var{key}. |
37 |
|
The size of each member is specified by @var{size}. The array contents |
38 |
|
should be sorted in ascending order according to the @var{compar} |
39 |
|
comparison function. This routine should take two arguments pointing to |
40 |
|
the @var{key} and to an array member, in that order, and should return an |
41 |
|
integer less than, equal to, or greater than zero if the @var{key} object |
42 |
|
is respectively less than, matching, or greater than the array member. |
43 |
|
|
44 |
|
@end deftypefn |
45 |
|
|
46 |
|
*/ |
47 |
|
|
48 |
#include "config.h" |
#include "config.h" |
49 |
#include "ansidecl.h" |
#include "ansidecl.h" |
50 |
#include <sys/types.h> /* size_t */ |
#include <sys/types.h> /* size_t */ |