2 * Copyright 2002-2017 Haiku, Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
13 intmax_t quot
; /* quotient */
14 intmax_t rem
; /* remainder */
17 /* fprintf() macros for signed integers */
19 # define PRIdLEAST8 "d"
20 # define PRIdFAST8 "d"
22 # define PRIiLEAST8 "i"
23 # define PRIiFAST8 "i"
26 # define PRIdLEAST16 "d"
27 # define PRIdFAST16 "d"
29 # define PRIiLEAST16 "i"
30 # define PRIiFAST16 "i"
32 # define PRId32 __HAIKU_STD_PRI_PREFIX_32 "d"
33 # define PRIdLEAST32 PRId32
34 # define PRIdFAST32 PRId32
35 # define PRIi32 __HAIKU_STD_PRI_PREFIX_32 "i"
36 # define PRIiLEAST32 PRIi32
37 # define PRIiFAST32 PRIi32
39 # define PRId64 __HAIKU_STD_PRI_PREFIX_64 "d"
40 # define PRIdLEAST64 PRId64
41 # define PRIdFAST64 PRId64
42 # define PRIi64 __HAIKU_STD_PRI_PREFIX_64 "i"
43 # define PRIiLEAST64 PRIi64
44 # define PRIiFAST64 PRIi64
46 # define PRIdMAX PRId64
47 # define PRIdPTR __HAIKU_PRI_PREFIX_ADDR "d"
48 # define PRIiMAX PRIi64
49 # define PRIiPTR __HAIKU_PRI_PREFIX_ADDR "i"
51 /* fprintf() macros for unsigned integers */
53 # define PRIuLEAST8 "u"
54 # define PRIuFAST8 "u"
56 # define PRIoLEAST8 "o"
57 # define PRIoFAST8 "o"
59 # define PRIxLEAST8 "x"
60 # define PRIxFAST8 "x"
62 # define PRIXLEAST8 "X"
63 # define PRIXFAST8 "X"
66 # define PRIuLEAST16 "u"
67 # define PRIuFAST16 "u"
69 # define PRIoLEAST16 "o"
70 # define PRIoFAST16 "o"
72 # define PRIxLEAST16 "x"
73 # define PRIxFAST16 "x"
75 # define PRIXLEAST16 "X"
76 # define PRIXFAST16 "X"
78 # define PRIu32 __HAIKU_STD_PRI_PREFIX_32 "u"
79 # define PRIuLEAST32 PRIu32
80 # define PRIuFAST32 PRIu32
81 # define PRIo32 __HAIKU_STD_PRI_PREFIX_32 "o"
82 # define PRIoLEAST32 PRIo32
83 # define PRIoFAST32 PRIo32
84 # define PRIx32 __HAIKU_STD_PRI_PREFIX_32 "x"
85 # define PRIxLEAST32 PRIx32
86 # define PRIxFAST32 PRIx32
87 # define PRIX32 __HAIKU_STD_PRI_PREFIX_32 "X"
88 # define PRIXLEAST32 PRIX32
89 # define PRIXFAST32 PRIX32
91 # define PRIu64 __HAIKU_STD_PRI_PREFIX_64 "u"
92 # define PRIuLEAST64 PRIu64
93 # define PRIuFAST64 PRIu64
94 # define PRIo64 __HAIKU_STD_PRI_PREFIX_64 "o"
95 # define PRIoLEAST64 PRIo64
96 # define PRIoFAST64 PRIo64
97 # define PRIx64 __HAIKU_STD_PRI_PREFIX_64 "x"
98 # define PRIxLEAST64 PRIx64
99 # define PRIxFAST64 PRIx64
100 # define PRIX64 __HAIKU_STD_PRI_PREFIX_64 "X"
101 # define PRIXLEAST64 PRIX64
102 # define PRIXFAST64 PRIX64
104 # define PRIuMAX PRIu64
105 # define PRIuPTR __HAIKU_PRI_PREFIX_ADDR "u"
106 # define PRIoMAX PRIo64
107 # define PRIoPTR __HAIKU_PRI_PREFIX_ADDR "o"
108 # define PRIxMAX PRIx64
109 # define PRIxPTR __HAIKU_PRI_PREFIX_ADDR "x"
110 # define PRIXMAX PRIX64
111 # define PRIXPTR __HAIKU_PRI_PREFIX_ADDR "X"
113 /* fscanf() macros for signed integers */
115 # define SCNdLEAST8 "hhd"
116 # define SCNdFAST8 "d"
118 # define SCNiLEAST8 "hhi"
119 # define SCNiFAST8 "i"
122 # define SCNdLEAST16 "hd"
123 # define SCNdFAST16 "d"
125 # define SCNiLEAST16 "hi"
126 # define SCNiFAST16 "i"
128 # define SCNd32 __HAIKU_STD_PRI_PREFIX_32 "d"
129 # define SCNdLEAST32 SCNd32
130 # define SCNdFAST32 SCNd32
131 # define SCNi32 __HAIKU_STD_PRI_PREFIX_32 "i"
132 # define SCNiLEAST32 SCNi32
133 # define SCNiFAST32 SCNi32
135 # define SCNd64 __HAIKU_STD_PRI_PREFIX_64 "d"
136 # define SCNdLEAST64 SCNd64
137 # define SCNdFAST64 SCNd64
138 # define SCNi64 __HAIKU_STD_PRI_PREFIX_64 "i"
139 # define SCNiLEAST64 SCNi64
140 # define SCNiFAST64 SCNi64
142 # define SCNdMAX SCNd64
143 # define SCNdPTR __HAIKU_PRI_PREFIX_ADDR "d"
144 # define SCNiMAX SCNi64
145 # define SCNiPTR __HAIKU_PRI_PREFIX_ADDR "i"
147 /* fscanf() macros for unsigned integers */
149 # define SCNuLEAST8 "hhu"
150 # define SCNuFAST8 "u"
152 # define SCNoLEAST8 "hho"
153 # define SCNoFAST8 "o"
155 # define SCNxLEAST8 "hhx"
156 # define SCNxFAST8 "x"
159 # define SCNuLEAST16 "hu"
160 # define SCNuFAST16 "u"
162 # define SCNoLEAST16 "ho"
163 # define SCNoFAST16 "o"
165 # define SCNxLEAST16 "hx"
166 # define SCNxFAST16 "x"
168 # define SCNu32 __HAIKU_STD_PRI_PREFIX_32 "u"
169 # define SCNuLEAST32 SCNu32
170 # define SCNuFAST32 SCNu32
171 # define SCNo32 __HAIKU_STD_PRI_PREFIX_32 "o"
172 # define SCNoLEAST32 SCNo32
173 # define SCNoFAST32 SCNo32
174 # define SCNx32 __HAIKU_STD_PRI_PREFIX_32 "x"
175 # define SCNxLEAST32 SCNx32
176 # define SCNxFAST32 SCNx32
178 # define SCNu64 __HAIKU_STD_PRI_PREFIX_64 "u"
179 # define SCNuLEAST64 SCNu64
180 # define SCNuFAST64 SCNu64
181 # define SCNo64 __HAIKU_STD_PRI_PREFIX_64 "o"
182 # define SCNoLEAST64 SCNo64
183 # define SCNoFAST64 SCNo64
184 # define SCNx64 __HAIKU_STD_PRI_PREFIX_64 "x"
185 # define SCNxLEAST64 SCNx64
186 # define SCNxFAST64 SCNx64
188 # define SCNuMAX SCNu64
189 # define SCNuPTR __HAIKU_PRI_PREFIX_ADDR "u"
190 # define SCNoMAX SCNo64
191 # define SCNoPTR __HAIKU_PRI_PREFIX_ADDR "o"
192 # define SCNxMAX SCNx64
193 # define SCNxPTR __HAIKU_PRI_PREFIX_ADDR "x"
200 extern intmax_t imaxabs(intmax_t num
);
201 extern imaxdiv_t
imaxdiv(intmax_t numer
, intmax_t denom
);
203 extern intmax_t strtoimax(const char *string
, char **_end
, int base
);
204 extern uintmax_t strtoumax(const char *string
, char **_end
, int base
);
205 /* extern intmax_t wcstoimax(const __wchar_t *, __wchar_t **, int); */
206 /* extern uintmax_t wcstoumax(const __wchar_t *, __wchar_t **, int); */
213 #endif /* _INTTYPES_H_ */