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

Defined variables

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

Defined struct's

argnod defined in line 126; never used
blk defined in line 84; never used
comnod defined in line 143; never used
dolnod defined in line 131; never used
fileblk defined in line 89; never used
filehdr defined in line 102; never used
forknod defined in line 137; never used
fornod defined in line 163; never used
ifnod defined in line 150; never used
ionod defined in line 193; never used
lstnod defined in line 187; never used
parnod defined in line 182; never used
regnod defined in line 176; never used
swnod defined in line 170; never used
sysnod defined in line 114; never used
trenod defined in line 120; never used
whnod defined in line 157; never used

Defined macros

BUFSIZ defined in line 88; used 2 times
COMTYPE defined in line 201; used 1 times
FORKTYPE defined in line 200; used 1 times
FORTYPE defined in line 204; used 1 times
IFTYPE defined in line 202; used 1 times
IOTYPE defined in line 209; used 1 times
LSTTYPE defined in line 208; used 1 times
Lcheat defined in line 58; used 2 times
NIL defined in line 49; used 11 times
PARTYPE defined in line 207; used 1 times
REGTYPE defined in line 206; used 1 times
Rcheat defined in line 59; used 11 times
SWTYPE defined in line 205; used 1 times
WHTYPE defined in line 203; used 1 times

Usage of this include

mode.h used 1 times
Last modified: 1982-06-09
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 3512
Valid CSS Valid XHTML 1.0 Strict