CTYPE(3,L) AIX Technical Reference CTYPE(3,L)
-------------------------------------------------------------------------------
ctype
PURPOSE
Classifies characters.
LIBRARY
Standard C Library (libc.a)
SYNTAX
#include <ctype.h>
Processed November 7, 1990 CTYPE(3,L) 1
CTYPE(3,L) AIX Technical Reference CTYPE(3,L)
int isalpha (c) int isspace (c)
int c; int c;
int isupper (c) int ispunct (c)
int c; int c;
int islower (c) int isprint (c)
int c; int c;
int isdigit (c) int isgraph (c)
int c; int c;
int isxdigit (c) int iscntrl (c)
int c; int c;
int isalnum (c) int isascii (c)
int c; int c;
int iswalpha (c) int iswupper (c)
wchar_t c; wchar_t c;
int iswlower (c) int iswdigit (c)
wchar_t c; wchar_t c;
int iswxdigit (c) int iswalnum (c)
wchar_t c; wchar_t c;
int iswspace (c) int iswpunct (c)
wchar_t c; wchar_t c;
int iswprint (c) int iswgraph (c)
wchar_t c; wchar_t c;
int iswcntrl (c) int iswascii (c)
wchar_t c; wchar_t c;
DESCRIPTION
The ctype macros classify character-coded integer values by table lookup. Each
of these macros returns a nonzero value for TRUE and 0 for FALSE.
The ctype character macros examine the least significant byte of the parameter
passed to them. Their use should be limited to an ASCII environment.
The isascii macro is defined for all integer values. The other macros return a
meaningful value only if isascii returns TRUE for the same c value, or if c is
EOF. (See "stdio" for information about the value EOF.)
Each of these macros also can be found in libc.a as subroutines.
Processed November 7, 1990 CTYPE(3,L) 2
CTYPE(3,L) AIX Technical Reference CTYPE(3,L)
The following list shows the set of values for which each macro returns a
nonzero (TRUE) value:
isalpha c is a letter.
isupper c is an uppercase letter.
islower c is a lowercase letter.
isdigit c is a digit in the range ["0-9"].
isxdigit c is a hexadecimal digit in the range ["0-9"], ["A-F"] or ["a-f"].
isalnum c is alphanumeric (a letter or a digit).
isspace c is a space, tab, carriage return, new-line, vertical tab, or
form-feed character.
ispunct c is a punctuation character (neither a control character nor
alphanumeric).
isprint c is a printing character, ASCII space (040 or 0x20) through "~"
(0176 or 0x7E).
isgraph c is a printing character, like isprint but, unlike isprint, isgraph
returns FALSE (0) for the space character.
iscntrl c is an ASCII DEL character (0177 or 0x7F) or an ordinary control
character (less than 040 or 0x20).
isascii c is an ASCII character whose value is in the range 0-0177 (0-0x7F),
inclusive.
The wide character ctype macros classify characters according to the rules of
the coded character set defined by character type information in the program's
locale (category LC_TYPE). You should also call these wide character macros if
you are in the C locale.
The following list specifies the set of values for which each wide character
ctype macro returns a nonzero (TRUE) value:
iswalpha (c) c is an upper or lower case process code character.
iswupper (c) c is an upper case process code character.
iswlower (c) c is a lower case process code character.
iswdigit (c) c is a process code digit in the range [0-9].
Processed November 7, 1990 CTYPE(3,L) 3
CTYPE(3,L) AIX Technical Reference CTYPE(3,L)
iswxdigit (c) c is a hexadecimal process code digit in the range [0-9],
[A-F], or [a-f].
iswalnum (c) c is a process code alphanumeric.
iswspace (c) c is a process code space, tab, carriage return, new-line,
vertical tab, or form-feed character.
iswpunct (c) c is a process code punctuation (neither a control chracter nor
alphanumeric).
iswprint (c) c is a printable process code character.
iswgraph (c) c is a printable process code character like iswprint, but
iswgraph returns FALSE (0) for the space character.
iswcntrl (c) c is an ordinary process code control character.
iswascii (c) c is a process code ASCII character.
RELATED INFORMATION
In this book: "NCctype," "ascii," "setlocale," and "data stream."
"Introduction to International Character Support" in Managing the AIX Operating
System and the ctab command in AIX Operating System Commands Reference.
AIX Guide to Multibyte Character Set (MBCS) Support.
Processed November 7, 1990 CTYPE(3,L) 4