2008-07-08 14:32:54 +00:00
|
|
|
.\" Copyright (c) 1993 by Thomas Koenig (ig25@rz.uni-karlsruhe.de)
|
2004-11-03 13:51:07 +00:00
|
|
|
.\"
|
|
|
|
.\" 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.
|
2007-04-12 22:42:49 +00:00
|
|
|
.\"
|
2004-11-03 13:51:07 +00:00
|
|
|
.\" 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.
|
2007-04-12 22:42:49 +00:00
|
|
|
.\"
|
2004-11-03 13:51:07 +00:00
|
|
|
.\" 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)
|
|
|
|
.\"
|
2009-03-14 18:40:59 +00:00
|
|
|
.TH ISALPHA 3 2009-03-15 "GNU" "Linux Programmer's Manual"
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH NAME
|
2007-04-12 22:42:49 +00:00
|
|
|
isalnum, isalpha, isascii, isblank, iscntrl, isdigit, isgraph, islower,
|
|
|
|
isprint, ispunct, isspace, isupper, isxdigit \- character
|
2004-11-03 13:51:07 +00:00
|
|
|
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
|
2007-07-08 12:11:40 +00:00
|
|
|
.sp
|
|
|
|
.in -4n
|
|
|
|
Feature Test Macro Requirements for glibc (see
|
|
|
|
.BR feature_test_macros (7)):
|
|
|
|
.in
|
|
|
|
.sp
|
|
|
|
.ad l
|
|
|
|
.BR isascii ():
|
2010-09-18 16:06:13 +00:00
|
|
|
.RS 4
|
2007-07-08 12:11:40 +00:00
|
|
|
_BSD_SOURCE || _SVID_SOURCE || _XOPEN_SOURCE
|
|
|
|
.br
|
2010-09-18 16:06:13 +00:00
|
|
|
.RE
|
2007-07-08 12:11:40 +00:00
|
|
|
.BR isblank ():
|
2010-09-18 16:06:13 +00:00
|
|
|
.RS 4
|
|
|
|
_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE;
|
|
|
|
.br
|
|
|
|
or
|
2007-07-08 12:11:40 +00:00
|
|
|
.I cc\ -std=c99
|
2010-09-18 16:06:13 +00:00
|
|
|
.RE
|
|
|
|
.ad
|
2004-11-03 13:51:07 +00:00
|
|
|
.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.
|
2007-04-12 22:42:49 +00:00
|
|
|
.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 ()
|
2007-04-12 22:42:49 +00:00
|
|
|
checks for an alphabetic character; in the standard \fB"C"\fP
|
2004-11-03 13:51:07 +00:00
|
|
|
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
|
2007-04-12 22:42:49 +00:00
|
|
|
case.
|
2004-11-03 13:51:07 +00:00
|
|
|
.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 ()
|
2007-04-12 22:42:49 +00:00
|
|
|
checks for white-space characters.
|
|
|
|
In the
|
2004-11-03 13:51:07 +00:00
|
|
|
.B """C"""
|
|
|
|
and
|
|
|
|
.B """POSIX"""
|
|
|
|
locales, these are: space, form-feed
|
2008-06-09 15:49:35 +00:00
|
|
|
.RB ( \(aq\ef\(aq ),
|
2004-11-03 13:51:07 +00:00
|
|
|
newline
|
2008-06-09 15:49:35 +00:00
|
|
|
.RB ( \(aq\en\(aq ),
|
2004-11-03 13:51:07 +00:00
|
|
|
carriage return
|
2008-06-09 15:49:35 +00:00
|
|
|
.RB ( \(aq\er\(aq ),
|
2004-11-03 13:51:07 +00:00
|
|
|
horizontal tab
|
2008-06-09 15:49:35 +00:00
|
|
|
.RB ( \(aq\et\(aq ),
|
2004-11-03 13:51:07 +00:00
|
|
|
and vertical tab
|
2008-06-09 15:49:35 +00:00
|
|
|
.RB ( \(aq\ev\(aq ).
|
2004-11-03 13:51:07 +00:00
|
|
|
.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 ()
|
2007-06-08 11:56:22 +00:00
|
|
|
checks for a hexadecimal digits, that is, 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"
|
intro.1, time.1, adjtimex.2, capget.2, eventfd.2, fcntl.2, getrlimit.2, getsockopt.2, gettimeofday.2, intro.2, ioctl_list.2, ioperm.2, mlock.2, pivot_root.2, poll.2, prctl.2, ptrace.2, sched_setscheduler.2, select_tut.2, semget.2, sigaltstack.2, signalfd.2, sysctl.2, timer_settime.2, timerfd_create.2, wait.2, CPU_SET.3, argz_add.3, assert_perror.3, atexit.3, backtrace.3, bcmp.3, clearenv.3, ctime.3, dl_iterate_phdr.3, dlopen.3, ecvt.3, errno.3, error.3, ether_aton.3, exit.3, fenv.3, ferror.3, finite.3, flockfile.3, fnmatch.3, fpathconf.3, fpclassify.3, ftime.3, ftok.3, ftw.3, fwide.3, getaddrinfo.3, gethostbyname.3, getlogin.3, getnameinfo.3, getnetent.3, getopt.3, getprotoent.3, getrpcent.3, getservent.3, glob.3, hsearch.3, inet.3, isalpha.3, iswalnum.3, iswalpha.3, iswblank.3, iswcntrl.3, iswctype.3, iswdigit.3, iswgraph.3, iswlower.3, iswprint.3, iswpunct.3, iswspace.3, iswupper.3, iswxdigit.3, longjmp.3, lsearch.3, malloc.3, matherr.3, mblen.3, mbsinit.3, mbtowc.3, on_exit.3, printf.3, pthread_attr_init.3, pthread_attr_setaffinity_np.3, pthread_attr_setdetachstate.3, pthread_attr_setguardsize.3, pthread_attr_setinheritsched.3, pthread_attr_setschedparam.3, pthread_attr_setschedpolicy.3, pthread_attr_setscope.3, pthread_attr_setstack.3, pthread_attr_setstackaddr.3, pthread_attr_setstacksize.3, pthread_cancel.3, pthread_cleanup_push.3, pthread_equal.3, pthread_getattr_np.3, pthread_getcpuclockid.3, pthread_setaffinity_np.3, pthread_setcancelstate.3, pthread_setconcurrency.3, pthread_setschedparam.3, pthread_setschedprio.3, ptsname.3, putenv.3, putgrent.3, raise.3, rcmd.3, regex.3, rexec.3, rpc.3, rpmatch.3, rtnetlink.3, scandir.3, sem_init.3, setaliasent.3, setbuf.3, setenv.3, setjmp.3, signbit.3, stdio_ext.3, strtod.3, strtol.3, strtoul.3, system.3, termios.3, timeradd.3, tzset.3, ualarm.3, wctomb.3, xdr.3, st.4, tty_ioctl.4, core.5, elf.5, proc.5, bootparam.7, capabilities.7, icmp.7, ip.7, ipv6.7, math_error.7, mdoc.samples.7, mq_overview.7, pthreads.7, raw.7, regex.7, socket.7, tcp.7, tzselect.8: Global fix: s/non-zero/nonzero/
The tendency in English, as prescribed in style guides like
Chicago MoS, is towards removing hyphens after prefixes
like "non-" etc.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2010-01-16 16:40:55 +00:00
|
|
|
The values returned are nonzero if the character
|
2004-11-03 13:51:07 +00:00
|
|
|
.I c
|
2007-04-12 22:42:49 +00:00
|
|
|
falls into the tested class, and a zero value
|
2004-11-03 13:51:07 +00:00
|
|
|
if not.
|
|
|
|
.SH "CONFORMING TO"
|
2006-08-03 13:57:30 +00:00
|
|
|
C99, 4.3BSD.
|
2007-05-12 09:06:04 +00:00
|
|
|
C89 specifies all of these functions except
|
|
|
|
.BR isascii ()
|
|
|
|
and
|
|
|
|
.BR isblank ().
|
|
|
|
.BR isascii ()
|
|
|
|
is a BSD extension
|
2006-08-03 13:57:30 +00:00
|
|
|
and is also an SVr4 extension.
|
2007-05-12 09:06:04 +00:00
|
|
|
.BR isblank ()
|
|
|
|
conforms to POSIX.1-2001 and C99 7.4.1.3.
|
2008-08-06 12:22:58 +00:00
|
|
|
POSIX.1-2008 marks
|
2009-01-23 23:14:35 +00:00
|
|
|
.BR isascii ()
|
2009-03-14 18:40:59 +00:00
|
|
|
as obsolete,
|
|
|
|
noting that it cannot be used portably in a localized application.
|
2007-05-16 02:54:18 +00:00
|
|
|
.SH NOTES
|
2004-11-03 13:51:07 +00:00
|
|
|
The details of what characters belong into which class depend on the current
|
2007-04-12 22:42:49 +00:00
|
|
|
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),
|
2009-02-03 04:01:15 +00:00
|
|
|
.BR toascii (3),
|
2004-11-03 13:51:07 +00:00
|
|
|
.BR tolower (3),
|
|
|
|
.BR toupper (3),
|
|
|
|
.BR ascii (7),
|
|
|
|
.BR locale (7)
|