11dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project/*	$OpenBSD: inttypes.h,v 1.9 2006/01/15 00:47:51 millert Exp $	*/
21dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
31dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project/*
41dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * Copyright (c) 1997, 2005 Todd C. Miller <Todd.Miller@courtesan.com>
51dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project *
61dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * Permission to use, copy, modify, and distribute this software for any
71dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * purpose with or without fee is hereby granted, provided that the above
81dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * copyright notice and this permission notice appear in all copies.
91dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project *
101dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
111dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
121dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
131dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
141dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
151dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
161dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
171dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project */
181dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
191dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#ifndef	_INTTYPES_H_
201dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	_INTTYPES_H_
211dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
221dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#include <stdint.h>
231dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#include <sys/cdefs.h>
241dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
251dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#if !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS)
261dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project/*
271dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * 7.8.1 Macros for format specifiers
281dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project *
291dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * Each of the following object-like macros expands to a string
301dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * literal containing a conversion specifier, possibly modified by
311dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * a prefix such as hh, h, l, or ll, suitable for use within the
321dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * format argument of a formatted input/output function when
331dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * converting the corresponding integer type.  These macro names
341dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * have the general form of PRI (character string literals for the
351dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * fprintf family) or SCN (character string literals for the fscanf
361dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * family), followed by the conversion specifier, followed by a
371dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * name corresponding to a similar typedef name.  For example,
381dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * PRIdFAST32 can be used in a format string to print the value of
391dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project * an integer of type int_fast32_t.
401dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project */
411dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
421dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project/* fprintf macros for signed integers */
431dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	PRId8			"d"		/* int8_t */
441dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	PRId16			"d"		/* int16_t */
451dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	PRId32			"d"		/* int32_t */
461dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	PRId64			"lld"		/* int64_t */
471dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
481dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	PRIdLEAST8		"d"		/* int_least8_t */
491dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	PRIdLEAST16		"d"		/* int_least16_t */
501dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	PRIdLEAST32		"d"		/* int_least32_t */
511dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	PRIdLEAST64		"lld"		/* int_least64_t */
521dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
531dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	PRIdFAST8		"d"		/* int_fast8_t */
541dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	PRIdFAST16		"d"		/* int_fast16_t */
551dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	PRIdFAST32		"d"		/* int_fast32_t */
561dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	PRIdFAST64		"lld"		/* int_fast64_t */
571dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
581dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	PRIdMAX			"jd"		/* intmax_t */
591dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	PRIdPTR			"ld"		/* intptr_t */
601dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
611dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	PRIi8			"i"		/* int8_t */
621dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	PRIi16			"i"		/* int16_t */
631dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	PRIi32			"i"		/* int32_t */
641dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	PRIi64			"lli"		/* int64_t */
651dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
661dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	PRIiLEAST8		"i"		/* int_least8_t */
671dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	PRIiLEAST16		"i"		/* int_least16_t */
681dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	PRIiLEAST32		"i"		/* int_least32_t */
691dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	PRIiLEAST64		"lli"		/* int_least64_t */
701dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
711dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	PRIiFAST8		"i"		/* int_fast8_t */
721dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	PRIiFAST16		"i"		/* int_fast16_t */
731dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	PRIiFAST32		"i"		/* int_fast32_t */
741dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	PRIiFAST64		"lli"		/* int_fast64_t */
751dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
761dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	PRIiMAX			"ji"		/* intmax_t */
771dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	PRIiPTR			"li"		/* intptr_t */
781dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
791dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project/* fprintf macros for unsigned integers */
801dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	PRIo8			"o"		/* int8_t */
811dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	PRIo16			"o"		/* int16_t */
821dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	PRIo32			"o"		/* int32_t */
831dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	PRIo64			"llo"		/* int64_t */
841dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
851dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	PRIoLEAST8		"o"		/* int_least8_t */
861dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	PRIoLEAST16		"o"		/* int_least16_t */
871dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	PRIoLEAST32		"o"		/* int_least32_t */
881dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	PRIoLEAST64		"llo"		/* int_least64_t */
891dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
901dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	PRIoFAST8		"o"		/* int_fast8_t */
911dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	PRIoFAST16		"o"		/* int_fast16_t */
921dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	PRIoFAST32		"o"		/* int_fast32_t */
931dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	PRIoFAST64		"llo"		/* int_fast64_t */
941dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
951dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	PRIoMAX			"jo"		/* intmax_t */
961dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	PRIoPTR			"lo"		/* intptr_t */
971dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
981dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	PRIu8			"u"		/* uint8_t */
991dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	PRIu16			"u"		/* uint16_t */
1001dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	PRIu32			"u"		/* uint32_t */
1011dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	PRIu64			"llu"		/* uint64_t */
1021dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
1031dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	PRIuLEAST8		"u"		/* uint_least8_t */
1041dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	PRIuLEAST16		"u"		/* uint_least16_t */
1051dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	PRIuLEAST32		"u"		/* uint_least32_t */
1061dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	PRIuLEAST64		"llu"		/* uint_least64_t */
1071dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
1081dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	PRIuFAST8		"u"		/* uint_fast8_t */
1091dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	PRIuFAST16		"u"		/* uint_fast16_t */
1101dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	PRIuFAST32		"u"		/* uint_fast32_t */
1111dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	PRIuFAST64		"llu"		/* uint_fast64_t */
1121dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
1131dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	PRIuMAX			"ju"		/* uintmax_t */
1141dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	PRIuPTR			"lu"		/* uintptr_t */
1151dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
1161dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	PRIx8			"x"		/* uint8_t */
1171dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	PRIx16			"x"		/* uint16_t */
1181dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	PRIx32			"x"		/* uint32_t */
1191dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	PRIx64			"llx"		/* uint64_t */
1201dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
1211dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	PRIxLEAST8		"x"		/* uint_least8_t */
1221dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	PRIxLEAST16		"x"		/* uint_least16_t */
1231dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	PRIxLEAST32		"x"		/* uint_least32_t */
1241dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	PRIxLEAST64		"llx"		/* uint_least64_t */
1251dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
1261dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	PRIxFAST8		"x"		/* uint_fast8_t */
1271dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	PRIxFAST16		"x"		/* uint_fast16_t */
1281dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	PRIxFAST32		"x"		/* uint_fast32_t */
1291dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	PRIxFAST64		"llx"		/* uint_fast64_t */
1301dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
1311dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	PRIxMAX			"jx"		/* uintmax_t */
1321dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	PRIxPTR			"lx"		/* uintptr_t */
1331dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
1341dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	PRIX8			"X"		/* uint8_t */
1351dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	PRIX16			"X"		/* uint16_t */
1361dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	PRIX32			"X"		/* uint32_t */
1371dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	PRIX64			"llX"		/* uint64_t */
1381dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
1391dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	PRIXLEAST8		"X"		/* uint_least8_t */
1401dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	PRIXLEAST16		"X"		/* uint_least16_t */
1411dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	PRIXLEAST32		"X"		/* uint_least32_t */
1421dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	PRIXLEAST64		"llX"		/* uint_least64_t */
1431dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
1441dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	PRIXFAST8		"X"		/* uint_fast8_t */
1451dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	PRIXFAST16		"X"		/* uint_fast16_t */
1461dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	PRIXFAST32		"X"		/* uint_fast32_t */
1471dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	PRIXFAST64		"llX"		/* uint_fast64_t */
1481dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
1491dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	PRIXMAX			"jX"		/* uintmax_t */
1501dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	PRIXPTR			"lX"		/* uintptr_t */
1511dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
1521dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project/* fscanf macros for signed integers */
1531dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	SCNd8			"hhd"		/* int8_t */
1541dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	SCNd16			"hd"		/* int16_t */
1551dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	SCNd32			"d"		/* int32_t */
1561dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	SCNd64			"lld"		/* int64_t */
1571dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
1581dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	SCNdLEAST8		"hhd"		/* int_least8_t */
1591dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	SCNdLEAST16		"hd"		/* int_least16_t */
1601dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	SCNdLEAST32		"d"		/* int_least32_t */
1611dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	SCNdLEAST64		"lld"		/* int_least64_t */
1621dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
1631dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	SCNdFAST8		"hhd"		/* int_fast8_t */
1641dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	SCNdFAST16		"hd"		/* int_fast16_t */
1651dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	SCNdFAST32		"d"		/* int_fast32_t */
1661dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	SCNdFAST64		"lld"		/* int_fast64_t */
1671dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
1681dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	SCNdMAX			"jd"		/* intmax_t */
1691dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	SCNdPTR			"ld"		/* intptr_t */
1701dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
1711dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	SCNi8			"hhi"		/* int8_t */
1721dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	SCNi16			"hi"		/* int16_t */
1731dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	SCNi32			"i"		/* int32_t */
1741dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	SCNi64			"lli"		/* int64_t */
1751dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
1761dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	SCNiLEAST8		"hhi"		/* int_least8_t */
1771dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	SCNiLEAST16		"hi"		/* int_least16_t */
1781dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	SCNiLEAST32		"i"		/* int_least32_t */
1791dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	SCNiLEAST64		"lli"		/* int_least64_t */
1801dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
1811dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	SCNiFAST8		"hhi"		/* int_fast8_t */
1821dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	SCNiFAST16		"hi"		/* int_fast16_t */
1831dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	SCNiFAST32		"i"		/* int_fast32_t */
1841dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	SCNiFAST64		"lli"		/* int_fast64_t */
1851dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
1861dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	SCNiMAX			"ji"		/* intmax_t */
1871dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	SCNiPTR			"li"		/* intptr_t */
1881dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
1891dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project/* fscanf macros for unsigned integers */
1901dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	SCNo8			"hho"		/* uint8_t */
1911dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	SCNo16			"ho"		/* uint16_t */
1921dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	SCNo32			"o"		/* uint32_t */
1931dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	SCNo64			"llo"		/* uint64_t */
1941dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
1951dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	SCNoLEAST8		"hho"		/* uint_least8_t */
1961dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	SCNoLEAST16		"ho"		/* uint_least16_t */
1971dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	SCNoLEAST32		"o"		/* uint_least32_t */
1981dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	SCNoLEAST64		"llo"		/* uint_least64_t */
1991dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
2001dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	SCNoFAST8		"hho"		/* uint_fast8_t */
2011dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	SCNoFAST16		"ho"		/* uint_fast16_t */
2021dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	SCNoFAST32		"o"		/* uint_fast32_t */
2031dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	SCNoFAST64		"llo"		/* uint_fast64_t */
2041dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
2051dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	SCNoMAX			"jo"		/* uintmax_t */
2061dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	SCNoPTR			"lo"		/* uintptr_t */
2071dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
2081dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	SCNu8			"hhu"		/* uint8_t */
2091dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	SCNu16			"hu"		/* uint16_t */
2101dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	SCNu32			"u"		/* uint32_t */
2111dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	SCNu64			"llu"		/* uint64_t */
2121dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
2131dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	SCNuLEAST8		"hhu"		/* uint_least8_t */
2141dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	SCNuLEAST16		"hu"		/* uint_least16_t */
2151dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	SCNuLEAST32		"u"		/* uint_least32_t */
2161dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	SCNuLEAST64		"llu"		/* uint_least64_t */
2171dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
2181dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	SCNuFAST8		"hhu"		/* uint_fast8_t */
2191dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	SCNuFAST16		"hu"		/* uint_fast16_t */
2201dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	SCNuFAST32		"u"		/* uint_fast32_t */
2211dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	SCNuFAST64		"llu"		/* uint_fast64_t */
2221dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
2231dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	SCNuMAX			"ju"		/* uintmax_t */
2241dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	SCNuPTR			"lu"		/* uintptr_t */
2251dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
2261dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	SCNx8			"hhx"		/* uint8_t */
2271dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	SCNx16			"hx"		/* uint16_t */
2281dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	SCNx32			"x"		/* uint32_t */
2291dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	SCNx64			"llx"		/* uint64_t */
2301dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
2311dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	SCNxLEAST8		"hhx"		/* uint_least8_t */
2321dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	SCNxLEAST16		"hx"		/* uint_least16_t */
2331dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	SCNxLEAST32		"x"		/* uint_least32_t */
2341dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	SCNxLEAST64		"llx"		/* uint_least64_t */
2351dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
2361dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	SCNxFAST8		"hhx"		/* uint_fast8_t */
2371dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	SCNxFAST16		"hx"		/* uint_fast16_t */
2381dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	SCNxFAST32		"x"		/* uint_fast32_t */
2391dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	SCNxFAST64		"llx"		/* uint_fast64_t */
2401dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
2411dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	SCNxMAX			"jx"		/* uintmax_t */
2421dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#define	SCNxPTR			"lx"		/* uintptr_t */
2431dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
2441dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#endif /* __cplusplus || __STDC_FORMAT_MACROS */
2451dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
2461dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projecttypedef struct {
2471dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project	intmax_t quot;		/* quotient */
2481dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project	intmax_t rem;		/* remainder */
2491dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project} imaxdiv_t;
2501dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
2511dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project__BEGIN_DECLS
2521dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectintmax_t	imaxabs(intmax_t);
2531dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectimaxdiv_t	imaxdiv(intmax_t, intmax_t);
2541dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectintmax_t	strtoimax(const char *, char **, int);
2551dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Projectuintmax_t	strtoumax(const char *, char **, int);
25650ace4fec5e8cb5afcbc656a4556fa528adfd760David 'Digit' Turner
25750ace4fec5e8cb5afcbc656a4556fa528adfd760David 'Digit' Turnerintmax_t	strntoimax(const char *nptr, char **endptr, int base, size_t n);
25850ace4fec5e8cb5afcbc656a4556fa528adfd760David 'Digit' Turneruintmax_t	strntoumax(const char *nptr, char **endptr, int base, size_t n);
2591dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project__END_DECLS
2601dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project
2611dc9e472e19acfe6dc7f41e429236e7eef7ceda1The Android Open Source Project#endif /* _INTTYPES_H_ */
262