1: #
   2: /*
   3:  *	UNIX shell
   4:  *
   5:  *	S. R. Bourne
   6:  *	Bell Telephone Laboratories
   7:  *
   8:  */
   9: 
  10: 
  11: /* table 1 */
  12: #define T_SUB   01
  13: #define T_MET   02
  14: #define T_SPC   04
  15: #define T_DIP   010
  16: #define T_EOF   020
  17: #define T_EOR   040
  18: #define T_QOT   0100
  19: #define T_ESC   0200
  20: 
  21: /* table 2 */
  22: #define T_BRC   01
  23: #define T_DEF   02
  24: #define T_AST   04
  25: #define T_DIG   010
  26: #define T_FNG   020
  27: #define T_SHN   040
  28: #define T_IDC   0100
  29: #define T_SET   0200
  30: 
  31: /* for single chars */
  32: #define _TAB    (T_SPC)
  33: #define _SPC    (T_SPC)
  34: #define _UPC    (T_IDC)
  35: #define _LPC    (T_IDC)
  36: #define _DIG    (T_DIG)
  37: #define _EOF    (T_EOF)
  38: #define _EOR    (T_EOR)
  39: #define _BAR    (T_DIP)
  40: #define _HAT    (T_MET)
  41: #define _BRA    (T_MET)
  42: #define _KET    (T_MET)
  43: #define _SQB    (T_FNG)
  44: #define _AMP    (T_DIP)
  45: #define _SEM    (T_DIP)
  46: #define _LT (T_DIP)
  47: #define _GT (T_DIP)
  48: #define _LQU    (T_QOT|T_ESC)
  49: #define _BSL    (T_ESC)
  50: #define _DQU    (T_QOT)
  51: #define _DOL1   (T_SUB|T_ESC)
  52: 
  53: #define _CBR    T_BRC
  54: #define _CKT    T_DEF
  55: #define _AST    (T_AST|T_FNG)
  56: #define _EQ (T_DEF)
  57: #define _MIN    (T_DEF|T_SHN)
  58: #define _PCS    (T_SHN)
  59: #define _NUM    (T_SHN)
  60: #define _DOL2   (T_SHN)
  61: #define _PLS    (T_DEF|T_SET)
  62: #define _AT (T_AST)
  63: #define _QU (T_DEF|T_FNG|T_SHN)
  64: 
  65: /* abbreviations for tests */
  66: #define _IDCH   (T_IDC|T_DIG)
  67: #define _META   (T_SPC|T_DIP|T_MET|T_EOR)
  68: 
  69: char    _ctype1[];
  70: 
  71: /* nb these args are not call by value !!!! */
  72: #define space(c)    (((c)&QUOTE)==0 ANDF _ctype1[c]&(T_SPC))
  73: #define eofmeta(c)  (((c)&QUOTE)==0 ANDF _ctype1[c]&(_META|T_EOF))
  74: #define qotchar(c)  (((c)&QUOTE)==0 ANDF _ctype1[c]&(T_QOT))
  75: #define eolchar(c)  (((c)&QUOTE)==0 ANDF _ctype1[c]&(T_EOR|T_EOF))
  76: #define dipchar(c)  (((c)&QUOTE)==0 ANDF _ctype1[c]&(T_DIP))
  77: #define subchar(c)  (((c)&QUOTE)==0 ANDF _ctype1[c]&(T_SUB|T_QOT))
  78: #define escchar(c)  (((c)&QUOTE)==0 ANDF _ctype1[c]&(T_ESC))
  79: 
  80: char    _ctype2[];
  81: 
  82: #define digit(c)    (((c)&QUOTE)==0 ANDF _ctype2[c]&(T_DIG))
  83: #define fngchar(c)  (((c)&QUOTE)==0 ANDF _ctype2[c]&(T_FNG))
  84: #define dolchar(c)  (((c)&QUOTE)==0 ANDF _ctype2[c]&(T_AST|T_BRC|T_DIG|T_IDC|T_SHN))
  85: #define defchar(c)  (((c)&QUOTE)==0 ANDF _ctype2[c]&(T_DEF))
  86: #define setchar(c)  (((c)&QUOTE)==0 ANDF _ctype2[c]&(T_SET))
  87: #define digchar(c)  (((c)&QUOTE)==0 ANDF _ctype2[c]&(T_AST|T_DIG))
  88: #define letter(c)   (((c)&QUOTE)==0 ANDF _ctype2[c]&(T_IDC))
  89: #define alphanum(c) (((c)&QUOTE)==0 ANDF _ctype2[c]&(_IDCH))
  90: #define astchar(c)  (((c)&QUOTE)==0 ANDF _ctype2[c]&(T_AST))

Defined variables

_ctype1 defined in line 69; used 7 times
_ctype2 defined in line 80; used 9 times

Defined macros

T_AST defined in line 24; used 5 times
T_BRC defined in line 22; used 2 times
T_DEF defined in line 23; used 6 times
T_DIG defined in line 25; used 5 times
T_DIP defined in line 15; used 7 times
T_EOF defined in line 16; used 3 times
T_EOR defined in line 17; used 3 times
T_ESC defined in line 19; used 4 times
T_FNG defined in line 26; used 4 times
T_IDC defined in line 28; used 5 times
T_MET defined in line 13; used 4 times
T_QOT defined in line 18; used 4 times
T_SET defined in line 29; used 2 times
T_SHN defined in line 27; used 6 times
T_SPC defined in line 14; used 4 times
T_SUB defined in line 12; used 2 times
_AMP defined in line 44; used 1 times
_AST defined in line 55; used 1 times
_AT defined in line 62; used 1 times
_BAR defined in line 39; used 1 times
_BRA defined in line 41; used 1 times
_BSL defined in line 49; used 1 times
_CBR defined in line 53; used 1 times
_CKT defined in line 54; used 1 times
_DIG defined in line 36; used 10 times
_DOL1 defined in line 51; used 1 times
_DOL2 defined in line 60; used 1 times
_DQU defined in line 50; used 1 times
_EOF defined in line 37; used 1 times
_EOR defined in line 38; used 1 times
_EQ defined in line 56; used 1 times
_GT defined in line 47; used 1 times
_HAT defined in line 40; used 1 times
_IDCH defined in line 66; used 1 times
  • in line 89
_KET defined in line 42; used 1 times
_LPC defined in line 35; used 26 times
_LQU defined in line 48; used 1 times
_LT defined in line 46; used 1 times
_META defined in line 67; used 1 times
  • in line 73
_MIN defined in line 57; used 1 times
_NUM defined in line 59; used 1 times
_PCS defined in line 58; used 1 times
_PLS defined in line 61; used 1 times
_QU defined in line 63; used 1 times
_SEM defined in line 45; used 1 times
_SPC defined in line 33; used 1 times
_SQB defined in line 43; used 1 times
_TAB defined in line 32; used 1 times
_UPC defined in line 34; used 27 times
alphanum defined in line 89; used 4 times
astchar defined in line 90; used 1 times
defchar defined in line 85; used 1 times
digchar defined in line 87; used 1 times
digit defined in line 82; used 3 times
dipchar defined in line 76; used 1 times
dolchar defined in line 84; used 1 times
eofmeta defined in line 73; used 2 times
eolchar defined in line 75; used 4 times
escchar defined in line 78; used 1 times
fngchar defined in line 83; used 1 times
letter defined in line 88; used 4 times
qotchar defined in line 74; used 1 times
setchar defined in line 86; used 1 times
space defined in line 72; used 1 times
subchar defined in line 77; used 1 times

Usage of this include

ctype.h used 1 times
Last modified: 1981-07-10
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 1074
Valid CSS Valid XHTML 1.0 Strict