1: /*
   2:  * Macros for determining character type.
   3:  *
   4:  * The table chrtype (in char.c) classifies each character
   5:  *  in one of the categories defined below.
   6:  */
   7: 
   8: #define _U  01      /* upper case */
   9: #define _L  02      /* lower case */
  10: #define _N  04      /* digit */
  11: #define _S  010     /* space */
  12: #define _P  020     /* punctuation */
  13: #define _C  040     /* control */
  14: #define _X  0100        /* hex digit (a-f) */
  15: 
  16: extern  char    ctype[];
  17: 
  18: #define isalpha(c)  (ctype[(c)&0377]&(_U|_L))
  19: #define isupper(c)  (ctype[(c)&0377]&_U)
  20: #define islower(c)  (ctype[(c)&0377]&_L)
  21: #define isdigit(c)  (ctype[(c)&0377]&_N)
  22: #define isxdigit(c) (ctype[(c)&0377]&(_N|_X))
  23: #define isspace(c)  (ctype[(c)&0377]&_S)
  24: #define ispunct(c)  (ctype[(c)&0377]&_P)
  25: #define isalnum(c)  (ctype[(c)&0377]&(_U|_L|_N))
  26: #define isprint(c)  (ctype[(c)&0377]&(_P|_U|_L|_N))
  27: #define iscntrl(c)  (ctype[(c)&0377]&_C)
  28: #define isascii(c)  ((unsigned)(c)<=0177)
  29: #define toupper(c)  (((c)&0377)-'a'+'A')
  30: #define tolower(c)  (((c)&0377)-'A'+'a')
  31: #define toascii(c)  (((c)&0177)
  32: #define tonum(c)    (isdigit(c)?(c)-'0':10+(((c)|(040))-'a'))

Defined macros

_C defined in line 13; used 1 times
  • in line 27
_L defined in line 9; used 4 times
_N defined in line 10; used 4 times
_P defined in line 12; used 2 times
_S defined in line 11; used 1 times
  • in line 23
_U defined in line 8; used 4 times
_X defined in line 14; used 1 times
  • in line 22
isalnum defined in line 25; never used
isalpha defined in line 18; never used
isascii defined in line 28; never used
iscntrl defined in line 27; never used
isdigit defined in line 21; used 1 times
  • in line 32
islower defined in line 20; never used
isprint defined in line 26; never used
ispunct defined in line 24; never used
isspace defined in line 23; never used
isupper defined in line 19; never used
isxdigit defined in line 22; never used
toascii defined in line 31; never used
tolower defined in line 30; never used
tonum defined in line 32; never used
toupper defined in line 29; never used
Last modified: 1986-05-25
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 685
Valid CSS Valid XHTML 1.0 Strict