1*d574aceaSmarc /* 2*d574aceaSmarc 3*d574aceaSmarc * Copyright (c) 1984, 1985, 1986 AT&T 4*d574aceaSmarc * All Rights Reserved 5*d574aceaSmarc 6*d574aceaSmarc * THIS IS UNPUBLISHED PROPRIETARY SOURCE 7*d574aceaSmarc * CODE OF AT&T. 8*d574aceaSmarc * The copyright notice above does not 9*d574aceaSmarc * evidence any actual or intended 10*d574aceaSmarc * publication of such source code. 11*d574aceaSmarc 12*d574aceaSmarc */ 13*d574aceaSmarc /* @(#)sym.h 1.1 */ 14*d574aceaSmarc /* 15*d574aceaSmarc * UNIX shell 16*d574aceaSmarc * S. R. Bourne 17*d574aceaSmarc * Rewritten by David Korn 18*d574aceaSmarc */ 19*d574aceaSmarc 20*d574aceaSmarc 21*d574aceaSmarc /* symbols for parsing */ 22*d574aceaSmarc #define DOSYM 0405 23*d574aceaSmarc #define FISYM 0420 24*d574aceaSmarc #define EFSYM 0422 25*d574aceaSmarc #define ELSYM 0421 26*d574aceaSmarc #define INSYM 0412 27*d574aceaSmarc #define BRSYM 0406 28*d574aceaSmarc #define KTSYM 0450 29*d574aceaSmarc #define THSYM 0444 30*d574aceaSmarc #define ODSYM 0441 31*d574aceaSmarc #define ESSYM 0442 32*d574aceaSmarc #define IFSYM 0436 33*d574aceaSmarc #define FORSYM 0435 34*d574aceaSmarc #define WHSYM 0433 35*d574aceaSmarc #define UNSYM 0427 36*d574aceaSmarc #define CASYM 0417 37*d574aceaSmarc #define PROCSYM 0460 38*d574aceaSmarc #define SELSYM 0470 39*d574aceaSmarc #define TIMSYM 0474 40*d574aceaSmarc 41*d574aceaSmarc #define SYMREP 04000 42*d574aceaSmarc #define ECSYM (SYMREP|';') 43*d574aceaSmarc #define ANDFSYM (SYMREP|'&') 44*d574aceaSmarc #define ORFSYM (SYMREP|'|') 45*d574aceaSmarc #define APPSYM (SYMREP|'>') 46*d574aceaSmarc #define DOCSYM (SYMREP|'<') 47*d574aceaSmarc #define SYMALT1 01000 48*d574aceaSmarc #define SYMALT2 010000 49*d574aceaSmarc #define COOPSYM (SYMALT1|'|') 50*d574aceaSmarc #define IPROC (SYMALT1|'(') 51*d574aceaSmarc #define OPROC (SYMALT2|'(') 52*d574aceaSmarc #define EOFSYM 02000 53*d574aceaSmarc #define SYMFLG 0400 54*d574aceaSmarc 55*d574aceaSmarc /* arg to `cmd' */ 56*d574aceaSmarc #define NLFLG 1 57*d574aceaSmarc #define MTFLG 2 58*d574aceaSmarc 59*d574aceaSmarc /* for peekc */ 60*d574aceaSmarc #define MARK 0100000 61*d574aceaSmarc 62*d574aceaSmarc /* odd chars */ 63*d574aceaSmarc #define DQUOTE '"' 64*d574aceaSmarc #define SQUOTE '`' 65*d574aceaSmarc #define DOLLAR '$' 66*d574aceaSmarc #define BRACE '{' 67*d574aceaSmarc #define LPAREN '(' 68*d574aceaSmarc #define RPAREN ')' 69*d574aceaSmarc 70*d574aceaSmarc struct sysnod 71*d574aceaSmarc { 72*d574aceaSmarc #ifdef apollo 73*d574aceaSmarc /* pointers can not be in readonly sections */ 74*d574aceaSmarc char sysnam[28]; 75*d574aceaSmarc #else 76*d574aceaSmarc char *sysnam; 77*d574aceaSmarc #endif /* apollo */ 78*d574aceaSmarc unsigned sysval; 79*d574aceaSmarc }; 80*d574aceaSmarc 81*d574aceaSmarc #define A_RAW 1 /* string needs no processing */ 82*d574aceaSmarc #define A_MAKE 2 /* bit set during argument expansion */ 83*d574aceaSmarc #define A_MAC 4 /* string needs macro expansion */ 84*d574aceaSmarc #define A_EXP 8 /* string needs file expansion */ 85*d574aceaSmarc 86*d574aceaSmarc /* dummy for access only */ 87*d574aceaSmarc struct argnod 88*d574aceaSmarc { 89*d574aceaSmarc struct argnod *argnxt; 90*d574aceaSmarc struct argnod *argchn; 91*d574aceaSmarc char argflag; 92*d574aceaSmarc char argval[1]; 93*d574aceaSmarc }; 94*d574aceaSmarc 95*d574aceaSmarc typedef struct sysnod SYSTAB[]; 96*d574aceaSmarc typedef struct argnod *ARGPTR; 97*d574aceaSmarc 98*d574aceaSmarc extern int wdval; 99*d574aceaSmarc extern int wdnum; 100*d574aceaSmarc extern ARGPTR wdarg; 101*d574aceaSmarc extern ARGPTR gchain; 102*d574aceaSmarc extern int subflag; 103*d574aceaSmarc extern SYSTAB reserved; 104*d574aceaSmarc extern SYSTAB commands; 105*d574aceaSmarc extern SYSTAB option_flags; 106*d574aceaSmarc extern SYSTAB signal_names; 107*d574aceaSmarc extern SYSTAB sig_messages; 108*d574aceaSmarc extern SYSTAB testops; 109*d574aceaSmarc extern SYSTAB attributes; 110*d574aceaSmarc extern MSG let_syntax; 111*d574aceaSmarc extern MSG unexpected; 112*d574aceaSmarc extern MSG unmatched; 113*d574aceaSmarc #ifdef DEVFD 114*d574aceaSmarc extern MSG devfd; 115*d574aceaSmarc #endif /* DEVFD */ 116