xref: /netbsd-src/share/man/man3/stddef.3 (revision 42c705227acae0f59136f6b94a3c516e4d4831b8)
1.\" $NetBSD: stddef.3,v 1.8 2011/04/10 10:02:34 jruoho Exp $
2.\"
3.\" Copyright (c) 2010 The NetBSD Foundation, Inc.
4.\" All rights reserved.
5.\"
6.\" This code is derived from software contributed to The NetBSD Foundation
7.\" by Jukka Ruohonen.
8.\"
9.\" Redistribution and use in source and binary forms, with or without
10.\" modification, are permitted provided that the following conditions
11.\" are met:
12.\" 1. Redistributions of source code must retain the above copyright
13.\"    notice, this list of conditions and the following disclaimer.
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\"    notice, this list of conditions and the following disclaimer in the
16.\"    documentation and/or other materials provided with the distribution.
17.\"
18.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
19.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
22.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28.\" POSSIBILITY OF SUCH DAMAGE.
29.\"
30.Dd April 10, 2011
31.Dt STDDEF 3
32.Os
33.Sh NAME
34.Nm stddef
35.Nd standard type definitions
36.Sh SYNOPSIS
37.In stddef.h
38.Sh DESCRIPTION
39The
40.In stddef.h
41header defines the following types and macros:
42.Bl -enum -offset 4n
43.It
44.Vt ptrdiff_t ,
45a signed integer type of the result of subtracting two pointers;
46.It
47.Vt size_t ,
48an unsigned integer type of the result of the
49.Fn sizeof
50operator;
51.It
52.Vt wchar_t ,
53an integer type whose range of values can represent distinct wide-character
54codes for all members of the largest character set specified among the
55supported locales: the null character has the code value 0 and each member
56of the character set has a code value equal to its value when used
57as the lone character in an integer character constant;
58.It
59.Dv NULL ,
60which expands to an implementation-defined null pointer constant; and
61.It
62.Fn offsetof ,
63a macro that expands to an integer constant as described in
64.Xr offsetof 3 .
65.El
66.Pp
67Some of the described types and macros may appear also in other headers.
68.Sh SEE ALSO
69.Xr offsetof 3 ,
70.Xr stdlib 3 ,
71.Xr unistd 3
72.Sh STANDARDS
73As described here, the
74.In stddef.h
75header conforms to
76.St -isoC-99
77and
78.St -p1003.1-2001 .
79Some of the types and macros conform to earlier standards such as
80.St -ansiC .
81.Sh HISTORY
82In the current form the
83.In stddef.h
84header was introduced in
85.Nx 0.8 ,
86the first official release of
87.Nx .
88Some definitions such as
89.Dv NULL
90were first introduced already in the
91.In nsys/param.h
92header of
93.At v4 .
94