CTYPE(3V) — SYSTEM V LIBRARY
NAME
ctype, isalpha, isupper, islower, isdigit, isxdigit, isalnum, isspace, ispunct, isprint, iscntrl, isascii, isgraph, toupper, tolower, toascii, _toupper, _tolower − character classification and conversion macros and functions
SYNOPSIS
#include <ctype.h>
isalpha(c)
...
CHARACTER CLASSIFICATION MACROS
These macros classify ASCII-coded integer values by table lookup. Each is a predicate returning nonzero for true, zero for false. isascii is defined on all integer values; the rest are defined only where isascii(c) is true and on the single non-ASCII value EOF (see stdio(3V)).
isalpha(c) c is a letter
isupper(c) c is an upper case letter
islower(c) c is a lower case letter
isdigit(c) c is a digit [0-9].
isxdigit(c) c is a hexadecimal digit [0-9], [A-F], or [a-f].
isalnum(c) c is an alphanumeric character, that is, c is a letter or a digit
isspace(c) c is a space, tab, carriage return, newline, vertical tab, or formfeed
ispunct(c) c is a punctuation character (neither control nor alphanumeric)
isprint(c) c is a printing character, code 040(8) (space) through 0176 (tilde)
iscntrl(c) c is a delete character (0177) or ordinary control character (less than 040).
isascii(c) c is an ASCII character, code less than 0200
isgraph(c) c is a visible graphic character, code 041 (exclamation mark) through 0176 (tilde).
CHARACTER CONVERSION MACROS AND FUNCTIONS
toupper and tolower are functions, rather than macros, and work correctly on all characters. The macros _toupper and _tolower are faster than the equivalent functions (toupper and tolower) but only work properly on a restricted range of characters.
These functions perform simple conversions on single characters.
toupper(c) converts c to its upper-case equivalent. If c is not a lower-case letter, it is returned unchanged.
tolower(c) converts c to its lower-case equivalent. If c is not an upper-case letter, it is returned unchanged.
toascii(c) masks c with the correct value so that c is guaranteed to be an ASCII character in the range 0 thru 0x7f.
These macros perform simple conversions on single characters.
_toupper(c) converts c to its upper-case equivalent. Note that this only works where c is known to be a lower-case character to start with (presumably checked using islower).
_tolower(c) converts c to its lower-case equivalent. Note: this only works where c is known to be a upper-case character to start with (presumably checked using isupper).
DIAGNOSTICS
If the argument to any of these macros is not in the domain of the function, the result is undefined.
SEE ALSO
Sun Release 4.0 — Last change: 30 January 1988