ReactOS 0.4.16-dev-2110-ge3521eb
lsearch.c
Go to the documentation of this file.
1#include <stdlib.h>
2#include <string.h>
3#include <search.h>
4
5/*
6 * @implemented
7 */
8void * __cdecl _lsearch(const void *key, void *base, unsigned int *nelp, unsigned int width,
9 int (__cdecl *compar)(const void *, const void *))
10{
11 void *ret_find = _lfind(key,base,nelp,width,compar);
12
13 if (ret_find != NULL)
14 return ret_find;
15
16 memcpy((void*)((int*)base + (*nelp*width)), key, width);
17
18 (*nelp)++;
19 return base;
20}
21
22
#define NULL
Definition: types.h:112
#define __cdecl
Definition: corecrt.h:121
_ACRTIMP void *__cdecl _lfind(const void *, const void *, unsigned int *, unsigned int, int(__cdecl *)(const void *, const void *))
GLint GLint GLsizei width
Definition: gl.h:1546
void *__cdecl _lsearch(const void *key, void *base, unsigned int *nelp, unsigned int width, int(__cdecl *compar)(const void *, const void *))
Definition: lsearch.c:8
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
Definition: copy.c:22