_inttypes.h revision 280364
1280364Sandrew/*- 2280364Sandrew * Copyright (c) 2001 The NetBSD Foundation, Inc. 3280364Sandrew * All rights reserved. 4280364Sandrew * 5280364Sandrew * This code is derived from software contributed to The NetBSD Foundation 6280364Sandrew * by Klaus Klein. 7280364Sandrew * 8280364Sandrew * Redistribution and use in source and binary forms, with or without 9280364Sandrew * modification, are permitted provided that the following conditions 10280364Sandrew * are met: 11280364Sandrew * 1. Redistributions of source code must retain the above copyright 12280364Sandrew * notice, this list of conditions and the following disclaimer. 13280364Sandrew * 2. Redistributions in binary form must reproduce the above copyright 14280364Sandrew * notice, this list of conditions and the following disclaimer in the 15280364Sandrew * documentation and/or other materials provided with the distribution. 16280364Sandrew * 17280364Sandrew * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 18280364Sandrew * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 19280364Sandrew * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 20280364Sandrew * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 21280364Sandrew * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22280364Sandrew * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23280364Sandrew * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24280364Sandrew * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25280364Sandrew * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26280364Sandrew * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27280364Sandrew * POSSIBILITY OF SUCH DAMAGE. 28280364Sandrew * 29280364Sandrew * From: $NetBSD: int_fmtio.h,v 1.4 2008/04/28 20:23:36 martin Exp $ 30280364Sandrew * $FreeBSD: head/sys/arm64/include/_inttypes.h 280364 2015-03-23 11:54:56Z andrew $ 31280364Sandrew */ 32280364Sandrew 33280364Sandrew#ifndef _MACHINE__INTTYPES_H_ 34280364Sandrew#define _MACHINE__INTTYPES_H_ 35280364Sandrew 36280364Sandrew/* 37280364Sandrew * Macros for format specifiers. 38280364Sandrew */ 39280364Sandrew 40280364Sandrew/* fprintf(3) macros for signed integers. */ 41280364Sandrew 42280364Sandrew#define PRId8 "d" /* int8_t */ 43280364Sandrew#define PRId16 "d" /* int16_t */ 44280364Sandrew#define PRId32 "d" /* int32_t */ 45280364Sandrew#define PRId64 "ld" /* int64_t */ 46280364Sandrew#define PRIdLEAST8 "d" /* int_least8_t */ 47280364Sandrew#define PRIdLEAST16 "d" /* int_least16_t */ 48280364Sandrew#define PRIdLEAST32 "d" /* int_least32_t */ 49280364Sandrew#define PRIdLEAST64 "ld" /* int_least64_t */ 50280364Sandrew#define PRIdFAST8 "d" /* int_fast8_t */ 51280364Sandrew#define PRIdFAST16 "d" /* int_fast16_t */ 52280364Sandrew#define PRIdFAST32 "d" /* int_fast32_t */ 53280364Sandrew#define PRIdFAST64 "ld" /* int_fast64_t */ 54280364Sandrew#define PRIdMAX "jd" /* intmax_t */ 55280364Sandrew#define PRIdPTR "ld" /* intptr_t */ 56280364Sandrew 57280364Sandrew#define PRIi8 "i" /* int8_t */ 58280364Sandrew#define PRIi16 "i" /* int16_t */ 59280364Sandrew#define PRIi32 "i" /* int32_t */ 60280364Sandrew#define PRIi64 "li" /* int64_t */ 61280364Sandrew#define PRIiLEAST8 "i" /* int_least8_t */ 62280364Sandrew#define PRIiLEAST16 "i" /* int_least16_t */ 63280364Sandrew#define PRIiLEAST32 "i" /* int_least32_t */ 64280364Sandrew#define PRIiLEAST64 "li" /* int_least64_t */ 65280364Sandrew#define PRIiFAST8 "i" /* int_fast8_t */ 66280364Sandrew#define PRIiFAST16 "i" /* int_fast16_t */ 67280364Sandrew#define PRIiFAST32 "i" /* int_fast32_t */ 68280364Sandrew#define PRIiFAST64 "li" /* int_fast64_t */ 69280364Sandrew#define PRIiMAX "ji" /* intmax_t */ 70280364Sandrew#define PRIiPTR "li" /* intptr_t */ 71280364Sandrew 72280364Sandrew/* fprintf(3) macros for unsigned integers. */ 73280364Sandrew 74280364Sandrew#define PRIo8 "o" /* uint8_t */ 75280364Sandrew#define PRIo16 "o" /* uint16_t */ 76280364Sandrew#define PRIo32 "o" /* uint32_t */ 77280364Sandrew#define PRIo64 "lo" /* uint64_t */ 78280364Sandrew#define PRIoLEAST8 "o" /* uint_least8_t */ 79280364Sandrew#define PRIoLEAST16 "o" /* uint_least16_t */ 80280364Sandrew#define PRIoLEAST32 "o" /* uint_least32_t */ 81280364Sandrew#define PRIoLEAST64 "lo" /* uint_least64_t */ 82280364Sandrew#define PRIoFAST8 "o" /* uint_fast8_t */ 83280364Sandrew#define PRIoFAST16 "o" /* uint_fast16_t */ 84280364Sandrew#define PRIoFAST32 "o" /* uint_fast32_t */ 85280364Sandrew#define PRIoFAST64 "lo" /* uint_fast64_t */ 86280364Sandrew#define PRIoMAX "jo" /* uintmax_t */ 87280364Sandrew#define PRIoPTR "lo" /* uintptr_t */ 88280364Sandrew 89280364Sandrew#define PRIu8 "u" /* uint8_t */ 90280364Sandrew#define PRIu16 "u" /* uint16_t */ 91280364Sandrew#define PRIu32 "u" /* uint32_t */ 92280364Sandrew#define PRIu64 "lu" /* uint64_t */ 93280364Sandrew#define PRIuLEAST8 "u" /* uint_least8_t */ 94280364Sandrew#define PRIuLEAST16 "u" /* uint_least16_t */ 95280364Sandrew#define PRIuLEAST32 "u" /* uint_least32_t */ 96280364Sandrew#define PRIuLEAST64 "lu" /* uint_least64_t */ 97280364Sandrew#define PRIuFAST8 "u" /* uint_fast8_t */ 98280364Sandrew#define PRIuFAST16 "u" /* uint_fast16_t */ 99280364Sandrew#define PRIuFAST32 "u" /* uint_fast32_t */ 100280364Sandrew#define PRIuFAST64 "lu" /* uint_fast64_t */ 101280364Sandrew#define PRIuMAX "ju" /* uintmax_t */ 102280364Sandrew#define PRIuPTR "lu" /* uintptr_t */ 103280364Sandrew 104280364Sandrew#define PRIx8 "x" /* uint8_t */ 105280364Sandrew#define PRIx16 "x" /* uint16_t */ 106280364Sandrew#define PRIx32 "x" /* uint32_t */ 107280364Sandrew#define PRIx64 "lx" /* uint64_t */ 108280364Sandrew#define PRIxLEAST8 "x" /* uint_least8_t */ 109280364Sandrew#define PRIxLEAST16 "x" /* uint_least16_t */ 110280364Sandrew#define PRIxLEAST32 "x" /* uint_least32_t */ 111280364Sandrew#define PRIxLEAST64 "lx" /* uint_least64_t */ 112280364Sandrew#define PRIxFAST8 "x" /* uint_fast8_t */ 113280364Sandrew#define PRIxFAST16 "x" /* uint_fast16_t */ 114280364Sandrew#define PRIxFAST32 "x" /* uint_fast32_t */ 115280364Sandrew#define PRIxFAST64 "lx" /* uint_fast64_t */ 116280364Sandrew#define PRIxMAX "jx" /* uintmax_t */ 117280364Sandrew#define PRIxPTR "lx" /* uintptr_t */ 118280364Sandrew 119280364Sandrew#define PRIX8 "X" /* uint8_t */ 120280364Sandrew#define PRIX16 "X" /* uint16_t */ 121280364Sandrew#define PRIX32 "X" /* uint32_t */ 122280364Sandrew#define PRIX64 "lX" /* uint64_t */ 123280364Sandrew#define PRIXLEAST8 "X" /* uint_least8_t */ 124280364Sandrew#define PRIXLEAST16 "X" /* uint_least16_t */ 125280364Sandrew#define PRIXLEAST32 "X" /* uint_least32_t */ 126280364Sandrew#define PRIXLEAST64 "lX" /* uint_least64_t */ 127280364Sandrew#define PRIXFAST8 "X" /* uint_fast8_t */ 128280364Sandrew#define PRIXFAST16 "X" /* uint_fast16_t */ 129280364Sandrew#define PRIXFAST32 "X" /* uint_fast32_t */ 130280364Sandrew#define PRIXFAST64 "lX" /* uint_fast64_t */ 131280364Sandrew#define PRIXMAX "jX" /* uintmax_t */ 132280364Sandrew#define PRIXPTR "lX" /* uintptr_t */ 133280364Sandrew 134280364Sandrew/* fscanf(3) macros for signed integers. */ 135280364Sandrew 136280364Sandrew#define SCNd8 "hhd" /* int8_t */ 137280364Sandrew#define SCNd16 "hd" /* int16_t */ 138280364Sandrew#define SCNd32 "d" /* int32_t */ 139280364Sandrew#define SCNd64 "ld" /* int64_t */ 140280364Sandrew#define SCNdLEAST8 "hhd" /* int_least8_t */ 141280364Sandrew#define SCNdLEAST16 "hd" /* int_least16_t */ 142280364Sandrew#define SCNdLEAST32 "d" /* int_least32_t */ 143280364Sandrew#define SCNdLEAST64 "ld" /* int_least64_t */ 144280364Sandrew#define SCNdFAST8 "d" /* int_fast8_t */ 145280364Sandrew#define SCNdFAST16 "d" /* int_fast16_t */ 146280364Sandrew#define SCNdFAST32 "d" /* int_fast32_t */ 147280364Sandrew#define SCNdFAST64 "ld" /* int_fast64_t */ 148280364Sandrew#define SCNdMAX "jd" /* intmax_t */ 149280364Sandrew#define SCNdPTR "ld" /* intptr_t */ 150280364Sandrew 151280364Sandrew#define SCNi8 "hhi" /* int8_t */ 152280364Sandrew#define SCNi16 "hi" /* int16_t */ 153280364Sandrew#define SCNi32 "i" /* int32_t */ 154280364Sandrew#define SCNi64 "li" /* int64_t */ 155280364Sandrew#define SCNiLEAST8 "hhi" /* int_least8_t */ 156280364Sandrew#define SCNiLEAST16 "hi" /* int_least16_t */ 157280364Sandrew#define SCNiLEAST32 "i" /* int_least32_t */ 158280364Sandrew#define SCNiLEAST64 "li" /* int_least64_t */ 159280364Sandrew#define SCNiFAST8 "i" /* int_fast8_t */ 160280364Sandrew#define SCNiFAST16 "i" /* int_fast16_t */ 161280364Sandrew#define SCNiFAST32 "i" /* int_fast32_t */ 162280364Sandrew#define SCNiFAST64 "li" /* int_fast64_t */ 163280364Sandrew#define SCNiMAX "ji" /* intmax_t */ 164280364Sandrew#define SCNiPTR "li" /* intptr_t */ 165280364Sandrew 166280364Sandrew/* fscanf(3) macros for unsigned integers. */ 167280364Sandrew 168280364Sandrew#define SCNo8 "hho" /* uint8_t */ 169280364Sandrew#define SCNo16 "ho" /* uint16_t */ 170280364Sandrew#define SCNo32 "o" /* uint32_t */ 171280364Sandrew#define SCNo64 "lo" /* uint64_t */ 172280364Sandrew#define SCNoLEAST8 "hho" /* uint_least8_t */ 173280364Sandrew#define SCNoLEAST16 "ho" /* uint_least16_t */ 174280364Sandrew#define SCNoLEAST32 "o" /* uint_least32_t */ 175280364Sandrew#define SCNoLEAST64 "lo" /* uint_least64_t */ 176280364Sandrew#define SCNoFAST8 "o" /* uint_fast8_t */ 177280364Sandrew#define SCNoFAST16 "o" /* uint_fast16_t */ 178280364Sandrew#define SCNoFAST32 "o" /* uint_fast32_t */ 179280364Sandrew#define SCNoFAST64 "lo" /* uint_fast64_t */ 180280364Sandrew#define SCNoMAX "jo" /* uintmax_t */ 181280364Sandrew#define SCNoPTR "lo" /* uintptr_t */ 182280364Sandrew 183280364Sandrew#define SCNu8 "hhu" /* uint8_t */ 184280364Sandrew#define SCNu16 "hu" /* uint16_t */ 185280364Sandrew#define SCNu32 "u" /* uint32_t */ 186280364Sandrew#define SCNu64 "lu" /* uint64_t */ 187280364Sandrew#define SCNuLEAST8 "hhu" /* uint_least8_t */ 188280364Sandrew#define SCNuLEAST16 "hu" /* uint_least16_t */ 189280364Sandrew#define SCNuLEAST32 "u" /* uint_least32_t */ 190280364Sandrew#define SCNuLEAST64 "lu" /* uint_least64_t */ 191280364Sandrew#define SCNuFAST8 "u" /* uint_fast8_t */ 192280364Sandrew#define SCNuFAST16 "u" /* uint_fast16_t */ 193280364Sandrew#define SCNuFAST32 "u" /* uint_fast32_t */ 194280364Sandrew#define SCNuFAST64 "lu" /* uint_fast64_t */ 195280364Sandrew#define SCNuMAX "ju" /* uintmax_t */ 196280364Sandrew#define SCNuPTR "lu" /* uintptr_t */ 197280364Sandrew 198280364Sandrew#define SCNx8 "hhx" /* uint8_t */ 199280364Sandrew#define SCNx16 "hx" /* uint16_t */ 200280364Sandrew#define SCNx32 "x" /* uint32_t */ 201280364Sandrew#define SCNx64 "lx" /* uint64_t */ 202280364Sandrew#define SCNxLEAST8 "hhx" /* uint_least8_t */ 203280364Sandrew#define SCNxLEAST16 "hx" /* uint_least16_t */ 204280364Sandrew#define SCNxLEAST32 "x" /* uint_least32_t */ 205280364Sandrew#define SCNxLEAST64 "lx" /* uint_least64_t */ 206280364Sandrew#define SCNxFAST8 "x" /* uint_fast8_t */ 207280364Sandrew#define SCNxFAST16 "x" /* uint_fast16_t */ 208280364Sandrew#define SCNxFAST32 "x" /* uint_fast32_t */ 209280364Sandrew#define SCNxFAST64 "lx" /* uint_fast64_t */ 210280364Sandrew#define SCNxMAX "jx" /* uintmax_t */ 211280364Sandrew#define SCNxPTR "lx" /* uintptr_t */ 212280364Sandrew 213280364Sandrew#endif /* !_MACHINE__INTTYPES_H_ */ 214