|
|
1.1 ! root 1: # ! 2: /* ! 3: * UNIX shell ! 4: */ ! 5: ! 6: ! 7: #define BYTESPERWORD (sizeof(char *)) ! 8: ! 9: TYPE char CHAR; ! 10: TYPE char BOOL; ! 11: TYPE int UFD; ! 12: TYPE int INT; ! 13: TYPE float REAL; ! 14: TYPE char *ADDRESS; ! 15: TYPE long int L_INT; ! 16: TYPE int VOID; ! 17: TYPE unsigned POS; ! 18: TYPE char *STRING; ! 19: TYPE char MSG[]; ! 20: TYPE int PIPE[]; ! 21: TYPE char *STKPTR; ! 22: TYPE char *BYTPTR; ! 23: ! 24: STRUCT stat STATBUF; /* defined in /usr/sys/stat.h */ ! 25: STRUCT blk *BLKPTR; ! 26: STRUCT fileblk FILEBLK; ! 27: STRUCT filehdr FILEHDR; ! 28: STRUCT fileblk *FILE; ! 29: STRUCT trenod *TREPTR; ! 30: STRUCT forknod *FORKPTR; ! 31: STRUCT comnod *COMPTR; ! 32: STRUCT swnod *SWPTR; ! 33: STRUCT regnod *REGPTR; ! 34: STRUCT parnod *PARPTR; ! 35: STRUCT ifnod *IFPTR; ! 36: STRUCT whnod *WHPTR; ! 37: STRUCT fornod *FORPTR; ! 38: STRUCT lstnod *LSTPTR; ! 39: STRUCT argnod *ARGPTR; ! 40: STRUCT dolnod *DOLPTR; ! 41: STRUCT ionod *IOPTR; ! 42: STRUCT namnod NAMNOD; ! 43: STRUCT namnod *NAMPTR; ! 44: STRUCT sysnod SYSNOD; ! 45: STRUCT sysnod *SYSPTR; ! 46: STRUCT sysnod SYSTAB[]; ! 47: #define NIL ((char*)0) ! 48: ! 49: ! 50: /* the following nonsense is required ! 51: * because casts turn an Lvalue ! 52: * into an Rvalue so two cheats ! 53: * are necessary, one for each context. ! 54: */ ! 55: union { int _cheat;}; ! 56: #define Lcheat(a) ((a)._cheat) ! 57: #define Rcheat(a) ((int)(a)) ! 58: ! 59: ! 60: /* address puns for storage allocation */ ! 61: UNION { ! 62: FORKPTR _forkptr; ! 63: COMPTR _comptr; ! 64: PARPTR _parptr; ! 65: IFPTR _ifptr; ! 66: WHPTR _whptr; ! 67: FORPTR _forptr; ! 68: LSTPTR _lstptr; ! 69: BLKPTR _blkptr; ! 70: NAMPTR _namptr; ! 71: BYTPTR _bytptr; ! 72: } address; ! 73: ! 74: ! 75: /* for functions that do not return values */ ! 76: /* ! 77: struct void {INT vvvvvvvv;}; ! 78: */ ! 79: ! 80: ! 81: /* heap storage */ ! 82: struct blk { ! 83: BLKPTR word; ! 84: }; ! 85: ! 86: #define BUFSIZ 64 ! 87: struct fileblk { ! 88: UFD fdes; ! 89: POS flin; ! 90: BOOL feof; ! 91: CHAR fsiz; ! 92: STRING fnxt; ! 93: STRING fend; ! 94: STRING *feval; ! 95: FILE fstak; ! 96: CHAR fbuf[BUFSIZ]; ! 97: }; ! 98: ! 99: /* for files not used with file descriptors */ ! 100: struct filehdr { ! 101: UFD fdes; ! 102: POS flin; ! 103: BOOL feof; ! 104: CHAR fsiz; ! 105: STRING fnxt; ! 106: STRING fend; ! 107: STRING *feval; ! 108: FILE fstak; ! 109: CHAR _fbuf[1]; ! 110: }; ! 111: ! 112: struct sysnod { ! 113: STRING sysnam; ! 114: INT sysval; ! 115: }; ! 116: ! 117: /* this node is a proforma for those that follow */ ! 118: struct trenod { ! 119: INT tretyp; ! 120: IOPTR treio; ! 121: }; ! 122: ! 123: /* dummy for access only */ ! 124: struct argnod { ! 125: ARGPTR argnxt; ! 126: CHAR argval[1]; ! 127: }; ! 128: ! 129: struct dolnod { ! 130: DOLPTR dolnxt; ! 131: INT doluse; ! 132: CHAR dolarg[1]; ! 133: }; ! 134: ! 135: struct forknod { ! 136: INT forktyp; ! 137: IOPTR forkio; ! 138: TREPTR forktre; ! 139: }; ! 140: ! 141: struct comnod { ! 142: INT comtyp; ! 143: IOPTR comio; ! 144: ARGPTR comarg; ! 145: ARGPTR comset; ! 146: }; ! 147: ! 148: struct ifnod { ! 149: INT iftyp; ! 150: TREPTR iftre; ! 151: TREPTR thtre; ! 152: TREPTR eltre; ! 153: }; ! 154: ! 155: struct whnod { ! 156: INT whtyp; ! 157: TREPTR whtre; ! 158: TREPTR dotre; ! 159: }; ! 160: ! 161: struct fornod { ! 162: INT fortyp; ! 163: TREPTR fortre; ! 164: STRING fornam; ! 165: COMPTR forlst; ! 166: }; ! 167: ! 168: struct swnod { ! 169: INT swtyp; ! 170: STRING swarg; ! 171: REGPTR swlst; ! 172: }; ! 173: ! 174: struct regnod { ! 175: ARGPTR regptr; ! 176: TREPTR regcom; ! 177: REGPTR regnxt; ! 178: }; ! 179: ! 180: struct parnod { ! 181: INT partyp; ! 182: TREPTR partre; ! 183: }; ! 184: ! 185: struct lstnod { ! 186: INT lsttyp; ! 187: TREPTR lstlef; ! 188: TREPTR lstrit; ! 189: }; ! 190: ! 191: struct ionod { ! 192: INT iofile; ! 193: STRING ioname; ! 194: IOPTR ionxt; ! 195: IOPTR iolst; ! 196: }; ! 197: ! 198: #define FORKTYPE (sizeof(struct forknod)) ! 199: #define COMTYPE (sizeof(struct comnod)) ! 200: #define IFTYPE (sizeof(struct ifnod)) ! 201: #define WHTYPE (sizeof(struct whnod)) ! 202: #define FORTYPE (sizeof(struct fornod)) ! 203: #define SWTYPE (sizeof(struct swnod)) ! 204: #define REGTYPE (sizeof(struct regnod)) ! 205: #define PARTYPE (sizeof(struct parnod)) ! 206: #define LSTTYPE (sizeof(struct lstnod)) ! 207: #define IOTYPE (sizeof(struct ionod))
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.