Blob
1 .TH CTYPE 32 .SH NAME3 isalpha, isupper, islower, isdigit, isxdigit, isalnum, isspace, ispunct, isprint, isgraph, iscntrl, isascii, toascii, _toupper, _tolower, toupper, tolower \- ASCII character classification4 .SH SYNOPSIS5 .B #include <u.h>6 .br7 .B #include <libc.h>8 .br9 .B #include <ctype.h>10 .PP11 .if t .2C12 .B isalpha(c)13 .PP14 .B isupper(c)15 .PP16 .B islower(c)17 .PP18 .B isdigit(c)19 .PP20 .B isxdigit(c)21 .PP22 .B isalnum(c)23 .PP24 .B isspace(c)25 .PP26 .B ispunct(c)27 .PP28 .B isprint(c)29 .PP30 .B isgraph(c)31 .PP32 .B iscntrl(c)33 .PP34 .B isascii(c)35 .PP36 .B _toupper(c)37 .PP38 .B _tolower(c)39 .PP40 .B toupper(c)41 .PP42 .B tolower(c)43 .PP44 .B toascii(c)45 .if t .1C46 .SH DESCRIPTION47 These macros classify48 .SM ASCII\c49 -coded integer values50 by table lookup.51 Each is a predicate returning nonzero for true,52 zero for false.53 .I Isascii54 is defined on all integer values; the rest55 are defined only where56 .I isascii57 is true and on the single non-\c58 .SM ASCII59 value60 .BR EOF ;61 see62 .IR fopen (3).63 .TP "\w'isalnum 'u"64 .I isalpha65 .I c66 is a letter, a\-z or A\-Z67 .TP68 .I isupper69 .I c70 is an upper case letter, A\-Z71 .TP72 .I islower73 .I c74 is a lower case letter, a\-z75 .TP76 .I isdigit77 .I c78 is a digit, 0\-979 .TP80 .I isxdigit81 .I c82 is a hexadecimal digit, 0\-9 or a\-f or A\-F83 .TP84 .I isalnum85 .I c86 is an alphanumeric character, a\-z or A\-Z or 0\-987 .TP88 .I isspace89 .I c90 is a space, horizontal tab, newline, vertical tab, formfeed, or carriage return91 (0x20, 0x9, 0xA, 0xB, 0xC, 0xD)92 .TP93 .I ispunct94 .I c95 is a punctuation character96 (one of97 .L98 !"#$%&'()*+,-./:;<=>?@[\e]^_`{|}~\fR)99 .TP100 .I isprint101 .I c102 is a printing character, 0x20 (space)103 through 0x7E (tilde)104 .TP105 .I isgraph106 .I c107 is a visible printing character, 0x21 (exclamation) through 0x7E108 (tilde)109 .TP110 .I iscntrl111 .I c112 is a delete character, 0x7F,113 or ordinary control character, 0x0 through 0x1F114 .TP115 .I isascii116 .I c117 is an118 .SM ASCII119 character, 0x0 through 0x7F120 .PP121 .I Toascii122 is not a classification macro;123 it converts its argument to124 .SM ASCII125 range by126 .IR and ing127 with 0x7F.128 .PP129 If130 .I c131 is an upper case letter,132 .I tolower133 returns the lower case version of the character;134 otherwise it returns the original character.135 .I Toupper136 is similar, returning the upper case version of a character137 or the original character.138 .I Tolower139 and140 .I toupper141 are functions;142 .I _tolower143 and144 .I _toupper145 are corresponding macros which should only be used when it146 is known that the argument is upper case or lower case, respectively.147 .SH SOURCE148 .TF /usr/local/plan9/src/libc/port/ctype.c149 .TP150 .B /sys/include/ctype.h151 for the macros.152 .TP153 .B /usr/local/plan9/src/libc/port/ctype.c154 for the tables.155 .SH "SEE ALSO156 .IR isalpharune (3)157 .SH BUGS158 These macros are159 .SM ASCII \c160 -centric.