_inttypes.h revision 99117
140843Smsmith/*- 240843Smsmith * Copyright (c) 2001 The NetBSD Foundation, Inc. 340843Smsmith * All rights reserved. 440843Smsmith * 560959Sdcs * This code is derived from software contributed to The NetBSD Foundation 660959Sdcs * by Klaus Klein. 740843Smsmith * 840843Smsmith * Redistribution and use in source and binary forms, with or without 940843Smsmith * modification, are permitted provided that the following conditions 1040843Smsmith * are met: 1140843Smsmith * 1. Redistributions of source code must retain the above copyright 1240843Smsmith * notice, this list of conditions and the following disclaimer. 1340843Smsmith * 2. Redistributions in binary form must reproduce the above copyright 1440843Smsmith * notice, this list of conditions and the following disclaimer in the 1540843Smsmith * documentation and/or other materials provided with the distribution. 1640843Smsmith * 3. All advertising materials mentioning features or use of this software 1740843Smsmith * must display the following acknowledgement: 1840843Smsmith * This product includes software developed by the NetBSD 1940843Smsmith * Foundation, Inc. and its contributors. 2040843Smsmith * 4. Neither the name of The NetBSD Foundation nor the names of its 2140843Smsmith * contributors may be used to endorse or promote products derived 2240843Smsmith * from this software without specific prior written permission. 2340843Smsmith * 2440843Smsmith * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 2540843Smsmith * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 2640843Smsmith * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 2740843Smsmith * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 2840843Smsmith * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 2940843Smsmith * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 3040843Smsmith * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 3140843Smsmith * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 3240843Smsmith * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 3340843Smsmith * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 3440843Smsmith * POSSIBILITY OF SUCH DAMAGE. 3540843Smsmith * 3640843Smsmith * From: $NetBSD: int_fmtio.h,v 1.2 2001/04/26 16:25:21 kleink Exp $ 3740843Smsmith * $FreeBSD: head/sys/ia64/include/_inttypes.h 99117 2002-06-30 05:48:03Z mike $ 3840843Smsmith */ 3940843Smsmith 4040843Smsmith#ifndef _MACHINE_INTTYPES_H_ 4140843Smsmith#define _MACHINE_INTTYPES_H_ 4240843Smsmith 4340843Smsmith/* 4440843Smsmith * Macros for format specifiers. 4540843Smsmith */ 4640843Smsmith 4740843Smsmith/* fprintf(3) macros for signed integers. */ 4840843Smsmith 4940843Smsmith#define PRId8 "d" /* int8_t */ 5040843Smsmith#define PRId16 "d" /* int16_t */ 5140843Smsmith#define PRId32 "d" /* int32_t */ 5240843Smsmith#define PRId64 "ld" /* int64_t */ 5340843Smsmith#define PRIdLEAST8 "d" /* int_least8_t */ 5440843Smsmith#define PRIdLEAST16 "d" /* int_least16_t */ 5540843Smsmith#define PRIdLEAST32 "d" /* int_least32_t */ 5640843Smsmith#define PRIdLEAST64 "ld" /* int_least64_t */ 5740843Smsmith#define PRIdFAST8 "d" /* int_fast8_t */ 5840843Smsmith#define PRIdFAST16 "d" /* int_fast16_t */ 5940843Smsmith#define PRIdFAST32 "d" /* int_fast32_t */ 6040843Smsmith#define PRIdFAST64 "ld" /* int_fast64_t */ 6140843Smsmith#define PRIdMAX "jd" /* intmax_t */ 6240843Smsmith#define PRIdPTR "ld" /* intptr_t */ 6340843Smsmith 6440843Smsmith#define PRIi8 "i" /* int8_t */ 6540843Smsmith#define PRIi16 "i" /* int16_t */ 6640843Smsmith#define PRIi32 "i" /* int32_t */ 6740843Smsmith#define PRIi64 "li" /* int64_t */ 6840843Smsmith#define PRIiLEAST8 "i" /* int_least8_t */ 6940843Smsmith#define PRIiLEAST16 "i" /* int_least16_t */ 7040843Smsmith#define PRIiLEAST32 "i" /* int_least32_t */ 7140843Smsmith#define PRIiLEAST64 "li" /* int_least64_t */ 7240843Smsmith#define PRIiFAST8 "i" /* int_fast8_t */ 7360959Sdcs#define PRIiFAST16 "i" /* int_fast16_t */ 7460959Sdcs#define PRIiFAST32 "i" /* int_fast32_t */ 7560959Sdcs#define PRIiFAST64 "li" /* int_fast64_t */ 7660959Sdcs#define PRIiMAX "ji" /* intmax_t */ 7760959Sdcs#define PRIiPTR "li" /* intptr_t */ 7860959Sdcs 7960959Sdcs/* fprintf(3) macros for unsigned integers. */ 8060959Sdcs 8160959Sdcs#define PRIo8 "o" /* uint8_t */ 8260959Sdcs#define PRIo16 "o" /* uint16_t */ 8340843Smsmith#define PRIo32 "o" /* uint32_t */ 8440843Smsmith#define PRIo64 "lo" /* uint64_t */ 8540843Smsmith#define PRIoLEAST8 "o" /* uint_least8_t */ 8640843Smsmith#define PRIoLEAST16 "o" /* uint_least16_t */ 8740843Smsmith#define PRIoLEAST32 "o" /* uint_least32_t */ 8840843Smsmith#define PRIoLEAST64 "lo" /* uint_least64_t */ 8940843Smsmith#define PRIoFAST8 "o" /* uint_fast8_t */ 9040843Smsmith#define PRIoFAST16 "o" /* uint_fast16_t */ 9140843Smsmith#define PRIoFAST32 "o" /* uint_fast32_t */ 9240843Smsmith#define PRIoFAST64 "lo" /* uint_fast64_t */ 9340843Smsmith#define PRIoMAX "jo" /* uintmax_t */ 9440843Smsmith#define PRIoPTR "lo" /* uintptr_t */ 9540843Smsmith 9640843Smsmith#define PRIu8 "u" /* uint8_t */ 9740843Smsmith#define PRIu16 "u" /* uint16_t */ 9840843Smsmith#define PRIu32 "u" /* uint32_t */ 9940843Smsmith#define PRIu64 "lu" /* uint64_t */ 10040843Smsmith#define PRIuLEAST8 "u" /* uint_least8_t */ 10140843Smsmith#define PRIuLEAST16 "u" /* uint_least16_t */ 10240843Smsmith#define PRIuLEAST32 "u" /* uint_least32_t */ 10340843Smsmith#define PRIuLEAST64 "lu" /* uint_least64_t */ 10440843Smsmith#define PRIuFAST8 "u" /* uint_fast8_t */ 10540843Smsmith#define PRIuFAST16 "u" /* uint_fast16_t */ 10640843Smsmith#define PRIuFAST32 "u" /* uint_fast32_t */ 10740843Smsmith#define PRIuFAST64 "lu" /* uint_fast64_t */ 10840843Smsmith#define PRIuMAX "ju" /* uintmax_t */ 10940843Smsmith#define PRIuPTR "lu" /* uintptr_t */ 11040843Smsmith 11140843Smsmith#define PRIx8 "x" /* uint8_t */ 11240843Smsmith#define PRIx16 "x" /* uint16_t */ 11340843Smsmith#define PRIx32 "x" /* uint32_t */ 11440843Smsmith#define PRIx64 "lx" /* uint64_t */ 11540843Smsmith#define PRIxLEAST8 "x" /* uint_least8_t */ 11640843Smsmith#define PRIxLEAST16 "x" /* uint_least16_t */ 11740843Smsmith#define PRIxLEAST32 "x" /* uint_least32_t */ 11840843Smsmith#define PRIxLEAST64 "lx" /* uint_least64_t */ 11940843Smsmith#define PRIxFAST8 "x" /* uint_fast8_t */ 12040843Smsmith#define PRIxFAST16 "x" /* uint_fast16_t */ 12140843Smsmith#define PRIxFAST32 "x" /* uint_fast32_t */ 12240843Smsmith#define PRIxFAST64 "lx" /* uint_fast64_t */ 12340843Smsmith#define PRIxMAX "jx" /* uintmax_t */ 12440843Smsmith#define PRIxPTR "lx" /* uintptr_t */ 12540843Smsmith 12640843Smsmith#define PRIX8 "X" /* uint8_t */ 12740843Smsmith#define PRIX16 "X" /* uint16_t */ 12840843Smsmith#define PRIX32 "X" /* uint32_t */ 12940843Smsmith#define PRIX64 "lX" /* uint64_t */ 13040843Smsmith#define PRIXLEAST8 "X" /* uint_least8_t */ 13140843Smsmith#define PRIXLEAST16 "X" /* uint_least16_t */ 13240843Smsmith#define PRIXLEAST32 "X" /* uint_least32_t */ 13340843Smsmith#define PRIXLEAST64 "lX" /* uint_least64_t */ 13440843Smsmith#define PRIXFAST8 "X" /* uint_fast8_t */ 13540843Smsmith#define PRIXFAST16 "X" /* uint_fast16_t */ 13640843Smsmith#define PRIXFAST32 "X" /* uint_fast32_t */ 13740843Smsmith#define PRIXFAST64 "lX" /* uint_fast64_t */ 13840843Smsmith#define PRIXMAX "jX" /* uintmax_t */ 13940843Smsmith#define PRIXPTR "lX" /* uintptr_t */ 14040843Smsmith 14140843Smsmith/* fscanf(3) macros for signed integers. */ 14240843Smsmith 14340843Smsmith#define SCNd8 "hhd" /* int8_t */ 14440843Smsmith#define SCNd16 "hd" /* int16_t */ 14540843Smsmith#define SCNd32 "d" /* int32_t */ 14640843Smsmith#define SCNd64 "ld" /* int64_t */ 14740843Smsmith#define SCNdLEAST8 "hhd" /* int_least8_t */ 14840843Smsmith#define SCNdLEAST16 "hd" /* int_least16_t */ 14940843Smsmith#define SCNdLEAST32 "d" /* int_least32_t */ 15040843Smsmith#define SCNdLEAST64 "ld" /* int_least64_t */ 15140843Smsmith#define SCNdFAST8 "d" /* int_fast8_t */ 15240843Smsmith#define SCNdFAST16 "d" /* int_fast16_t */ 153#define SCNdFAST32 "d" /* int_fast32_t */ 154#define SCNdFAST64 "ld" /* int_fast64_t */ 155#define SCNdMAX "jd" /* intmax_t */ 156#define SCNdPTR "ld" /* intptr_t */ 157 158#define SCNi8 "hhi" /* int8_t */ 159#define SCNi16 "hi" /* int16_t */ 160#define SCNi32 "i" /* int32_t */ 161#define SCNi64 "li" /* int64_t */ 162#define SCNiLEAST8 "hhi" /* int_least8_t */ 163#define SCNiLEAST16 "hi" /* int_least16_t */ 164#define SCNiLEAST32 "i" /* int_least32_t */ 165#define SCNiLEAST64 "li" /* int_least64_t */ 166#define SCNiFAST8 "i" /* int_fast8_t */ 167#define SCNiFAST16 "i" /* int_fast16_t */ 168#define SCNiFAST32 "i" /* int_fast32_t */ 169#define SCNiFAST64 "li" /* int_fast64_t */ 170#define SCNiMAX "ji" /* intmax_t */ 171#define SCNiPTR "li" /* intptr_t */ 172 173/* fscanf(3) macros for unsigned integers. */ 174 175#define SCNo8 "hho" /* uint8_t */ 176#define SCNo16 "ho" /* uint16_t */ 177#define SCNo32 "o" /* uint32_t */ 178#define SCNo64 "lo" /* uint64_t */ 179#define SCNoLEAST8 "hho" /* uint_least8_t */ 180#define SCNoLEAST16 "ho" /* uint_least16_t */ 181#define SCNoLEAST32 "o" /* uint_least32_t */ 182#define SCNoLEAST64 "lo" /* uint_least64_t */ 183#define SCNoFAST8 "o" /* uint_fast8_t */ 184#define SCNoFAST16 "o" /* uint_fast16_t */ 185#define SCNoFAST32 "o" /* uint_fast32_t */ 186#define SCNoFAST64 "lo" /* uint_fast64_t */ 187#define SCNoMAX "jo" /* uintmax_t */ 188#define SCNoPTR "lo" /* uintptr_t */ 189 190#define SCNu8 "hhu" /* uint8_t */ 191#define SCNu16 "hu" /* uint16_t */ 192#define SCNu32 "u" /* uint32_t */ 193#define SCNu64 "lu" /* uint64_t */ 194#define SCNuLEAST8 "hhu" /* uint_least8_t */ 195#define SCNuLEAST16 "hu" /* uint_least16_t */ 196#define SCNuLEAST32 "u" /* uint_least32_t */ 197#define SCNuLEAST64 "lu" /* uint_least64_t */ 198#define SCNuFAST8 "u" /* uint_fast8_t */ 199#define SCNuFAST16 "u" /* uint_fast16_t */ 200#define SCNuFAST32 "u" /* uint_fast32_t */ 201#define SCNuFAST64 "lu" /* uint_fast64_t */ 202#define SCNuMAX "ju" /* uintmax_t */ 203#define SCNuPTR "lu" /* uintptr_t */ 204 205#define SCNx8 "hhx" /* uint8_t */ 206#define SCNx16 "hx" /* uint16_t */ 207#define SCNx32 "x" /* uint32_t */ 208#define SCNx64 "lx" /* uint64_t */ 209#define SCNxLEAST8 "hhx" /* uint_least8_t */ 210#define SCNxLEAST16 "hx" /* uint_least16_t */ 211#define SCNxLEAST32 "x" /* uint_least32_t */ 212#define SCNxLEAST64 "lx" /* uint_least64_t */ 213#define SCNxFAST8 "x" /* uint_fast8_t */ 214#define SCNxFAST16 "x" /* uint_fast16_t */ 215#define SCNxFAST32 "x" /* uint_fast32_t */ 216#define SCNxFAST64 "lx" /* uint_fast64_t */ 217#define SCNxMAX "jx" /* uintmax_t */ 218#define SCNxPTR "lx" /* uintptr_t */ 219 220#endif /* !_MACHINE_INTTYPES_H_ */ 221