mirror of
https://github.com/reactos/reactos.git
synced 2025-06-19 23:55:20 +00:00
22 lines
403 B
C
22 lines
403 B
C
![]() |
#include <search.h>
|
||
|
#include <stdlib.h>
|
||
|
#include <string.h>
|
||
|
|
||
|
/*
|
||
|
* @implemented
|
||
|
*/
|
||
|
void *_lsearch(const void *key, void *base, size_t *nelp, size_t width,
|
||
|
int (*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;
|
||
|
}
|
||
|
|