11719Smckusick /* Copyright (c) 1979 Regents of the University of California */ 21719Smckusick 3*2177Smckusic /* sccsid[] = "@(#)h00vars.h 1.2 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 14*2177Smckusic #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 42*2177Smckusic struct errentry { 43*2177Smckusic long (*entryaddr)(); 44*2177Smckusic }; 45*2177Smckusic 46*2177Smckusic 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 */ 551719Smckusick extern char *_maxptr; /* maximum valid pointer */ 561719Smckusick extern char *_minptr; /* minimum valid pointer */ 571719Smckusick extern long _pcpcount[]; /* pxp buffer */ 58*2177Smckusic extern struct errentry _entry[MAXERRS];/* error entry catches */ 591719Smckusick 601719Smckusick /* 611719Smckusick * file structures 621719Smckusick */ 631719Smckusick struct iorechd { 641719Smckusick char *fileptr; /* ptr to file window */ 651719Smckusick long lcount; /* number of lines printed */ 661719Smckusick long llimit; /* maximum number of text lines */ 671719Smckusick FILE *fbuf; /* FILE ptr */ 681719Smckusick struct iorec *fchain; /* chain to next file */ 691719Smckusick struct iorec *flev; /* ptr to associated file variable */ 701719Smckusick char *pfname; /* ptr to name of file */ 711719Smckusick short funit; /* file status flags */ 721719Smckusick short fblk; /* index into active file table */ 731719Smckusick long fsize; /* size of elements in the file */ 741719Smckusick char fname[NAMSIZ]; /* name of associated UNIX file */ 751719Smckusick }; 761719Smckusick 771719Smckusick struct iorec { 781719Smckusick char *fileptr; /* ptr to file window */ 791719Smckusick long lcount; /* number of lines printed */ 801719Smckusick long llimit; /* maximum number of text lines */ 811719Smckusick FILE *fbuf; /* FILE ptr */ 821719Smckusick struct iorec *fchain; /* chain to next file */ 831719Smckusick struct iorec *flev; /* ptr to associated file variable */ 841719Smckusick char *pfname; /* ptr to name of file */ 851719Smckusick short funit; /* file status flags */ 861719Smckusick short fblk; /* index into active file table */ 871719Smckusick long fsize; /* size of elements in the file */ 881719Smckusick char fname[NAMSIZ]; /* name of associated UNIX file */ 891719Smckusick char buf[BUFSIZ]; /* I/O buffer */ 901719Smckusick char window[1]; /* file window element */ 911719Smckusick }; 921719Smckusick 931719Smckusick /* 941719Smckusick * unit flags 951719Smckusick */ 961719Smckusick #define FDEF 0x80 /* 1 => reserved file name */ 971719Smckusick #define FTEXT 0x40 /* 1 => text file, process EOLN */ 981719Smckusick #define FWRITE 0x20 /* 1 => open for writing */ 991719Smckusick #define FREAD 0x10 /* 1 => open for reading */ 1001719Smckusick #define TEMP 0x08 /* 1 => temporary file */ 1011719Smckusick #define SYNC 0x04 /* 1 => window is out of sync */ 1021719Smckusick #define EOLN 0x02 /* 1 => at end of line */ 1031719Smckusick #define EOFF 0x01 /* 1 => at end of file */ 1041719Smckusick 1051719Smckusick /* 1061719Smckusick * file routines 1071719Smckusick */ 1081719Smckusick extern struct iorec *GETNAME(); 1091719Smckusick extern char *MKTEMP(); 1101719Smckusick extern char *PALLOC(); 1111719Smckusick 1121719Smckusick /* 1131719Smckusick * file record variables 1141719Smckusick */ 1151719Smckusick extern struct iorechd _fchain; /* head of active file chain */ 1161719Smckusick extern struct iorec *_actfile[]; /* table of active files */ 1171719Smckusick extern long _filefre; /* last used entry in _actfile */ 1181719Smckusick 1191719Smckusick /* 1201719Smckusick * standard files 1211719Smckusick */ 1221719Smckusick extern struct iorechd input; 1231719Smckusick extern struct iorechd output; 1241719Smckusick extern struct iorechd _err; 125