2 .\" Copyright (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de)
4 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
6 .\" Modified Sat Jul 24 19:10:00 1993 by Rik Faith (faith@cs.unc.edu)
7 .\" Modified Sun Aug 21 17:51:50 1994 by Rik Faith (faith@cs.unc.edu)
8 .\" Modified Sat Sep 2 21:52:01 1995 by Jim Van Zandt <jrv@vanzandt.mv.com>
9 .\" Modified Mon May 27 22:55:26 1996 by Martin Schulze (joey@linux.de)
11 .TH isalpha 3 (date) "Linux man-pages (unreleased)"
13 isalnum, isalpha, isascii, isblank, iscntrl, isdigit, isgraph, islower,
14 isprint, ispunct, isspace, isupper, isxdigit,
15 isalnum_l, isalpha_l, isascii_l, isblank_l, iscntrl_l,
16 isdigit_l, isgraph_l, islower_l,
17 isprint_l, ispunct_l, isspace_l, isupper_l, isxdigit_l
18 \- character classification functions
21 .RI ( libc ", " \-lc )
26 .BI "int isalnum(int " c );
27 .BI "int isalpha(int " c );
28 .BI "int iscntrl(int " c );
29 .BI "int isdigit(int " c );
30 .BI "int isgraph(int " c );
31 .BI "int islower(int " c );
32 .BI "int isprint(int " c );
33 .BI "int ispunct(int " c );
34 .BI "int isspace(int " c );
35 .BI "int isupper(int " c );
36 .BI "int isxdigit(int " c );
38 .BI "int isascii(int " c );
39 .BI "int isblank(int " c );
41 .BI "int isalnum_l(int " c ", locale_t " locale );
42 .BI "int isalpha_l(int " c ", locale_t " locale );
43 .BI "int isblank_l(int " c ", locale_t " locale );
44 .BI "int iscntrl_l(int " c ", locale_t " locale );
45 .BI "int isdigit_l(int " c ", locale_t " locale );
46 .BI "int isgraph_l(int " c ", locale_t " locale );
47 .BI "int islower_l(int " c ", locale_t " locale );
48 .BI "int isprint_l(int " c ", locale_t " locale );
49 .BI "int ispunct_l(int " c ", locale_t " locale );
50 .BI "int isspace_l(int " c ", locale_t " locale );
51 .BI "int isupper_l(int " c ", locale_t " locale );
52 .BI "int isxdigit_l(int " c ", locale_t " locale );
54 .BI "int isascii_l(int " c ", locale_t " locale );
58 Feature Test Macro Requirements for glibc (see
59 .BR feature_test_macros (7)):
66 || /* glibc >= 2.19: */ _DEFAULT_SOURCE
67 || /* glibc <= 2.19: */ _SVID_SOURCE
72 _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
97 _XOPEN_SOURCE >= 700 && (_SVID_SOURCE || _BSD_SOURCE)
103 These functions check whether
105 which must have the value of an
109 falls into a certain character class according to the specified locale.
110 The functions without the
111 "_l" suffix perform the check based on the current locale.
113 The functions with the "_l" suffix perform the check
114 based on the locale specified by the locale object
116 The behavior of these functions is undefined if
118 is the special locale object
122 or is not a valid locale object handle.
124 The list below explains the operation of the functions without
126 the functions with the "_l" suffix differ only in using the locale object
128 instead of the current locale.
131 checks for an alphanumeric character; it is equivalent to
132 .BI "(isalpha(" c ") || isdigit(" c "))" \fR.
135 checks for an alphabetic character; in the standard \fB"C"\fP
136 locale, it is equivalent to
137 .BI "(isupper(" c ") || islower(" c "))" \fR.
138 In some locales, there may be additional characters for which
140 is true\[em]letters which are neither uppercase nor lowercase.
143 checks whether \fIc\fP is a 7-bit
146 the ASCII character set.
149 checks for a blank character; that is, a space or a tab.
152 checks for a control character.
155 checks for a digit (0 through 9).
158 checks for any printable character except space.
161 checks for a lowercase character.
164 checks for any printable character including space.
167 checks for any printable character which is not a space or an
168 alphanumeric character.
171 checks for white-space characters.
176 locales, these are: space, form-feed
177 .RB ( \[aq]\ef\[aq] ),
179 .RB ( \[aq]\en\[aq] ),
181 .RB ( \[aq]\er\[aq] ),
183 .RB ( \[aq]\et\[aq] ),
185 .RB ( \[aq]\ev\[aq] ).
188 checks for an uppercase letter.
191 checks for hexadecimal digits, that is, one of
193 .BR "0 1 2 3 4 5 6 7 8 9 a b c d e f A B C D E F" .
195 The values returned are nonzero if the character
197 falls into the tested class, and zero if not.
199 For an explanation of the terms used in this section, see
205 Interface Attribute Value
222 T} Thread safety MT-Safe
224 .\" FIXME: need a thread-safety statement about the *_l functions
312 POSIX.1-2008 marks it as obsolete,
313 noting that it cannot be used portably in a localized application.
344 The standards require that the argument
346 for these functions is either
348 or a value that is representable in the type
349 .IR "unsigned char" ;
351 the behavior is undefined.
357 .IR "unsigned char" ,
358 as in the following example:
364 res = toupper((unsigned char) c);
368 This is necessary because
370 may be the equivalent of
372 in which case a byte where the top bit is set would be sign extended when
375 yielding a value that is outside the range of
376 .IR "unsigned char" .
378 The details of what characters belong to which class depend on the
382 will not recognize an A-umlaut (\(:A) as an uppercase letter in the default