#include <stddef.h>
#include <stdlib.h>
Go to the source code of this file.
|
void * | bsearch (void *key, const void *base0, size_t nmemb, size_t size, int *compar) const |
|
◆ bsearch()
void* bsearch |
( |
void * |
key, |
|
|
const void * |
base0, |
|
|
size_t |
nmemb, |
|
|
size_t |
size, |
|
|
int * |
compar |
|
) |
| const |
Definition at line 51 of file bsearch.c.
59 const char* base = base0;
64 for(lim = nmemb; lim != 0; lim >>= 1)
66 p = base + (lim >> 1) * size;
67 cmp = (*compar)(key, p);
70 return ((
void*)(uintptr_t)p);
74 base = (
const char*)p + size;
int cmp(Bigint *a, Bigint *b)
References cmp(), and NULL.