|
|
1.1 root 1:
2: static char *sccsid = "@(#)data.c 34.3 10/21/80";
3:
4: #include "global.h"
5: #include "gtabs.h"
6: #include "structs.h"
7: #include <stdio.h>
8:
9: /*char firstalloc[NBPG] = { 'x' }; /* first thing allocated in file */
10: lispval lispsys[SIGNIF]; /* lisp data used by system */
11:
12: lispval gftab[GFTABLEN]; /* global function table for interpreter */
13:
14: lispval gctab[GCTABLEN] = /* global constant table for interpreter */
15: {nil,0,SMALL(-1),SMALL(0),SMALL(1),SMALL(2),SMALL(3),SMALL(4)};
16:
17:
18: /* Port definitions *****************************************************/
19: FILE *piport, /* standard input port */
20: *poport, /* standard output port */
21: *errport, /* port for error messages */
22: *rdrport, /* temporary port for readr */
23: *proport; /* port for protocal */
24: int lineleng = 80; /* line length desired */
25: int rlevel; /* used to indicate depth of recursion
26: in reader. No longer really necessary */
27: char keybin = FALSE; /* logical flag: using keyboard */
28: char protflag = FALSE; /* logical flag: want protocall */
29: char rbktf; /* logical flag: ] mode */
30:
31: lispval ioname[_NFILE]; /* strings of names of files currently open */
32:
33: /* name stack ***********************************************************/
34: struct argent *orgnp; /* used by top level to reset to start */
35: struct argent *namptr, /* temporary pointer */
36: *nplim; /* don't have this = np */
37: struct nament *bnp, /* top of bind stack */
38: *orgbnp, /* absolute bottom of ""*/
39: *bnplim; /* absolute top of "" */
40:
41:
42:
43: /* hashing things *******************************************************/
44: int hash; /* set by ratom */
45: int atmlen; /* length of atom including final null */
46:
47:
48: /* big string buffer for whomever needs it ******************************/
49: char strbuf[STRBLEN];
50: char *endstrb = strbuf + STRBLEN - 1 ;
51:
52: /* set by sstatus commands */
53: int uctolc = 0; /* when set, uc chars in atoms go to lc */
54: int dmpmode = 413; /* default mode for dumplisp
55: (note this is decimal not octal) */
56:
57: /* break and error declarations *****************************************/
58: int depth = 0; /* depth of nested breaks */
59: lispval contval; /* the value being returned up */
60: int retval; /* used by each error/prog call */
61: int rsetsw; /* when set, trace frames built */
62: int bcdtrsw; /* when set with rsetsw, trace bcd too */
63:
64:
65: /* exception handling stuff *********************************************/
66: int exception; /* true if an exception is pending */
67: int sigintcnt; /* number of SIGINT's pending */
68:
69: /* current state of the hole (for fasling into) *************************/
70: int curhbeg; /* next location to fasl into */
71: int usehole; /* if TRUE, fasl tries to use hole */
72:
73: /* other stuff **********************************************************/
74: lispval ftemp,vtemp,argptr,ttemp; /* temporaries: use briefly */
75: int itemp;
76: lispval sigacts[16]; /* for catching interrupts */
77: int sigstruck,sigdelay; /* for catching interrupts */
78: lispval stattab[16]; /* miscelleneous options */
79:
80: /* interpreter globals */
81:
82: int lctrace;
83: int fvirgin;
84: int GCtime;
85: int errp; /* where are lying through our teeth. This
86: is a pointer to inside a function. */
87:
88:
89: /* global pointers to the transfer tables */
90:
91:
92: struct trtab *trhead= /* first in list of transfer tables */
93: (struct trtab *) 0;
94: struct trent *trcur; /* next entry to allocate */
95: int trleft = 0; /* number of entries left in current table */
96:
97: /* globals from sysat.c */
98:
99: int *beginsweep; /* place for sweeper to begin */
100: int initflag = TRUE; /* inhibit gcing initially */
101: int tgcthresh = 15;
102:
103: /* globals from rlc */
104:
105: int usehole; /* TRUE if allocator should consider the
106: hole for allocation */
107:
108: /* global used in io.c */
109:
110: lispval lastrtab;
111:
112: /* globals from [VT]alloc.c */
113:
114:
115: struct heads header[TTSIZE];
116: int *bind_lists = (int *) CNIL; /* lisp data for compiled code */
117:
118:
119: struct types
120: atom_str =
121: {
122: (char *)CNIL, 0, ATOMSPP, ATOM, 5,
123: &atom_items, &atom_pages, &atom_name,
124: (struct heads *) CNIL
125: },
126: strng_str =
127: {
128: (char *) CNIL, 0, STRSPP, STRNG, 1,
129: &str_items, &str_pages, &str_name,
130: (struct heads *) CNIL
131: },
132: int_str =
133: {
134: (char *) CNIL, 0, INTSPP, INT, 1,
135: &int_items, &int_pages, &int_name,
136: (struct heads *) CNIL
137: },
138: dtpr_str =
139: {
140: (char *) CNIL, 0, DTPRSPP, DTPR, 2,
141: &dtpr_items, &dtpr_pages, &dtpr_name,
142: (struct heads *) CNIL
143: },
144: doub_str =
145: {
146: (char *) CNIL, 0, DOUBSPP, DOUB, 2,
147: &doub_items, &doub_pages, &doub_name,
148: (struct heads *) CNIL
149: },
150: array_str =
151: {
152: (char *) CNIL, 0, ARRAYSPP, ARRAY, 5,
153: &array_items, &array_pages, &array_name,
154: (struct heads *) CNIL
155: },
156: sdot_str =
157: {
158: (char *) CNIL, 0, SDOTSPP, SDOT, 2,
159: &sdot_items, &sdot_pages, &sdot_name,
160: (struct heads *) CNIL
161: },
162: val_str =
163: {
164: (char *) CNIL, 0, VALSPP, VALUE, 1,
165: &val_items, &val_pages, &val_name,
166: (struct heads *) CNIL
167: },
168: funct_str =
169: {
170: (char *) CNIL, 0, BCDSPP, BCD, 2,
171: &funct_items, &funct_pages, &funct_name,
172: (struct heads *) CNIL
173: },
174: hunk_str[7] =
175: {
176: {
177: (char *) CNIL, 0, HUNK2SPP, HUNK2, 2,
178: &hunk_items[0], &hunk_pages[0], &hunk_name[0],
179: (struct heads *) CNIL
180: },
181: {
182: (char *) CNIL, 0, HUNK4SPP, HUNK4, 4,
183: &hunk_items[1], &hunk_pages[1], &hunk_name[1],
184: (struct heads *) CNIL
185: },
186: {
187: (char *) CNIL, 0, HUNK8SPP, HUNK8, 8,
188: &hunk_items[2], &hunk_pages[2], &hunk_name[2],
189: (struct heads *) CNIL
190: },
191: {
192: (char *) CNIL, 0, HUNK16SPP, HUNK16, 16,
193: &hunk_items[3], &hunk_pages[3], &hunk_name[3],
194: (struct heads *) CNIL
195: },
196: {
197: (char *) CNIL, 0, HUNK32SPP, HUNK32, 32,
198: &hunk_items[4], &hunk_pages[4], &hunk_name[4],
199: (struct heads *) CNIL
200: },
201: {
202: (char *) CNIL, 0, HUNK64SPP, HUNK64, 64,
203: &hunk_items[5], &hunk_pages[5], &hunk_name[5],
204: (struct heads *) CNIL
205: },
206: {
207: (char *) CNIL, 0, HUNK128SPP, HUNK128, 128,
208: &hunk_items[6], &hunk_pages[6], &hunk_name[6],
209: (struct heads *) CNIL
210: }
211: };
212:
213: int hashtop = HASHTOP;
214: int xcycle = 0; /* used by xsbrk */
215: struct atom *hasht[HASHTOP];
216: lispval datalim; /* pointer to next location to allocate */
217:
218: char typetable[TTSIZE] = {UNBO,ATOM,PORT,INT,INT,INT,INT,INT,INT,INT,INT,INT,INT,INT,INT,INT,INT,INT,INT};
219:
220: /* this must be the last thing allocated in this file */
221: #ifdef VMS
222: char *lsbrkpnt = (char *)0;
223: char zfreespace[FREESIZE];
224: #else
225: char lsbrkpnt,zfreespace;
226: #endif
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.