1 .\" Copyright (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de)
3 .\" %%%LICENSE_START(VERBATIM)
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date. The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein. The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
25 .\" Modified Sat Jul 24 19:10:00 1993 by Rik Faith (faith@cs.unc.edu)
26 .\" Modified Sun Aug 21 17:51:50 1994 by Rik Faith (faith@cs.unc.edu)
27 .\" Modified Sat Sep 2 21:52:01 1995 by Jim Van Zandt <jrv@vanzandt.mv.com>
28 .\" Modified Mon May 27 22:55:26 1996 by Martin Schulze (joey@linux.de)
30 .TH ISALPHA 3 2021-03-22 "GNU" "Linux Programmer's Manual"
32 isalnum, isalpha, isascii, isblank, iscntrl, isdigit, isgraph, islower,
33 isprint, ispunct, isspace, isupper, isxdigit,
34 isalnum_l, isalpha_l, isascii_l, isblank_l, iscntrl_l,
35 isdigit_l, isgraph_l, islower_l,
36 isprint_l, ispunct_l, isspace_l, isupper_l, isxdigit_l
37 \- character classification functions
42 .BI "int isalnum(int " c );
43 .BI "int isalpha(int " c );
44 .BI "int iscntrl(int " c );
45 .BI "int isdigit(int " c );
46 .BI "int isgraph(int " c );
47 .BI "int islower(int " c );
48 .BI "int isprint(int " c );
49 .BI "int ispunct(int " c );
50 .BI "int isspace(int " c );
51 .BI "int isupper(int " c );
52 .BI "int isxdigit(int " c );
54 .BI "int isascii(int " c );
55 .BI "int isblank(int " c );
57 .BI "int isalnum_l(int " c ", locale_t " locale );
58 .BI "int isalpha_l(int " c ", locale_t " locale );
59 .BI "int isblank_l(int " c ", locale_t " locale );
60 .BI "int iscntrl_l(int " c ", locale_t " locale );
61 .BI "int isdigit_l(int " c ", locale_t " locale );
62 .BI "int isgraph_l(int " c ", locale_t " locale );
63 .BI "int islower_l(int " c ", locale_t " locale );
64 .BI "int isprint_l(int " c ", locale_t " locale );
65 .BI "int ispunct_l(int " c ", locale_t " locale );
66 .BI "int isspace_l(int " c ", locale_t " locale );
67 .BI "int isupper_l(int " c ", locale_t " locale );
68 .BI "int isxdigit_l(int " c ", locale_t " locale );
70 .BI "int isascii_l(int " c ", locale_t " locale );
74 Feature Test Macro Requirements for glibc (see
75 .BR feature_test_macros (7)):
82 || /* Glibc since 2.19: */ _DEFAULT_SOURCE
83 || /* Glibc <= 2.19: */ _SVID_SOURCE
88 _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
115 _XOPEN_SOURCE >= 700 && (_SVID_SOURCE || _BSD_SOURCE)
121 These functions check whether
123 which must have the value of an
127 falls into a certain character class according to the specified locale.
128 The functions without the
129 "_l" suffix perform the check based on the current locale.
131 The functions with the "_l" suffix perform the check
132 based on the locale specified by the locale object
134 The behavior of these functions is undefined if
136 is the special locale object
140 or is not a valid locale object handle.
142 The list below explains the operation of the functions without
144 the functions with the "_l" suffix differ only in using the locale object
146 instead of the current locale.
149 checks for an alphanumeric character; it is equivalent to
150 .BI "(isalpha(" c ") || isdigit(" c "))" \fR.
153 checks for an alphabetic character; in the standard \fB"C"\fP
154 locale, it is equivalent to
155 .BI "(isupper(" c ") || islower(" c "))" \fR.
156 In some locales, there may be additional characters for which
158 is true\(emletters which are neither uppercase nor lowercase.
161 checks whether \fIc\fP is a 7-bit
164 the ASCII character set.
167 checks for a blank character; that is, a space or a tab.
170 checks for a control character.
173 checks for a digit (0 through 9).
176 checks for any printable character except space.
179 checks for a lowercase character.
182 checks for any printable character including space.
185 checks for any printable character which is not a space or an
186 alphanumeric character.
189 checks for white-space characters.
194 locales, these are: space, form-feed
206 checks for an uppercase letter.
209 checks for hexadecimal digits, that is, one of
211 .BR "0 1 2 3 4 5 6 7 8 9 a b c d e f A B C D E F" .
213 The values returned are nonzero if the character
215 falls into the tested class, and zero if not.
231 are available since glibc 2.3.
233 For an explanation of the terms used in this section, see
241 Interface Attribute Value
256 T} Thread safety MT-Safe
261 .\" FIXME: need a thread-safety statement about the *_l functions
281 also specifies those functions, and also
283 (as an XSI extension)
286 C99 specifies all of the preceding functions, except
292 noting that it cannot be used portably in a localized application.
294 POSIX.1-2008 specifies
312 The standards require that the argument
314 for these functions is either
316 or a value that is representable in the type
317 .IR "unsigned char" .
323 .IR "unsigned char" ,
324 as in the following example:
330 res = toupper((unsigned char) c);
334 This is necessary because
336 may be the equivalent of
338 in which case a byte where the top bit is set would be sign extended when
341 yielding a value that is outside the range of
342 .IR "unsigned char" .
344 The details of what characters belong to which class depend on the
348 will not recognize an A-umlaut (\(:A) as an uppercase letter in the default