[9] | 1 | .\" @(#)ctype.3 6.4 (Berkeley) 5/12/86
|
---|
| 2 | .\"
|
---|
| 3 | .TH CTYPE 3 "May 12, 1986"
|
---|
| 4 | .AT 3
|
---|
| 5 | .SH NAME
|
---|
| 6 | ctype, isalpha, isupper, islower, isdigit, isxdigit, isalnum, isspace, ispunct, isprint, isgraph, iscntrl, isascii, toupper, tolower, toascii \- character classification macros
|
---|
| 7 | .SH SYNOPSIS
|
---|
| 8 | .nf
|
---|
| 9 | .ft B
|
---|
| 10 | #include <ctype.h>
|
---|
| 11 |
|
---|
| 12 | int isalpha(int \fIc\fP)
|
---|
| 13 | \&...
|
---|
| 14 | .fi
|
---|
| 15 | .SH DESCRIPTION
|
---|
| 16 | These macros classify characters
|
---|
| 17 | by table lookup.
|
---|
| 18 | Each is a predicate returning nonzero for true,
|
---|
| 19 | zero for false.
|
---|
| 20 | .B Isascii
|
---|
| 21 | and
|
---|
| 22 | .B toascii
|
---|
| 23 | are defined on all integer values; the rest
|
---|
| 24 | are defined only on the range of
|
---|
| 25 | .B "unsigned char"
|
---|
| 26 | and on the special value
|
---|
| 27 | EOF (see
|
---|
| 28 | .BR stdio (3)).
|
---|
| 29 | .TP 15n
|
---|
| 30 | .B isalpha
|
---|
| 31 | .I c
|
---|
| 32 | is a letter
|
---|
| 33 | .TP
|
---|
| 34 | .B isupper
|
---|
| 35 | .I c
|
---|
| 36 | is an upper case letter
|
---|
| 37 | .TP
|
---|
| 38 | .B islower
|
---|
| 39 | .I c
|
---|
| 40 | is a lower case letter
|
---|
| 41 | .TP
|
---|
| 42 | .B isdigit
|
---|
| 43 | .I c
|
---|
| 44 | is a digit
|
---|
| 45 | .TP
|
---|
| 46 | .B isxdigit
|
---|
| 47 | .I c
|
---|
| 48 | is a hex digit
|
---|
| 49 | .TP
|
---|
| 50 | .B isalnum
|
---|
| 51 | .I c
|
---|
| 52 | is an alphanumeric character
|
---|
| 53 | .TP
|
---|
| 54 | .B isspace
|
---|
| 55 | .I c
|
---|
| 56 | is a space, tab, carriage return, newline, vertical tab, or formfeed
|
---|
| 57 | .TP
|
---|
| 58 | .B ispunct
|
---|
| 59 | .I c
|
---|
| 60 | is a punctuation character (neither control nor alphanumeric)
|
---|
| 61 | .TP
|
---|
| 62 | .B isprint
|
---|
| 63 | .I c
|
---|
| 64 | is a printing character, code 040(8) (space) through 0176 (tilde)
|
---|
| 65 | .TP
|
---|
| 66 | .B isgraph
|
---|
| 67 | .I c
|
---|
| 68 | is a printing character, similar to
|
---|
| 69 | .B isprint
|
---|
| 70 | except false for space.
|
---|
| 71 | .TP
|
---|
| 72 | .B iscntrl
|
---|
| 73 | .I c
|
---|
| 74 | is a delete character (0177) or ordinary control character
|
---|
| 75 | (less than 040).
|
---|
| 76 | .TP
|
---|
| 77 | .B isascii
|
---|
| 78 | .I c
|
---|
| 79 | is an ASCII character, code less than 0200
|
---|
| 80 | .TP
|
---|
| 81 | .B tolower
|
---|
| 82 | .I c
|
---|
| 83 | is converted to lower case. Return value is undefined if not
|
---|
| 84 | .BR isupper (\fIc\fR).
|
---|
| 85 | .TP
|
---|
| 86 | .B toupper
|
---|
| 87 | .I c
|
---|
| 88 | is converted to upper case. Return value is undefined if not
|
---|
| 89 | .BR islower (\fIc\fR).
|
---|
| 90 | .TP
|
---|
| 91 | .B toascii
|
---|
| 92 | .I c
|
---|
| 93 | is converted to be a valid ascii character.
|
---|
| 94 | .SH "SEE ALSO"
|
---|
| 95 | .BR ascii (7)
|
---|