ReactOS  0.4.15-dev-3303-g1ade494
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  */
8 void * __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 
GLint GLint GLsizei width
Definition: gl.h:1546
#define __cdecl
Definition: accygwin.h:79
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
GLuint base
Definition: 3dtext.c:35
void * _lfind(const void *match, const void *start, unsigned int *array_size, unsigned int elem_size, int(*cf)(const void *, const void *))
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define NULL
Definition: types.h:112
Definition: path.c:41