|
|
1.1 ! root 1: #ifndef lint ! 2: static char *rcsid = ! 3: "$Header: data.c,v 1.7 83/09/12 14:17:15 sklower Exp $"; ! 4: #endif ! 5: ! 6: /* -[Sun Jun 19 14:41:00 1983 by jkf]- ! 7: * data.c $Locker: $ ! 8: * static storage declarations ! 9: * ! 10: * (c) copyright 1982, Regents of the University of California ! 11: */ ! 12: ! 13: ! 14: ! 15: #include "global.h" ! 16: #include "gtabs.h" ! 17: #include "structs.h" ! 18: #include "frame.h" ! 19: #include <stdio.h> ! 20: ! 21: /*char firstalloc[NBPG] = { 'x' }; /* first thing allocated in file */ ! 22: lispval lispsys[SIGNIF]; /* lisp data used by system */ ! 23: ! 24: lispval gftab[GFTABLEN]; /* global function table for interpreter */ ! 25: ! 26: lispval gctab[GCTABLEN] = /* global constant table for interpreter */ ! 27: {nil,0,SMALL(-1),SMALL(0),SMALL(1),SMALL(2),SMALL(3),SMALL(4)}; ! 28: ! 29: ! 30: /* Port definitions *****************************************************/ ! 31: FILE *piport, /* standard input port */ ! 32: *poport, /* standard output port */ ! 33: *errport, /* port for error messages */ ! 34: *rdrport, /* temporary port for readr */ ! 35: *proport; /* port for protocal */ ! 36: int lineleng = 80; /* line length desired */ ! 37: int rlevel; /* used to indicate depth of recursion ! 38: in reader. No longer really necessary */ ! 39: char keybin = FALSE; /* logical flag: using keyboard */ ! 40: char protflag = FALSE; /* logical flag: want protocall */ ! 41: char rbktf; /* logical flag: ] mode */ ! 42: ! 43: lispval ioname[_NFILE]; /* strings of names of files currently open */ ! 44: ! 45: /* name stack ***********************************************************/ ! 46: struct argent *orgnp; /* used by top level to reset to start */ ! 47: struct argent *namptr, /* temporary pointer */ ! 48: #ifndef NPINREG ! 49: *lbot, /* beginning of frame */ ! 50: *np, /* first free entry */ ! 51: #endif ! 52: *nplim; /* don't have this = np */ ! 53: struct nament *bnp, /* top of bind stack */ ! 54: *orgbnp, /* absolute bottom of ""*/ ! 55: *bnplim; /* absolute top of "" */ ! 56: ! 57: ! 58: ! 59: /* hashing things *******************************************************/ ! 60: int hash; /* set by ratom */ ! 61: int atmlen; /* length of atom including final null */ ! 62: ! 63: ! 64: /* big string buffer for whomever needs it ******************************/ ! 65: static char i_strbuf[600]; ! 66: char *strbuf = i_strbuf; ! 67: char *endstrb = i_strbuf + 599; ! 68: ! 69: /* in the case we can't use the C stack for extending automatics */ ! 70: #ifdef SPISFP ! 71: long xstack[16384]; ! 72: long *xsp; ! 73: long *exsp = xstack + ((sizeof xstack)/(sizeof (long))); ! 74: #endif ! 75: ! 76: /* strings needed by the two hand crafted atoms, nil and eof */ ! 77: char nilpname[] = "nil"; ! 78: char eofpname[] = "eof"; ! 79: ! 80: /* set by sstatus commands */ ! 81: int uctolc = 0; /* when set, uc chars in atoms go to lc */ ! 82: /* default mode for dumplisp ! 83: (note this is decimal not octal) */ ! 84: #if os_unisoft || os_unix_ts ! 85: int dmpmode = 410; ! 86: #else ! 87: int dmpmode = 413; ! 88: #endif ! 89: ! 90: /* break and error declarations *****************************************/ ! 91: int depth = 0; /* depth of nested breaks */ ! 92: lispval contval; /* the value being returned up */ ! 93: int retval; /* used by each error/prog call */ ! 94: lispval lispretval; /* used by non-local goto's */ ! 95: int rsetsw; /* when set, trace frames built */ ! 96: int bcdtrsw; /* when set with rsetsw, trace bcd too */ ! 97: int evalhcallsw; /* when set will not evalhook next eval */ ! 98: int funhcallsw; /* when set will not funcallhook next eval */ ! 99: ! 100: ! 101: /* exception handling stuff *********************************************/ ! 102: int exception; /* true if an exception is pending */ ! 103: int sigintcnt; /* number of SIGINT's pending */ ! 104: ! 105: /* current state of the hole (for fasling into) *************************/ ! 106: #ifndef HOLE ! 107: #define HOLE 0 ! 108: #endif ! 109: extern char holbeg[]; ! 110: char *curhbeg = holbeg; /* next location to fasl into */ ! 111: int usehole = HOLE; /* if TRUE, fasl tries to use hole */ ! 112: int holesize = HOLE; /* This avoids an ifdef in dumplisp */ ! 113: ! 114: /* other stuff **********************************************************/ ! 115: lispval ftemp,vtemp,argptr,ttemp; /* temporaries: use briefly */ ! 116: int itemp; ! 117: lispval sigacts[16]; /* for catching interrupts */ ! 118: int sigstruck,sigdelay; /* for catching interrupts */ ! 119: lispval stattab[16]; /* miscelleneous options */ ! 120: lispval Vprintsym; /* value is the symbol 'print' */ ! 121: ! 122: /* interpreter globals */ ! 123: ! 124: int lctrace; ! 125: int fvirgin = 1; /* set to 1 initially */ ! 126: int gctime; ! 127: struct frame *errp; /* stack of error frames */ ! 128: ! 129: ! 130: /* global pointers to the transfer tables */ ! 131: ! 132: ! 133: struct trtab *trhead= /* first in list of transfer tables */ ! 134: (struct trtab *) 0; ! 135: struct trent *trcur; /* next entry to allocate */ ! 136: int trleft = 0; /* number of entries left in current table */ ! 137: ! 138: /* globals from sysat.c */ ! 139: ! 140: int *beginsweep; /* place for sweeper to begin */ ! 141: int initflag = TRUE; /* inhibit gcing initially */ ! 142: int tgcthresh = 15; ! 143: int page_limit = (5 * TTSIZE) / 6; ! 144: int ttsize = TTSIZE; ! 145: ! 146: ! 147: /* global used in io.c */ ! 148: ! 149: lispval lastrtab; ! 150: ! 151: /* globals from [VT]alloc.c */ ! 152: ! 153: ! 154: char purepage[TTSIZE]; ! 155: int fakettsize = TTSIZE - 8; ! 156: int gcstrings; /* Do we mark and sweep strings? */ ! 157: int *bind_lists = (int *) CNIL; /* lisp data for compiled code */ ! 158: ! 159: ! 160: struct str_x str_current[2]; /* next free string spaces */ ! 161: ! 162: struct types ! 163: atom_str = ! 164: { ! 165: (char *)CNIL, 0, ATOMSPP, ATOM, 5, ! 166: &atom_items, &atom_pages, &atom_name, ! 167: (struct heads *) CNIL, (char *)CNIL ! 168: }, ! 169: strng_str = ! 170: { ! 171: (char *) CNIL, 0, STRSPP, STRNG, 128, ! 172: &str_items, &str_pages, &str_name, ! 173: (struct heads *) CNIL, (char *)CNIL ! 174: }, ! 175: int_str = ! 176: { ! 177: (char *) CNIL, 0, INTSPP, INT, 1, ! 178: &int_items, &int_pages, &int_name, ! 179: (struct heads *) CNIL, (char *)CNIL ! 180: }, ! 181: dtpr_str = ! 182: { ! 183: (char *) CNIL, 0, DTPRSPP, DTPR, 2, ! 184: &dtpr_items, &dtpr_pages, &dtpr_name, ! 185: (struct heads *) CNIL, (char *)CNIL ! 186: }, ! 187: doub_str = ! 188: { ! 189: (char *) CNIL, 0, DOUBSPP, DOUB, 2, ! 190: &doub_items, &doub_pages, &doub_name, ! 191: (struct heads *) CNIL, (char *)CNIL ! 192: }, ! 193: array_str = ! 194: { ! 195: (char *) CNIL, 0, ARRAYSPP, ARRAY, 5, ! 196: &array_items, &array_pages, &array_name, ! 197: (struct heads *) CNIL, (char *)CNIL ! 198: }, ! 199: other_str = ! 200: { ! 201: (char *) CNIL, 0, STRSPP, OTHER, 128, ! 202: &other_items, &other_pages, &other_name, ! 203: (struct heads *) CNIL, (char *)CNIL ! 204: }, ! 205: ! 206: sdot_str = ! 207: { ! 208: (char *) CNIL, 0, SDOTSPP, SDOT, 2, ! 209: &sdot_items, &sdot_pages, &sdot_name, ! 210: (struct heads *) CNIL, (char *)CNIL ! 211: }, ! 212: val_str = ! 213: { ! 214: (char *) CNIL, 0, VALSPP, VALUE, 1, ! 215: &val_items, &val_pages, &val_name, ! 216: (struct heads *) CNIL, (char *)CNIL ! 217: }, ! 218: funct_str = ! 219: { ! 220: (char *) CNIL, 0, BCDSPP, BCD, 2, ! 221: &funct_items, &funct_pages, &funct_name, ! 222: (struct heads *) CNIL, (char *)CNIL ! 223: }, ! 224: vect_str = ! 225: { ! 226: ! 227: (char *) CNIL, 0, VECTORSPP, VECTOR, 1, ! 228: &vect_items, &vect_pages, &vect_name, ! 229: (struct heads *) CNIL, (char *)CNIL ! 230: }, ! 231: vecti_str = ! 232: { ! 233: ! 234: (char *) CNIL, 0, VECTORSPP, VECTORI, 1, ! 235: &vect_items, &vecti_pages, &vecti_name, ! 236: (struct heads *) CNIL, (char *)CNIL ! 237: }, ! 238: ! 239: hunk_str[7] = ! 240: { ! 241: { ! 242: (char *) CNIL, 0, HUNK2SPP, HUNK2, 2, ! 243: &hunk_items[0], &hunk_pages[0], &hunk_name[0], ! 244: (struct heads *) CNIL, (char *)CNIL ! 245: }, ! 246: { ! 247: (char *) CNIL, 0, HUNK4SPP, HUNK4, 4, ! 248: &hunk_items[1], &hunk_pages[1], &hunk_name[1], ! 249: (struct heads *) CNIL, (char *)CNIL ! 250: }, ! 251: { ! 252: (char *) CNIL, 0, HUNK8SPP, HUNK8, 8, ! 253: &hunk_items[2], &hunk_pages[2], &hunk_name[2], ! 254: (struct heads *) CNIL, (char *)CNIL ! 255: }, ! 256: { ! 257: (char *) CNIL, 0, HUNK16SPP, HUNK16, 16, ! 258: &hunk_items[3], &hunk_pages[3], &hunk_name[3], ! 259: (struct heads *) CNIL, (char *)CNIL ! 260: }, ! 261: { ! 262: (char *) CNIL, 0, HUNK32SPP, HUNK32, 32, ! 263: &hunk_items[4], &hunk_pages[4], &hunk_name[4], ! 264: (struct heads *) CNIL, (char *)CNIL ! 265: }, ! 266: { ! 267: (char *) CNIL, 0, HUNK64SPP, HUNK64, 64, ! 268: &hunk_items[5], &hunk_pages[5], &hunk_name[5], ! 269: (struct heads *) CNIL, (char *)CNIL ! 270: }, ! 271: { ! 272: (char *) CNIL, 0, HUNK128SPP, HUNK128, 128, ! 273: &hunk_items[6], &hunk_pages[6], &hunk_name[6], ! 274: (struct heads *) CNIL, (char *)CNIL ! 275: } ! 276: }; ! 277: extern struct readtable { unsigned char ctable[132]; } initread; ! 278: unsigned char *ctable = initread.ctable; ! 279: int gensymcounter = 0; ! 280: ! 281: int hashtop = HASHTOP; ! 282: int xcycle = 0; /* used by xsbrk */ ! 283: struct atom *hasht[HASHTOP]; ! 284: lispval datalim; /* pointer to next location to allocate */ ! 285: ! 286: char typetable[TTSIZE+1] = {UNBO,ATOM,PORT,INT,INT,INT,INT,INT,INT,INT,INT,INT,INT,INT,INT,INT,INT,INT,INT}; ! 287: ! 288: /* this must be the last thing allocated in this file */ ! 289: char lsbrkpnt,zfreespace;
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.