# 2.11BSD#431 - /usr/src/bin/sh/mode.h

##### Variables

    ADDRESS           X
    BOOL              X
    BYTPTR            X
    CHAR              X
    INT               X
    L_INT             X
    MSG               X
    PIPE              X
    POS               X
    REAL              X
    STKPTR            X
    STRING            X
    UFD               X
    VOID              X

##### Macros

    BUFSIZ            X
    BYTESPERWORD      X
    COMTYPE           X
    FORKTYPE          X
    FORTYPE           X
    IFTYPE            X
    IOTYPE            X
    LSTTYPE           X
    Lcheat            X
    NIL               X
    PARTYPE           X
    REGTYPE           X
    Rcheat            X
    SWTYPE            X
    WHTYPE            X

##### struct's

    argnod            X
    blk               X
    comnod            X
    dolnod            X
    fileblk           X
    filehdr           X
    forknod           X
    fornod            X
    ifnod             X
    ionod             X
    lstnod            X
    parnod            X
    regnod            X
    swnod             X
    sysnod            X
    trenod            X
    whnod             X

       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

- in /usr/src/bin/sh/blok.c line 31
- in /usr/src/bin/sh/defs.h line 83

BOOL defined in line 12; used 22 times

- in line 92, 105
- in /usr/src/bin/sh/cmd.c line 194
- in /usr/src/bin/sh/defs.h line 157, 245-248(3), 258
- in /usr/src/bin/sh/expand.c line 38, 51, 132
- in /usr/src/bin/sh/fault.c line 18-19(2)
- in /usr/src/bin/sh/io.c line 109
- in /usr/src/bin/sh/macro.c line 68, 158
- in /usr/src/bin/sh/main.c line 23, 101
- in /usr/src/bin/sh/name.c line 16, 217
- in /usr/src/bin/sh/service.c line 287
- in /usr/src/bin/sh/xec.c line 108

BYTPTR defined in line 24; used 3 times

- in line 73
- in /usr/src/bin/sh/defs.h line 133
- in /usr/src/bin/sh/setbrk.c line 18

CHAR defined in line 11; used 44 times

- in line 93-98(2), 106-111(2), 128, 134
- in /usr/src/bin/sh/args.c line 19-21(2)
- in /usr/src/bin/sh/cmd.c line 323
- in /usr/src/bin/sh/defs.h line 193, 252
- in /usr/src/bin/sh/expand.c line 110, 122
- in /usr/src/bin/sh/io.c line 114-115(2)
- in /usr/src/bin/sh/macro.c line 17-25(4), 34-37(2), 54-56(2), 70, 159, 176, 216
- in /usr/src/bin/sh/main.c line 24
- in /usr/src/bin/sh/name.c line 36, 134, 220
- in /usr/src/bin/sh/print.c line 16, 47, 90-92(2)
- in /usr/src/bin/sh/service.c line 293-294(2)
- in /usr/src/bin/sh/string.c line 28-31(2)
- in /usr/src/bin/sh/word.c line 23-24(2), 82-84(2), 98

INT defined in line 14; used 124 times

- in line 116-121(2), 133-138(2), 144, 151, 158, 164, 171, 183-188(2), 194
- in /usr/src/bin/sh/args.c line 24, 31-33(2), 77
- in /usr/src/bin/sh/blok.c line 36, 95-98(2)
- in /usr/src/bin/sh/cmd.c line 36, 47, 70-71(2), 123, 155, 219, 283, 321, 371
- in /usr/src/bin/sh/defs.h line 121-126(2), 153-156(3), 195-200(2), 220, 257-260(3)
- in /usr/src/bin/sh/error.c line 52
- in /usr/src/bin/sh/expand.c line 33-36(2), 121, 132, 167
- in /usr/src/bin/sh/fault.c line 25-27(2), 58, 68, 77, 92, 104, 112
- in /usr/src/bin/sh/io.c line 63, 73, 82, 94, 116
- in /usr/src/bin/sh/macro.c line 64-67(2), 190, 214-218(2)
- in /usr/src/bin/sh/main.c line 37-40(2), 104, 184
- in /usr/src/bin/sh/msg.c line 128
- in /usr/src/bin/sh/name.c line 54, 69, 129, 135, 171, 194, 308
- in /usr/src/bin/sh/print.c line 57, 70, 77, 91
- in /usr/src/bin/sh/service.c line 21-23(2), 40, 88, 201-206(3), 214-216(2), 229-242(8), 312, 337-338(2), 360-364(2), 377-382(3)
- in /usr/src/bin/sh/stak.c line 23-26(2)
- in /usr/src/bin/sh/string.c line 27, 41, 52
- in /usr/src/bin/sh/word.c line 25, 99, 130
- in /usr/src/bin/sh/xec.c line 17, 28, 37-38(2), 49, 74, 113, 126, 177, 311, 365

L_INT defined in line 17; used 3 times

- in /usr/src/bin/sh/main.c line 103
- in /usr/src/bin/sh/print.c line 55
- in /usr/src/bin/sh/xec.c line 85

MSG defined in line 21; used 97 times

- in /usr/src/bin/sh/defs.h line 141-149(9), 160-162(3), 174, 181-190(8), 202, 253-254(2), 263-287(25)
- in /usr/src/bin/sh/msg.c line 18-70(46), 130-131(2)

PIPE defined in line 22; never used
POS defined in line 19; used 9 times

- in line 91, 104
- in /usr/src/bin/sh/blok.c line 25, 32-34(2), 57
- in /usr/src/bin/sh/defs.h line 230
- in /usr/src/bin/sh/main.c line 45
- in /usr/src/bin/sh/print.c line 77

REAL defined in line 15; used 1 times

- in /usr/src/bin/sh/defs.h line 93

STKPTR defined in line 23; used 16 times

- in /usr/src/bin/sh/blok.c line 60, 75
- in /usr/src/bin/sh/defs.h line 134
- in /usr/src/bin/sh/macro.c line 177
- in /usr/src/bin/sh/name.c line 137
- in /usr/src/bin/sh/stak.c line 16, 22-25(2), 34, 47, 53-56(2), 63, 81-82(2)
- in /usr/src/bin/sh/xec.c line 32

STRING defined in line 20; used 141 times

- in line 94-96(3), 107-109(3), 115, 166, 172, 195
- in /usr/src/bin/sh/args.c line 16, 32-38(5), 73-76(2), 90, 105-110(6)
- in /usr/src/bin/sh/defs.h line 85-86(2), 94-104(8), 110, 127, 175-179(5), 194, 201, 246-251(2)
- in /usr/src/bin/sh/error.c line 36, 46, 71
- in /usr/src/bin/sh/expand.c line 34-40(3), 79, 119, 164-166(2), 189
- in /usr/src/bin/sh/fault.c line 17, 78, 105
- in /usr/src/bin/sh/io.c line 30, 71, 92
- in /usr/src/bin/sh/macro.c line 22, 69-71(2), 152-153(2), 184
- in /usr/src/bin/sh/main.c line 38
- in /usr/src/bin/sh/msg.c line 93
- in /usr/src/bin/sh/name.c line 33-37(2), 57, 68-71(2), 104-105(2), 112, 121, 130, 170, 176-179(3), 190, 218, 254, 264-267(2), 302, 316, 326-328(2)
- in /usr/src/bin/sh/print.c line 37-39(2), 88
- in /usr/src/bin/sh/service.c line 22, 39, 73-76(3), 89, 98-103(4), 114-121(5), 132-136(4), 290-292(2), 303-315(5), 335, 348-351(2), 378-380(2)
- in /usr/src/bin/sh/stak.c line 54
- in /usr/src/bin/sh/string.c line 20-21(2), 29, 42, 53-55(2)
- in /usr/src/bin/sh/xec.c line 39, 48, 339, 386-391(2), 413

UFD defined in line 13; used 7 times

- in line 90, 103
- in /usr/src/bin/sh/defs.h line 120
- in /usr/src/bin/sh/io.c line 20
- in /usr/src/bin/sh/main.c line 22
- in /usr/src/bin/sh/service.c line 91
- in /usr/src/bin/sh/xec.c line 414

VOID defined in line 18; used 47 times

- in /usr/src/bin/sh/args.c line 72
- in /usr/src/bin/sh/blok.c line 56, 81
- in /usr/src/bin/sh/cmd.c line 18-19(2), 25-27(3), 312, 362, 369, 377, 395
- in /usr/src/bin/sh/defs.h line 84, 90-91(2), 100-109(8), 244
- in /usr/src/bin/sh/expand.c line 30, 163
- in /usr/src/bin/sh/fault.c line 24
- in /usr/src/bin/sh/main.c line 31, 100
- in /usr/src/bin/sh/name.c line 67, 241, 251, 275, 286, 300, 310, 318
- in /usr/src/bin/sh/print.c line 36, 46
- in /usr/src/bin/sh/service.c line 17, 36, 117, 213, 228, 334
- in /usr/src/bin/sh/stak.c line 62

#### 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

- in line 98
- in /usr/src/bin/sh/io.c line 24

BYTESPERWORD defined in line 9; used 14 times

- in /usr/src/bin/sh/args.c line 108
- in /usr/src/bin/sh/blok.c line 34(2), 64
- in /usr/src/bin/sh/expand.c line 169
- in /usr/src/bin/sh/name.c line 332(2)
- in /usr/src/bin/sh/service.c line 317(2), 384-387(2)
- in /usr/src/bin/sh/stak.c line 28, 58
- in /usr/src/bin/sh/word.c line 24

COMTYPE defined in line 201; used 1 times

- in /usr/src/bin/sh/cmd.c line 284

FORKTYPE defined in line 200; used 1 times

- in /usr/src/bin/sh/cmd.c line 41

FORTYPE defined in line 204; used 1 times

- in /usr/src/bin/sh/cmd.c line 231

IFTYPE defined in line 202; used 1 times

- in /usr/src/bin/sh/cmd.c line 220

IOTYPE defined in line 209; used 1 times

- in /usr/src/bin/sh/cmd.c line 354

LSTTYPE defined in line 208; used 1 times

- in /usr/src/bin/sh/cmd.c line 54

Lcheat defined in line 58; used 2 times

- in /usr/src/bin/sh/blok.c line 87
- in /usr/src/bin/sh/service.c line 400

NIL defined in line 49; used 11 times

- in /usr/src/bin/sh/error.c line 48
- in /usr/src/bin/sh/macro.c line 66
- in /usr/src/bin/sh/name.c line 19-22(8), 211

PARTYPE defined in line 207; used 1 times

- in /usr/src/bin/sh/cmd.c line 266

REGTYPE defined in line 206; used 1 times

- in /usr/src/bin/sh/cmd.c line 160

Rcheat defined in line 59; used 11 times

- in /usr/src/bin/sh/args.c line 79, 97
- in /usr/src/bin/sh/blok.c line 23, 46-50(2), 67-72(2), 101
- in /usr/src/bin/sh/service.c line 314, 324-329(2)

SWTYPE defined in line 205; used 1 times

- in /usr/src/bin/sh/cmd.c line 208

WHTYPE defined in line 203; used 1 times

- in /usr/src/bin/sh/cmd.c line 252

#### Usage of this include

mode.h used 1 times

- in /usr/src/bin/sh/defs.h line 77

Last modified: 1982-06-09 Generated: 2016-12-26 | Generated by src2html V0.67 page hit count: 1060 |