STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
inttypes.h
Go to the documentation of this file.
1 //
2 // inttypes.h
3 //
4 // Copyright (c) Microsoft Corporation. All rights reserved.
5 //
6 // Various integer format specifier macros for use with the stdio library, and
7 // various integer conversion and manipulation functions.
8 //
9 #pragma once
10 #define _INTTYPES
11 
12 #include <corecrt.h>
13 #include <stdint.h>
14 
16 
17 
18 
19 //-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
20 //
21 // Types
22 //
23 //-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
24 typedef struct
25 {
28 } _Lldiv_t;
29 
31 
32 
33 
34 //-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
35 //
36 // Functions
37 //
38 //-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
40 _ACRTIMP intmax_t __cdecl imaxabs(
41  _In_ intmax_t _Number
42  );
43 
45 _ACRTIMP imaxdiv_t __cdecl imaxdiv(
46  _In_ intmax_t _Numerator,
47  _In_ intmax_t _Denominator
48  );
49 
51  _In_z_ char const* _String,
52  _Out_opt_ _Deref_post_z_ char** _EndPtr,
53  _In_ int _Radix
54  );
55 
57  _In_z_ char const* _String,
58  _Out_opt_ _Deref_post_z_ char** _EndPtr,
59  _In_ int _Radix,
61  );
62 
64  _In_z_ char const* _String,
65  _Out_opt_ _Deref_post_z_ char** _EndPtr,
66  _In_ int _Radix
67  );
68 
70  _In_z_ char const* _String,
71  _Out_opt_ _Deref_post_z_ char** _EndPtr,
72  _In_ int _Radix,
74  );
75 
77  _In_z_ wchar_t const* _String,
78  _Out_opt_ _Deref_post_z_ wchar_t** _EndPtr,
79  _In_ int _Radix
80  );
81 
83  _In_z_ wchar_t const* _String,
84  _Out_opt_ _Deref_post_z_ wchar_t** _EndPtr,
85  _In_ int _Radix,
87  );
88 
90  _In_z_ wchar_t const* _String,
91  _Out_opt_ _Deref_post_z_ wchar_t** _EndPtr,
92  _In_ int _Radix
93  );
94 
96  _In_z_ wchar_t const* _String,
97  _Out_opt_ _Deref_post_z_ wchar_t** _EndPtr,
98  _In_ int _Radix,
100  );
101 
102 
103 
104 //-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
105 //
106 // Output Format Specifier Macros
107 //
108 //-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
109 #define PRId8 "hhd"
110 #define PRId16 "hd"
111 #define PRId32 "d"
112 #define PRId64 "lld"
113 #define PRIdLEAST8 PRId8
114 #define PRIdLEAST16 PRId16
115 #define PRIdLEAST32 PRId32
116 #define PRIdLEAST64 PRId64
117 #define PRIdFAST8 PRId8
118 #define PRIdFAST16 PRId32
119 #define PRIdFAST32 PRId32
120 #define PRIdFAST64 PRId64
121 #define PRIdMAX PRId64
122 #ifdef _WIN64
123  #define PRIdPTR PRId64
124 #else
125  #define PRIdPTR PRId32
126 #endif
127 
128 #define PRIi8 "hhi"
129 #define PRIi16 "hi"
130 #define PRIi32 "i"
131 #define PRIi64 "lli"
132 #define PRIiLEAST8 PRIi8
133 #define PRIiLEAST16 PRIi16
134 #define PRIiLEAST32 PRIi32
135 #define PRIiLEAST64 PRIi64
136 #define PRIiFAST8 PRIi8
137 #define PRIiFAST16 PRIi32
138 #define PRIiFAST32 PRIi32
139 #define PRIiFAST64 PRIi64
140 #define PRIiMAX PRIi64
141 #ifdef _WIN64
142  #define PRIiPTR PRIi64
143 #else
144  #define PRIiPTR PRIi32
145 #endif
146 
147 #define PRIo8 "hho"
148 #define PRIo16 "ho"
149 #define PRIo32 "o"
150 #define PRIo64 "llo"
151 #define PRIoLEAST8 PRIo8
152 #define PRIoLEAST16 PRIo16
153 #define PRIoLEAST32 PRIo32
154 #define PRIoLEAST64 PRIo64
155 #define PRIoFAST8 PRIo8
156 #define PRIoFAST16 PRIo32
157 #define PRIoFAST32 PRIo32
158 #define PRIoFAST64 PRIo64
159 #define PRIoMAX PRIo64
160 #ifdef _WIN64
161  #define PRIoPTR PRIo64
162 #else
163  #define PRIoPTR PRIo32
164 #endif
165 
166 #define PRIu8 "hhu"
167 #define PRIu16 "hu"
168 #define PRIu32 "u"
169 #define PRIu64 "llu"
170 #define PRIuLEAST8 PRIu8
171 #define PRIuLEAST16 PRIu16
172 #define PRIuLEAST32 PRIu32
173 #define PRIuLEAST64 PRIu64
174 #define PRIuFAST8 PRIu8
175 #define PRIuFAST16 PRIu32
176 #define PRIuFAST32 PRIu32
177 #define PRIuFAST64 PRIu64
178 #define PRIuMAX PRIu64
179 #ifdef _WIN64
180  #define PRIuPTR PRIu64
181 #else
182  #define PRIuPTR PRIu32
183 #endif
184 
185 #define PRIx8 "hhx"
186 #define PRIx16 "hx"
187 #define PRIx32 "x"
188 #define PRIx64 "llx"
189 #define PRIxLEAST8 PRIx8
190 #define PRIxLEAST16 PRIx16
191 #define PRIxLEAST32 PRIx32
192 #define PRIxLEAST64 PRIx64
193 #define PRIxFAST8 PRIx8
194 #define PRIxFAST16 PRIx32
195 #define PRIxFAST32 PRIx32
196 #define PRIxFAST64 PRIx64
197 #define PRIxMAX PRIx64
198 #ifdef _WIN64
199  #define PRIxPTR PRIx64
200 #else
201  #define PRIxPTR PRIx32
202 #endif
203 
204 #define PRIX8 "hhX"
205 #define PRIX16 "hX"
206 #define PRIX32 "X"
207 #define PRIX64 "llX"
208 #define PRIXLEAST8 PRIX8
209 #define PRIXLEAST16 PRIX16
210 #define PRIXLEAST32 PRIX32
211 #define PRIXLEAST64 PRIX64
212 #define PRIXFAST8 PRIX8
213 #define PRIXFAST16 PRIX32
214 #define PRIXFAST32 PRIX32
215 #define PRIXFAST64 PRIX64
216 #define PRIXMAX PRIX64
217 #ifdef _WIN64
218  #define PRIXPTR PRIX64
219 #else
220  #define PRIXPTR PRIX32
221 #endif
222 
223 
224 
225 //-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
226 //
227 // Input Format Specifier Macros
228 //
229 //-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
230 #define SCNd8 "hhd"
231 #define SCNd16 "hd"
232 #define SCNd32 "d"
233 #define SCNd64 "lld"
234 #define SCNdLEAST8 SCNd8
235 #define SCNdLEAST16 SCNd16
236 #define SCNdLEAST32 SCNd32
237 #define SCNdLEAST64 SCNd64
238 #define SCNdFAST8 SCNd8
239 #define SCNdFAST16 SCNd32
240 #define SCNdFAST32 SCNd32
241 #define SCNdFAST64 SCNd64
242 #define SCNdMAX SCNd64
243 #ifdef _WIN64
244  #define SCNdPTR SCNd64
245 #else
246  #define SCNdPTR SCNd32
247 #endif
248 
249 #define SCNi8 "hhi"
250 #define SCNi16 "hi"
251 #define SCNi32 "i"
252 #define SCNi64 "lli"
253 #define SCNiLEAST8 SCNi8
254 #define SCNiLEAST16 SCNi16
255 #define SCNiLEAST32 SCNi32
256 #define SCNiLEAST64 SCNi64
257 #define SCNiFAST8 SCNi8
258 #define SCNiFAST16 SCNi32
259 #define SCNiFAST32 SCNi32
260 #define SCNiFAST64 SCNi64
261 #define SCNiMAX SCNi64
262 #ifdef _WIN64
263  #define SCNiPTR SCNi64
264 #else
265  #define SCNiPTR SCNi32
266 #endif
267 
268 #define SCNo8 "hho"
269 #define SCNo16 "ho"
270 #define SCNo32 "o"
271 #define SCNo64 "llo"
272 #define SCNoLEAST8 SCNo8
273 #define SCNoLEAST16 SCNo16
274 #define SCNoLEAST32 SCNo32
275 #define SCNoLEAST64 SCNo64
276 #define SCNoFAST8 SCNo8
277 #define SCNoFAST16 SCNo32
278 #define SCNoFAST32 SCNo32
279 #define SCNoFAST64 SCNo64
280 #define SCNoMAX SCNo64
281 #ifdef _WIN64
282  #define SCNoPTR SCNo64
283 #else
284  #define SCNoPTR SCNo32
285 #endif
286 
287 #define SCNu8 "hhu"
288 #define SCNu16 "hu"
289 #define SCNu32 "u"
290 #define SCNu64 "llu"
291 #define SCNuLEAST8 SCNu8
292 #define SCNuLEAST16 SCNu16
293 #define SCNuLEAST32 SCNu32
294 #define SCNuLEAST64 SCNu64
295 #define SCNuFAST8 SCNu8
296 #define SCNuFAST16 SCNu32
297 #define SCNuFAST32 SCNu32
298 #define SCNuFAST64 SCNu64
299 #define SCNuMAX SCNu64
300 #ifdef _WIN64
301  #define SCNuPTR SCNu64
302 #else
303  #define SCNuPTR SCNu32
304 #endif
305 
306 #define SCNx8 "hhx"
307 #define SCNx16 "hx"
308 #define SCNx32 "x"
309 #define SCNx64 "llx"
310 #define SCNxLEAST8 SCNx8
311 #define SCNxLEAST16 SCNx16
312 #define SCNxLEAST32 SCNx32
313 #define SCNxLEAST64 SCNx64
314 #define SCNxFAST8 SCNx8
315 #define SCNxFAST16 SCNx32
316 #define SCNxFAST32 SCNx32
317 #define SCNxFAST64 SCNx64
318 #define SCNxMAX SCNx64
319 #ifdef _WIN64
320  #define SCNxPTR SCNx64
321 #else
322  #define SCNxPTR SCNx32
323 #endif
324 
325 
326 
328 
329 /*
330  * Copyright (c) 1992-2010 by P.J. Plauger. ALL RIGHTS RESERVED.
331  * Consult your license regarding permissions and restrictions.
332 V5.30:0009 */
_Lldiv_t imaxdiv_t
Definition: inttypes.h:30
Definition: corecrt.h:489
long long intmax_t
Definition: stdint.h:44
#define _ACRTIMP
Definition: corecrt.h:27
#define _Out_opt_
Definition: sal.h:343
_Check_return_ _ACRTIMP imaxdiv_t __cdecl imaxdiv(_In_ intmax_t _Numerator, _In_ intmax_t _Denominator)
_ACRTIMP intmax_t __cdecl wcstoimax(_In_z_ wchar_t const *_String, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, _In_ int _Radix)
_ACRTIMP uintmax_t __cdecl _strtoumax_l(_In_z_ char const *_String, _Out_opt_ _Deref_post_z_ char **_EndPtr, _In_ int _Radix, _In_opt_ _locale_t _Locale)
#define _CRT_BEGIN_C_HEADER
Definition: vcruntime.h:73
_ACRTIMP uintmax_t __cdecl strtoumax(_In_z_ char const *_String, _Out_opt_ _Deref_post_z_ char **_EndPtr, _In_ int _Radix)
_In_ size_t _In_ int _Radix
Definition: corecrt_wstdlib.h:53
#define _Check_return_
Definition: sal.h:554
_String
Definition: corecrt_wstring.h:355
#define _In_z_
Definition: sal.h:310
#define _In_
Definition: sal.h:305
#define _In_opt_
Definition: sal.h:306
intmax_t rem
Definition: inttypes.h:27
_ACRTIMP intmax_t __cdecl _strtoimax_l(_In_z_ char const *_String, _Out_opt_ _Deref_post_z_ char **_EndPtr, _In_ int _Radix, _In_opt_ _locale_t _Locale)
intmax_t quot
Definition: inttypes.h:26
_ACRTIMP uintmax_t __cdecl wcstoumax(_In_z_ wchar_t const *_String, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, _In_ int _Radix)
#define _CRT_END_C_HEADER
Definition: vcruntime.h:76
#define _Deref_post_z_
Definition: sal.h:1118
unsigned long long uintmax_t
Definition: stdint.h:45
_ACRTIMP intmax_t __cdecl strtoimax(_In_z_ char const *_String, _Out_opt_ _Deref_post_z_ char **_EndPtr, _In_ int _Radix)
_ACRTIMP intmax_t __cdecl _wcstoimax_l(_In_z_ wchar_t const *_String, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, _In_ int _Radix, _In_opt_ _locale_t _Locale)
_Check_return_opt_ _In_opt_ _locale_t const _Locale
Definition: corecrt_wconio.h:289
_ACRTIMP uintmax_t __cdecl _wcstoumax_l(_In_z_ wchar_t const *_String, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, _In_ int _Radix, _In_opt_ _locale_t _Locale)
Definition: inttypes.h:24
_Check_return_ _ACRTIMP intmax_t __cdecl imaxabs(_In_ intmax_t _Number)