STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
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 
17 
18 
19  typedef int (__cdecl* _CoreCrtSecureSearchSortCompareFunction)(void*, void const*, void const*);
20  typedef int (__cdecl* _CoreCrtNonSecureSearchSortCompareFunction)(void const*, void const*);
21 
22 
23 #if __STDC_WANT_SECURE_LIB__
24 
26  _ACRTIMP void* __cdecl bsearch_s(
27  _In_ void const* _Key,
30  _In_ rsize_t _SizeOfElements,
31  _In_ _CoreCrtSecureSearchSortCompareFunction _CompareFunction,
32  _In_opt_ void* _Context
33  );
34 
35  _ACRTIMP void __cdecl qsort_s(
38  _In_ rsize_t _SizeOfElements,
39  _In_ _CoreCrtSecureSearchSortCompareFunction _CompareFunction,
40  _In_opt_ void* _Context
41  );
42 
43 #endif // __STDC_WANT_SECURE_LIB__
44 
45 
46 
48 _ACRTIMP void* __cdecl bsearch(
49  _In_ void const* _Key,
51  _In_ size_t _NumOfElements,
52  _In_ size_t _SizeOfElements,
53  _In_ _CoreCrtNonSecureSearchSortCompareFunction _CompareFunction
54  );
55 
56 _ACRTIMP void __cdecl qsort(
58  _In_ size_t _NumOfElements,
59  _In_ size_t _SizeOfElements,
60  _In_ _CoreCrtNonSecureSearchSortCompareFunction _CompareFunction
61  );
62 
64 _ACRTIMP void* __cdecl _lfind_s(
65  _In_ void const* _Key,
67  _Inout_ unsigned int* _NumOfElements,
68  _In_ size_t _SizeOfElements,
69  _In_ _CoreCrtSecureSearchSortCompareFunction _CompareFunction,
70  _In_ void* _Context
71  );
72 
74 _ACRTIMP void* __cdecl _lfind(
75  _In_ void const* _Key,
77  _Inout_ unsigned int* _NumOfElements,
78  _In_ unsigned int _SizeOfElements,
79  _In_ _CoreCrtNonSecureSearchSortCompareFunction _CompareFunction
80  );
81 
83 _ACRTIMP void* __cdecl _lsearch_s(
84  _In_ void const* _Key,
86  _Inout_ unsigned int* _NumOfElements,
87  _In_ size_t _SizeOfElements,
88  _In_ _CoreCrtSecureSearchSortCompareFunction _CompareFunction,
89  _In_ void* _Context
90  );
91 
93 _ACRTIMP void* __cdecl _lsearch(
94  _In_ void const* _Key,
96  _Inout_ unsigned int* _NumOfElements,
97  _In_ unsigned int _SizeOfElements,
98  _In_ _CoreCrtNonSecureSearchSortCompareFunction _CompareFunction
99  );
100 
101 
102 
103 // Managed search routines
104 #if defined __cplusplus && defined _M_CEE
105 extern "C++"
106 {
107  typedef int (__clrcall* _CoreCrtMgdSecureSearchSortCompareFunction)(void*, void const*, void const*);
108  typedef int (__clrcall* _CoreCrtMgdNonSecureSearchSortCompareFunction)(void const*, void const*);
109 
110  #if __STDC_WANT_SECURE_LIB__
111 
113  void* __clrcall bsearch_s(
114  _In_ void const* _Key,
117  _In_ rsize_t _SizeOfElements,
118  _In_ _CoreCrtMgdSecureSearchSortCompareFunction _CompareFunction,
119  _In_ void* _Context);
120 
121  void __clrcall qsort_s(
124  _In_ rsize_t _SizeOfElements,
125  _In_ _CoreCrtMgdSecureSearchSortCompareFunction _CompareFunction,
126  _In_ void* _Context);
127 
128  #endif // __STDC_WANT_SECURE_LIB__
129 
131  void* __clrcall bsearch(
132  _In_ void const* _Key,
134  _In_ size_t _NumOfElements,
135  _In_ size_t _SizeOfElements,
136  _In_ _CoreCrtMgdNonSecureSearchSortCompareFunction _CompareFunction
137  );
138 
140  void* __clrcall _lfind_s(
141  _In_ void const* _Key,
143  _Inout_ unsigned int* _NumOfElements,
144  _In_ size_t _SizeOfElements,
145  _In_ _CoreCrtMgdSecureSearchSortCompareFunction _CompareFunction,
146  _In_ void* _Context
147  );
148 
150  void* __clrcall _lfind(
151  _In_ void const* _Key,
153  _Inout_ unsigned int* _NumOfElements,
154  _In_ unsigned int _SizeOfElements,
155  _In_ _CoreCrtMgdNonSecureSearchSortCompareFunction _CompareFunction
156  );
157 
159  void* __clrcall _lsearch_s(
160  _In_ void const* _Key,
162  _In_ unsigned int* _NumOfElements,
163  _In_ size_t _SizeOfElements,
164  _In_ _CoreCrtMgdSecureSearchSortCompareFunction _CompareFunction,
165  _In_ void* _Context
166  );
167 
169  void* __clrcall _lsearch(
170  _In_ void const* _Key,
172  _Inout_ unsigned int* _NumOfElements,
173  _In_ unsigned int _SizeOfElements,
174  _In_ _CoreCrtMgdNonSecureSearchSortCompareFunction _CompareFunction
175  );
176 
177  void __clrcall qsort(
179  _In_ size_t _NumOfElements,
180  _In_ size_t _SizeOfElements,
181  _In_ _CoreCrtMgdNonSecureSearchSortCompareFunction _CompareFunction
182  );
183 }
184 #endif // defined __cplusplus && defined _M_CEE
185 
186 
187 
188 #if _CRT_INTERNAL_NONSTDC_NAMES
189 
191  _ACRTIMP void* __cdecl lfind(
192  _In_ void const* _Key,
194  _Inout_ unsigned int* _NumOfElements,
195  _In_ unsigned int _SizeOfElements,
196  _In_ _CoreCrtNonSecureSearchSortCompareFunction _CompareFunction
197  );
198 
200  _ACRTIMP void* __cdecl lsearch(
201  _In_ void const* _Key,
202  _Inout_updates_bytes_((*_NumOfElements) * _SizeOfElements) void* _Base,
203  _Inout_ unsigned int* _NumOfElements,
204  _In_ unsigned int _SizeOfElements,
205  _In_ _CoreCrtNonSecureSearchSortCompareFunction _CompareFunction
206  );
207 
208 #endif // _CRT_INTERNAL_NONSTDC_NAMES
209 
210 
211 
_Check_return_ _Inout_ unsigned int * _NumOfElements
Definition: corecrt_search.h:194
#define _ACRTIMP
Definition: corecrt.h:27
_Check_return_ _ACRTIMP void *__cdecl bsearch(_In_ void const *_Key, _In_reads_bytes_(_NumOfElements *_SizeOfElements) void const *_Base, _In_ size_t _NumOfElements, _In_ size_t _SizeOfElements, _In_ _CoreCrtNonSecureSearchSortCompareFunction _CompareFunction)
_Check_return_ _Inout_ unsigned int _In_ unsigned int _SizeOfElements
Definition: corecrt_search.h:194
_Check_return_ _CRT_NONSTDC_DEPRECATE(_lfind) _ACRTIMP void *__cdecl lfind(_In_ void const *_Key
_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)
size_t rsize_t
Definition: corecrt.h:527
_CRT_BEGIN_C_HEADER typedef void const void const *typedef void const *_Check_return_ _ACRTIMP void *__cdecl bsearch_s(_In_ void const *_Key, _In_reads_bytes_(_NumOfElements *_SizeOfElements) void const *_Base, _In_ rsize_t _NumOfElements, _In_ rsize_t _SizeOfElements, _In_ _CoreCrtSecureSearchSortCompareFunction _CompareFunction, _In_opt_ void *_Context)
#define _CRT_BEGIN_C_HEADER
Definition: vcruntime.h:73
_ACRTIMP void __cdecl qsort(_Inout_updates_bytes_(_NumOfElements *_SizeOfElements) void *_Base, _In_ size_t _NumOfElements, _In_ size_t _SizeOfElements, _In_ _CoreCrtNonSecureSearchSortCompareFunction _CompareFunction)
#define _Check_return_
Definition: sal.h:554
#define _In_
Definition: sal.h:305
#define _In_opt_
Definition: sal.h:306
_In_ int _Base
Definition: time.h:323
_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_ _Inout_updates_bytes_((*_NumOfElements)*_SizeOfElements) void *_Base
_Check_return_ _Inout_ unsigned int _In_ unsigned int _In_ _CoreCrtNonSecureSearchSortCompareFunction _CompareFunction
Definition: corecrt_search.h:194
_ACRTIMP void __cdecl qsort_s(_Inout_updates_bytes_(_NumOfElements *_SizeOfElements) void *_Base, _In_ rsize_t _NumOfElements, _In_ rsize_t _SizeOfElements, _In_ _CoreCrtSecureSearchSortCompareFunction _CompareFunction, _In_opt_ void *_Context)
#define _CRT_END_C_HEADER
Definition: vcruntime.h:76
_Check_return_ _In_z_ wchar_t const _Inout_opt_ _Deref_prepost_opt_z_ wchar_t ** _Context
Definition: corecrt_wstring.h:228
_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)
_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)
_CRT_BEGIN_C_HEADER typedef int(__cdecl *_CoreCrtSecureSearchSortCompareFunction)(void *
#define _Inout_
Definition: sal.h:375
_Check_return_ _In_reads_bytes_((*_NumOfElements)*_SizeOfElements) void const *_Base