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 _S   01     /* space */
   9: #define _U   02     /* upper case */
  10: #define _L   04     /* lower case */
  11: #define _A  010     /* other alphabetic (e.g. "_") */
  12: #define _N  020     /* digit */
  13: 
  14: #define _UL (_U | _L)   /* letter */
  15: #define _ULA    (_UL | _A)  /* alphabetic */
  16: #define _ULAN   (_ULA | _N) /* alphanumeric */
  17: 
  18: #define isspace(c)  (chrtype[c] & _S)
  19: #define isupper(c)  (chrtype[c] & _U)
  20: #define islower(c)  (chrtype[c] & _L)
  21: #define isletter(c) (chrtype[c] & _UL)
  22: #define isalpha(c)  (chrtype[c] & _ULA)
  23: #define isdigit(c)  (chrtype[c] & _N)
  24: #define isalnum(c)  (chrtype[c] & _ULAN)
  25: 
  26: #define toupper(c)  (islower(c)? (c - ('a'-'A')) : c)
  27: #define tolower(c)  (isupper(c)? (c + ('a'-'A')) : c)
  28: #define tonum(c)    (isdigit(c)? (c - '0') : ((c & 037) + 9))
  29: 
  30: extern char chrtype[];

Defined macros

_A defined in line 11; used 2 times
_L defined in line 10; used 28 times
_N defined in line 12; used 12 times
_S defined in line 8; used 7 times
_U defined in line 9; used 28 times
_UL defined in line 14; used 2 times
_ULA defined in line 15; used 2 times
_ULAN defined in line 16; used 1 times
  • in line 24
isalnum defined in line 24; used 1 times
isalpha defined in line 22; used 1 times
isdigit defined in line 23; used 9 times
isletter defined in line 21; used 2 times
islower defined in line 20; used 2 times
isspace defined in line 18; used 3 times
isupper defined in line 19; used 1 times
  • in line 27
tolower defined in line 27; used 3 times
tonum defined in line 28; used 5 times
toupper defined in line 26; never used

Usage of this include

Last modified: 1984-11-29
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 990
Valid CSS Valid XHTML 1.0 Strict