1*efe99ca4Smatt /* $NetBSD: int_fmtio.h,v 1.3 2014/08/13 19:48:17 matt Exp $ */ 2ba7cbe76Scherry 3ba7cbe76Scherry /*- 4ba7cbe76Scherry * Copyright (c) 2001 The NetBSD Foundation, Inc. 5ba7cbe76Scherry * All rights reserved. 6ba7cbe76Scherry * 7ba7cbe76Scherry * This code is derived from software contributed to The NetBSD Foundation 8ba7cbe76Scherry * by Klaus Klein. 9ba7cbe76Scherry * 10ba7cbe76Scherry * Redistribution and use in source and binary forms, with or without 11ba7cbe76Scherry * modification, are permitted provided that the following conditions 12ba7cbe76Scherry * are met: 13ba7cbe76Scherry * 1. Redistributions of source code must retain the above copyright 14ba7cbe76Scherry * notice, this list of conditions and the following disclaimer. 15ba7cbe76Scherry * 2. Redistributions in binary form must reproduce the above copyright 16ba7cbe76Scherry * notice, this list of conditions and the following disclaimer in the 17ba7cbe76Scherry * documentation and/or other materials provided with the distribution. 18ba7cbe76Scherry * 19ba7cbe76Scherry * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 20ba7cbe76Scherry * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 21ba7cbe76Scherry * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 22ba7cbe76Scherry * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 23ba7cbe76Scherry * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24ba7cbe76Scherry * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25ba7cbe76Scherry * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26ba7cbe76Scherry * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27ba7cbe76Scherry * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28ba7cbe76Scherry * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29ba7cbe76Scherry * POSSIBILITY OF SUCH DAMAGE. 30ba7cbe76Scherry */ 31ba7cbe76Scherry 32ba7cbe76Scherry #ifndef _IA64_INT_FMTIO_H_ 33ba7cbe76Scherry #define _IA64_INT_FMTIO_H_ 34ba7cbe76Scherry 35*efe99ca4Smatt #ifdef __INTPTR_FMTd__ 36*efe99ca4Smatt #include <sys/common_int_fmtio.h> 37*efe99ca4Smatt #else 38ba7cbe76Scherry /* 39ba7cbe76Scherry * 7.8.1 Macros for format specifiers 40ba7cbe76Scherry */ 41ba7cbe76Scherry 42ba7cbe76Scherry /* fprintf macros for signed integers */ 43ba7cbe76Scherry 44ba7cbe76Scherry #define PRId8 "d" /* int8_t */ 45ba7cbe76Scherry #define PRId16 "d" /* int16_t */ 46ba7cbe76Scherry #define PRId32 "d" /* int32_t */ 47ba7cbe76Scherry #define PRId64 "ld" /* int64_t */ 48ba7cbe76Scherry #define PRIdLEAST8 "d" /* int_least8_t */ 49ba7cbe76Scherry #define PRIdLEAST16 "d" /* int_least16_t */ 50ba7cbe76Scherry #define PRIdLEAST32 "d" /* int_least32_t */ 51ba7cbe76Scherry #define PRIdLEAST64 "ld" /* int_least64_t */ 52ba7cbe76Scherry #define PRIdFAST8 "d" /* int_fast8_t */ 53ba7cbe76Scherry #define PRIdFAST16 "d" /* int_fast16_t */ 54ba7cbe76Scherry #define PRIdFAST32 "d" /* int_fast32_t */ 55ba7cbe76Scherry #define PRIdFAST64 "ld" /* int_fast64_t */ 56ba7cbe76Scherry #define PRIdMAX "ld" /* intmax_t */ 57ba7cbe76Scherry #define PRIdPTR "ld" /* intptr_t */ 58ba7cbe76Scherry 59ba7cbe76Scherry #define PRIi8 "i" /* int8_t */ 60ba7cbe76Scherry #define PRIi16 "i" /* int16_t */ 61ba7cbe76Scherry #define PRIi32 "i" /* int32_t */ 62ba7cbe76Scherry #define PRIi64 "li" /* int64_t */ 63ba7cbe76Scherry #define PRIiLEAST8 "i" /* int_least8_t */ 64ba7cbe76Scherry #define PRIiLEAST16 "i" /* int_least16_t */ 65ba7cbe76Scherry #define PRIiLEAST32 "i" /* int_least32_t */ 66ba7cbe76Scherry #define PRIiLEAST64 "li" /* int_least64_t */ 67ba7cbe76Scherry #define PRIiFAST8 "i" /* int_fast8_t */ 68ba7cbe76Scherry #define PRIiFAST16 "i" /* int_fast16_t */ 69ba7cbe76Scherry #define PRIiFAST32 "i" /* int_fast32_t */ 70ba7cbe76Scherry #define PRIiFAST64 "li" /* int_fast64_t */ 71ba7cbe76Scherry #define PRIiMAX "li" /* intmax_t */ 72ba7cbe76Scherry #define PRIiPTR "li" /* intptr_t */ 73ba7cbe76Scherry 74ba7cbe76Scherry /* fprintf macros for unsigned integers */ 75ba7cbe76Scherry 76ba7cbe76Scherry #define PRIo8 "o" /* uint8_t */ 77ba7cbe76Scherry #define PRIo16 "o" /* uint16_t */ 78ba7cbe76Scherry #define PRIo32 "o" /* uint32_t */ 79ba7cbe76Scherry #define PRIo64 "lo" /* uint64_t */ 80ba7cbe76Scherry #define PRIoLEAST8 "o" /* uint_least8_t */ 81ba7cbe76Scherry #define PRIoLEAST16 "o" /* uint_least16_t */ 82ba7cbe76Scherry #define PRIoLEAST32 "o" /* uint_least32_t */ 83ba7cbe76Scherry #define PRIoLEAST64 "lo" /* uint_least64_t */ 84ba7cbe76Scherry #define PRIoFAST8 "o" /* uint_fast8_t */ 85ba7cbe76Scherry #define PRIoFAST16 "o" /* uint_fast16_t */ 86ba7cbe76Scherry #define PRIoFAST32 "o" /* uint_fast32_t */ 87ba7cbe76Scherry #define PRIoFAST64 "lo" /* uint_fast64_t */ 88ba7cbe76Scherry #define PRIoMAX "lo" /* uintmax_t */ 89ba7cbe76Scherry #define PRIoPTR "lo" /* uintptr_t */ 90ba7cbe76Scherry 91ba7cbe76Scherry #define PRIu8 "u" /* uint8_t */ 92ba7cbe76Scherry #define PRIu16 "u" /* uint16_t */ 93ba7cbe76Scherry #define PRIu32 "u" /* uint32_t */ 94ba7cbe76Scherry #define PRIu64 "lu" /* uint64_t */ 95ba7cbe76Scherry #define PRIuLEAST8 "u" /* uint_least8_t */ 96ba7cbe76Scherry #define PRIuLEAST16 "u" /* uint_least16_t */ 97ba7cbe76Scherry #define PRIuLEAST32 "u" /* uint_least32_t */ 98ba7cbe76Scherry #define PRIuLEAST64 "lu" /* uint_least64_t */ 99ba7cbe76Scherry #define PRIuFAST8 "u" /* uint_fast8_t */ 100ba7cbe76Scherry #define PRIuFAST16 "u" /* uint_fast16_t */ 101ba7cbe76Scherry #define PRIuFAST32 "u" /* uint_fast32_t */ 102ba7cbe76Scherry #define PRIuFAST64 "lu" /* uint_fast64_t */ 103ba7cbe76Scherry #define PRIuMAX "lu" /* uintmax_t */ 104ba7cbe76Scherry #define PRIuPTR "lu" /* uintptr_t */ 105ba7cbe76Scherry 106ba7cbe76Scherry #define PRIx8 "x" /* uint8_t */ 107ba7cbe76Scherry #define PRIx16 "x" /* uint16_t */ 108ba7cbe76Scherry #define PRIx32 "x" /* uint32_t */ 109ba7cbe76Scherry #define PRIx64 "lx" /* uint64_t */ 110ba7cbe76Scherry #define PRIxLEAST8 "x" /* uint_least8_t */ 111ba7cbe76Scherry #define PRIxLEAST16 "x" /* uint_least16_t */ 112ba7cbe76Scherry #define PRIxLEAST32 "x" /* uint_least32_t */ 113ba7cbe76Scherry #define PRIxLEAST64 "lx" /* uint_least64_t */ 114ba7cbe76Scherry #define PRIxFAST8 "x" /* uint_fast8_t */ 115ba7cbe76Scherry #define PRIxFAST16 "x" /* uint_fast16_t */ 116ba7cbe76Scherry #define PRIxFAST32 "x" /* uint_fast32_t */ 117ba7cbe76Scherry #define PRIxFAST64 "lx" /* uint_fast64_t */ 118ba7cbe76Scherry #define PRIxMAX "lx" /* uintmax_t */ 119ba7cbe76Scherry #define PRIxPTR "lx" /* uintptr_t */ 120ba7cbe76Scherry 121ba7cbe76Scherry #define PRIX8 "X" /* uint8_t */ 122ba7cbe76Scherry #define PRIX16 "X" /* uint16_t */ 123ba7cbe76Scherry #define PRIX32 "X" /* uint32_t */ 124ba7cbe76Scherry #define PRIX64 "lX" /* uint64_t */ 125ba7cbe76Scherry #define PRIXLEAST8 "X" /* uint_least8_t */ 126ba7cbe76Scherry #define PRIXLEAST16 "X" /* uint_least16_t */ 127ba7cbe76Scherry #define PRIXLEAST32 "X" /* uint_least32_t */ 128ba7cbe76Scherry #define PRIXLEAST64 "lX" /* uint_least64_t */ 129ba7cbe76Scherry #define PRIXFAST8 "X" /* uint_fast8_t */ 130ba7cbe76Scherry #define PRIXFAST16 "X" /* uint_fast16_t */ 131ba7cbe76Scherry #define PRIXFAST32 "X" /* uint_fast32_t */ 132ba7cbe76Scherry #define PRIXFAST64 "lX" /* uint_fast64_t */ 133ba7cbe76Scherry #define PRIXMAX "lX" /* uintmax_t */ 134ba7cbe76Scherry #define PRIXPTR "lX" /* uintptr_t */ 135ba7cbe76Scherry 136ba7cbe76Scherry /* fscanf macros for signed integers */ 137ba7cbe76Scherry 138ba7cbe76Scherry #define SCNd8 "hhd" /* int8_t */ 139ba7cbe76Scherry #define SCNd16 "hd" /* int16_t */ 140ba7cbe76Scherry #define SCNd32 "d" /* int32_t */ 141ba7cbe76Scherry #define SCNd64 "ld" /* int64_t */ 142ba7cbe76Scherry #define SCNdLEAST8 "hhd" /* int_least8_t */ 143ba7cbe76Scherry #define SCNdLEAST16 "hd" /* int_least16_t */ 144ba7cbe76Scherry #define SCNdLEAST32 "d" /* int_least32_t */ 145ba7cbe76Scherry #define SCNdLEAST64 "ld" /* int_least64_t */ 146ba7cbe76Scherry #define SCNdFAST8 "d" /* int_fast8_t */ 147ba7cbe76Scherry #define SCNdFAST16 "d" /* int_fast16_t */ 148ba7cbe76Scherry #define SCNdFAST32 "d" /* int_fast32_t */ 149ba7cbe76Scherry #define SCNdFAST64 "ld" /* int_fast64_t */ 150ba7cbe76Scherry #define SCNdMAX "ld" /* intmax_t */ 151ba7cbe76Scherry #define SCNdPTR "ld" /* intptr_t */ 152ba7cbe76Scherry 153ba7cbe76Scherry #define SCNi8 "hhi" /* int8_t */ 154ba7cbe76Scherry #define SCNi16 "hi" /* int16_t */ 155ba7cbe76Scherry #define SCNi32 "i" /* int32_t */ 156ba7cbe76Scherry #define SCNi64 "li" /* int64_t */ 157ba7cbe76Scherry #define SCNiLEAST8 "hhi" /* int_least8_t */ 158ba7cbe76Scherry #define SCNiLEAST16 "hi" /* int_least16_t */ 159ba7cbe76Scherry #define SCNiLEAST32 "i" /* int_least32_t */ 160ba7cbe76Scherry #define SCNiLEAST64 "li" /* int_least64_t */ 161ba7cbe76Scherry #define SCNiFAST8 "i" /* int_fast8_t */ 162ba7cbe76Scherry #define SCNiFAST16 "i" /* int_fast16_t */ 163ba7cbe76Scherry #define SCNiFAST32 "i" /* int_fast32_t */ 164ba7cbe76Scherry #define SCNiFAST64 "li" /* int_fast64_t */ 165ba7cbe76Scherry #define SCNiMAX "li" /* intmax_t */ 166ba7cbe76Scherry #define SCNiPTR "li" /* intptr_t */ 167ba7cbe76Scherry 168ba7cbe76Scherry /* fscanf macros for unsigned integers */ 169ba7cbe76Scherry 170ba7cbe76Scherry #define SCNo8 "hho" /* uint8_t */ 171ba7cbe76Scherry #define SCNo16 "ho" /* uint16_t */ 172ba7cbe76Scherry #define SCNo32 "o" /* uint32_t */ 173ba7cbe76Scherry #define SCNo64 "lo" /* uint64_t */ 174ba7cbe76Scherry #define SCNoLEAST8 "hho" /* uint_least8_t */ 175ba7cbe76Scherry #define SCNoLEAST16 "ho" /* uint_least16_t */ 176ba7cbe76Scherry #define SCNoLEAST32 "o" /* uint_least32_t */ 177ba7cbe76Scherry #define SCNoLEAST64 "lo" /* uint_least64_t */ 178ba7cbe76Scherry #define SCNoFAST8 "o" /* uint_fast8_t */ 179ba7cbe76Scherry #define SCNoFAST16 "o" /* uint_fast16_t */ 180ba7cbe76Scherry #define SCNoFAST32 "o" /* uint_fast32_t */ 181ba7cbe76Scherry #define SCNoFAST64 "lo" /* uint_fast64_t */ 182ba7cbe76Scherry #define SCNoMAX "lo" /* uintmax_t */ 183ba7cbe76Scherry #define SCNoPTR "lo" /* uintptr_t */ 184ba7cbe76Scherry 185ba7cbe76Scherry #define SCNu8 "hhu" /* uint8_t */ 186ba7cbe76Scherry #define SCNu16 "hu" /* uint16_t */ 187ba7cbe76Scherry #define SCNu32 "u" /* uint32_t */ 188ba7cbe76Scherry #define SCNu64 "lu" /* uint64_t */ 189ba7cbe76Scherry #define SCNuLEAST8 "hhu" /* uint_least8_t */ 190ba7cbe76Scherry #define SCNuLEAST16 "hu" /* uint_least16_t */ 191ba7cbe76Scherry #define SCNuLEAST32 "u" /* uint_least32_t */ 192ba7cbe76Scherry #define SCNuLEAST64 "lu" /* uint_least64_t */ 193ba7cbe76Scherry #define SCNuFAST8 "u" /* uint_fast8_t */ 194ba7cbe76Scherry #define SCNuFAST16 "u" /* uint_fast16_t */ 195ba7cbe76Scherry #define SCNuFAST32 "u" /* uint_fast32_t */ 196ba7cbe76Scherry #define SCNuFAST64 "lu" /* uint_fast64_t */ 197ba7cbe76Scherry #define SCNuMAX "lu" /* uintmax_t */ 198ba7cbe76Scherry #define SCNuPTR "lu" /* uintptr_t */ 199ba7cbe76Scherry 200ba7cbe76Scherry #define SCNx8 "hhx" /* uint8_t */ 201ba7cbe76Scherry #define SCNx16 "hx" /* uint16_t */ 202ba7cbe76Scherry #define SCNx32 "x" /* uint32_t */ 203ba7cbe76Scherry #define SCNx64 "lx" /* uint64_t */ 204ba7cbe76Scherry #define SCNxLEAST8 "hhx" /* uint_least8_t */ 205ba7cbe76Scherry #define SCNxLEAST16 "hx" /* uint_least16_t */ 206ba7cbe76Scherry #define SCNxLEAST32 "x" /* uint_least32_t */ 207ba7cbe76Scherry #define SCNxLEAST64 "lx" /* uint_least64_t */ 208ba7cbe76Scherry #define SCNxFAST8 "x" /* uint_fast8_t */ 209ba7cbe76Scherry #define SCNxFAST16 "x" /* uint_fast16_t */ 210ba7cbe76Scherry #define SCNxFAST32 "x" /* uint_fast32_t */ 211ba7cbe76Scherry #define SCNxFAST64 "lx" /* uint_fast64_t */ 212ba7cbe76Scherry #define SCNxMAX "lx" /* uintmax_t */ 213ba7cbe76Scherry #define SCNxPTR "lx" /* uintptr_t */ 214ba7cbe76Scherry 215*efe99ca4Smatt #endif /* !__INTPTR_FMTd__ */ 216*efe99ca4Smatt 217ba7cbe76Scherry #endif /* !_IA64_INT_FMTIO_H_ */ 218