1.\"	$OpenBSD: iscntrl.3,v 1.13 2017/10/04 18:19:25 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: October 4 2017 $
36.Dt ISCNTRL 3
37.Os
38.Sh NAME
39.Nm iscntrl ,
40.Nm iscntrl_l
41.Nd control single-byte character test
42.Sh SYNOPSIS
43.In ctype.h
44.Ft int
45.Fn iscntrl "int c"
46.Ft int
47.Fn iscntrl_l "int c" "locale_t locale"
48.Sh DESCRIPTION
49The
50.Fn iscntrl
51and
52.Fn iscntrl_l
53functions tests for any control character.
54.Pp
55In the C locale, the complete list of control characters
56consists of the characters numbered 0x00\(en0x1f and 0x7f.
57.Ox
58always uses the C locale for these functions,
59ignoring the global locale, the thread-specific locale, and the
60.Fa locale
61argument.
62.Sh RETURN VALUES
63These functions return zero if the character tests false or
64non-zero if the character tests true.
65.Sh ENVIRONMENT
66On systems supporting non-ASCII single-byte character encodings,
67results of these functions may differ, and the results of
68.Fn iscntrl
69may depend on the
70.Ev LC_CTYPE
71.Xr locale 1 .
72.Sh SEE ALSO
73.Xr isalnum 3 ,
74.Xr isalpha 3 ,
75.Xr isascii 3 ,
76.Xr isblank 3 ,
77.Xr isdigit 3 ,
78.Xr isgraph 3 ,
79.Xr islower 3 ,
80.Xr isprint 3 ,
81.Xr ispunct 3 ,
82.Xr isspace 3 ,
83.Xr isupper 3 ,
84.Xr iswcntrl 3 ,
85.Xr isxdigit 3 ,
86.Xr stdio 3 ,
87.Xr toascii 3 ,
88.Xr tolower 3 ,
89.Xr toupper 3 ,
90.Xr ascii 7
91.Sh STANDARDS
92The
93.Fn iscntrl
94function conforms to
95.St -ansiC ,
96and
97.Fn iscntrl_l
98to
99.St -p1003.1-2008 .
100.Sh HISTORY
101The
102.Fn iscntrl
103function first appeared in
104.At v7 ,
105and
106.Fn iscntrl_l
107has been available since
108.Ox 6.2 .
109.Sh CAVEATS
110The argument
111.Fa c
112must be
113.Dv EOF
114or representable as an
115.Li unsigned char ;
116otherwise, the result is undefined.
117