]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/isalpha.3
intro.1, _exit.2, access.2, alarm.2, alloc_hugepages.2, arch_prctl.2, bind.2, chdir...
[thirdparty/man-pages.git] / man3 / isalpha.3
1 .\" Copyright (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de)
2 .\"
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.
7 .\"
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.
12 .\"
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
19 .\" professionally.
20 .\"
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" %%%LICENSE_END
24 .\"
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)
29 .\"
30 .TH ISALPHA 3 2010-09-20 "GNU" "Linux Programmer's Manual"
31 .SH NAME
32 isalnum, isalpha, isascii, isblank, iscntrl, isdigit, isgraph, islower,
33 isprint, ispunct, isspace, isupper, isxdigit \- character
34 classification routines
35 .SH SYNOPSIS
36 .nf
37 .B #include <ctype.h>
38 .sp
39 .BI "int isalnum(int " "c" );
40 .br
41 .BI "int isalpha(int " "c" );
42 .br
43 .BI "int isascii(int " "c" );
44 .br
45 .BI "int isblank(int " "c" );
46 .br
47 .BI "int iscntrl(int " "c" );
48 .br
49 .BI "int isdigit(int " "c" );
50 .br
51 .BI "int isgraph(int " "c" );
52 .br
53 .BI "int islower(int " "c" );
54 .br
55 .BI "int isprint(int " "c" );
56 .br
57 .BI "int ispunct(int " "c" );
58 .br
59 .BI "int isspace(int " "c" );
60 .br
61 .BI "int isupper(int " "c" );
62 .br
63 .BI "int isxdigit(int " "c" );
64 .fi
65 .sp
66 .in -4n
67 Feature Test Macro Requirements for glibc (see
68 .BR feature_test_macros (7)):
69 .in
70 .sp
71 .ad l
72 .BR isascii ():
73 .RS 4
74 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE
75 .br
76 .RE
77 .BR isblank ():
78 .RS 4
79 _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE ||
80 _POSIX_C_SOURCE\ >=\ 200112L;
81 .br
82 or
83 .I cc\ -std=c99
84 .RE
85 .ad
86 .SH DESCRIPTION
87 These functions check whether
88 .IR c ,
89 which must have the value of an
90 .I unsigned char
91 or
92 .BR EOF ,
93 falls into a certain character class according to the current locale.
94 .TP
95 .BR isalnum ()
96 checks for an alphanumeric character; it is equivalent to
97 .BI "(isalpha(" c ") || isdigit(" c "))" \fR.
98 .TP
99 .BR isalpha ()
100 checks for an alphabetic character; in the standard \fB"C"\fP
101 locale, it is equivalent to
102 .BI "(isupper(" c ") || islower(" c "))" \fR.
103 In some locales, there may be additional characters for which
104 .BR isalpha ()
105 is true\(emletters which are neither upper case nor lower
106 case.
107 .TP
108 .BR isascii ()
109 checks whether \fIc\fP is a 7-bit
110 .I unsigned char
111 value that fits into
112 the ASCII character set.
113 .TP
114 .BR isblank ()
115 checks for a blank character; that is, a space or a tab.
116 .TP
117 .BR iscntrl ()
118 checks for a control character.
119 .TP
120 .BR isdigit ()
121 checks for a digit (0 through 9).
122 .TP
123 .BR isgraph ()
124 checks for any printable character except space.
125 .TP
126 .BR islower ()
127 checks for a lower-case character.
128 .TP
129 .BR isprint ()
130 checks for any printable character including space.
131 .TP
132 .BR ispunct ()
133 checks for any printable character which is not a space or an
134 alphanumeric character.
135 .TP
136 .BR isspace ()
137 checks for white-space characters.
138 In the
139 .B """C"""
140 and
141 .B """POSIX"""
142 locales, these are: space, form-feed
143 .RB ( \(aq\ef\(aq ),
144 newline
145 .RB ( \(aq\en\(aq ),
146 carriage return
147 .RB ( \(aq\er\(aq ),
148 horizontal tab
149 .RB ( \(aq\et\(aq ),
150 and vertical tab
151 .RB ( \(aq\ev\(aq ).
152 .TP
153 .BR isupper ()
154 checks for an uppercase letter.
155 .TP
156 .BR isxdigit ()
157 checks for a hexadecimal digits, that is, one of
158 .br
159 .BR "0 1 2 3 4 5 6 7 8 9 a b c d e f A B C D E F" .
160 .SH RETURN VALUE
161 The values returned are nonzero if the character
162 .I c
163 falls into the tested class, and a zero value
164 if not.
165 .SH CONFORMING TO
166 C99, 4.3BSD.
167 C89 specifies all of these functions except
168 .BR isascii ()
169 and
170 .BR isblank ().
171 .BR isascii ()
172 is a BSD extension
173 and is also an SVr4 extension.
174 .BR isblank ()
175 conforms to POSIX.1-2001 and C99 7.4.1.3.
176 POSIX.1-2008 marks
177 .BR isascii ()
178 as obsolete,
179 noting that it cannot be used portably in a localized application.
180 .SH NOTES
181 The details of what characters belong into which class depend on the current
182 locale.
183 For example,
184 .BR isupper ()
185 will not recognize an A-umlaut (\(:A) as an uppercase letter in the default
186 .B "C"
187 locale.
188 .SH SEE ALSO
189 .BR iswalnum (3),
190 .BR iswalpha (3),
191 .BR iswblank (3),
192 .BR iswcntrl (3),
193 .BR iswdigit (3),
194 .BR iswgraph (3),
195 .BR iswlower (3),
196 .BR iswprint (3),
197 .BR iswpunct (3),
198 .BR iswspace (3),
199 .BR iswupper (3),
200 .BR iswxdigit (3),
201 .BR setlocale (3),
202 .BR toascii (3),
203 .BR tolower (3),
204 .BR toupper (3),
205 .BR ascii (7),
206 .BR locale (7)