mirror of
https://github.com/reactos/reactos.git
synced 2026-09-15 06:10:07 +08:00
21 lines
384 B
C
21 lines
384 B
C
#include <string.h>
|
|
/*
|
|
* @implemented
|
|
*/
|
|
void *_lfind(const void *key, const void *base, size_t *nelp,
|
|
size_t width, int (*compar)(const void *, const void *))
|
|
{
|
|
char* char_base = (char*)base;
|
|
size_t i;
|
|
|
|
for (i = 0; i < *nelp; i++)
|
|
{
|
|
if (compar(key, char_base) == 0)
|
|
return char_base;
|
|
|
|
char_base += width;
|
|
}
|
|
|
|
return NULL;
|
|
}
|