]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/isalpha.3
fc06223091ea38551264bfd6802a4381d89fcce9
[thirdparty/man-pages.git] / man3 / isalpha.3
1 .\" (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 1995-09-02 "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 .nl
40 .BI "int isalpha(int " "c" );
41 .nl
42 .BI "int isascii(int " "c" );
43 .nl
44 .BI "int isblank(int " "c" );
45 .nl
46 .BI "int iscntrl(int " "c" );
47 .nl
48 .BI "int isdigit(int " "c" );
49 .nl
50 .BI "int isgraph(int " "c" );
51 .nl
52 .BI "int islower(int " "c" );
53 .nl
54 .BI "int isprint(int " "c" );
55 .nl
56 .BI "int ispunct(int " "c" );
57 .nl
58 .BI "int isspace(int " "c" );
59 .nl
60 .BI "int isupper(int " "c" );
61 .nl
62 .BI "int isxdigit(int " "c" );
63 .fi
64 .SH DESCRIPTION
65 These functions check whether
66 .IR c ,
67 which must have the value of an
68 .B unsigned char
69 or
70 .BR EOF ,
71 falls into a certain character class according to the current locale.
72 .TP
73 .B "isalnum()"
74 checks for an alphanumeric character; it is equivalent to
75 .BI "(isalpha(" c ") || isdigit(" c "))" \fR.
76 .TP
77 .B "isalpha()"
78 checks for an alphabetic character; in the standard \fB"C"\fP
79 locale, it is equivalent to
80 .BI "(isupper(" c ") || islower(" c "))" \fR.
81 In some locales, there may be additional characters for which
82 .B isalpha()
83 is true--letters which are neither upper case nor lower
84 case.
85 .TP
86 .B "isascii()"
87 checks whether \fIc\fP is a 7-bit
88 .I unsigned char
89 value that fits into
90 the ASCII character set. This function is a BSD extension
91 and is also an SVID extension.
92 .TP
93 .B "isblank()"
94 checks for a blank character; that is, a space or a tab.
95 .TP
96 .B "iscntrl()"
97 checks for a control character.
98 .TP
99 .B "isdigit()"
100 checks for a digit (0 through 9).
101 .TP
102 .B "isgraph()"
103 checks for any printable character except space.
104 .TP
105 .B "islower()"
106 checks for a lower-case character.
107 .TP
108 .B "isprint()"
109 checks for any printable character including space.
110 .TP
111 .B "ispunct()"
112 checks for any printable character which is not a space or an
113 alphanumeric character.
114 .TP
115 .B "isspace()"
116 checks for white-space characters. In the
117 .B """C"""
118 and
119 .B """POSIX"""
120 locales, these are: space, form-feed
121 .RB ( '\ef' ),
122 newline
123 .RB ( '\en' ),
124 carriage return
125 .RB ( '\er' ),
126 horizontal tab
127 .RB ( '\et' ),
128 and vertical tab
129 .RB ( '\ev' ).
130 .TP
131 .B "isupper()"
132 checks for an uppercase letter.
133 .TP
134 .B "isxdigit()"
135 checks for a hexadecimal digits, i.e. one of
136 .nl
137 .BR "0 1 2 3 4 5 6 7 8 9 a b c d e f A B C D E F" .
138 .SH "RETURN VALUE"
139 The values returned are nonzero if the character
140 .I c
141 falls into the tested class, and a zero value
142 if not.
143 .SH "CONFORMING TO"
144 ANSI - C, BSD 4.3.
145 \fBisascii()\fP is a BSD extension
146 and is also an SVID extension.
147 \fBisblank()\fP conforms to ISO C99 7.4.1.3.
148 .SH NOTE
149 The details of what characters belong into which class depend on the current
150 locale. For example,
151 .B isupper()
152 will not recognize an A - umlaut as an uppercase letter in the default
153 .B "C"
154 locale.
155 .SH "SEE ALSO"
156 .BR setlocale (3),
157 .BR tolower (3),
158 .BR toupper (3),
159 .BR ascii (7),
160 .BR locale (7)