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