ReactOS 0.4.15-dev-7958-gcd0bb1a
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 __cdecl
Definition: accygwin.h:79
#define NULL
Definition: types.h:112
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
void * _lfind(const void *match, const void *start, unsigned int *array_size, unsigned int elem_size, int(*cf)(const void *, const void *))
Definition: copy.c:22