OSDN Git Service

(split) LDP: Update original to LDP v3.38.
[linuxjm/LDP_man-pages.git] / original / man3 / isalpha.3
1 .\" Copyright (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de)
2 .\"
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
6 .\"
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
11 .\"
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein.  The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
18 .\" professionally.
19 .\"
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
22 .\" License.
23 .\"
24 .\" Modified Sat Jul 24 19:10:00 1993 by Rik Faith (faith@cs.unc.edu)
25 .\" Modified Sun Aug 21 17:51:50 1994 by Rik Faith (faith@cs.unc.edu)
26 .\" Modified Sat Sep  2 21:52:01 1995 by Jim Van Zandt <jrv@vanzandt.mv.com>
27 .\" Modified Mon May 27 22:55:26 1996 by Martin Schulze (joey@linux.de)
28 .\"
29 .TH ISALPHA 3 2010-09-20 "GNU" "Linux Programmer's Manual"
30 .SH NAME
31 isalnum, isalpha, isascii, isblank, iscntrl, isdigit, isgraph, islower,
32 isprint, ispunct, isspace, isupper, isxdigit \- character
33 classification routines
34 .SH SYNOPSIS
35 .nf
36 .B #include <ctype.h>
37 .sp
38 .BI "int isalnum(int " "c" );
39 .br
40 .BI "int isalpha(int " "c" );
41 .br
42 .BI "int isascii(int " "c" );
43 .br
44 .BI "int isblank(int " "c" );
45 .br
46 .BI "int iscntrl(int " "c" );
47 .br
48 .BI "int isdigit(int " "c" );
49 .br
50 .BI "int isgraph(int " "c" );
51 .br
52 .BI "int islower(int " "c" );
53 .br
54 .BI "int isprint(int " "c" );
55 .br
56 .BI "int ispunct(int " "c" );
57 .br
58 .BI "int isspace(int " "c" );
59 .br
60 .BI "int isupper(int " "c" );
61 .br
62 .BI "int isxdigit(int " "c" );
63 .fi
64 .sp
65 .in -4n
66 Feature Test Macro Requirements for glibc (see
67 .BR feature_test_macros (7)):
68 .in
69 .sp
70 .ad l
71 .BR isascii ():
72 .RS 4
73 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE
74 .br
75 .RE
76 .BR isblank ():
77 .RS 4
78 _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE ||
79 _POSIX_C_SOURCE\ >=\ 200112L;
80 .br
81 or
82 .I cc\ -std=c99
83 .RE
84 .ad
85 .SH DESCRIPTION
86 These functions check whether
87 .IR c ,
88 which must have the value of an
89 .I unsigned char
90 or
91 .BR EOF ,
92 falls into a certain character class according to the current locale.
93 .TP
94 .BR isalnum ()
95 checks for an alphanumeric character; it is equivalent to
96 .BI "(isalpha(" c ") || isdigit(" c "))" \fR.
97 .TP
98 .BR isalpha ()
99 checks for an alphabetic character; in the standard \fB"C"\fP
100 locale, it is equivalent to
101 .BI "(isupper(" c ") || islower(" c "))" \fR.
102 In some locales, there may be additional characters for which
103 .BR isalpha ()
104 is true\(emletters which are neither upper case nor lower
105 case.
106 .TP
107 .BR isascii ()
108 checks whether \fIc\fP is a 7-bit
109 .I unsigned char
110 value that fits into
111 the ASCII character set.
112 .TP
113 .BR isblank ()
114 checks for a blank character; that is, a space or a tab.
115 .TP
116 .BR iscntrl ()
117 checks for a control character.
118 .TP
119 .BR isdigit ()
120 checks for a digit (0 through 9).
121 .TP
122 .BR isgraph ()
123 checks for any printable character except space.
124 .TP
125 .BR islower ()
126 checks for a lower-case character.
127 .TP
128 .BR isprint ()
129 checks for any printable character including space.
130 .TP
131 .BR ispunct ()
132 checks for any printable character which is not a space or an
133 alphanumeric character.
134 .TP
135 .BR isspace ()
136 checks for white-space characters.
137 In the
138 .B """C"""
139 and
140 .B """POSIX"""
141 locales, these are: space, form-feed
142 .RB ( \(aq\ef\(aq ),
143 newline
144 .RB ( \(aq\en\(aq ),
145 carriage return
146 .RB ( \(aq\er\(aq ),
147 horizontal tab
148 .RB ( \(aq\et\(aq ),
149 and vertical tab
150 .RB ( \(aq\ev\(aq ).
151 .TP
152 .BR isupper ()
153 checks for an uppercase letter.
154 .TP
155 .BR isxdigit ()
156 checks for a hexadecimal digits, that is, one of
157 .br
158 .BR "0 1 2 3 4 5 6 7 8 9 a b c d e f A B C D E F" .
159 .SH "RETURN VALUE"
160 The values returned are nonzero if the character
161 .I c
162 falls into the tested class, and a zero value
163 if not.
164 .SH "CONFORMING TO"
165 C99, 4.3BSD.
166 C89 specifies all of these functions except
167 .BR isascii ()
168 and
169 .BR isblank ().
170 .BR isascii ()
171 is a BSD extension
172 and is also an SVr4 extension.
173 .BR isblank ()
174 conforms to POSIX.1-2001 and C99 7.4.1.3.
175 POSIX.1-2008 marks
176 .BR isascii ()
177 as obsolete,
178 noting that it cannot be used portably in a localized application.
179 .SH NOTES
180 The details of what characters belong into which class depend on the current
181 locale.
182 For example,
183 .BR isupper ()
184 will not recognize an A-umlaut (\(:A) as an uppercase letter in the default
185 .B "C"
186 locale.
187 .SH "SEE ALSO"
188 .BR iswalnum (3),
189 .BR iswalpha (3),
190 .BR iswblank (3),
191 .BR iswcntrl (3),
192 .BR iswdigit (3),
193 .BR iswgraph (3),
194 .BR iswlower (3),
195 .BR iswprint (3),
196 .BR iswpunct (3),
197 .BR iswspace (3),
198 .BR iswupper (3),
199 .BR iswxdigit (3),
200 .BR setlocale (3),
201 .BR toascii (3),
202 .BR tolower (3),
203 .BR toupper (3),
204 .BR ascii (7),
205 .BR locale (7)