|
|
1.1 ! root 1: /*- ! 2: * Copyright (c) 1979 The Regents of the University of California. ! 3: * All rights reserved. ! 4: * ! 5: * Redistribution and use in source and binary forms are permitted ! 6: * provided that: (1) source distributions retain this entire copyright ! 7: * notice and comment, and (2) distributions including binaries display ! 8: * the following acknowledgement: ``This product includes software ! 9: * developed by the University of California, Berkeley and its contributors'' ! 10: * in the documentation or other materials provided with the distribution ! 11: * and in all advertising materials mentioning features or use of this ! 12: * software. Neither the name of the University nor the names of its ! 13: * contributors may be used to endorse or promote products derived ! 14: * from this software without specific prior written permission. ! 15: * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR ! 16: * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED ! 17: * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ! 18: * ! 19: * @(#)h00vars.h 1.12 (Berkeley) 4/9/90 ! 20: */ ! 21: ! 22: #include <stdio.h> ! 23: #include "whoami.h" ! 24: ! 25: #define PXPFILE "pmon.out" ! 26: #define BITSPERBYTE 8 ! 27: #define BITSPERLONG (BITSPERBYTE * sizeof(long)) ! 28: #define LG2BITSBYTE 03 ! 29: #define MSKBITSBYTE 07 ! 30: #define LG2BITSLONG 05 ! 31: #define MSKBITSLONG 037 ! 32: #define HZ 60 ! 33: #define MAXLVL 20 ! 34: #define MAXERRS 75 ! 35: #define NAMSIZ 76 ! 36: #define MAXFILES 32 ! 37: #define PREDEF 2 ! 38: #ifdef ADDR32 ! 39: #ifndef tahoe ! 40: #define STDLVL ((struct iorec *)(0x7ffffff1)) ! 41: #define GLVL ((struct iorec *)(0x7ffffff0)) ! 42: #else tahoe ! 43: #define STDLVL ((struct iorec *)(0xbffffff1)) ! 44: #define GLVL ((struct iorec *)(0xbffffff0)) ! 45: #endif tahoe ! 46: #endif ADDR32 ! 47: #ifdef ADDR16 ! 48: #define STDLVL ((struct iorec *)(0xfff1)) ! 49: #define GLVL ((struct iorec *)(0xfff0)) ! 50: #endif ADDR16 ! 51: #define FILNIL ((struct iorec *)(0)) ! 52: #define INPUT ((struct iorec *)(&input)) ! 53: #define OUTPUT ((struct iorec *)(&output)) ! 54: #define ERR ((struct iorec *)(&_err)) ! 55: typedef enum {FALSE, TRUE} bool; ! 56: ! 57: /* ! 58: * runtime display structure ! 59: */ ! 60: struct display { ! 61: char *ap; ! 62: char *fp; ! 63: }; ! 64: ! 65: /* ! 66: * formal routine structure ! 67: */ ! 68: struct formalrtn { ! 69: long (*fentryaddr)(); /* formal entry point */ ! 70: long fbn; /* block number of function */ ! 71: struct display fdisp[ MAXLVL ]; /* saved at first passing */ ! 72: }; ! 73: ! 74: /* ! 75: * program variables ! 76: */ ! 77: extern struct display _disply[MAXLVL];/* runtime display */ ! 78: extern int _argc; /* number of passed args */ ! 79: extern char **_argv; /* values of passed args */ ! 80: extern long _stlim; /* statement limit */ ! 81: extern long _stcnt; /* statement count */ ! 82: extern long _seed; /* random number seed */ ! 83: extern char *_maxptr; /* maximum valid pointer */ ! 84: extern char *_minptr; /* minimum valid pointer */ ! 85: extern long _pcpcount[]; /* pxp buffer */ ! 86: ! 87: /* ! 88: * file structures ! 89: */ ! 90: struct iorechd { ! 91: char *fileptr; /* ptr to file window */ ! 92: long lcount; /* number of lines printed */ ! 93: long llimit; /* maximum number of text lines */ ! 94: FILE *fbuf; /* FILE ptr */ ! 95: struct iorec *fchain; /* chain to next file */ ! 96: struct iorec *flev; /* ptr to associated file variable */ ! 97: char *pfname; /* ptr to name of file */ ! 98: short funit; /* file status flags */ ! 99: unsigned short fblk; /* index into active file table */ ! 100: long fsize; /* size of elements in the file */ ! 101: char fname[NAMSIZ]; /* name of associated UNIX file */ ! 102: }; ! 103: ! 104: struct iorec { ! 105: char *fileptr; /* ptr to file window */ ! 106: long lcount; /* number of lines printed */ ! 107: long llimit; /* maximum number of text lines */ ! 108: FILE *fbuf; /* FILE ptr */ ! 109: struct iorec *fchain; /* chain to next file */ ! 110: struct iorec *flev; /* ptr to associated file variable */ ! 111: char *pfname; /* ptr to name of file */ ! 112: short funit; /* file status flags */ ! 113: unsigned short fblk; /* index into active file table */ ! 114: long fsize; /* size of elements in the file */ ! 115: char fname[NAMSIZ]; /* name of associated UNIX file */ ! 116: char buf[BUFSIZ]; /* I/O buffer */ ! 117: char window[1]; /* file window element */ ! 118: }; ! 119: ! 120: /* ! 121: * unit flags ! 122: */ ! 123: #define SPEOLN 0x100 /* 1 => pseudo EOLN char read at EOF */ ! 124: #define FDEF 0x080 /* 1 => reserved file name */ ! 125: #define FTEXT 0x040 /* 1 => text file, process EOLN */ ! 126: #define FWRITE 0x020 /* 1 => open for writing */ ! 127: #define FREAD 0x010 /* 1 => open for reading */ ! 128: #define TEMP 0x008 /* 1 => temporary file */ ! 129: #define SYNC 0x004 /* 1 => window is out of sync */ ! 130: #define EOLN 0x002 /* 1 => at end of line */ ! 131: #define EOFF 0x001 /* 1 => at end of file */ ! 132: ! 133: /* ! 134: * file routines ! 135: */ ! 136: extern struct iorec *GETNAME(); ! 137: extern char *MKTEMP(); ! 138: extern char *PALLOC(); ! 139: ! 140: /* ! 141: * file record variables ! 142: */ ! 143: extern struct iorechd _fchain; /* head of active file chain */ ! 144: extern struct iorec *_actfile[]; /* table of active files */ ! 145: extern long _filefre; /* last used entry in _actfile */ ! 146: ! 147: /* ! 148: * standard files ! 149: */ ! 150: extern struct iorechd input; ! 151: extern struct iorechd output; ! 152: extern struct iorechd _err; ! 153: ! 154: /* ! 155: * seek pointer struct for TELL, SEEK extensions ! 156: */ ! 157: struct seekptr { ! 158: long cnt; ! 159: };
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.