nightly: remove unused BINARCHIVE
[unleashed.git] / share / man / man3head / inttypes.h.3head
blob7ddc644756d71b3c6ea923c37c3111fbce4a6ac5
1 .\"
2 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for
3 .\" permission to reproduce portions of its copyrighted documentation.
4 .\" Original documentation from The Open Group can be obtained online at
5 .\" http://www.opengroup.org/bookstore/.
6 .\"
7 .\" The Institute of Electrical and Electronics Engineers and The Open
8 .\" Group, have given us permission to reprint portions of their
9 .\" documentation.
10 .\"
11 .\" In the following statement, the phrase ``this text'' refers to portions
12 .\" of the system documentation.
13 .\"
14 .\" Portions of this text are reprinted and reproduced in electronic form
15 .\" in the SunOS Reference Manual, from IEEE Std 1003.1, 2004 Edition,
16 .\" Standard for Information Technology -- Portable Operating System
17 .\" Interface (POSIX), The Open Group Base Specifications Issue 6,
18 .\" Copyright (C) 2001-2004 by the Institute of Electrical and Electronics
19 .\" Engineers, Inc and The Open Group.  In the event of any discrepancy
20 .\" between these versions and the original IEEE and The Open Group
21 .\" Standard, the original IEEE and The Open Group Standard is the referee
22 .\" document.  The original Standard can be obtained online at
23 .\" http://www.opengroup.org/unix/online.html.
24 .\"
25 .\" This notice shall appear on any product containing this material.
26 .\"
27 .\" The contents of this file are subject to the terms of the
28 .\" Common Development and Distribution License (the "License").
29 .\" You may not use this file except in compliance with the License.
30 .\"
31 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
32 .\" or http://www.opensolaris.org/os/licensing.
33 .\" See the License for the specific language governing permissions
34 .\" and limitations under the License.
35 .\"
36 .\" When distributing Covered Code, include this CDDL HEADER in each
37 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
38 .\" If applicable, add the following below this CDDL HEADER, with the
39 .\" fields enclosed by brackets "[]" replaced with your own identifying
40 .\" information: Portions Copyright [yyyy] [name of copyright owner]
41 .\"
42 .\"
43 .\" Copyright (c) 2001, The IEEE and The Open Group.  All Rights Reserved.
44 .\" Portions Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved.
45 .\"
46 .TH INTTYPES.H 3HEAD "Sep 10, 2004"
47 .SH NAME
48 inttypes.h, inttypes \- fixed size integer types
49 .SH SYNOPSIS
50 .LP
51 .nf
52 #include <\fBinttypes.h\fR>
53 .fi
55 .SH DESCRIPTION
56 .sp
57 .LP
58 The <\fBinttypes.h\fR> header includes the <\fBstdint.h\fR> header.
59 .sp
60 .LP
61 The <\fBinttypes.h\fR> header includes a definition of the following type:
62 .sp
63 .ne 2
64 .na
65 \fB\fBimaxdiv_t\fR\fR
66 .ad
67 .RS 13n
68 structure type that is the type of the value returned by the \fBimaxdiv()\fR
69 function.
70 .RE
72 .sp
73 .LP
74 The following macros are defined. Each expands to a character string literal
75 containing a conversion specifier, possibly modified by a length modifier,
76 suitable for use within the format argument of a formatted input/output
77 function when converting the corresponding integer type. These macros have the
78 general form of \fBPRI\fR (character string literals for the \fBfprintf()\fR
79 and \fBfwprintf()\fR family of functions) or \fBSCN\fR (character string
80 literals for the \fBfscanf()\fR and \fBfwscanf()\fR family of functions),
81 followed by the conversion specifier, followed by a name corresponding to a
82 similar type name in <\fBstdint.h\fR>. In these names, \fIN\fR represents the
83 width of the type as described in <\fBstdint.h\fR>. For example,
84 \fBPRIdFAST32\fR can be used in a format string to print the value of an
85 integer of type \fBint_fast32_t\fR.
86 .sp
87 .LP
88 The \fBfprintf()\fR macros for signed integers are:
89 .sp
90 .in +2
91 .nf
92 PRId\fIN\fR  PRIdLEAST\fIN\fR  PRIdFAST\fIN\fR  PRIdMAX  PRIdPTR
93 PRIi\fIN\fR  PRIiLEAST\fIN\fR  PRIiFAST\fIN\fR  PRIiMAX  PRIiPTR
94 .fi
95 .in -2
97 .sp
98 .LP
99 The \fBfprintf()\fR macros for unsigned integers are:
101 .in +2
103 PRIo\fIN\fR   PRIoLEAST\fIN\fR  PRIoFAST\fIN\fR  PRIoMAX  PRIoPTR
104 PRIu\fIN\fR   PRIuLEAST\fIN\fR  PRIuFAST\fIN\fR  PRIuMAX  PRIuPTR
105 PRIx\fIN\fR   PRIxLEAST\fIN\fR  PRIxFAST\fIN\fR  PRIxMAX  PRIxPTR
106 PRIX\fIN\fR   PRIXLEAST\fIN\fR  PRIXFAST\fIN\fR  PRIXMAX  PRIXPTR
108 .in -2
112 The \fBfscanf()\fR macros for signed integers are:
114 .in +2
116 SCNd\fIN\fR  SCNdLEAST\fIN\fR  SCNdFAST\fIN\fR  SCNdMAX  SCNdPTR
117 SCNi\fIN\fR  SCNiLEAST\fIN\fR  SCNiFAST\fIN\fR  SCNiMAX  SCNiPTR
119 .in -2
123 The \fBfscanf()\fR macros for unsigned integers are:
125 .in +2
127 SCNo\fIN\fR  SCNoLEAST\fIN\fR  SCNoFAST\fIN\fR  SCNoMAX  SCNoPTR
128 SCNu\fIN\fR  SCNuLEAST\fIN\fR  SCNuFAST\fIN\fR  SCNuMAX  SCNuPTR
129 SCNx\fIN\fR  SCNxLEAST\fIN\fR  SCNxFAST\fIN\fR  SCNxMAX  SCNxPTR
131 .in -2
135 For each type that the implementation provides in <\fBstdint.h\fR>, the
136 corresponding \fBfprintf()\fR and  \fBfwprintf()\fR macros must be defined. The
137 corresponding \fBfscanf()\fR and \fBfwscanf()\fR macros must be defined as
138 well, unless the implementation does not have a suitable modifier for the type.
139 .SH USAGE
142 The purpose of <\fBinttypes.h\fR> is to provide a set of integer types whose
143 definitions are consistent across machines and independent of operating systems
144 and other implementation idiosyncrasies. It defines, with a \fBtypedef\fR,
145 integer types of various sizes. Implementations are free to \fBtypedef\fR them
146 as ISO C standard integer types or extensions that they support. Consistent use
147 of this header greatly increases the portability of applications across
148 platforms.
149 .SH EXAMPLES
151 \fBExample 1 \fRUse of Macro
154 The following code uses one of the macros available through <\fBinttypes.h\fR>.
157 .in +2
159 #include <inttypes.h>
160 #include <wchar.h>
161 int main(void)
163      uintmax_t i = UINTMAX_MAX; // This type always exists.
164      wprintf("The largest integer value is %020"
165           PRIxMAX, "\en", i);
166      return 0;
169 .in -2
171 .SH ATTRIBUTES
174 See \fBattributes\fR(5) for descriptions of the following attributes:
179 box;
180 c | c
181 l | l .
182 ATTRIBUTE TYPE  ATTRIBUTE VALUE
184 Interface Stability     Standard
187 .SH SEE ALSO
190 \fBimaxdiv\fR(3C), \fBattributes\fR(5), \fBstandards\fR(5)