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 2017-09-15 "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 versions <= 2.19: */ _SVID_SOURCE
88 _ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L
107 _XOPEN_SOURCE\ >=\ 700
119 _XOPEN_SOURCE\ >=\ 700 && (_SVID_SOURCE || _BSD_SOURCE)
127 These functions check whether
129 which must have the value of an
133 falls into a certain character class according to the specified locale.
134 The functions without the
135 "_l" suffix perform the check based on the current locale.
137 The functions with the "_l" suffix perform the check
138 based on the locale specified by the locale object
140 The behavior of these functions is undefined if
142 is the special locale object
146 or is not a valid locale object handle.
148 The list below explains the operation of the functions without
150 the functions with the "_l" suffix differ only in using the locale object
152 instead of the current locale.
155 checks for an alphanumeric character; it is equivalent to
156 .BI "(isalpha(" c ") || isdigit(" c "))" \fR.
159 checks for an alphabetic character; in the standard \fB"C"\fP
160 locale, it is equivalent to
161 .BI "(isupper(" c ") || islower(" c "))" \fR.
162 In some locales, there may be additional characters for which
164 is true\(emletters which are neither uppercase nor lowercase.
167 checks whether \fIc\fP is a 7-bit
170 the ASCII character set.
173 checks for a blank character; that is, a space or a tab.
176 checks for a control character.
179 checks for a digit (0 through 9).
182 checks for any printable character except space.
185 checks for a lowercase character.
188 checks for any printable character including space.
191 checks for any printable character which is not a space or an
192 alphanumeric character.
195 checks for white-space characters.
200 locales, these are: space, form-feed
212 checks for an uppercase letter.
215 checks for hexadecimal digits, that is, one of
217 .BR "0 1 2 3 4 5 6 7 8 9 a b c d e f A B C D E F" .
219 The values returned are nonzero if the character
221 falls into the tested class, and zero if not.
237 are available since glibc 2.3.
239 For an explanation of the terms used in this section, see
246 Interface Attribute Value
261 T} Thread safety MT-Safe
264 .\" FIXME: need a thread-safety statement about the *_l functions
284 also specifies those functions, and also
286 (as an XSI extension)
289 C99 specifies all of the preceding functions, except
295 noting that it cannot be used portably in a localized application.
297 POSIX.1-2008 specifies
315 The standards require that the argument
317 for these functions is either
319 or a value that is representable in the type
320 .IR "unsigned char" .
326 .IR "unsigned char" ,
327 as in the following example:
333 res = toupper((unsigned char) c);
337 This is necessary because
339 may be the equivalent of
341 in which case a byte where the top bit is set would be sign extended when
344 yielding a value that is outside the range of
345 .IR "unsigned char" .
347 The details of what characters belong to which class depend on the
351 will not recognize an A-umlaut (\(:A) as an uppercase letter in the default