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