PageRenderTime 34ms CodeModel.GetById 17ms app.highlight 15ms RepoModel.GetById 0ms app.codeStats 0ms

/src/core/stdc/inttypes.d

http://github.com/AlexeyProkhin/druntime
D | 259 lines | 200 code | 46 blank | 13 comment | 0 complexity | 7cdcc7df8290b8d0b142d0ad657411e9 MD5 | raw file
  1/**
  2 * D header file for C99.
  3 *
  4 * Copyright: Copyright Sean Kelly 2005 - 2009.
  5 * License:   <a href="http://www.boost.org/LICENSE_1_0.txt">Boost License 1.0</a>.
  6 * Authors:   Sean Kelly
  7 * Standards: ISO/IEC 9899:1999 (E)
  8 */
  9
 10/*          Copyright Sean Kelly 2005 - 2009.
 11 * Distributed under the Boost Software License, Version 1.0.
 12 *    (See accompanying file LICENSE or copy at
 13 *          http://www.boost.org/LICENSE_1_0.txt)
 14 */
 15module core.stdc.inttypes;
 16
 17public import core.stdc.stddef; // for wchar_t
 18public import core.stdc.stdint; // required by spec
 19
 20extern (C):
 21@trusted: // Types and constants only.
 22nothrow:
 23
 24struct imaxdiv_t
 25{
 26    intmax_t    quot,
 27                rem;
 28}
 29
 30private alias immutable(char)* _cstr;
 31
 32enum _cstr PRId8            = "hhd";
 33enum _cstr PRId16           = "hd";
 34enum _cstr PRId32           = "ld";
 35enum _cstr PRId64           = "lld";
 36
 37enum _cstr PRIdLEAST8       = "hhd";
 38enum _cstr PRIdLEAST16      = "hd";
 39enum _cstr PRIdLEAST32      = "ld";
 40enum _cstr PRIdLEAST64      = "lld";
 41
 42enum _cstr PRIdFAST8        = "hhd";
 43enum _cstr PRIdFAST16       = "d";
 44enum _cstr PRIdFAST32       = "ld";
 45enum _cstr PRIdFAST64       = "lld";
 46
 47enum _cstr PRIi8            = "hhi";
 48enum _cstr PRIi16           = "hi";
 49enum _cstr PRIi32           = "li";
 50enum _cstr PRIi64           = "lli";
 51
 52enum _cstr PRIiLEAST8       = "hhi";
 53enum _cstr PRIiLEAST16      = "hi";
 54enum _cstr PRIiLEAST32      = "li";
 55enum _cstr PRIiLEAST64      = "lli";
 56
 57enum _cstr PRIiFAST8        = "hhi";
 58enum _cstr PRIiFAST16       = "i";
 59enum _cstr PRIiFAST32       = "li";
 60enum _cstr PRIiFAST64       = "lli";
 61
 62enum _cstr PRIo8            = "hho";
 63enum _cstr PRIo16           = "ho";
 64enum _cstr PRIo32           = "lo";
 65enum _cstr PRIo64           = "llo";
 66
 67enum _cstr PRIoLEAST8       = "hho";
 68enum _cstr PRIoLEAST16      = "ho";
 69enum _cstr PRIoLEAST32      = "lo";
 70enum _cstr PRIoLEAST64      = "llo";
 71
 72enum _cstr PRIoFAST8        = "hho";
 73enum _cstr PRIoFAST16       = "o";
 74enum _cstr PRIoFAST32       = "lo";
 75enum _cstr PRIoFAST64       = "llo";
 76
 77enum _cstr PRIu8            = "hhu";
 78enum _cstr PRIu16           = "hu";
 79enum _cstr PRIu32           = "lu";
 80enum _cstr PRIu64           = "llu";
 81
 82enum _cstr PRIuLEAST8       = "hhu";
 83enum _cstr PRIuLEAST16      = "hu";
 84enum _cstr PRIuLEAST32      = "lu";
 85enum _cstr PRIuLEAST64      = "llu";
 86
 87enum _cstr PRIuFAST8        = "hhu";
 88enum _cstr PRIuFAST16       = "u";
 89enum _cstr PRIuFAST32       = "lu";
 90enum _cstr PRIuFAST64       = "llu";
 91
 92enum _cstr PRIx8            = "hhx";
 93enum _cstr PRIx16           = "hx";
 94enum _cstr PRIx32           = "lx";
 95enum _cstr PRIx64           = "llx";
 96
 97enum _cstr PRIxLEAST8       = "hhx";
 98enum _cstr PRIxLEAST16      = "hx";
 99enum _cstr PRIxLEAST32      = "lx";
100enum _cstr PRIxLEAST64      = "llx";
101
102enum _cstr PRIxFAST8        = "hhx";
103enum _cstr PRIxFAST16       = "x";
104enum _cstr PRIxFAST32       = "lx";
105enum _cstr PRIxFAST64       = "llx";
106
107enum _cstr PRIX8            = "hhX";
108enum _cstr PRIX16           = "hX";
109enum _cstr PRIX32           = "lX";
110enum _cstr PRIX64           = "llX";
111
112enum _cstr PRIXLEAST8       = "hhX";
113enum _cstr PRIXLEAST16      = "hX";
114enum _cstr PRIXLEAST32      = "lX";
115enum _cstr PRIXLEAST64      = "llX";
116
117enum _cstr PRIXFAST8        = "hhX";
118enum _cstr PRIXFAST16       = "X";
119enum _cstr PRIXFAST32       = "lX";
120enum _cstr PRIXFAST64       = "llX";
121
122enum _cstr SCNd8            = "hhd";
123enum _cstr SCNd16           = "hd";
124enum _cstr SCNd32           = "ld";
125enum _cstr SCNd64           = "lld";
126
127enum _cstr SCNdLEAST8       = "hhd";
128enum _cstr SCNdLEAST16      = "hd";
129enum _cstr SCNdLEAST32      = "ld";
130enum _cstr SCNdLEAST64      = "lld";
131
132enum _cstr SCNdFAST8        = "hhd";
133enum _cstr SCNdFAST16       = "d";
134enum _cstr SCNdFAST32       = "ld";
135enum _cstr SCNdFAST64       = "lld";
136
137enum _cstr SCNi8            = "hhd";
138enum _cstr SCNi16           = "hi";
139enum _cstr SCNi32           = "li";
140enum _cstr SCNi64           = "lli";
141
142enum _cstr SCNiLEAST8       = "hhd";
143enum _cstr SCNiLEAST16      = "hi";
144enum _cstr SCNiLEAST32      = "li";
145enum _cstr SCNiLEAST64      = "lli";
146
147enum _cstr SCNiFAST8        = "hhd";
148enum _cstr SCNiFAST16       = "i";
149enum _cstr SCNiFAST32       = "li";
150enum _cstr SCNiFAST64       = "lli";
151
152enum _cstr SCNo8            = "hhd";
153enum _cstr SCNo16           = "ho";
154enum _cstr SCNo32           = "lo";
155enum _cstr SCNo64           = "llo";
156
157enum _cstr SCNoLEAST8       = "hhd";
158enum _cstr SCNoLEAST16      = "ho";
159enum _cstr SCNoLEAST32      = "lo";
160enum _cstr SCNoLEAST64      = "llo";
161
162enum _cstr SCNoFAST8        = "hhd";
163enum _cstr SCNoFAST16       = "o";
164enum _cstr SCNoFAST32       = "lo";
165enum _cstr SCNoFAST64       = "llo";
166
167enum _cstr SCNu8            = "hhd";
168enum _cstr SCNu16           = "hu";
169enum _cstr SCNu32           = "lu";
170enum _cstr SCNu64           = "llu";
171
172enum _cstr SCNuLEAST8       = "hhd";
173enum _cstr SCNuLEAST16      = "hu";
174enum _cstr SCNuLEAST32      = "lu";
175enum _cstr SCNuLEAST64      = "llu";
176
177enum _cstr SCNuFAST8        = "hhd";
178enum _cstr SCNuFAST16       = "u";
179enum _cstr SCNuFAST32       = "lu";
180enum _cstr SCNuFAST64       = "llu";
181
182enum _cstr SCNx8            = "hhd";
183enum _cstr SCNx16           = "hx";
184enum _cstr SCNx32           = "lx";
185enum _cstr SCNx64           = "llx";
186
187enum _cstr SCNxLEAST8       = "hhd";
188enum _cstr SCNxLEAST16      = "hx";
189enum _cstr SCNxLEAST32      = "lx";
190enum _cstr SCNxLEAST64      = "llx";
191
192enum _cstr SCNxFAST8        = "hhd";
193enum _cstr SCNxFAST16       = "x";
194enum _cstr SCNxFAST32       = "lx";
195enum _cstr SCNxFAST64       = "llx";
196
197version( D_LP64 )
198{
199    enum _cstr PRIdMAX      = PRId64;
200    enum _cstr PRIiMAX      = PRIi64;
201    enum _cstr PRIoMAX      = PRIo64;
202    enum _cstr PRIuMAX      = PRIu64;
203    enum _cstr PRIxMAX      = PRIx64;
204    enum _cstr PRIXMAX      = PRIX64;
205
206    enum _cstr SCNdMAX      = SCNd64;
207    enum _cstr SCNiMAX      = SCNi64;
208    enum _cstr SCNoMAX      = SCNo64;
209    enum _cstr SCNuMAX      = SCNu64;
210    enum _cstr SCNxMAX      = SCNx64;
211
212    enum _cstr PRIdPTR      = PRId64;
213    enum _cstr PRIiPTR      = PRIi64;
214    enum _cstr PRIoPTR      = PRIo64;
215    enum _cstr PRIuPTR      = PRIu64;
216    enum _cstr PRIxPTR      = PRIx64;
217    enum _cstr PRIXPTR      = PRIX64;
218
219    enum _cstr SCNdPTR      = SCNd64;
220    enum _cstr SCNiPTR      = SCNi64;
221    enum _cstr SCNoPTR      = SCNo64;
222    enum _cstr SCNuPTR      = SCNu64;
223    enum _cstr SCNxPTR      = SCNx64;
224}
225else
226{
227    enum _cstr PRIdMAX      = PRId32;
228    enum _cstr PRIiMAX      = PRIi32;
229    enum _cstr PRIoMAX      = PRIo32;
230    enum _cstr PRIuMAX      = PRIu32;
231    enum _cstr PRIxMAX      = PRIx32;
232    enum _cstr PRIXMAX      = PRIX32;
233
234    enum _cstr SCNdMAX      = SCNd32;
235    enum _cstr SCNiMAX      = SCNi32;
236    enum _cstr SCNoMAX      = SCNo32;
237    enum _cstr SCNuMAX      = SCNu32;
238    enum _cstr SCNxMAX      = SCNx32;
239
240    enum _cstr PRIdPTR      = PRId32;
241    enum _cstr PRIiPTR      = PRIi32;
242    enum _cstr PRIoPTR      = PRIo32;
243    enum _cstr PRIuPTR      = PRIu32;
244    enum _cstr PRIxPTR      = PRIx32;
245    enum _cstr PRIXPTR      = PRIX32;
246
247    enum _cstr SCNdPTR      = SCNd32;
248    enum _cstr SCNiPTR      = SCNi32;
249    enum _cstr SCNoPTR      = SCNo32;
250    enum _cstr SCNuPTR      = SCNu32;
251    enum _cstr SCNxPTR      = SCNx32;
252}
253
254intmax_t  imaxabs(intmax_t j);
255imaxdiv_t imaxdiv(intmax_t numer, intmax_t denom);
256intmax_t  strtoimax(in char* nptr, char** endptr, int base);
257uintmax_t strtoumax(in char* nptr, char** endptr, int base);
258intmax_t  wcstoimax(in wchar_t* nptr, wchar_t** endptr, int base);
259uintmax_t wcstoumax(in wchar_t* nptr, wchar_t** endptr, int base);