1 /* Copyright (c) 1979 Regents of the University of California */
2 
3 /* sccsid[] = "@(#)h00vars.h 1.3 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 long		_seed;		/* random number seed */
56 extern char		*_maxptr;	/* maximum valid pointer */
57 extern char		*_minptr;	/* minimum valid pointer */
58 extern long		_pcpcount[];	/* pxp buffer */
59 extern struct errentry	_entry[MAXERRS];/* error entry catches */
60 
61 /*
62  * file structures
63  */
64 struct iorechd {
65 	char		*fileptr;	/* ptr to file window */
66 	long		lcount;		/* number of lines printed */
67 	long		llimit;		/* maximum number of text lines */
68 	FILE		*fbuf;		/* FILE ptr */
69 	struct iorec	*fchain;	/* chain to next file */
70 	struct iorec	*flev;		/* ptr to associated file variable */
71 	char		*pfname;	/* ptr to name of file */
72 	short		funit;		/* file status flags */
73 	short		fblk;		/* index into active file table */
74 	long		fsize;		/* size of elements in the file */
75 	char		fname[NAMSIZ];	/* name of associated UNIX file */
76 };
77 
78 struct iorec {
79 	char		*fileptr;	/* ptr to file window */
80 	long		lcount;		/* number of lines printed */
81 	long		llimit;		/* maximum number of text lines */
82 	FILE		*fbuf;		/* FILE ptr */
83 	struct iorec	*fchain;	/* chain to next file */
84 	struct iorec	*flev;		/* ptr to associated file variable */
85 	char		*pfname;	/* ptr to name of file */
86 	short		funit;		/* file status flags */
87 	short		fblk;		/* index into active file table */
88 	long		fsize;		/* size of elements in the file */
89 	char		fname[NAMSIZ];	/* name of associated UNIX file */
90 	char		buf[BUFSIZ];	/* I/O buffer */
91 	char		window[1];	/* file window element */
92 };
93 
94 /*
95  * unit flags
96  */
97 #define	FDEF	0x80	/* 1 => reserved file name */
98 #define	FTEXT	0x40	/* 1 => text file, process EOLN */
99 #define	FWRITE	0x20	/* 1 => open for writing */
100 #define	FREAD	0x10	/* 1 => open for reading */
101 #define	TEMP	0x08	/* 1 => temporary file */
102 #define	SYNC	0x04	/* 1 => window is out of sync */
103 #define	EOLN	0x02	/* 1 => at end of line */
104 #define	EOFF	0x01	/* 1 => at end of file */
105 
106 /*
107  * file routines
108  */
109 extern struct iorec	*GETNAME();
110 extern char		*MKTEMP();
111 extern char		*PALLOC();
112 
113 /*
114  * file record variables
115  */
116 extern struct iorechd	_fchain;	/* head of active file chain */
117 extern struct iorec	*_actfile[];	/* table of active files */
118 extern long		_filefre;	/* last used entry in _actfile */
119 
120 /*
121  * standard files
122  */
123 extern struct iorechd	input;
124 extern struct iorechd	output;
125 extern struct iorechd	_err;
126