FCALL and FRTN no longer return values
[unix-history] / usr / src / usr.bin / pascal / libpc / h00vars.h
CommitLineData
e9664031
KM
1/* Copyright (c) 1979 Regents of the University of California */
2
492cc5d3 3/* sccsid[] = "@(#)h00vars.h 1.5 %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
492cc5d3 21#ifdef VAX
e9664031
KM
22#define STDLVL ((struct iorec *)(0x7ffffff1))
23#define GLVL ((struct iorec *)(0x7ffffff0))
492cc5d3
KM
24#else
25#define STDLVL ((struct iorec *)(0xfff1))
26#define GLVL ((struct iorec *)(0xfff0))
27#endif VAX
e9664031
KM
28#define FILNIL ((struct iorec *)(0))
29#define INPUT ((struct iorec *)(&input))
30#define OUTPUT ((struct iorec *)(&output))
31#define ERR ((struct iorec *)(&_err))
492cc5d3 32typedef enum {FALSE, TRUE} bool;
e9664031
KM
33
34/*
35 * runtime display structure
36 */
37struct display {
38 char *ap;
39 char *fp;
40};
41
42/*
43 * formal routine structure
44 */
45struct formalrtn {
46 long (*entryaddr)();
47 long cbn;
48 struct display disp[2*MAXLVL];
49};
50
93ac5838
KM
51struct errentry {
52 long (*entryaddr)();
53};
54
55
e9664031
KM
56/*
57 * program variables
58 */
59extern struct display _disply[MAXLVL];/* runtime display */
60extern int _argc; /* number of passed args */
61extern char **_argv; /* values of passed args */
62extern long _stlim; /* statement limit */
63extern long _stcnt; /* statement count */
b91a3590 64extern long _seed; /* random number seed */
e9664031
KM
65extern char *_maxptr; /* maximum valid pointer */
66extern char *_minptr; /* minimum valid pointer */
67extern long _pcpcount[]; /* pxp buffer */
93ac5838 68extern struct errentry _entry[MAXERRS];/* error entry catches */
e9664031
KM
69
70/*
71 * file structures
72 */
73struct 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 */
82 short fblk; /* index into active file table */
83 long fsize; /* size of elements in the file */
84 char fname[NAMSIZ]; /* name of associated UNIX file */
85};
86
87struct 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 */
96 short fblk; /* index into active file table */
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 */
119extern struct iorec *GETNAME();
120extern char *MKTEMP();
121extern char *PALLOC();
122
123/*
124 * file record variables
125 */
126extern struct iorechd _fchain; /* head of active file chain */
127extern struct iorec *_actfile[]; /* table of active files */
128extern long _filefre; /* last used entry in _actfile */
129
130/*
131 * standard files
132 */
133extern struct iorechd input;
134extern struct iorechd output;
135extern struct iorechd _err;