11719Smckusick /* Copyright (c) 1979 Regents of the University of California */ 21719Smckusick 3*2178Smckusic /* sccsid[] = "@(#)h00vars.h 1.3 01/16/81"; */ 41719Smckusick 51719Smckusick #include <stdio.h> 61719Smckusick 71719Smckusick #define PXPFILE "pmon.out" 81719Smckusick #define BITSPERBYTE 8 91719Smckusick #define BITSPERLONG (BITSPERBYTE * sizeof(long)) 101719Smckusick #define HZ 60 111719Smckusick #define TRUE 1 121719Smckusick #define FALSE 0 131719Smckusick #define MAXLVL 20 142177Smckusic #define MAXERRS 75 151719Smckusick #define NAMSIZ 76 161719Smckusick #define MAXFILES 32 171719Smckusick #define PREDEF 2 181719Smckusick #define STDLVL ((struct iorec *)(0x7ffffff1)) 191719Smckusick #define GLVL ((struct iorec *)(0x7ffffff0)) 201719Smckusick #define FILNIL ((struct iorec *)(0)) 211719Smckusick #define INPUT ((struct iorec *)(&input)) 221719Smckusick #define OUTPUT ((struct iorec *)(&output)) 231719Smckusick #define ERR ((struct iorec *)(&_err)) 241719Smckusick 251719Smckusick /* 261719Smckusick * runtime display structure 271719Smckusick */ 281719Smckusick struct display { 291719Smckusick char *ap; 301719Smckusick char *fp; 311719Smckusick }; 321719Smckusick 331719Smckusick /* 341719Smckusick * formal routine structure 351719Smckusick */ 361719Smckusick struct formalrtn { 371719Smckusick long (*entryaddr)(); 381719Smckusick long cbn; 391719Smckusick struct display disp[2*MAXLVL]; 401719Smckusick }; 411719Smckusick 422177Smckusic struct errentry { 432177Smckusic long (*entryaddr)(); 442177Smckusic }; 452177Smckusic 462177Smckusic 471719Smckusick /* 481719Smckusick * program variables 491719Smckusick */ 501719Smckusick extern struct display _disply[MAXLVL];/* runtime display */ 511719Smckusick extern int _argc; /* number of passed args */ 521719Smckusick extern char **_argv; /* values of passed args */ 531719Smckusick extern long _stlim; /* statement limit */ 541719Smckusick extern long _stcnt; /* statement count */ 55*2178Smckusic extern long _seed; /* random number seed */ 561719Smckusick extern char *_maxptr; /* maximum valid pointer */ 571719Smckusick extern char *_minptr; /* minimum valid pointer */ 581719Smckusick extern long _pcpcount[]; /* pxp buffer */ 592177Smckusic extern struct errentry _entry[MAXERRS];/* error entry catches */ 601719Smckusick 611719Smckusick /* 621719Smckusick * file structures 631719Smckusick */ 641719Smckusick struct iorechd { 651719Smckusick char *fileptr; /* ptr to file window */ 661719Smckusick long lcount; /* number of lines printed */ 671719Smckusick long llimit; /* maximum number of text lines */ 681719Smckusick FILE *fbuf; /* FILE ptr */ 691719Smckusick struct iorec *fchain; /* chain to next file */ 701719Smckusick struct iorec *flev; /* ptr to associated file variable */ 711719Smckusick char *pfname; /* ptr to name of file */ 721719Smckusick short funit; /* file status flags */ 731719Smckusick short fblk; /* index into active file table */ 741719Smckusick long fsize; /* size of elements in the file */ 751719Smckusick char fname[NAMSIZ]; /* name of associated UNIX file */ 761719Smckusick }; 771719Smckusick 781719Smckusick struct iorec { 791719Smckusick char *fileptr; /* ptr to file window */ 801719Smckusick long lcount; /* number of lines printed */ 811719Smckusick long llimit; /* maximum number of text lines */ 821719Smckusick FILE *fbuf; /* FILE ptr */ 831719Smckusick struct iorec *fchain; /* chain to next file */ 841719Smckusick struct iorec *flev; /* ptr to associated file variable */ 851719Smckusick char *pfname; /* ptr to name of file */ 861719Smckusick short funit; /* file status flags */ 871719Smckusick short fblk; /* index into active file table */ 881719Smckusick long fsize; /* size of elements in the file */ 891719Smckusick char fname[NAMSIZ]; /* name of associated UNIX file */ 901719Smckusick char buf[BUFSIZ]; /* I/O buffer */ 911719Smckusick char window[1]; /* file window element */ 921719Smckusick }; 931719Smckusick 941719Smckusick /* 951719Smckusick * unit flags 961719Smckusick */ 971719Smckusick #define FDEF 0x80 /* 1 => reserved file name */ 981719Smckusick #define FTEXT 0x40 /* 1 => text file, process EOLN */ 991719Smckusick #define FWRITE 0x20 /* 1 => open for writing */ 1001719Smckusick #define FREAD 0x10 /* 1 => open for reading */ 1011719Smckusick #define TEMP 0x08 /* 1 => temporary file */ 1021719Smckusick #define SYNC 0x04 /* 1 => window is out of sync */ 1031719Smckusick #define EOLN 0x02 /* 1 => at end of line */ 1041719Smckusick #define EOFF 0x01 /* 1 => at end of file */ 1051719Smckusick 1061719Smckusick /* 1071719Smckusick * file routines 1081719Smckusick */ 1091719Smckusick extern struct iorec *GETNAME(); 1101719Smckusick extern char *MKTEMP(); 1111719Smckusick extern char *PALLOC(); 1121719Smckusick 1131719Smckusick /* 1141719Smckusick * file record variables 1151719Smckusick */ 1161719Smckusick extern struct iorechd _fchain; /* head of active file chain */ 1171719Smckusick extern struct iorec *_actfile[]; /* table of active files */ 1181719Smckusick extern long _filefre; /* last used entry in _actfile */ 1191719Smckusick 1201719Smckusick /* 1211719Smckusick * standard files 1221719Smckusick */ 1231719Smckusick extern struct iorechd input; 1241719Smckusick extern struct iorechd output; 1251719Smckusick extern struct iorechd _err; 126