--- /dev/null
+/* $NetBSD: int_fmtio.h,v 1.4 2005/12/11 12:16:25 christos Exp $ */\r
+\r
+/*-\r
+ * Copyright (c) 2001 The NetBSD Foundation, Inc.\r
+ * All rights reserved.\r
+ *\r
+ * This code is derived from software contributed to The NetBSD Foundation\r
+ * by Klaus Klein.\r
+ *\r
+ * Redistribution and use in source and binary forms, with or without\r
+ * modification, are permitted provided that the following conditions\r
+ * are met:\r
+ * 1. Redistributions of source code must retain the above copyright\r
+ * notice, this list of conditions and the following disclaimer.\r
+ * 2. Redistributions in binary form must reproduce the above copyright\r
+ * notice, this list of conditions and the following disclaimer in the\r
+ * documentation and/or other materials provided with the distribution.\r
+ * 3. All advertising materials mentioning features or use of this software\r
+ * must display the following acknowledgement:\r
+ * This product includes software developed by the NetBSD\r
+ * Foundation, Inc. and its contributors.\r
+ * 4. Neither the name of The NetBSD Foundation nor the names of its\r
+ * contributors may be used to endorse or promote products derived\r
+ * from this software without specific prior written permission.\r
+ *\r
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS\r
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED\r
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\r
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS\r
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\r
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\r
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r
+ * POSSIBILITY OF SUCH DAMAGE.\r
+ */\r
+\r
+#ifndef _AMD64_INT_FMTIO_H_\r
+#define _AMD64_INT_FMTIO_H_\r
+\r
+/*\r
+ * 7.8.1 Macros for format specifiers\r
+ */\r
+\r
+/* fprintf macros for signed integers */\r
+\r
+#define PRId8 "d" /* int8_t */\r
+#define PRId16 "d" /* int16_t */\r
+#define PRId32 "d" /* int32_t */\r
+#define PRId64 "ld" /* int64_t */\r
+#define PRIdLEAST8 "d" /* int_least8_t */\r
+#define PRIdLEAST16 "d" /* int_least16_t */\r
+#define PRIdLEAST32 "d" /* int_least32_t */\r
+#define PRIdLEAST64 "ld" /* int_least64_t */\r
+#define PRIdFAST8 "d" /* int_fast8_t */\r
+#define PRIdFAST16 "d" /* int_fast16_t */\r
+#define PRIdFAST32 "d" /* int_fast32_t */\r
+#define PRIdFAST64 "ld" /* int_fast64_t */\r
+#define PRIdMAX "ld" /* intmax_t */\r
+#define PRIdPTR "ld" /* intptr_t */\r
+\r
+#define PRIi8 "i" /* int8_t */\r
+#define PRIi16 "i" /* int16_t */\r
+#define PRIi32 "i" /* int32_t */\r
+#define PRIi64 "li" /* int64_t */\r
+#define PRIiLEAST8 "i" /* int_least8_t */\r
+#define PRIiLEAST16 "i" /* int_least16_t */\r
+#define PRIiLEAST32 "i" /* int_least32_t */\r
+#define PRIiLEAST64 "li" /* int_least64_t */\r
+#define PRIiFAST8 "i" /* int_fast8_t */\r
+#define PRIiFAST16 "i" /* int_fast16_t */\r
+#define PRIiFAST32 "i" /* int_fast32_t */\r
+#define PRIiFAST64 "li" /* int_fast64_t */\r
+#define PRIiMAX "li" /* intmax_t */\r
+#define PRIiPTR "li" /* intptr_t */\r
+\r
+/* fprintf macros for unsigned integers */\r
+\r
+#define PRIo8 "o" /* uint8_t */\r
+#define PRIo16 "o" /* uint16_t */\r
+#define PRIo32 "o" /* uint32_t */\r
+#define PRIo64 "lo" /* uint64_t */\r
+#define PRIoLEAST8 "o" /* uint_least8_t */\r
+#define PRIoLEAST16 "o" /* uint_least16_t */\r
+#define PRIoLEAST32 "o" /* uint_least32_t */\r
+#define PRIoLEAST64 "lo" /* uint_least64_t */\r
+#define PRIoFAST8 "o" /* uint_fast8_t */\r
+#define PRIoFAST16 "o" /* uint_fast16_t */\r
+#define PRIoFAST32 "o" /* uint_fast32_t */\r
+#define PRIoFAST64 "lo" /* uint_fast64_t */\r
+#define PRIoMAX "lo" /* uintmax_t */\r
+#define PRIoPTR "lo" /* uintptr_t */\r
+\r
+#define PRIu8 "u" /* uint8_t */\r
+#define PRIu16 "u" /* uint16_t */\r
+#define PRIu32 "u" /* uint32_t */\r
+#define PRIu64 "lu" /* uint64_t */\r
+#define PRIuLEAST8 "u" /* uint_least8_t */\r
+#define PRIuLEAST16 "u" /* uint_least16_t */\r
+#define PRIuLEAST32 "u" /* uint_least32_t */\r
+#define PRIuLEAST64 "lu" /* uint_least64_t */\r
+#define PRIuFAST8 "u" /* uint_fast8_t */\r
+#define PRIuFAST16 "u" /* uint_fast16_t */\r
+#define PRIuFAST32 "u" /* uint_fast32_t */\r
+#define PRIuFAST64 "lu" /* uint_fast64_t */\r
+#define PRIuMAX "lu" /* uintmax_t */\r
+#define PRIuPTR "lu" /* uintptr_t */\r
+\r
+#define PRIx8 "x" /* uint8_t */\r
+#define PRIx16 "x" /* uint16_t */\r
+#define PRIx32 "x" /* uint32_t */\r
+#define PRIx64 "lx" /* uint64_t */\r
+#define PRIxLEAST8 "x" /* uint_least8_t */\r
+#define PRIxLEAST16 "x" /* uint_least16_t */\r
+#define PRIxLEAST32 "x" /* uint_least32_t */\r
+#define PRIxLEAST64 "lx" /* uint_least64_t */\r
+#define PRIxFAST8 "x" /* uint_fast8_t */\r
+#define PRIxFAST16 "x" /* uint_fast16_t */\r
+#define PRIxFAST32 "x" /* uint_fast32_t */\r
+#define PRIxFAST64 "lx" /* uint_fast64_t */\r
+#define PRIxMAX "lx" /* uintmax_t */\r
+#define PRIxPTR "lx" /* uintptr_t */\r
+\r
+#define PRIX8 "X" /* uint8_t */\r
+#define PRIX16 "X" /* uint16_t */\r
+#define PRIX32 "X" /* uint32_t */\r
+#define PRIX64 "lX" /* uint64_t */\r
+#define PRIXLEAST8 "X" /* uint_least8_t */\r
+#define PRIXLEAST16 "X" /* uint_least16_t */\r
+#define PRIXLEAST32 "X" /* uint_least32_t */\r
+#define PRIXLEAST64 "lX" /* uint_least64_t */\r
+#define PRIXFAST8 "X" /* uint_fast8_t */\r
+#define PRIXFAST16 "X" /* uint_fast16_t */\r
+#define PRIXFAST32 "X" /* uint_fast32_t */\r
+#define PRIXFAST64 "lX" /* uint_fast64_t */\r
+#define PRIXMAX "lX" /* uintmax_t */\r
+#define PRIXPTR "lX" /* uintptr_t */\r
+\r
+/* fscanf macros for signed integers */\r
+\r
+#define SCNd8 "hhd" /* int8_t */\r
+#define SCNd16 "hd" /* int16_t */\r
+#define SCNd32 "d" /* int32_t */\r
+#define SCNd64 "ld" /* int64_t */\r
+#define SCNdLEAST8 "hhd" /* int_least8_t */\r
+#define SCNdLEAST16 "hd" /* int_least16_t */\r
+#define SCNdLEAST32 "d" /* int_least32_t */\r
+#define SCNdLEAST64 "ld" /* int_least64_t */\r
+#define SCNdFAST8 "d" /* int_fast8_t */\r
+#define SCNdFAST16 "d" /* int_fast16_t */\r
+#define SCNdFAST32 "d" /* int_fast32_t */\r
+#define SCNdFAST64 "ld" /* int_fast64_t */\r
+#define SCNdMAX "ld" /* intmax_t */\r
+#define SCNdPTR "ld" /* intptr_t */\r
+\r
+#define SCNi8 "hhi" /* int8_t */\r
+#define SCNi16 "hi" /* int16_t */\r
+#define SCNi32 "i" /* int32_t */\r
+#define SCNi64 "li" /* int64_t */\r
+#define SCNiLEAST8 "hhi" /* int_least8_t */\r
+#define SCNiLEAST16 "hi" /* int_least16_t */\r
+#define SCNiLEAST32 "i" /* int_least32_t */\r
+#define SCNiLEAST64 "li" /* int_least64_t */\r
+#define SCNiFAST8 "i" /* int_fast8_t */\r
+#define SCNiFAST16 "i" /* int_fast16_t */\r
+#define SCNiFAST32 "i" /* int_fast32_t */\r
+#define SCNiFAST64 "li" /* int_fast64_t */\r
+#define SCNiMAX "li" /* intmax_t */\r
+#define SCNiPTR "li" /* intptr_t */\r
+\r
+/* fscanf macros for unsigned integers */\r
+\r
+#define SCNo8 "hho" /* uint8_t */\r
+#define SCNo16 "ho" /* uint16_t */\r
+#define SCNo32 "o" /* uint32_t */\r
+#define SCNo64 "lo" /* uint64_t */\r
+#define SCNoLEAST8 "hho" /* uint_least8_t */\r
+#define SCNoLEAST16 "ho" /* uint_least16_t */\r
+#define SCNoLEAST32 "o" /* uint_least32_t */\r
+#define SCNoLEAST64 "lo" /* uint_least64_t */\r
+#define SCNoFAST8 "o" /* uint_fast8_t */\r
+#define SCNoFAST16 "o" /* uint_fast16_t */\r
+#define SCNoFAST32 "o" /* uint_fast32_t */\r
+#define SCNoFAST64 "lo" /* uint_fast64_t */\r
+#define SCNoMAX "lo" /* uintmax_t */\r
+#define SCNoPTR "lo" /* uintptr_t */\r
+\r
+#define SCNu8 "hhu" /* uint8_t */\r
+#define SCNu16 "hu" /* uint16_t */\r
+#define SCNu32 "u" /* uint32_t */\r
+#define SCNu64 "lu" /* uint64_t */\r
+#define SCNuLEAST8 "hhu" /* uint_least8_t */\r
+#define SCNuLEAST16 "hu" /* uint_least16_t */\r
+#define SCNuLEAST32 "u" /* uint_least32_t */\r
+#define SCNuLEAST64 "lu" /* uint_least64_t */\r
+#define SCNuFAST8 "u" /* uint_fast8_t */\r
+#define SCNuFAST16 "u" /* uint_fast16_t */\r
+#define SCNuFAST32 "u" /* uint_fast32_t */\r
+#define SCNuFAST64 "lu" /* uint_fast64_t */\r
+#define SCNuMAX "lu" /* uintmax_t */\r
+#define SCNuPTR "lu" /* uintptr_t */\r
+\r
+#define SCNx8 "hhx" /* uint8_t */\r
+#define SCNx16 "hx" /* uint16_t */\r
+#define SCNx32 "x" /* uint32_t */\r
+#define SCNx64 "lx" /* uint64_t */\r
+#define SCNxLEAST8 "hhx" /* uint_least8_t */\r
+#define SCNxLEAST16 "hx" /* uint_least16_t */\r
+#define SCNxLEAST32 "x" /* uint_least32_t */\r
+#define SCNxLEAST64 "lx" /* uint_least64_t */\r
+#define SCNxFAST8 "x" /* uint_fast8_t */\r
+#define SCNxFAST16 "x" /* uint_fast16_t */\r
+#define SCNxFAST32 "x" /* uint_fast32_t */\r
+#define SCNxFAST64 "lx" /* uint_fast64_t */\r
+#define SCNxMAX "lx" /* uintmax_t */\r
+#define SCNxPTR "lx" /* uintptr_t */\r
+\r
+#endif /* !_AMD64_INT_FMTIO_H_ */\r