- Sync up Mm interface with WinLdr branch (introduce the concept of a memory type...
[reactos.git] / reactos / lib / sdk / crt / search / lsearch.c
1 #include <search.h>
2 #include <stdlib.h>
3 #include <string.h>
4
5 /*
6 * @implemented
7 */
8 void *_lsearch(const void *key, void *base, size_t *nelp, size_t width,
9 int (*compar)(const void *, const void *))
10 {
11 void *ret_find = _lfind(key,base,nelp,width,compar);
12
13 if (ret_find != NULL)
14 return ret_find;
15
16 memcpy((void*)((int*)base + (*nelp*width)), key, width);
17
18 (*nelp)++;
19 return base;
20 }
21