reactos/lib/sdk/crt/search/lfind.c
Amine Khaldi 527f2f9057 [SHELL/EXPERIMENTS]
* Create a branch for some evul shell experiments.

svn path=/branches/shell-experiments/; revision=61927
2014-02-02 19:37:27 +00:00

22 lines
397 B
C

#include <stdlib.h>
#include <search.h>
/*
* @implemented
*/
void *_lfind(const void *key, const void *base, unsigned int *nelp,
unsigned int width, int (__cdecl *compar)(const void *, const void *))
{
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;
}