Bring back ext2 code from branch
[reactos.git] / reactos / lib / sdk / crt / search / lfind.c
1 #include <search.h>
2 #include <stdlib.h>
3
4
5 /*
6 * @implemented
7 */
8 void *_lfind(const void *key, const void *base, size_t *nelp,
9 size_t width, int (*compar)(const void *, const void *))
10 {
11 char* char_base = (char*)base;
12 unsigned int i;
13
14 for (i = 0; i < *nelp; i++) {
15 if (compar(key, char_base) == 0)
16 return char_base;
17 char_base += width;
18 }
19 return NULL;
20 }
21