reactos/lib/sdk/crt/search/lsearch.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

23 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;
}