OSDN Git Service

Import translated manuals from JM CVS Repository.
[linuxjm/jm.git] / manual / LDP_man-pages / 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 2009-03-15 "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 _BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE
73 .br
74 .BR isblank ():
75 _XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE; or
76 .I cc\ -std=c99
77 .ad b
78 .SH DESCRIPTION
79 These functions check whether
80 .IR c ,
81 which must have the value of an
82 .I unsigned char
83 or
84 .BR EOF ,
85 falls into a certain character class according to the current locale.
86 .TP
87 .BR isalnum ()
88 checks for an alphanumeric character; it is equivalent to
89 .BI "(isalpha(" c ") || isdigit(" c "))" \fR.
90 .TP
91 .BR isalpha ()
92 checks for an alphabetic character; in the standard \fB"C"\fP
93 locale, it is equivalent to
94 .BI "(isupper(" c ") || islower(" c "))" \fR.
95 In some locales, there may be additional characters for which
96 .BR isalpha ()
97 is true\(emletters which are neither upper case nor lower
98 case.
99 .TP
100 .BR isascii ()
101 checks whether \fIc\fP is a 7-bit
102 .I unsigned char
103 value that fits into
104 the ASCII character set.
105 .TP
106 .BR isblank ()
107 checks for a blank character; that is, a space or a tab.
108 .TP
109 .BR iscntrl ()
110 checks for a control character.
111 .TP
112 .BR isdigit ()
113 checks for a digit (0 through 9).
114 .TP
115 .BR isgraph ()
116 checks for any printable character except space.
117 .TP
118 .BR islower ()
119 checks for a lower-case character.
120 .TP
121 .BR isprint ()
122 checks for any printable character including space.
123 .TP
124 .BR ispunct ()
125 checks for any printable character which is not a space or an
126 alphanumeric character.
127 .TP
128 .BR isspace ()
129 checks for white-space characters.
130 In the
131 .B """C"""
132 and
133 .B """POSIX"""
134 locales, these are: space, form-feed
135 .RB ( \(aq\ef\(aq ),
136 newline
137 .RB ( \(aq\en\(aq ),
138 carriage return
139 .RB ( \(aq\er\(aq ),
140 horizontal tab
141 .RB ( \(aq\et\(aq ),
142 and vertical tab
143 .RB ( \(aq\ev\(aq ).
144 .TP
145 .BR isupper ()
146 checks for an uppercase letter.
147 .TP
148 .BR isxdigit ()
149 checks for a hexadecimal digits, that is, one of
150 .br
151 .BR "0 1 2 3 4 5 6 7 8 9 a b c d e f A B C D E F" .
152 .SH "RETURN VALUE"
153 The values returned are nonzero if the character
154 .I c
155 falls into the tested class, and a zero value
156 if not.
157 .SH "CONFORMING TO"
158 C99, 4.3BSD.
159 C89 specifies all of these functions except
160 .BR isascii ()
161 and
162 .BR isblank ().
163 .BR isascii ()
164 is a BSD extension
165 and is also an SVr4 extension.
166 .BR isblank ()
167 conforms to POSIX.1-2001 and C99 7.4.1.3.
168 POSIX.1-2008 marks
169 .BR isascii ()
170 as obsolete,
171 noting that it cannot be used portably in a localized application.
172 .SH NOTES
173 The details of what characters belong into which class depend on the current
174 locale.
175 For example,
176 .BR isupper ()
177 will not recognize an A-umlaut (\(:A) as an uppercase letter in the default
178 .B "C"
179 locale.
180 .SH "SEE ALSO"
181 .BR iswalnum (3),
182 .BR iswalpha (3),
183 .BR iswblank (3),
184 .BR iswcntrl (3),
185 .BR iswdigit (3),
186 .BR iswgraph (3),
187 .BR iswlower (3),
188 .BR iswprint (3),
189 .BR iswpunct (3),
190 .BR iswspace (3),
191 .BR iswupper (3),
192 .BR iswxdigit (3),
193 .BR setlocale (3),
194 .BR toascii (3),
195 .BR tolower (3),
196 .BR toupper (3),
197 .BR ascii (7),
198 .BR locale (7)