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