xref: /openbsd/lib/libc/gen/isspace.3 (revision 771fbea0)
1.\"	$OpenBSD: isspace.3,v 1.14 2017/09/05 03:16:13 schwarze Exp $
2.\"
3.\" Copyright (c) 1991 The Regents of the University of California.
4.\" Copyright (c) 2017 Ingo Schwarze <schwarze@openbsd.org>
5.\" All rights reserved.
6.\"
7.\" This code is derived from software contributed to Berkeley by
8.\" the American National Standards Committee X3, on Information
9.\" Processing Systems.
10.\"
11.\" Redistribution and use in source and binary forms, with or without
12.\" modification, are permitted provided that the following conditions
13.\" are met:
14.\" 1. Redistributions of source code must retain the above copyright
15.\"    notice, this list of conditions and the following disclaimer.
16.\" 2. Redistributions in binary form must reproduce the above copyright
17.\"    notice, this list of conditions and the following disclaimer in the
18.\"    documentation and/or other materials provided with the distribution.
19.\" 3. Neither the name of the University nor the names of its contributors
20.\"    may be used to endorse or promote products derived from this software
21.\"    without specific prior written permission.
22.\"
23.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33.\" SUCH DAMAGE.
34.\"
35.Dd $Mdocdate: September 5 2017 $
36.Dt ISSPACE 3
37.Os
38.Sh NAME
39.Nm isspace ,
40.Nm isspace_l
41.Nd whitespace single-byte character test
42.Sh SYNOPSIS
43.In ctype.h
44.Ft int
45.Fn isspace "int c"
46.Ft int
47.Fn isspace_l "int c" "locale_t locale"
48.Sh DESCRIPTION
49The
50.Fn isspace
51and
52.Fn isspace_l
53functions test for whitespace characters.
54.Pp
55In the C locale, the complete list of whitespace characters is:
56.Pp
57.Bl -tag -width xxxxx -offset indent -compact
58.It Sq \0
59Space character.
60.It Li \ef
61Form feed.
62.It Li \en
63New-line.
64.It Li \er
65Carriage return.
66.It Li \et
67Horizontal tab.
68.It Li \ev
69And vertical tab.
70.El
71.Pp
72.Ox
73always uses the C locale for these functions,
74ignoring the global locale, the thread-specific locale, and the
75.Fa locale
76argument.
77.Sh RETURN VALUES
78These functions return zero if the character tests false or
79non-zero if the character tests true.
80.Sh ENVIRONMENT
81On systems supporting non-ASCII single-byte character encodings,
82these functions may return non-zero for additional characters,
83and the results of
84.Fn isspace
85may depend on the
86.Ev LC_CTYPE
87.Xr locale 1 .
88.Sh SEE ALSO
89.Xr isalnum 3 ,
90.Xr isalpha 3 ,
91.Xr isascii 3 ,
92.Xr isblank 3 ,
93.Xr iscntrl 3 ,
94.Xr isdigit 3 ,
95.Xr isgraph 3 ,
96.Xr islower 3 ,
97.Xr isprint 3 ,
98.Xr ispunct 3 ,
99.Xr isupper 3 ,
100.Xr iswspace 3 ,
101.Xr isxdigit 3 ,
102.Xr stdio 3 ,
103.Xr toascii 3 ,
104.Xr tolower 3 ,
105.Xr toupper 3 ,
106.Xr ascii 7
107.Sh STANDARDS
108The
109.Fn isspace
110function conforms to
111.St -ansiC ,
112and
113.Fn isspace_l
114to
115.St -p1003.1-2008 .
116.Sh HISTORY
117The
118.Fn isspace
119function first appeared in
120.At v7 ,
121and
122.Fn isspace_l
123has been available since
124.Ox 6.2 .
125.Sh CAVEATS
126The argument
127.Fa c
128must be
129.Dv EOF
130or representable as an
131.Li unsigned char ;
132otherwise, the result is undefined.
133