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
99 _XOPEN_SOURCE >= 700 && (_SVID_SOURCE || _BSD_SOURCE)
105 These functions check whether
107 which must have the value of an
111 falls into a certain character class according to the specified locale.
112 The functions without the
113 "_l" suffix perform the check based on the current locale.
115 The functions with the "_l" suffix perform the check
116 based on the locale specified by the locale object
118 The behavior of these functions is undefined if
120 is the special locale object
124 or is not a valid locale object handle.
126 The list below explains the operation of the functions without
128 the functions with the "_l" suffix differ only in using the locale object
130 instead of the current locale.
133 checks for an alphanumeric character; it is equivalent to
134 .BI "(isalpha(" c ") || isdigit(" c "))" \fR.
137 checks for an alphabetic character; in the standard \fB"C"\fP
138 locale, it is equivalent to
139 .BI "(isupper(" c ") || islower(" c "))" \fR.
140 In some locales, there may be additional characters for which
142 is true\(emletters which are neither uppercase nor lowercase.
145 checks whether \fIc\fP is a 7-bit
148 the ASCII character set.
151 checks for a blank character; that is, a space or a tab.
154 checks for a control character.
157 checks for a digit (0 through 9).
160 checks for any printable character except space.
163 checks for a lowercase character.
166 checks for any printable character including space.
169 checks for any printable character which is not a space or an
170 alphanumeric character.
173 checks for white-space characters.
178 locales, these are: space, form-feed
190 checks for an uppercase letter.
193 checks for hexadecimal digits, that is, one of
195 .BR "0 1 2 3 4 5 6 7 8 9 a b c d e f A B C D E F" .
197 The values returned are nonzero if the character
199 falls into the tested class, and zero if not.
215 are available since glibc 2.3.
217 For an explanation of the terms used in this section, see
225 Interface Attribute Value
240 T} Thread safety MT-Safe
245 .\" FIXME: need a thread-safety statement about the *_l functions
265 also specifies those functions, and also
267 (as an XSI extension)
270 C99 specifies all of the preceding functions, except
276 noting that it cannot be used portably in a localized application.
278 POSIX.1-2008 specifies
296 The standards require that the argument
298 for these functions is either
300 or a value that is representable in the type
301 .IR "unsigned char" .
307 .IR "unsigned char" ,
308 as in the following example:
314 res = toupper((unsigned char) c);
318 This is necessary because
320 may be the equivalent of
322 in which case a byte where the top bit is set would be sign extended when
325 yielding a value that is outside the range of
326 .IR "unsigned char" .
328 The details of what characters belong to which class depend on the
332 will not recognize an A-umlaut (\(:A) as an uppercase letter in the default