Share more duplicated functions
[reactos.git] / reactos / lib / string / lfind.c
1 #include <string.h>
2 /*
3 * @implemented
4 */
5 void *_lfind(const void *key, const void *base, size_t *nelp,
6 size_t width, int (*compar)(const void *, const void *))
7 {
8 char* char_base = (char*)base;
9 size_t i;
10
11 for (i = 0; i < *nelp; i++)
12 {
13 if (compar(key, char_base) == 0)
14 return char_base;
15
16 char_base += width;
17 }
18
19 return NULL;
20 }