Commit | Line | Data |
---|---|---|
e9664031 KM |
1 | /* Copyright (c) 1979 Regents of the University of California */ |
2 | ||
a5e597c9 | 3 | /* sccsid[] = "@(#)h00vars.h 1.11 %G%"; */ |
e9664031 KM |
4 | |
5 | #include <stdio.h> | |
492cc5d3 | 6 | #include "whoami.h" |
e9664031 KM |
7 | |
8 | #define PXPFILE "pmon.out" | |
9 | #define BITSPERBYTE 8 | |
10 | #define BITSPERLONG (BITSPERBYTE * sizeof(long)) | |
492cc5d3 KM |
11 | #define LG2BITSBYTE 03 |
12 | #define MSKBITSBYTE 07 | |
13 | #define LG2BITSLONG 05 | |
14 | #define MSKBITSLONG 037 | |
e9664031 | 15 | #define HZ 60 |
e9664031 | 16 | #define MAXLVL 20 |
93ac5838 | 17 | #define MAXERRS 75 |
e9664031 KM |
18 | #define NAMSIZ 76 |
19 | #define MAXFILES 32 | |
20 | #define PREDEF 2 | |
a7012926 | 21 | #ifdef ADDR32 |
a5e597c9 | 22 | #ifndef tahoe |
e9664031 KM |
23 | #define STDLVL ((struct iorec *)(0x7ffffff1)) |
24 | #define GLVL ((struct iorec *)(0x7ffffff0)) | |
a5e597c9 KM |
25 | #else tahoe |
26 | #define STDLVL ((struct iorec *)(0xbffffff1)) | |
27 | #define GLVL ((struct iorec *)(0xbffffff0)) | |
28 | #endif tahoe | |
a7012926 KM |
29 | #endif ADDR32 |
30 | #ifdef ADDR16 | |
492cc5d3 KM |
31 | #define STDLVL ((struct iorec *)(0xfff1)) |
32 | #define GLVL ((struct iorec *)(0xfff0)) | |
a7012926 | 33 | #endif ADDR16 |
e9664031 KM |
34 | #define FILNIL ((struct iorec *)(0)) |
35 | #define INPUT ((struct iorec *)(&input)) | |
36 | #define OUTPUT ((struct iorec *)(&output)) | |
37 | #define ERR ((struct iorec *)(&_err)) | |
492cc5d3 | 38 | typedef enum {FALSE, TRUE} bool; |
e9664031 KM |
39 | |
40 | /* | |
41 | * runtime display structure | |
42 | */ | |
43 | struct display { | |
44 | char *ap; | |
45 | char *fp; | |
46 | }; | |
47 | ||
48 | /* | |
49 | * formal routine structure | |
50 | */ | |
51 | struct formalrtn { | |
f630942b KM |
52 | long (*fentryaddr)(); /* formal entry point */ |
53 | long fbn; /* block number of function */ | |
54 | struct display fdisp[ MAXLVL ]; /* saved at first passing */ | |
e9664031 KM |
55 | }; |
56 | ||
57 | /* | |
58 | * program variables | |
59 | */ | |
60 | extern struct display _disply[MAXLVL];/* runtime display */ | |
61 | extern int _argc; /* number of passed args */ | |
62 | extern char **_argv; /* values of passed args */ | |
63 | extern long _stlim; /* statement limit */ | |
64 | extern long _stcnt; /* statement count */ | |
b91a3590 | 65 | extern long _seed; /* random number seed */ |
e9664031 KM |
66 | extern char *_maxptr; /* maximum valid pointer */ |
67 | extern char *_minptr; /* minimum valid pointer */ | |
68 | extern long _pcpcount[]; /* pxp buffer */ | |
69 | ||
70 | /* | |
71 | * file structures | |
72 | */ | |
73 | struct iorechd { | |
74 | char *fileptr; /* ptr to file window */ | |
75 | long lcount; /* number of lines printed */ | |
76 | long llimit; /* maximum number of text lines */ | |
77 | FILE *fbuf; /* FILE ptr */ | |
78 | struct iorec *fchain; /* chain to next file */ | |
79 | struct iorec *flev; /* ptr to associated file variable */ | |
80 | char *pfname; /* ptr to name of file */ | |
81 | short funit; /* file status flags */ | |
9ebeac9b | 82 | unsigned short fblk; /* index into active file table */ |
e9664031 KM |
83 | long fsize; /* size of elements in the file */ |
84 | char fname[NAMSIZ]; /* name of associated UNIX file */ | |
85 | }; | |
86 | ||
87 | struct iorec { | |
88 | char *fileptr; /* ptr to file window */ | |
89 | long lcount; /* number of lines printed */ | |
90 | long llimit; /* maximum number of text lines */ | |
91 | FILE *fbuf; /* FILE ptr */ | |
92 | struct iorec *fchain; /* chain to next file */ | |
93 | struct iorec *flev; /* ptr to associated file variable */ | |
94 | char *pfname; /* ptr to name of file */ | |
95 | short funit; /* file status flags */ | |
9ebeac9b | 96 | unsigned short fblk; /* index into active file table */ |
e9664031 KM |
97 | long fsize; /* size of elements in the file */ |
98 | char fname[NAMSIZ]; /* name of associated UNIX file */ | |
99 | char buf[BUFSIZ]; /* I/O buffer */ | |
100 | char window[1]; /* file window element */ | |
101 | }; | |
102 | ||
103 | /* | |
104 | * unit flags | |
105 | */ | |
1d9ef80b KM |
106 | #define SPEOLN 0x100 /* 1 => pseudo EOLN char read at EOF */ |
107 | #define FDEF 0x080 /* 1 => reserved file name */ | |
108 | #define FTEXT 0x040 /* 1 => text file, process EOLN */ | |
109 | #define FWRITE 0x020 /* 1 => open for writing */ | |
110 | #define FREAD 0x010 /* 1 => open for reading */ | |
111 | #define TEMP 0x008 /* 1 => temporary file */ | |
112 | #define SYNC 0x004 /* 1 => window is out of sync */ | |
113 | #define EOLN 0x002 /* 1 => at end of line */ | |
114 | #define EOFF 0x001 /* 1 => at end of file */ | |
e9664031 KM |
115 | |
116 | /* | |
117 | * file routines | |
118 | */ | |
119 | extern struct iorec *GETNAME(); | |
120 | extern char *MKTEMP(); | |
121 | extern char *PALLOC(); | |
122 | ||
123 | /* | |
124 | * file record variables | |
125 | */ | |
126 | extern struct iorechd _fchain; /* head of active file chain */ | |
127 | extern struct iorec *_actfile[]; /* table of active files */ | |
128 | extern long _filefre; /* last used entry in _actfile */ | |
129 | ||
130 | /* | |
131 | * standard files | |
132 | */ | |
133 | extern struct iorechd input; | |
134 | extern struct iorechd output; | |
135 | extern struct iorechd _err; | |
cbeb1e89 KM |
136 | |
137 | /* | |
138 | * seek pointer struct for TELL, SEEK extensions | |
139 | */ | |
140 | struct seekptr { | |
141 | long cnt; | |
142 | }; |