]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - share/man/man7/stdint.7
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / share / man / man7 / stdint.7
1 .\" Copyright (c) 2002 Mike Barcroft <mike@FreeBSD.org>
2 .\" All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\"
13 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23 .\" SUCH DAMAGE.
24 .\"
25 .\" $FreeBSD$
26 .\"
27 .Dd September 15, 2002
28 .Dt STDINT 7
29 .Os
30 .Sh NAME
31 .Nm stdint
32 .Nd "standard integer types"
33 .Sh SYNOPSIS
34 .In stdint.h
35 .Sh DESCRIPTION
36 The
37 .In stdint.h
38 header provides source-portable integer types of a specific
39 size, smallest memory footprint with a minimum size, fastest
40 access speed with a minimum size, largest integer size, and
41 those capable of storing pointers.
42 .Pp
43 The types
44 .Vt int8_t ,
45 .Vt int16_t ,
46 .Vt int32_t ,
47 and
48 .Vt int64_t
49 provide a signed integer type of width 8, 16, 32, or 64 bits, respectively.
50 The types
51 .Vt uint8_t ,
52 .Vt uint16_t ,
53 .Vt uint32_t ,
54 and
55 .Vt uint64_t
56 provide an unsigned integer type of width 8, 16, 32, or 64 bits, respectively.
57 These integer types should be used when a specific size is required.
58 .Pp
59 The types
60 .Vt int_fast8_t ,
61 .Vt int_fast16_t ,
62 .Vt int_fast32_t ,
63 and
64 .Vt int_fast64_t
65 provide the fastest signed integer type with a width
66 of at least 8, 16, 32, or 64 bits, respectively.
67 The types
68 .Vt uint_fast8_t ,
69 .Vt uint_fast16_t ,
70 .Vt uint_fast32_t ,
71 and
72 .Vt uint_fast64_t
73 provide the fastest unsigned integer type with a width
74 of at least 8, 16, 32, or 64 bits, respectively.
75 These types should be used when access speed is
76 paramount, and when a specific size is not required.
77 .Pp
78 The types
79 .Vt int_least8_t ,
80 .Vt int_least16_t ,
81 .Vt int_least32_t ,
82 and
83 .Vt int_least64_t
84 provide the smallest memory footprint signed integer type with
85 a width of at least 8, 16, 32, or 64 bits, respectively.
86 The types
87 .Vt uint_least8_t ,
88 .Vt uint_least16_t ,
89 .Vt uint_least32_t ,
90 and
91 .Vt uint_least64_t
92 provide the smallest memory footprint unsigned integer type with
93 a width of at least 8, 16, 32, or 64 bits, respectively.
94 These types should be used when memory storage is of
95 concern, and when a specific size is not required.
96 .Pp
97 The type
98 .Vt intmax_t
99 provides a signed integer type large
100 enough to hold any other signed integer.
101 The type
102 .Vt uintmax_t
103 provides an unsigned integer type large
104 enough to hold any other unsigned integer.
105 These types are generally the largest signed and unsigned
106 integer types available on a specific architecture.
107 .Pp
108 The type
109 .Vt intptr_t
110 provides a signed integer type with the ability to hold a pointer to
111 .Vt void ,
112 that can later be converted back to a pointer to
113 .Vt void .
114 .Pp
115 The type
116 .Vt uintptr_t
117 provides an unsigned integer type with the ability to hold a pointer to
118 .Vt void ,
119 that can later be converted back to a pointer to
120 .Vt void .
121 .Pp
122 Additionally, the
123 .In stdint.h
124 header defines some macros, but none of them are documented here.
125 .Sh STANDARDS
126 The
127 .In stdint.h
128 header conforms to
129 .St -isoC-99
130 and
131 .St -p1003.1-2001 .
132 .Sh HISTORY
133 The
134 .In stdint.h
135 header was first introduced in
136 .Fx 5.0 .