4 * Functions for searching and sorting.
6 * This file is part of the Mingw32 package.
9 * Created by Danny Smith <dannysmith@users.sourceforge.net>
11 * THIS SOFTWARE IS NOT COPYRIGHTED
13 * This source code is offered for use in the public domain. You may
14 * use, modify or distribute it freely.
16 * This code is distributed in the hope that it will be useful but
17 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
18 * DISCLAIMED. This includes but is not limited to warranties of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
26 /* All the headers include this file. */
35 #ifndef _SIZE_T_DEFINED
36 typedef unsigned int size_t;
37 #define _SIZE_T_DEFINED
40 /* bsearch and qsort are also declared in stdlib.h */
41 _CRTIMP
void* __cdecl
bsearch (const void*, const void*, size_t, size_t,
42 int (*)(const void*, const void*));
43 _CRTIMP
void __cdecl
qsort (void*, size_t, size_t,
44 int (*)(const void*, const void*));
46 _CRTIMP
void* __cdecl
_lfind (const void*, const void*, unsigned int*,
47 unsigned int, int (*)(const void*, const void*));
48 _CRTIMP
void* __cdecl
_lsearch (const void*, void*, unsigned int*, unsigned int,
49 int (*)(const void*, const void*));
51 Documentation for these POSIX definitions and prototypes can be found in
52 The Open Group Base Specifications Issue 6
53 IEEE Std 1003.1, 2004 Edition.
54 eg: http://www.opengroup.org/onlinepubs/009695399/functions/twalk.html
58 typedef struct entry
{
75 #ifdef _SEARCH_PRIVATE
78 struct node
*llink
, *rlink
;
82 void * __cdecl
tdelete (const void * __restrict__
, void ** __restrict__
,
83 int (*)(const void *, const void *))
84 __MINGW_ATTRIB_NONNULL (1) __MINGW_ATTRIB_NONNULL (3);
85 void * __cdecl
tfind (const void *, void * const *,
86 int (*)(const void *, const void *))
87 __MINGW_ATTRIB_NONNULL (1) __MINGW_ATTRIB_NONNULL (3);
88 void * __cdecl
tsearch (const void *, void **,
89 int (*)(const void *, const void *))
90 __MINGW_ATTRIB_NONNULL (1) __MINGW_ATTRIB_NONNULL (3);
91 void __cdecl
twalk (const void *, void (*)(const void *, VISIT
, int));
94 _CRTIMP
void* __cdecl
lfind (const void*, const void*, unsigned int*,
95 unsigned int, int (*)(const void*, const void*));
96 _CRTIMP
void* __cdecl
lsearch (const void*, void*, unsigned int*, unsigned int,
97 int (*)(const void*, const void*));
104 #endif /* RC_INVOKED */
106 #endif /* _SEARCH_H_ */