1: /*	defs.h	4.4	85/03/19	*/
   2: 
   3: #
   4: /*
   5:  *	UNIX shell
   6:  */
   7: 
   8: /* error exits from various parts of shell */
   9: #define ERROR   1
  10: #define SYNBAD  2
  11: #define SIGFAIL 3
  12: #define SIGFLG  0200
  13: 
  14: /* command tree */
  15: #define FPRS    020
  16: #define FINT    040
  17: #define FAMP    0100
  18: #define FPIN    0400
  19: #define FPOU    01000
  20: #define FPCL    02000
  21: #define FCMD    04000
  22: #define COMMSK  017
  23: 
  24: #define TCOM    0
  25: #define TPAR    1
  26: #define TFIL    2
  27: #define TLST    3
  28: #define TIF 4
  29: #define TWH 5
  30: #define TUN 6
  31: #define TSW 7
  32: #define TAND    8
  33: #define TORF    9
  34: #define TFORK   10
  35: #define TFOR    11
  36: 
  37: /* execute table */
  38: #define SYSSET  1
  39: #define SYSCD   2
  40: #define SYSEXEC 3
  41: #define SYSLOGIN 4
  42: #define SYSTRAP 5
  43: #define SYSEXIT 6
  44: #define SYSSHFT 7
  45: #define SYSWAIT 8
  46: #define SYSCONT 9
  47: #define SYSBREAK 10
  48: #define SYSEVAL 11
  49: #define SYSDOT  12
  50: #define SYSRDONLY 13
  51: #define SYSTIMES 14
  52: #define SYSXPORT 15
  53: #define SYSNULL 16
  54: #define SYSREAD 17
  55: #define SYSTST  18
  56: #define SYSUMASK    19
  57: 
  58: /* used for input and output of shell */
  59: #define INIO 10
  60: #define OTIO 11
  61: 
  62: /*io nodes*/
  63: #define USERIO  10
  64: #define IOUFD   15
  65: #define IODOC   16
  66: #define IOPUT   32
  67: #define IOAPP   64
  68: #define IOMOV   128
  69: #define IORDW   256
  70: #define INPIPE  0
  71: #define OTPIPE  1
  72: 
  73: /* arg list terminator */
  74: #define ENDARGS 0
  75: 
  76: #include    "mac.h"
  77: #include    "mode.h"
  78: #include    "name.h"
  79: 
  80: 
  81: /* result type declarations */
  82: #define alloc malloc
  83: ADDRESS     alloc();
  84: VOID        addblok();
  85: STRING      make();
  86: STRING      movstr();
  87: TREPTR      cmd();
  88: TREPTR      makefork();
  89: NAMPTR      lookup();
  90: VOID        setname();
  91: VOID        setargs();
  92: DOLPTR      useargs();
  93: REAL        expr();
  94: STRING      catpath();
  95: STRING      getpath();
  96: STRING      *scan();
  97: STRING      mactrim();
  98: STRING      macro();
  99: STRING      execs();
 100: VOID        await();
 101: VOID        post();
 102: STRING      copyto();
 103: VOID        exname();
 104: STRING      staknam();
 105: VOID        printnam();
 106: VOID        printflg();
 107: VOID        prs();
 108: VOID        prc();
 109: VOID        setupenv();
 110: STRING      *setenv();
 111: 
 112: #define attrib(n,f) (n->namflg |= f)
 113: #define round(a,b)  (((int)((ADR(a)+b)-1))&~((b)-1))
 114: #define closepipe(x)    (close(x[INPIPE]), close(x[OTPIPE]))
 115: #define eq(a,b)     (cf(a,b)==0)
 116: #define max(a,b)    ((a)>(b)?(a):(b))
 117: #define assert(x)   ;
 118: 
 119: /* temp files and io */
 120: UFD     output;
 121: INT     ioset;
 122: IOPTR       iotemp;     /* files to be deleted sometime */
 123: IOPTR       iopend;     /* documents waiting to be read at NL */
 124: 
 125: /* substitution */
 126: INT     dolc;
 127: STRING      *dolv;
 128: DOLPTR      argfor;
 129: ARGPTR      gchain;
 130: 
 131: /* stack */
 132: #define     BLK(x)  ((BLKPTR)(x))
 133: #define     BYT(x)  ((BYTPTR)(x))
 134: #define     STK(x)  ((STKPTR)(x))
 135: #define     ADR(x)  ((char*)(x))
 136: 
 137: /* stak stuff */
 138: #include    "stak.h"
 139: 
 140: /* string constants */
 141: MSG     atline;
 142: MSG     readmsg;
 143: MSG     colon;
 144: MSG     minus;
 145: MSG     nullstr;
 146: MSG     sptbnl;
 147: MSG     unexpected;
 148: MSG     endoffile;
 149: MSG     synmsg;
 150: 
 151: /* name tree and words */
 152: SYSTAB      reserved;
 153: INT     wdval;
 154: INT     wdnum;
 155: ARGPTR      wdarg;
 156: INT     wdset;
 157: BOOL        reserv;
 158: 
 159: /* prompting */
 160: MSG     stdprompt;
 161: MSG     supprompt;
 162: MSG     profile;
 163: 
 164: /* built in names */
 165: NAMNOD      fngnod;
 166: NAMNOD      ifsnod;
 167: NAMNOD      homenod;
 168: NAMNOD      mailnod;
 169: NAMNOD      pathnod;
 170: NAMNOD      ps1nod;
 171: NAMNOD      ps2nod;
 172: 
 173: /* special names */
 174: MSG     flagadr;
 175: STRING      cmdadr;
 176: STRING      exitadr;
 177: STRING      dolladr;
 178: STRING      pcsadr;
 179: STRING      pidadr;
 180: 
 181: MSG     defpath;
 182: 
 183: /* names always present */
 184: MSG     mailname;
 185: MSG     homename;
 186: MSG     pathname;
 187: MSG     fngname;
 188: MSG     ifsname;
 189: MSG     ps1name;
 190: MSG     ps2name;
 191: 
 192: /* transput */
 193: CHAR        tmpout[];
 194: STRING      tmpnam;
 195: INT     serial;
 196: #define     TMPNAM 7
 197: FILE        standin;
 198: #define input   (standin->fdes)
 199: #define eof (standin->feof)
 200: INT     peekc;
 201: STRING      comdiv;
 202: MSG     devnull;
 203: 
 204: /* flags */
 205: #define     noexec  01
 206: #define     intflg  02
 207: #define     prompt  04
 208: #define     setflg  010
 209: #define     errflg  020
 210: #define     ttyflg  040
 211: #define     forked  0100
 212: #define     oneflg  0200
 213: #define     rshflg  0400
 214: #define     waiting 01000
 215: #define     stdflg  02000
 216: #define     execpr  04000
 217: #define     readpr  010000
 218: #define     keyflg  020000
 219: #define     batchflg    040000
 220: INT     flags;
 221: 
 222: /* error exits from various parts of shell */
 223: #include    <setjmp.h>
 224: jmp_buf     subshell;
 225: jmp_buf     errshell;
 226: jmp_buf     INTbuf;
 227: 
 228: /* fault handling */
 229: #include    "brkincr.h"
 230: POS     brkincr;
 231: 
 232: #define MINTRAP 0
 233: #define MAXTRAP 32
 234: 
 235: #define INTR    2
 236: #define QUIT    3
 237: #define MEMF    11
 238: #define ALARM   14
 239: #define KILL    15
 240: #define TRAPSET 2
 241: #define SIGSET  4
 242: #define SIGMOD  8
 243: 
 244: VOID        fault();
 245: BOOL        trapnote;
 246: STRING      trapcom[];
 247: BOOL        trapflg[];
 248: BOOL        trapjmp[];
 249: 
 250: /* name tree and words */
 251: STRING      *environ;
 252: CHAR        numbuf[];
 253: MSG     export;
 254: MSG     readonly;
 255: 
 256: /* execflgs */
 257: INT     exitval;
 258: BOOL        execbrk;
 259: INT     loopcnt;
 260: INT     breakcnt;
 261: 
 262: /* messages */
 263: MSG     mailmsg;
 264: MSG     coredump;
 265: MSG     badopt;
 266: MSG     badparam;
 267: MSG     badsub;
 268: MSG     nospace;
 269: MSG     notfound;
 270: MSG     badtrap;
 271: MSG     baddir;
 272: MSG     badshift;
 273: MSG     illegal;
 274: MSG     restricted;
 275: MSG     execpmsg;
 276: MSG     notid;
 277: MSG     wtfailed;
 278: MSG     badcreate;
 279: MSG     piperr;
 280: MSG     badopen;
 281: MSG     badnum;
 282: MSG     arglist;
 283: MSG     txtbsy;
 284: MSG     toobig;
 285: MSG     badexec;
 286: MSG     notfound;
 287: MSG     badfile;
 288: 
 289: address end[];
 290: 
 291: #include    "ctype.h"

Defined variables

errshell defined in line 225; used 2 times
subshell defined in line 224; used 2 times

Defined macros

ADR defined in line 135; used 11 times
ALARM defined in line 238; used 2 times
BLK defined in line 132; used 9 times
BYT defined in line 133; never used
COMMSK defined in line 22; used 1 times
ENDARGS defined in line 74; used 7 times
ERROR defined in line 9; used 1 times
FAMP defined in line 17; used 4 times
FCMD defined in line 21; never used
FINT defined in line 16; used 3 times
FPCL defined in line 20; used 2 times
FPIN defined in line 18; used 2 times
FPOU defined in line 19; used 5 times
FPRS defined in line 15; used 2 times
INIO defined in line 59; used 2 times
INPIPE defined in line 70; used 5 times
IOAPP defined in line 67; used 2 times
IODOC defined in line 65; used 4 times
IOMOV defined in line 68; used 2 times
IOPUT defined in line 66; used 2 times
IORDW defined in line 69; used 1 times
IOUFD defined in line 64; used 2 times
KILL defined in line 239; used 1 times
MAXTRAP defined in line 233; used 7 times
MEMF defined in line 237; used 2 times
MINTRAP defined in line 232; used 1 times
OTIO defined in line 60; used 2 times
OTPIPE defined in line 71; used 5 times
QUIT defined in line 236; used 2 times
SIGFAIL defined in line 11; used 1 times
SIGFLG defined in line 12; used 1 times
SIGMOD defined in line 242; used 4 times
STK defined in line 134; used 1 times
SYNBAD defined in line 10; used 1 times
SYSBREAK defined in line 47; used 1 times
SYSCD defined in line 39; used 2 times
SYSCONT defined in line 46; used 1 times
SYSDOT defined in line 49; used 1 times
SYSEVAL defined in line 48; used 1 times
SYSEXEC defined in line 40; used 1 times
SYSEXIT defined in line 43; used 1 times
SYSLOGIN defined in line 41; used 1 times
SYSNULL defined in line 53; used 1 times
SYSRDONLY defined in line 50; used 1 times
SYSREAD defined in line 54; used 1 times
SYSSET defined in line 38; used 1 times
SYSSHFT defined in line 44; used 1 times
SYSTIMES defined in line 51; used 1 times
SYSTRAP defined in line 42; used 1 times
SYSTST defined in line 55; never used
SYSUMASK defined in line 56; used 1 times
SYSWAIT defined in line 45; used 1 times
SYSXPORT defined in line 52; used 1 times
TAND defined in line 32; used 1 times
TCOM defined in line 24; used 2 times
TFIL defined in line 26; used 1 times
TFOR defined in line 35; used 1 times
TFORK defined in line 34; used 1 times
TIF defined in line 28; used 1 times
TLST defined in line 27; used 1 times
TMPNAM defined in line 196; used 1 times
TORF defined in line 33; used 1 times
TPAR defined in line 25; used 1 times
TRAPSET defined in line 240; used 4 times
TSW defined in line 31; used 1 times
TUN defined in line 30; used 1 times
TWH defined in line 29; used 2 times
USERIO defined in line 63; used 1 times
alloc defined in line 82; used 4 times
assert defined in line 117; used 1 times
attrib defined in line 112; used 2 times
batchflg defined in line 219; never used
closepipe defined in line 114; used 2 times
eof defined in line 199; used 5 times
eq defined in line 115; used 4 times
errflg defined in line 209; used 3 times
execpr defined in line 216; used 5 times
forked defined in line 211; used 3 times
input defined in line 198; used 16 times
intflg defined in line 206; used 2 times
keyflg defined in line 218; used 2 times
max defined in line 116; used 1 times
noexec defined in line 205; used 4 times
oneflg defined in line 212; used 4 times
readpr defined in line 217; used 3 times
round defined in line 113; used 4 times
rshflg defined in line 213; used 5 times
setflg defined in line 208; used 2 times
stdflg defined in line 215; used 4 times
waiting defined in line 214; used 1 times

Usage of this include

Last modified: 1985-03-20
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 318
Valid CSS Valid XHTML 1.0 Strict