2007-03-14 20:24:57 +00:00
|
|
|
#include <stdlib.h>
|
2008-08-27 03:59:24 +00:00
|
|
|
#include <search.h>
|
2007-03-14 20:24:57 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
2015-09-15 10:35:49 +00:00
|
|
|
void * __cdecl _lfind(const void *key, const void *base, unsigned int *nelp,
|
2009-08-06 15:27:23 +00:00
|
|
|
unsigned int width, int (__cdecl *compar)(const void *, const void *))
|
2007-03-14 20:24:57 +00:00
|
|
|
{
|
|
|
|
char* char_base = (char*)base;
|
|
|
|
unsigned int i;
|
|
|
|
|
|
|
|
for (i = 0; i < *nelp; i++) {
|
|
|
|
if (compar(key, char_base) == 0)
|
|
|
|
return char_base;
|
|
|
|
char_base += width;
|
|
|
|
}
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2008-08-27 03:59:24 +00:00
|
|
|
|