2004-11-03 13:51:07 +00:00
|
|
|
.\" (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de)
|
|
|
|
.\"
|
|
|
|
.\" Permission is granted to make and distribute verbatim copies of this
|
|
|
|
.\" manual provided the copyright notice and this permission notice are
|
|
|
|
.\" preserved on all copies.
|
|
|
|
.\"
|
|
|
|
.\" Permission is granted to copy and distribute modified versions of this
|
|
|
|
.\" manual under the conditions for verbatim copying, provided that the
|
|
|
|
.\" entire resulting derived work is distributed under the terms of a
|
|
|
|
.\" permission notice identical to this one.
|
|
|
|
.\"
|
|
|
|
.\" Since the Linux kernel and libraries are constantly changing, this
|
|
|
|
.\" manual page may be incorrect or out-of-date. The author(s) assume no
|
|
|
|
.\" responsibility for errors or omissions, or for damages resulting from
|
|
|
|
.\" the use of the information contained herein. The author(s) may not
|
|
|
|
.\" have taken the same level of care in the production of this manual,
|
|
|
|
.\" which is licensed free of charge, as they might when working
|
|
|
|
.\" professionally.
|
|
|
|
.\"
|
|
|
|
.\" Formatted or processed versions of this manual, if unaccompanied by
|
|
|
|
.\" the source, must acknowledge the copyright and authors of this work.
|
|
|
|
.\" License.
|
|
|
|
.\"
|
|
|
|
.\" Modified Sat Jul 24 19:10:00 1993 by Rik Faith (faith@cs.unc.edu)
|
|
|
|
.\" Modified Sun Aug 21 17:51:50 1994 by Rik Faith (faith@cs.unc.edu)
|
|
|
|
.\" Modified Sat Sep 2 21:52:01 1995 by Jim Van Zandt <jrv@vanzandt.mv.com>
|
|
|
|
.\" Modified Mon May 27 22:55:26 1996 by Martin Schulze (joey@linux.de)
|
|
|
|
.\"
|
|
|
|
.TH ISALPHA 3 1995-09-02 "GNU" "Linux Programmer's Manual"
|
|
|
|
.SH NAME
|
|
|
|
isalnum, isalpha, isascii, isblank, iscntrl, isdigit, isgraph, islower,
|
|
|
|
isprint, ispunct, isspace, isupper, isxdigit \- character
|
|
|
|
classification routines
|
|
|
|
.SH SYNOPSIS
|
|
|
|
.nf
|
|
|
|
.B #include <ctype.h>
|
|
|
|
.sp
|
|
|
|
.BI "int isalnum(int " "c" );
|
2006-07-20 16:16:51 +00:00
|
|
|
.br
|
2004-11-03 13:51:07 +00:00
|
|
|
.BI "int isalpha(int " "c" );
|
2006-07-20 16:16:51 +00:00
|
|
|
.br
|
2004-11-03 13:51:07 +00:00
|
|
|
.BI "int isascii(int " "c" );
|
2006-07-20 16:16:51 +00:00
|
|
|
.br
|
2004-11-03 13:51:07 +00:00
|
|
|
.BI "int isblank(int " "c" );
|
2006-07-20 16:16:51 +00:00
|
|
|
.br
|
2004-11-03 13:51:07 +00:00
|
|
|
.BI "int iscntrl(int " "c" );
|
2006-07-20 16:16:51 +00:00
|
|
|
.br
|
2004-11-03 13:51:07 +00:00
|
|
|
.BI "int isdigit(int " "c" );
|
2006-07-20 16:16:51 +00:00
|
|
|
.br
|
2004-11-03 13:51:07 +00:00
|
|
|
.BI "int isgraph(int " "c" );
|
2006-07-20 16:16:51 +00:00
|
|
|
.br
|
2004-11-03 13:51:07 +00:00
|
|
|
.BI "int islower(int " "c" );
|
2006-07-20 16:16:51 +00:00
|
|
|
.br
|
2004-11-03 13:51:07 +00:00
|
|
|
.BI "int isprint(int " "c" );
|
2006-07-20 16:16:51 +00:00
|
|
|
.br
|
2004-11-03 13:51:07 +00:00
|
|
|
.BI "int ispunct(int " "c" );
|
2006-07-20 16:16:51 +00:00
|
|
|
.br
|
2004-11-03 13:51:07 +00:00
|
|
|
.BI "int isspace(int " "c" );
|
2006-07-20 16:16:51 +00:00
|
|
|
.br
|
2004-11-03 13:51:07 +00:00
|
|
|
.BI "int isupper(int " "c" );
|
2006-07-20 16:16:51 +00:00
|
|
|
.br
|
2004-11-03 13:51:07 +00:00
|
|
|
.BI "int isxdigit(int " "c" );
|
|
|
|
.fi
|
|
|
|
.SH DESCRIPTION
|
|
|
|
These functions check whether
|
|
|
|
.IR c ,
|
|
|
|
which must have the value of an
|
2006-02-09 20:24:53 +00:00
|
|
|
.I unsigned char
|
2004-11-03 13:51:07 +00:00
|
|
|
or
|
|
|
|
.BR EOF ,
|
|
|
|
falls into a certain character class according to the current locale.
|
|
|
|
.TP
|
2005-10-19 07:29:28 +00:00
|
|
|
.BR isalnum ()
|
2004-11-03 13:51:07 +00:00
|
|
|
checks for an alphanumeric character; it is equivalent to
|
|
|
|
.BI "(isalpha(" c ") || isdigit(" c "))" \fR.
|
|
|
|
.TP
|
2005-10-19 07:29:28 +00:00
|
|
|
.BR isalpha ()
|
2004-11-03 13:51:07 +00:00
|
|
|
checks for an alphabetic character; in the standard \fB"C"\fP
|
|
|
|
locale, it is equivalent to
|
|
|
|
.BI "(isupper(" c ") || islower(" c "))" \fR.
|
|
|
|
In some locales, there may be additional characters for which
|
2005-10-19 16:30:05 +00:00
|
|
|
.BR isalpha ()
|
2005-07-06 12:57:38 +00:00
|
|
|
is true\(emletters which are neither upper case nor lower
|
2004-11-03 13:51:07 +00:00
|
|
|
case.
|
|
|
|
.TP
|
2005-10-19 07:29:28 +00:00
|
|
|
.BR isascii ()
|
2004-11-03 13:51:07 +00:00
|
|
|
checks whether \fIc\fP is a 7-bit
|
|
|
|
.I unsigned char
|
|
|
|
value that fits into
|
2006-08-03 13:57:30 +00:00
|
|
|
the ASCII character set.
|
2004-11-03 13:51:07 +00:00
|
|
|
.TP
|
2005-10-19 07:29:28 +00:00
|
|
|
.BR isblank ()
|
2004-11-03 13:51:07 +00:00
|
|
|
checks for a blank character; that is, a space or a tab.
|
|
|
|
.TP
|
2005-10-19 07:29:28 +00:00
|
|
|
.BR iscntrl ()
|
2004-11-03 13:51:07 +00:00
|
|
|
checks for a control character.
|
|
|
|
.TP
|
2005-10-19 07:29:28 +00:00
|
|
|
.BR isdigit ()
|
2004-11-03 13:51:07 +00:00
|
|
|
checks for a digit (0 through 9).
|
|
|
|
.TP
|
2005-10-19 07:29:28 +00:00
|
|
|
.BR isgraph ()
|
2004-11-03 13:51:07 +00:00
|
|
|
checks for any printable character except space.
|
|
|
|
.TP
|
2005-10-19 07:29:28 +00:00
|
|
|
.BR islower ()
|
2004-11-03 13:51:07 +00:00
|
|
|
checks for a lower-case character.
|
|
|
|
.TP
|
2005-10-19 07:29:28 +00:00
|
|
|
.BR isprint ()
|
2004-11-03 13:51:07 +00:00
|
|
|
checks for any printable character including space.
|
|
|
|
.TP
|
2005-10-19 07:29:28 +00:00
|
|
|
.BR ispunct ()
|
2004-11-03 13:51:07 +00:00
|
|
|
checks for any printable character which is not a space or an
|
|
|
|
alphanumeric character.
|
|
|
|
.TP
|
2005-10-19 07:29:28 +00:00
|
|
|
.BR isspace ()
|
2004-11-03 13:51:07 +00:00
|
|
|
checks for white-space characters. In the
|
|
|
|
.B """C"""
|
|
|
|
and
|
|
|
|
.B """POSIX"""
|
|
|
|
locales, these are: space, form-feed
|
|
|
|
.RB ( '\ef' ),
|
|
|
|
newline
|
|
|
|
.RB ( '\en' ),
|
|
|
|
carriage return
|
|
|
|
.RB ( '\er' ),
|
|
|
|
horizontal tab
|
|
|
|
.RB ( '\et' ),
|
|
|
|
and vertical tab
|
|
|
|
.RB ( '\ev' ).
|
|
|
|
.TP
|
2005-10-19 07:29:28 +00:00
|
|
|
.BR isupper ()
|
2004-11-03 13:51:07 +00:00
|
|
|
checks for an uppercase letter.
|
|
|
|
.TP
|
2005-10-19 07:29:28 +00:00
|
|
|
.BR isxdigit ()
|
2004-11-03 13:51:07 +00:00
|
|
|
checks for a hexadecimal digits, i.e. one of
|
2006-07-20 16:16:51 +00:00
|
|
|
.br
|
2004-11-03 13:51:07 +00:00
|
|
|
.BR "0 1 2 3 4 5 6 7 8 9 a b c d e f A B C D E F" .
|
|
|
|
.SH "RETURN VALUE"
|
2005-06-15 13:32:34 +00:00
|
|
|
The values returned are non-zero if the character
|
2004-11-03 13:51:07 +00:00
|
|
|
.I c
|
|
|
|
falls into the tested class, and a zero value
|
|
|
|
if not.
|
|
|
|
.SH "CONFORMING TO"
|
2006-08-03 13:57:30 +00:00
|
|
|
C99, 4.3BSD.
|
2005-10-19 07:07:02 +00:00
|
|
|
\fBisascii\fP() is a BSD extension
|
2006-08-03 13:57:30 +00:00
|
|
|
and is also an SVr4 extension.
|
|
|
|
\fBisblank\fP() conforms to POSIX.1-2001 and C99 7.4.1.3.
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH NOTE
|
|
|
|
The details of what characters belong into which class depend on the current
|
|
|
|
locale. For example,
|
2005-10-19 07:07:02 +00:00
|
|
|
.BR isupper ()
|
2005-07-06 08:00:30 +00:00
|
|
|
will not recognize an A-umlaut (\(:A) as an uppercase letter in the default
|
2004-11-03 13:51:07 +00:00
|
|
|
.B "C"
|
|
|
|
locale.
|
|
|
|
.SH "SEE ALSO"
|
2006-02-09 20:57:44 +00:00
|
|
|
.BR iswalnum (3),
|
|
|
|
.BR iswalpha (3),
|
|
|
|
.BR iswblank (3),
|
|
|
|
.BR iswcntrl (3),
|
|
|
|
.BR iswdigit (3),
|
|
|
|
.BR iswgraph (3),
|
|
|
|
.BR iswlower (3),
|
|
|
|
.BR iswprint (3),
|
|
|
|
.BR iswpunct (3),
|
|
|
|
.BR iswspace (3),
|
|
|
|
.BR iswupper (3),
|
|
|
|
.BR iswxdigit (3),
|
2004-11-03 13:51:07 +00:00
|
|
|
.BR setlocale (3),
|
|
|
|
.BR tolower (3),
|
|
|
|
.BR toupper (3),
|
|
|
|
.BR ascii (7),
|
|
|
|
.BR locale (7)
|