Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ ctype(3) — SunOS 3.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

ascii(7)

CTYPE(3)  —  C LIBRARY FUNCTIONS

NAME

ctype isalpha, isupper, islower, isdigit, isxdigit, isalnum, isspace, ispunct, isprint, iscntrl, isascii, isgraph, toupper, tolower, toascii − character classification and conversion macros

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(3S)).

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

isxdigit(c) c is a hexadecimal digit

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, 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

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 via islower).

tolower(c) converts c to its lower-case equivalent.  Note that this only works where c is known to be a upper-case character to start with (presumably checked via isupper).

toascii(c) masks c with the correct value so that c is guaranteed to be an ASCII character in the range 0 thru 0x7f. 

SEE ALSO

ascii(7)

Sun Release 3.0β  —  Last change: 7 November 1984

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026