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