_inttypes.h revision 85892
185892Smike/*- 285892Smike * Copyright (c) 2001 The NetBSD Foundation, Inc. 385892Smike * All rights reserved. 485892Smike * 585892Smike * This code is derived from software contributed to The NetBSD Foundation 685892Smike * by Klaus Klein. 785892Smike * 885892Smike * Redistribution and use in source and binary forms, with or without 985892Smike * modification, are permitted provided that the following conditions 1085892Smike * are met: 1185892Smike * 1. Redistributions of source code must retain the above copyright 1285892Smike * notice, this list of conditions and the following disclaimer. 1385892Smike * 2. Redistributions in binary form must reproduce the above copyright 1485892Smike * notice, this list of conditions and the following disclaimer in the 1585892Smike * documentation and/or other materials provided with the distribution. 1685892Smike * 3. All advertising materials mentioning features or use of this software 1785892Smike * must display the following acknowledgement: 1885892Smike * This product includes software developed by the NetBSD 1985892Smike * Foundation, Inc. and its contributors. 2085892Smike * 4. Neither the name of The NetBSD Foundation nor the names of its 2185892Smike * contributors may be used to endorse or promote products derived 2285892Smike * from this software without specific prior written permission. 2385892Smike * 2485892Smike * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 2585892Smike * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 2685892Smike * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 2785892Smike * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 2885892Smike * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 2985892Smike * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 3085892Smike * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 3185892Smike * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 3285892Smike * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 3385892Smike * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 3485892Smike * POSSIBILITY OF SUCH DAMAGE. 3585892Smike * 3685892Smike * From: $NetBSD: int_fmtio.h,v 1.2 2001/04/26 16:25:21 kleink Exp $ 3785892Smike * $FreeBSD: head/sys/ia64/include/_inttypes.h 85892 2001-11-02 18:05:43Z mike $ 3885892Smike */ 3985892Smike 4085892Smike#ifndef _MACHINE_INTTYPES_H_ 4185892Smike#define _MACHINE_INTTYPES_H_ 4285892Smike 4385892Smike/* 4485892Smike * Macros for format specifiers. 4585892Smike */ 4685892Smike 4785892Smike/* fprintf(3) macros for signed integers. */ 4885892Smike 4985892Smike#define PRId8 "d" /* int8_t */ 5085892Smike#define PRId16 "d" /* int16_t */ 5185892Smike#define PRId32 "d" /* int32_t */ 5285892Smike#define PRId64 "ld" /* int64_t */ 5385892Smike#define PRIdLEAST8 "d" /* int_least8_t */ 5485892Smike#define PRIdLEAST16 "d" /* int_least16_t */ 5585892Smike#define PRIdLEAST32 "d" /* int_least32_t */ 5685892Smike#define PRIdLEAST64 "ld" /* int_least64_t */ 5785892Smike#define PRIdFAST8 "d" /* int_fast8_t */ 5885892Smike#define PRIdFAST16 "d" /* int_fast16_t */ 5985892Smike#define PRIdFAST32 "d" /* int_fast32_t */ 6085892Smike#define PRIdFAST64 "ld" /* int_fast64_t */ 6185892Smike#define PRIdMAX "ld" /* intmax_t */ 6285892Smike#define PRIdPTR "ld" /* intptr_t */ 6385892Smike 6485892Smike#define PRIi8 "i" /* int8_t */ 6585892Smike#define PRIi16 "i" /* int16_t */ 6685892Smike#define PRIi32 "i" /* int32_t */ 6785892Smike#define PRIi64 "li" /* int64_t */ 6885892Smike#define PRIiLEAST8 "i" /* int_least8_t */ 6985892Smike#define PRIiLEAST16 "i" /* int_least16_t */ 7085892Smike#define PRIiLEAST32 "i" /* int_least32_t */ 7185892Smike#define PRIiLEAST64 "li" /* int_least64_t */ 7285892Smike#define PRIiFAST8 "i" /* int_fast8_t */ 7385892Smike#define PRIiFAST16 "i" /* int_fast16_t */ 7485892Smike#define PRIiFAST32 "i" /* int_fast32_t */ 7585892Smike#define PRIiFAST64 "li" /* int_fast64_t */ 7685892Smike#define PRIiMAX "li" /* intmax_t */ 7785892Smike#define PRIiPTR "li" /* intptr_t */ 7885892Smike 7985892Smike/* fprintf(3) macros for unsigned integers. */ 8085892Smike 8185892Smike#define PRIo8 "o" /* uint8_t */ 8285892Smike#define PRIo16 "o" /* uint16_t */ 8385892Smike#define PRIo32 "o" /* uint32_t */ 8485892Smike#define PRIo64 "lo" /* uint64_t */ 8585892Smike#define PRIoLEAST8 "o" /* uint_least8_t */ 8685892Smike#define PRIoLEAST16 "o" /* uint_least16_t */ 8785892Smike#define PRIoLEAST32 "o" /* uint_least32_t */ 8885892Smike#define PRIoLEAST64 "lo" /* uint_least64_t */ 8985892Smike#define PRIoFAST8 "o" /* uint_fast8_t */ 9085892Smike#define PRIoFAST16 "o" /* uint_fast16_t */ 9185892Smike#define PRIoFAST32 "o" /* uint_fast32_t */ 9285892Smike#define PRIoFAST64 "lo" /* uint_fast64_t */ 9385892Smike#define PRIoMAX "lo" /* uintmax_t */ 9485892Smike#define PRIoPTR "lo" /* uintptr_t */ 9585892Smike 9685892Smike#define PRIu8 "u" /* uint8_t */ 9785892Smike#define PRIu16 "u" /* uint16_t */ 9885892Smike#define PRIu32 "u" /* uint32_t */ 9985892Smike#define PRIu64 "lu" /* uint64_t */ 10085892Smike#define PRIuLEAST8 "u" /* uint_least8_t */ 10185892Smike#define PRIuLEAST16 "u" /* uint_least16_t */ 10285892Smike#define PRIuLEAST32 "u" /* uint_least32_t */ 10385892Smike#define PRIuLEAST64 "lu" /* uint_least64_t */ 10485892Smike#define PRIuFAST8 "u" /* uint_fast8_t */ 10585892Smike#define PRIuFAST16 "u" /* uint_fast16_t */ 10685892Smike#define PRIuFAST32 "u" /* uint_fast32_t */ 10785892Smike#define PRIuFAST64 "lu" /* uint_fast64_t */ 10885892Smike#define PRIuMAX "lu" /* uintmax_t */ 10985892Smike#define PRIuPTR "lu" /* uintptr_t */ 11085892Smike 11185892Smike#define PRIx8 "x" /* uint8_t */ 11285892Smike#define PRIx16 "x" /* uint16_t */ 11385892Smike#define PRIx32 "x" /* uint32_t */ 11485892Smike#define PRIx64 "lx" /* uint64_t */ 11585892Smike#define PRIxLEAST8 "x" /* uint_least8_t */ 11685892Smike#define PRIxLEAST16 "x" /* uint_least16_t */ 11785892Smike#define PRIxLEAST32 "x" /* uint_least32_t */ 11885892Smike#define PRIxLEAST64 "lx" /* uint_least64_t */ 11985892Smike#define PRIxFAST8 "x" /* uint_fast8_t */ 12085892Smike#define PRIxFAST16 "x" /* uint_fast16_t */ 12185892Smike#define PRIxFAST32 "x" /* uint_fast32_t */ 12285892Smike#define PRIxFAST64 "lx" /* uint_fast64_t */ 12385892Smike#define PRIxMAX "lx" /* uintmax_t */ 12485892Smike#define PRIxPTR "lx" /* uintptr_t */ 12585892Smike 12685892Smike#define PRIX8 "X" /* uint8_t */ 12785892Smike#define PRIX16 "X" /* uint16_t */ 12885892Smike#define PRIX32 "X" /* uint32_t */ 12985892Smike#define PRIX64 "lX" /* uint64_t */ 13085892Smike#define PRIXLEAST8 "X" /* uint_least8_t */ 13185892Smike#define PRIXLEAST16 "X" /* uint_least16_t */ 13285892Smike#define PRIXLEAST32 "X" /* uint_least32_t */ 13385892Smike#define PRIXLEAST64 "lX" /* uint_least64_t */ 13485892Smike#define PRIXFAST8 "X" /* uint_fast8_t */ 13585892Smike#define PRIXFAST16 "X" /* uint_fast16_t */ 13685892Smike#define PRIXFAST32 "X" /* uint_fast32_t */ 13785892Smike#define PRIXFAST64 "lX" /* uint_fast64_t */ 13885892Smike#define PRIXMAX "lX" /* uintmax_t */ 13985892Smike#define PRIXPTR "lX" /* uintptr_t */ 14085892Smike 14185892Smike/* fscanf(3) macros for signed integers. */ 14285892Smike 14385892Smike#define SCNd8 "hhd" /* int8_t */ 14485892Smike#define SCNd16 "hd" /* int16_t */ 14585892Smike#define SCNd32 "d" /* int32_t */ 14685892Smike#define SCNd64 "ld" /* int64_t */ 14785892Smike#define SCNdLEAST8 "hhd" /* int_least8_t */ 14885892Smike#define SCNdLEAST16 "hd" /* int_least16_t */ 14985892Smike#define SCNdLEAST32 "d" /* int_least32_t */ 15085892Smike#define SCNdLEAST64 "ld" /* int_least64_t */ 15185892Smike#define SCNdFAST8 "d" /* int_fast8_t */ 15285892Smike#define SCNdFAST16 "d" /* int_fast16_t */ 15385892Smike#define SCNdFAST32 "d" /* int_fast32_t */ 15485892Smike#define SCNdFAST64 "ld" /* int_fast64_t */ 15585892Smike#define SCNdMAX "ld" /* intmax_t */ 15685892Smike#define SCNdPTR "ld" /* intptr_t */ 15785892Smike 15885892Smike#define SCNi8 "hhi" /* int8_t */ 15985892Smike#define SCNi16 "hi" /* int16_t */ 16085892Smike#define SCNi32 "i" /* int32_t */ 16185892Smike#define SCNi64 "li" /* int64_t */ 16285892Smike#define SCNiLEAST8 "hhi" /* int_least8_t */ 16385892Smike#define SCNiLEAST16 "hi" /* int_least16_t */ 16485892Smike#define SCNiLEAST32 "i" /* int_least32_t */ 16585892Smike#define SCNiLEAST64 "li" /* int_least64_t */ 16685892Smike#define SCNiFAST8 "i" /* int_fast8_t */ 16785892Smike#define SCNiFAST16 "i" /* int_fast16_t */ 16885892Smike#define SCNiFAST32 "i" /* int_fast32_t */ 16985892Smike#define SCNiFAST64 "li" /* int_fast64_t */ 17085892Smike#define SCNiMAX "li" /* intmax_t */ 17185892Smike#define SCNiPTR "li" /* intptr_t */ 17285892Smike 17385892Smike/* fscanf(3) macros for unsigned integers. */ 17485892Smike 17585892Smike#define SCNo8 "hho" /* uint8_t */ 17685892Smike#define SCNo16 "ho" /* uint16_t */ 17785892Smike#define SCNo32 "o" /* uint32_t */ 17885892Smike#define SCNo64 "lo" /* uint64_t */ 17985892Smike#define SCNoLEAST8 "hho" /* uint_least8_t */ 18085892Smike#define SCNoLEAST16 "ho" /* uint_least16_t */ 18185892Smike#define SCNoLEAST32 "o" /* uint_least32_t */ 18285892Smike#define SCNoLEAST64 "lo" /* uint_least64_t */ 18385892Smike#define SCNoFAST8 "o" /* uint_fast8_t */ 18485892Smike#define SCNoFAST16 "o" /* uint_fast16_t */ 18585892Smike#define SCNoFAST32 "o" /* uint_fast32_t */ 18685892Smike#define SCNoFAST64 "lo" /* uint_fast64_t */ 18785892Smike#define SCNoMAX "lo" /* uintmax_t */ 18885892Smike#define SCNoPTR "lo" /* uintptr_t */ 18985892Smike 19085892Smike#define SCNu8 "hhu" /* uint8_t */ 19185892Smike#define SCNu16 "hu" /* uint16_t */ 19285892Smike#define SCNu32 "u" /* uint32_t */ 19385892Smike#define SCNu64 "lu" /* uint64_t */ 19485892Smike#define SCNuLEAST8 "hhu" /* uint_least8_t */ 19585892Smike#define SCNuLEAST16 "hu" /* uint_least16_t */ 19685892Smike#define SCNuLEAST32 "u" /* uint_least32_t */ 19785892Smike#define SCNuLEAST64 "lu" /* uint_least64_t */ 19885892Smike#define SCNuFAST8 "u" /* uint_fast8_t */ 19985892Smike#define SCNuFAST16 "u" /* uint_fast16_t */ 20085892Smike#define SCNuFAST32 "u" /* uint_fast32_t */ 20185892Smike#define SCNuFAST64 "lu" /* uint_fast64_t */ 20285892Smike#define SCNuMAX "lu" /* uintmax_t */ 20385892Smike#define SCNuPTR "lu" /* uintptr_t */ 20485892Smike 20585892Smike#define SCNx8 "hhx" /* uint8_t */ 20685892Smike#define SCNx16 "hx" /* uint16_t */ 20785892Smike#define SCNx32 "x" /* uint32_t */ 20885892Smike#define SCNx64 "lx" /* uint64_t */ 20985892Smike#define SCNxLEAST8 "hhx" /* uint_least8_t */ 21085892Smike#define SCNxLEAST16 "hx" /* uint_least16_t */ 21185892Smike#define SCNxLEAST32 "x" /* uint_least32_t */ 21285892Smike#define SCNxLEAST64 "lx" /* uint_least64_t */ 21385892Smike#define SCNxFAST8 "x" /* uint_fast8_t */ 21485892Smike#define SCNxFAST16 "x" /* uint_fast16_t */ 21585892Smike#define SCNxFAST32 "x" /* uint_fast32_t */ 21685892Smike#define SCNxFAST64 "lx" /* uint_fast64_t */ 21785892Smike#define SCNxMAX "lx" /* uintmax_t */ 21885892Smike#define SCNxPTR "lx" /* uintptr_t */ 21985892Smike 22085892Smike#endif /* !_MACHINE_INTTYPES_H_ */ 221