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