reactos/lib/sdk/crt/search/lsearch.c
Amine Khaldi c424146e2c Create a branch for cmake bringup.
svn path=/branches/cmake-bringup/; revision=48236
2010-07-24 18:52:44 +00:00

22 lines
424 B
C

#include <stdlib.h>
#include <string.h>
#include <search.h>
/*
* @implemented
*/
void *_lsearch(const void *key, void *base, unsigned int *nelp, unsigned int width,
int (__cdecl *compar)(const void *, const void *))
{
void *ret_find = _lfind(key,base,nelp,width,compar);
if (ret_find != NULL)
return ret_find;
memcpy((void*)((int*)base + (*nelp*width)), key, width);
(*nelp)++;
return base;
}