1 /* Copyright (c) 1979 Regents of the University of California */ 2 3 /* sccsid[] = "@(#)h00vars.h 1.2 01/16/81"; */ 4 5 #include <stdio.h> 6 7 #define PXPFILE "pmon.out" 8 #define BITSPERBYTE 8 9 #define BITSPERLONG (BITSPERBYTE * sizeof(long)) 10 #define HZ 60 11 #define TRUE 1 12 #define FALSE 0 13 #define MAXLVL 20 14 #define MAXERRS 75 15 #define NAMSIZ 76 16 #define MAXFILES 32 17 #define PREDEF 2 18 #define STDLVL ((struct iorec *)(0x7ffffff1)) 19 #define GLVL ((struct iorec *)(0x7ffffff0)) 20 #define FILNIL ((struct iorec *)(0)) 21 #define INPUT ((struct iorec *)(&input)) 22 #define OUTPUT ((struct iorec *)(&output)) 23 #define ERR ((struct iorec *)(&_err)) 24 25 /* 26 * runtime display structure 27 */ 28 struct display { 29 char *ap; 30 char *fp; 31 }; 32 33 /* 34 * formal routine structure 35 */ 36 struct formalrtn { 37 long (*entryaddr)(); 38 long cbn; 39 struct display disp[2*MAXLVL]; 40 }; 41 42 struct errentry { 43 long (*entryaddr)(); 44 }; 45 46 47 /* 48 * program variables 49 */ 50 extern struct display _disply[MAXLVL];/* runtime display */ 51 extern int _argc; /* number of passed args */ 52 extern char **_argv; /* values of passed args */ 53 extern long _stlim; /* statement limit */ 54 extern long _stcnt; /* statement count */ 55 extern char *_maxptr; /* maximum valid pointer */ 56 extern char *_minptr; /* minimum valid pointer */ 57 extern long _pcpcount[]; /* pxp buffer */ 58 extern struct errentry _entry[MAXERRS];/* error entry catches */ 59 60 /* 61 * file structures 62 */ 63 struct iorechd { 64 char *fileptr; /* ptr to file window */ 65 long lcount; /* number of lines printed */ 66 long llimit; /* maximum number of text lines */ 67 FILE *fbuf; /* FILE ptr */ 68 struct iorec *fchain; /* chain to next file */ 69 struct iorec *flev; /* ptr to associated file variable */ 70 char *pfname; /* ptr to name of file */ 71 short funit; /* file status flags */ 72 short fblk; /* index into active file table */ 73 long fsize; /* size of elements in the file */ 74 char fname[NAMSIZ]; /* name of associated UNIX file */ 75 }; 76 77 struct iorec { 78 char *fileptr; /* ptr to file window */ 79 long lcount; /* number of lines printed */ 80 long llimit; /* maximum number of text lines */ 81 FILE *fbuf; /* FILE ptr */ 82 struct iorec *fchain; /* chain to next file */ 83 struct iorec *flev; /* ptr to associated file variable */ 84 char *pfname; /* ptr to name of file */ 85 short funit; /* file status flags */ 86 short fblk; /* index into active file table */ 87 long fsize; /* size of elements in the file */ 88 char fname[NAMSIZ]; /* name of associated UNIX file */ 89 char buf[BUFSIZ]; /* I/O buffer */ 90 char window[1]; /* file window element */ 91 }; 92 93 /* 94 * unit flags 95 */ 96 #define FDEF 0x80 /* 1 => reserved file name */ 97 #define FTEXT 0x40 /* 1 => text file, process EOLN */ 98 #define FWRITE 0x20 /* 1 => open for writing */ 99 #define FREAD 0x10 /* 1 => open for reading */ 100 #define TEMP 0x08 /* 1 => temporary file */ 101 #define SYNC 0x04 /* 1 => window is out of sync */ 102 #define EOLN 0x02 /* 1 => at end of line */ 103 #define EOFF 0x01 /* 1 => at end of file */ 104 105 /* 106 * file routines 107 */ 108 extern struct iorec *GETNAME(); 109 extern char *MKTEMP(); 110 extern char *PALLOC(); 111 112 /* 113 * file record variables 114 */ 115 extern struct iorechd _fchain; /* head of active file chain */ 116 extern struct iorec *_actfile[]; /* table of active files */ 117 extern long _filefre; /* last used entry in _actfile */ 118 119 /* 120 * standard files 121 */ 122 extern struct iorechd input; 123 extern struct iorechd output; 124 extern struct iorechd _err; 125