2007-03-14 20:24:57 +00:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
2008-08-27 03:59:24 +00:00
|
|
|
#include <search.h>
|
2007-03-14 20:24:57 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* @implemented
|
|
|
|
*/
|
2015-09-15 10:35:49 +00:00
|
|
|
void * __cdecl _lsearch(const void *key, void *base, unsigned int *nelp, unsigned int width,
|
2009-08-06 15:27:23 +00:00
|
|
|
int (__cdecl *compar)(const void *, const void *))
|
2007-03-14 20:24:57 +00:00
|
|
|
{
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2008-08-27 03:59:24 +00:00
|
|
|
|