ReactOS 0.4.16-dev-1104-ge0ef51b
corecrt_search.h
Go to the documentation of this file.
1//
2// corecrt_search.h
3//
4// Copyright (c) Microsoft Corporation. All rights reserved.
5//
6// Declarations of functions for sorting and searching. These declarations are
7// split out so that they may be included by both <stdlib.h> and <search.h>.
8// <stdlib.h> does not include <search.h> to avoid introducing conflicts with
9// other user headers named <search.h>.
10//
11#pragma once
12
13#include <corecrt.h>
14#include <stddef.h>
15
16#pragma warning(push)
17#pragma warning(disable: _UCRT_DISABLED_WARNINGS)
19
21
22
23 typedef int (__cdecl* _CoreCrtSecureSearchSortCompareFunction)(void*, void const*, void const*);
24 typedef int (__cdecl* _CoreCrtNonSecureSearchSortCompareFunction)(void const*, void const*);
25
26
27#if __STDC_WANT_SECURE_LIB__
28
30 _ACRTIMP void* __cdecl bsearch_s(
31 _In_ void const* _Key,
32 _In_reads_bytes_(_NumOfElements * _SizeOfElements) void const* _Base,
33 _In_ rsize_t _NumOfElements,
35 _In_ _CoreCrtSecureSearchSortCompareFunction _CompareFunction,
36 _In_opt_ void* _Context
37 );
38
39 _ACRTIMP void __cdecl qsort_s(
40 _Inout_updates_bytes_(_NumOfElements * _SizeOfElements) void* _Base,
41 _In_ rsize_t _NumOfElements,
43 _In_ _CoreCrtSecureSearchSortCompareFunction _CompareFunction,
44 _In_opt_ void* _Context
45 );
46
47#endif // __STDC_WANT_SECURE_LIB__
48
49
50
53 _In_ void const* _Key,
54 _In_reads_bytes_(_NumOfElements * _SizeOfElements) void const* _Base,
55 _In_ size_t _NumOfElements,
56 _In_ size_t _SizeOfElements,
57 _In_ _CoreCrtNonSecureSearchSortCompareFunction _CompareFunction
58 );
59
61 _Inout_updates_bytes_(_NumOfElements * _SizeOfElements) void* _Base,
62 _In_ size_t _NumOfElements,
63 _In_ size_t _SizeOfElements,
64 _In_ _CoreCrtNonSecureSearchSortCompareFunction _CompareFunction
65 );
66
69 _In_ void const* _Key,
70 _In_reads_bytes_((*_NumOfElements) * _SizeOfElements) void const* _Base,
71 _Inout_ unsigned int* _NumOfElements,
72 _In_ size_t _SizeOfElements,
73 _In_ _CoreCrtSecureSearchSortCompareFunction _CompareFunction,
74 _In_ void* _Context
75 );
76
79 _In_ void const* _Key,
80 _In_reads_bytes_((*_NumOfElements) * _SizeOfElements) void const* _Base,
81 _Inout_ unsigned int* _NumOfElements,
82 _In_ unsigned int _SizeOfElements,
83 _In_ _CoreCrtNonSecureSearchSortCompareFunction _CompareFunction
84 );
85
88 _In_ void const* _Key,
89 _Inout_updates_bytes_((*_NumOfElements ) * _SizeOfElements) void* _Base,
90 _Inout_ unsigned int* _NumOfElements,
91 _In_ size_t _SizeOfElements,
92 _In_ _CoreCrtSecureSearchSortCompareFunction _CompareFunction,
93 _In_ void* _Context
94 );
95
98 _In_ void const* _Key,
99 _Inout_updates_bytes_((*_NumOfElements ) * _SizeOfElements) void* _Base,
100 _Inout_ unsigned int* _NumOfElements,
101 _In_ unsigned int _SizeOfElements,
102 _In_ _CoreCrtNonSecureSearchSortCompareFunction _CompareFunction
103 );
104
105
106
107// Managed search routines
108#if defined __cplusplus && defined _M_CEE
109extern "C++"
110{
111 typedef int (__clrcall* _CoreCrtMgdSecureSearchSortCompareFunction)(void*, void const*, void const*);
112 typedef int (__clrcall* _CoreCrtMgdNonSecureSearchSortCompareFunction)(void const*, void const*);
113
114 #if __STDC_WANT_SECURE_LIB__
115
117 void* __clrcall bsearch_s(
118 _In_ void const* _Key,
119 _In_reads_bytes_(_NumOfElements * _SizeOfElements) void const* _Base,
120 _In_ rsize_t _NumOfElements,
122 _In_ _CoreCrtMgdSecureSearchSortCompareFunction _CompareFunction,
123 _In_ void* _Context);
124
125 void __clrcall qsort_s(
126 _Inout_updates_bytes_(_NumOfElements * _SizeOfElements) void* _Base,
127 _In_ rsize_t _NumOfElements,
129 _In_ _CoreCrtMgdSecureSearchSortCompareFunction _CompareFunction,
130 _In_ void* _Context);
131
132 #endif // __STDC_WANT_SECURE_LIB__
133
135 void* __clrcall bsearch(
136 _In_ void const* _Key,
137 _In_reads_bytes_(_NumOfElements * _SizeOfElements) void const* _Base,
138 _In_ size_t _NumOfElements,
139 _In_ size_t _SizeOfElements,
140 _In_ _CoreCrtMgdNonSecureSearchSortCompareFunction _CompareFunction
141 );
142
144 void* __clrcall _lfind_s(
145 _In_ void const* _Key,
146 _In_reads_bytes_(_NumOfElements * _SizeOfElements) void const* _Base,
147 _Inout_ unsigned int* _NumOfElements,
148 _In_ size_t _SizeOfElements,
149 _In_ _CoreCrtMgdSecureSearchSortCompareFunction _CompareFunction,
150 _In_ void* _Context
151 );
152
154 void* __clrcall _lfind(
155 _In_ void const* _Key,
156 _In_reads_bytes_((*_NumOfElements) * _SizeOfElements) void const* _Base,
157 _Inout_ unsigned int* _NumOfElements,
158 _In_ unsigned int _SizeOfElements,
159 _In_ _CoreCrtMgdNonSecureSearchSortCompareFunction _CompareFunction
160 );
161
163 void* __clrcall _lsearch_s(
164 _In_ void const* _Key,
165 _In_reads_bytes_((*_NumOfElements) * _SizeOfElements) void* _Base,
166 _In_ unsigned int* _NumOfElements,
167 _In_ size_t _SizeOfElements,
168 _In_ _CoreCrtMgdSecureSearchSortCompareFunction _CompareFunction,
169 _In_ void* _Context
170 );
171
173 void* __clrcall _lsearch(
174 _In_ void const* _Key,
175 _Inout_updates_bytes_((*_NumOfElements) * _SizeOfElements) void* _Base,
176 _Inout_ unsigned int* _NumOfElements,
177 _In_ unsigned int _SizeOfElements,
178 _In_ _CoreCrtMgdNonSecureSearchSortCompareFunction _CompareFunction
179 );
180
181 void __clrcall qsort(
182 _Inout_updates_bytes_(_NumOfElements * _SizeOfElements) void* _Base,
183 _In_ size_t _NumOfElements,
184 _In_ size_t _SizeOfElements,
185 _In_ _CoreCrtMgdNonSecureSearchSortCompareFunction _CompareFunction
186 );
187}
188#endif // defined __cplusplus && defined _M_CEE
189
190
191
192#if defined(_CRT_INTERNAL_NONSTDC_NAMES) && _CRT_INTERNAL_NONSTDC_NAMES
193
195 _ACRTIMP void* __cdecl lfind(
196 _In_ void const* _Key,
197 _In_reads_bytes_((*_NumOfElements) * _SizeOfElements) void const* _Base,
198 _Inout_ unsigned int* _NumOfElements,
199 _In_ unsigned int _SizeOfElements,
200 _In_ _CoreCrtNonSecureSearchSortCompareFunction _CompareFunction
201 );
202
205 _In_ void const* _Key,
206 _Inout_updates_bytes_((*_NumOfElements) * _SizeOfElements) void* _Base,
207 _Inout_ unsigned int* _NumOfElements,
208 _In_ unsigned int _SizeOfElements,
209 _In_ _CoreCrtNonSecureSearchSortCompareFunction _CompareFunction
210 );
211
212#endif // _CRT_INTERNAL_NONSTDC_NAMES
213
214
215
218#pragma warning(pop) // _UCRT_DISABLED_WARNINGS
#define __cdecl
Definition: accygwin.h:79
_Check_return_ _ACRTIMP void *__cdecl _lfind(_In_ void const *_Key, _In_reads_bytes_((*_NumOfElements) *_SizeOfElements) void const *_Base, _Inout_ unsigned int *_NumOfElements, _In_ unsigned int _SizeOfElements, _In_ _CoreCrtNonSecureSearchSortCompareFunction _CompareFunction)
_Check_return_ _ACRTIMP void *__cdecl _lsearch(_In_ void const *_Key, _Inout_updates_bytes_((*_NumOfElements) *_SizeOfElements) void *_Base, _Inout_ unsigned int *_NumOfElements, _In_ unsigned int _SizeOfElements, _In_ _CoreCrtNonSecureSearchSortCompareFunction _CompareFunction)
_ACRTIMP void __cdecl qsort(_Inout_updates_bytes_(_NumOfElements *_SizeOfElements) void *_Base, _In_ size_t _NumOfElements, _In_ size_t _SizeOfElements, _In_ _CoreCrtNonSecureSearchSortCompareFunction _CompareFunction)
_Check_return_ _ACRTIMP void *__cdecl _lfind_s(_In_ void const *_Key, _In_reads_bytes_((*_NumOfElements) *_SizeOfElements) void const *_Base, _Inout_ unsigned int *_NumOfElements, _In_ size_t _SizeOfElements, _In_ _CoreCrtSecureSearchSortCompareFunction _CompareFunction, _In_ void *_Context)
_Check_return_ _ACRTIMP void *__cdecl _lsearch_s(_In_ void const *_Key, _Inout_updates_bytes_((*_NumOfElements) *_SizeOfElements) void *_Base, _Inout_ unsigned int *_NumOfElements, _In_ size_t _SizeOfElements, _In_ _CoreCrtSecureSearchSortCompareFunction _CompareFunction, _In_ void *_Context)
_Check_return_ _In_z_ wchar_t const _Inout_opt_ _Deref_prepost_opt_z_ wchar_t ** _Context
_Check_return_ _Ret_maybenull_ _In_ size_t _SizeOfElements
Definition: malloc.h:76
_Check_return_ _CRTIMP void *__cdecl lsearch(_In_ const void *_Key, _Inout_updates_bytes_((*_NumOfElements) *_SizeOfElements) void *_Base, _Inout_ unsigned int *_NumOfElements, _In_ unsigned int _SizeOfElements, _In_ int(__cdecl *_PtFuncCompare)(const void *, const void *))
size_t rsize_t
Definition: stubs.c:780
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
#define _In_reads_bytes_(s)
Definition: no_sal2.h:170
#define _Inout_
Definition: no_sal2.h:162
#define _Check_return_
Definition: no_sal2.h:60
#define _In_
Definition: no_sal2.h:158
#define _In_opt_
Definition: no_sal2.h:212
#define _Inout_updates_bytes_(s)
Definition: no_sal2.h:184
_In_ int _Base
Definition: time.h:330
#define lfind
Definition: tif_config.h:130
#define bsearch
#define _CRT_NONSTDC_DEPRECATE(_NewName)
Definition: corecrt.h:439
#define _ACRTIMP
Definition: corecrt.h:138
#define _UCRT_DISABLE_CLANG_WARNINGS
Definition: corecrt.h:109
#define _UCRT_RESTORE_CLANG_WARNINGS
Definition: corecrt.h:117
#define _CRT_END_C_HEADER
Definition: vcruntime.h:42
#define _CRT_BEGIN_C_HEADER
Definition: vcruntime.h:40