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: struct void {INT vvvvvvvv;};
  77: 
  78: 
  79: /* heap storage */
  80: struct blk {
  81:     BLKPTR  word;
  82: };
  83: 
  84: #define BUFSIZ  64
  85: struct fileblk {
  86:     UFD fdes;
  87:     POS flin;
  88:     BOOL    feof;
  89:     CHAR    fsiz;
  90:     STRING  fnxt;
  91:     STRING  fend;
  92:     STRING  *feval;
  93:     FILE    fstak;
  94:     CHAR    fbuf[BUFSIZ];
  95: };
  96: 
  97: /* for files not used with file descriptors */
  98: struct filehdr {
  99:     UFD fdes;
 100:     POS flin;
 101:     BOOL    feof;
 102:     CHAR    fsiz;
 103:     STRING  fnxt;
 104:     STRING  fend;
 105:     STRING  *feval;
 106:     FILE    fstak;
 107:     CHAR    _fbuf[1];
 108: };
 109: 
 110: struct sysnod {
 111:     STRING  sysnam;
 112:     INT sysval;
 113: };
 114: 
 115: /* this node is a proforma for those that follow */
 116: struct trenod {
 117:     INT tretyp;
 118:     IOPTR   treio;
 119: };
 120: 
 121: /* dummy for access only */
 122: struct argnod {
 123:     ARGPTR  argnxt;
 124:     CHAR    argval[1];
 125: };
 126: 
 127: struct dolnod {
 128:     DOLPTR  dolnxt;
 129:     INT doluse;
 130:     CHAR    dolarg[1];
 131: };
 132: 
 133: struct forknod {
 134:     INT forktyp;
 135:     IOPTR   forkio;
 136:     TREPTR  forktre;
 137: };
 138: 
 139: struct comnod {
 140:     INT comtyp;
 141:     IOPTR   comio;
 142:     ARGPTR  comarg;
 143:     ARGPTR  comset;
 144: };
 145: 
 146: struct ifnod {
 147:     INT iftyp;
 148:     TREPTR  iftre;
 149:     TREPTR  thtre;
 150:     TREPTR  eltre;
 151: };
 152: 
 153: struct whnod {
 154:     INT whtyp;
 155:     TREPTR  whtre;
 156:     TREPTR  dotre;
 157: };
 158: 
 159: struct fornod {
 160:     INT fortyp;
 161:     TREPTR  fortre;
 162:     STRING  fornam;
 163:     COMPTR  forlst;
 164: };
 165: 
 166: struct swnod {
 167:     INT swtyp;
 168:     STRING  swarg;
 169:     REGPTR  swlst;
 170: };
 171: 
 172: struct regnod {
 173:     ARGPTR  regptr;
 174:     TREPTR  regcom;
 175:     REGPTR  regnxt;
 176: };
 177: 
 178: struct parnod {
 179:     INT partyp;
 180:     TREPTR  partre;
 181: };
 182: 
 183: struct lstnod {
 184:     INT lsttyp;
 185:     TREPTR  lstlef;
 186:     TREPTR  lstrit;
 187: };
 188: 
 189: struct ionod {
 190:     INT iofile;
 191:     STRING  ioname;
 192:     IOPTR   ionxt;
 193:     IOPTR   iolst;
 194: };
 195: 
 196: #define FORKTYPE    (sizeof(struct forknod))
 197: #define COMTYPE     (sizeof(struct comnod))
 198: #define IFTYPE      (sizeof(struct ifnod))
 199: #define WHTYPE      (sizeof(struct whnod))
 200: #define FORTYPE     (sizeof(struct fornod))
 201: #define SWTYPE      (sizeof(struct swnod))
 202: #define REGTYPE     (sizeof(struct regnod))
 203: #define PARTYPE     (sizeof(struct parnod))
 204: #define LSTTYPE     (sizeof(struct lstnod))
 205: #define IOTYPE      (sizeof(struct ionod))

Defined variables

ADDRESS defined in line 14; used 2 times
BYTPTR defined in line 22; used 3 times
INT defined in line 12; used 123 times
L_INT defined in line 15; used 3 times
MSG defined in line 19; used 97 times
PIPE defined in line 20; never used
POS defined in line 17; used 9 times
REAL defined in line 13; used 1 times
STKPTR defined in line 21; used 16 times
STRING defined in line 18; used 141 times
UFD defined in line 11; used 7 times

Defined struct's

argnod defined in line 122; never used
blk defined in line 80; never used
comnod defined in line 139; never used
dolnod defined in line 127; never used
fileblk defined in line 85; never used
filehdr defined in line 98; never used
forknod defined in line 133; never used
fornod defined in line 159; never used
ifnod defined in line 146; never used
ionod defined in line 189; never used
lstnod defined in line 183; never used
parnod defined in line 178; never used
regnod defined in line 172; never used
swnod defined in line 166; never used
sysnod defined in line 110; never used
trenod defined in line 116; never used
whnod defined in line 153; never used

Defined macros

BUFSIZ defined in line 84; used 2 times
COMTYPE defined in line 197; used 1 times
FORKTYPE defined in line 196; used 1 times
FORTYPE defined in line 200; used 1 times
IFTYPE defined in line 198; used 1 times
IOTYPE defined in line 205; used 1 times
LSTTYPE defined in line 204; used 1 times
Lcheat defined in line 56; used 2 times
NIL defined in line 47; used 11 times
PARTYPE defined in line 203; used 1 times
REGTYPE defined in line 202; used 1 times
Rcheat defined in line 57; used 11 times
SWTYPE defined in line 201; used 1 times
WHTYPE defined in line 199; used 1 times

Usage of this include

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