BSD 4_3_Reno development
authorCSRG <csrg@ucbvax.Berkeley.EDU>
Wed, 13 Mar 1985 10:40:40 +0000 (02:40 -0800)
committerCSRG <csrg@ucbvax.Berkeley.EDU>
Wed, 13 Mar 1985 10:40:40 +0000 (02:40 -0800)
Work on file usr/src/pgrm/lisp/franz/fex3.c
Work on file usr/src/pgrm/lisp/franz/fex4.c
Work on file usr/src/pgrm/lisp/franz/lam9.c
Work on file usr/src/pgrm/lisp/franz/sysat.c

Synthesized-from: CSRG/cd2/4.3reno

usr/src/pgrm/lisp/franz/fex3.c [new file with mode: 0644]
usr/src/pgrm/lisp/franz/fex4.c [new file with mode: 0644]
usr/src/pgrm/lisp/franz/lam9.c [new file with mode: 0644]
usr/src/pgrm/lisp/franz/sysat.c [new file with mode: 0644]

diff --git a/usr/src/pgrm/lisp/franz/fex3.c b/usr/src/pgrm/lisp/franz/fex3.c
new file mode 100644 (file)
index 0000000..8c868af
--- /dev/null
@@ -0,0 +1,535 @@
+#ifndef lint
+static char *rcsid = "$Header: fex3.c,v 1.15 85/03/13 17:18:29 sklower Exp $";
+#endif
+/*                                     -[Sat Apr  9 17:03:02 1983 by layer]-
+ *     fex3.c                          $Locker:  $
+ * nlambda functions
+ *
+ * (c) copyright 1982, Regents of the University of California
+ */
+
+
+#include "global.h"
+extern char *gstab();
+static int pagsiz, pagrnd;
+
+
+/*
+ *Ndumplisp -- create executable version of current state of this lisp.
+ */
+#ifndef        os_vms
+#include "aout.h"
+
+lispval
+Ndumplisp()
+{
+       register struct exec *workp;
+       register lispval argptr, temp;
+       register char *fname;
+       extern int reborn;
+       struct exec work, old;
+       extern int dmpmode,usehole;
+       extern char etext[], *curhbeg;
+       int descrip, des2, ax,mode;
+       extern int holesize;
+       char tbuf[BUFSIZ];
+       long count, lseek();
+
+
+       pageseql();
+       pagsiz = Igtpgsz();
+       pagrnd = pagsiz - 1;
+
+       /* dump mode is kept in decimal (which looks like octal in dmpmode)
+          and is changeable via (sstatus dumpmode n) where n is 413 or 410
+          base 10              
+       */
+       if(dmpmode == 413) mode = 0413;
+       else if(dmpmode == 407) mode = 0407;
+       else mode = 0410;
+
+       workp = &work;
+       workp->a_magic  = mode;
+#ifdef os_masscomp
+       workp->a_stamp  = 1;
+#endif
+
+       if(holesize) {  /* was ifdef HOLE */
+               curhbeg         = (char *) (1 + (pagrnd | ((int)curhbeg)-1));
+               workp->a_text   = (unsigned long)curhbeg - (unsigned long)OFFSET;
+               workp->a_data   = (unsigned) sbrk(0) - workp->a_text - OFFSET;
+       } else {
+               if(mode==0407)
+                   workp->a_text = ((int)etext) - OFFSET;
+               else
+                   workp->a_text = 1 + ((((int)etext)-1-OFFSET) | pagrnd);
+               workp->a_data   = (int) sbrk(0) - ((int)curhbeg);
+       }
+       workp->a_bss    = 0;
+       workp->a_syms   = 0;
+       workp->a_entry  = (unsigned) gstart();
+       workp->a_trsize = 0;
+       workp->a_drsize = 0;
+
+       fname = "savedlisp"; /*set defaults*/
+       reborn = (int) CNIL;
+       argptr = lbot->val;
+       if (argptr != nil) {
+               temp = argptr->d.car;
+               if((TYPE(temp))==ATOM)
+                       fname = temp->a.pname;
+       }
+       des2 = open(gstab(),0);
+       if(des2 >= 0) {
+               if(read(des2,(char *)&old,sizeof(old))>=0)
+                       work.a_syms = old.a_syms;
+       }
+       descrip=creat(fname,0777); /*doit!*/
+       if(-1==write(descrip,(char *)workp,sizeof(work)))
+       {
+               close(descrip);
+               error("Dumplisp header failed",FALSE);
+       }
+       if(mode == 0413) lseek(descrip,(long)pagsiz,0); 
+       if( -1==write(descrip,(char *)nil,(int)workp->a_text) )
+       {
+               close(descrip);
+               error("Dumplisp text failed",FALSE);
+       }
+       if( -1==write(descrip,(char *)curhbeg,(int)workp->a_data) )
+       {
+               close(descrip);
+               error("Dumplisp data failed",FALSE);
+       }
+       if(des2>0  && work.a_syms) {
+               count = old.a_text + old.a_data + (old.a_magic == 0413 ? pagsiz 
+                                                              : sizeof(old));
+               if(-1==lseek(des2,count,0))
+                       error("Could not seek to stab",FALSE);
+               for(count = old.a_syms;count > 0; count -=BUFSIZ) {
+                       ax = read(des2,tbuf,(int)(count < BUFSIZ ? count : BUFSIZ));
+                       if(ax==0) {
+                               printf("Unexpected end of syms",count);
+                               fflush(stdout);
+                               break;
+                       } else if(ax >  0)
+                               write(descrip,tbuf,ax);
+                       else 
+                               error("Failure to write dumplisp stab",FALSE);
+               }
+#if ! (os_unix_ts | os_unisoft)
+               if(-1 == lseek(des2,(long)
+                       ((old.a_magic == 0413 ? pagsiz : sizeof(old))
+                       + old.a_text + old.a_data
+                               + old.a_trsize + old.a_drsize + old.a_syms),
+                              0))
+                       error(" Could not seek to string table ",FALSE);
+               for( ax = 1 ; ax > 0;) {
+                    ax = read(des2,tbuf,BUFSIZ);
+                    if(ax > 0)
+                        write(descrip,tbuf,ax);
+                    else if (ax < 0)
+                        error("Error in string table read ",FALSE);
+               }
+#endif
+       }
+       close(descrip);
+       if(des2>0) close(des2);
+       reborn = 0;
+
+       pagenorm();
+
+       return(nil);
+}
+
+\f
+/*** VMS version of Ndumplisp ***/
+#else
+#include "aout.h"
+#undef protect
+#include <vms/vmsexe.h>
+
+lispval
+Ndumplisp()
+{
+       register struct exec *workp;
+       register lispval argptr, temp;
+       char *fname;
+       register ISD *Isd;
+       register int i;
+       extern lispval reborn;
+       struct exec work,old;
+       extern etext;
+       extern int dmpmode,holend,curhbeg,usehole,holesize;
+       int extra_cref_page = 0;
+       char *start_of_data;
+       int descrip, des2, count, ax,mode;
+       char buf[5000],stabname[100],tbuf[BUFSIZ];
+       int fp,fp1;
+       union {
+               char Buffer[512];
+               struct {
+                       IHD Ihd;
+                       IHA Iha;
+                       IHS Ihs;
+                       IHI Ihi;
+                       } Header;
+               } Buffer;       /* VMS Header */
+
+       /*
+        *      Dumpmode is always 413!!
+        */
+       mode = 0413;
+       pagsiz = Igtpgsz();
+       pagrnd = pagsiz - 1;
+
+       workp = &work;
+       workp->a_magic   = mode;
+       if (holesize) {
+               workp->a_text   =
+                       ((unsigned)curhbeg) & (~pagrnd);
+               if (((unsigned)curhbeg) & pagrnd) extra_cref_page = 1;
+               start_of_data = (char *)
+                       (((((unsigned) (&holend)) -1) & (~pagrnd)) + pagsiz);
+       } else {
+               workp->a_text   =
+                       ((((unsigned) (&etext)) -1) & (~pagrnd)) + pagsiz;
+               start_of_data = (char *)workp->a_text;
+       }
+       workp->a_data   =
+               (unsigned) sbrk(0) - (unsigned)start_of_data;
+       workp->a_bss    = 0;
+       workp->a_syms   = 0;
+       workp->a_entry  = (unsigned) gstart();
+       workp->a_trsize = 0;
+       workp->a_drsize = 0;
+
+       fname = "savedlisp";    /* set defaults */
+       reborn = CNIL;
+       argptr = lbot->val;
+       if (argptr != nil) {
+               temp = argptr->d.car;
+               if((TYPE(temp))==ATOM)
+                       fname = temp->a.pname;
+       }
+       /*
+        *      Open the new executable file
+        */
+       strcpy(buf,fname);
+       if (index(buf,'.') == 0) strcat(buf,".exe");
+       if ((descrip = creat(buf,0777)) < 0) error("Dumplisp failed",FALSE);
+       /*
+        *      Create the VMS header
+        */
+       for(i = 0; i < 512; i++) Buffer.Buffer[i] = 0;  /* Clear Header */
+       Buffer.Header.Ihd.size          = sizeof(Buffer.Header);
+       Buffer.Header.Ihd.activoff      = sizeof(IHD);
+       Buffer.Header.Ihd.symdbgoff     = sizeof(IHD) + sizeof(IHA);
+       Buffer.Header.Ihd.imgidoff      = sizeof(IHD) + sizeof(IHA) + sizeof(IHS);
+       Buffer.Header.Ihd.majorid[0]    = '0';
+       Buffer.Header.Ihd.majorid[1]    = '2';
+       Buffer.Header.Ihd.minorid[0]    = '0';
+       Buffer.Header.Ihd.minorid[1]    = '2';
+       Buffer.Header.Ihd.imgtype       = IHD_EXECUTABLE;
+       Buffer.Header.Ihd.privreqs[0]   = -1;
+       Buffer.Header.Ihd.privreqs[1]   = -1;
+       Buffer.Header.Ihd.lnkflags.nopobufs = 1;
+       Buffer.Header.Ihd.imgiocnt = 250;
+
+       Buffer.Header.Iha.tfradr1       = SYS$IMGSTA;
+       Buffer.Header.Iha.tfradr2       = workp->a_entry;
+
+       strcpy(Buffer.Header.Ihi.imgnam+1,"SAVEDLISP");
+       Buffer.Header.Ihi.imgnam[0] = 9;
+       Buffer.Header.Ihi.imgid[0] = 0;
+       Buffer.Header.Ihi.imgid[1] = '0';
+       sys$gettim(Buffer.Header.Ihi.linktime);
+       strcpy(Buffer.Header.Ihi.linkid+1," Opus 38");
+       Buffer.Header.Ihi.linkid[0] = 8;
+
+       Isd = (ISD *)&Buffer.Buffer[sizeof(Buffer.Header)];
+               /* Text ISD */
+       Isd->size       = ISDSIZE_TEXT;
+       Isd->pagcnt     = workp->a_text >> 9;
+       Isd->vpnpfc.vpn = 0;
+       Isd->flags.type = ISD_NORMAL;
+       Isd->vbn        = 3;
+       Isd = (ISD *)((char *)Isd + Isd->size);
+               /* Hole ISDs (if necessary) */
+       if (usehole) {
+               /* Copy on Ref ISD for possible extra text page */
+               if(extra_cref_page) {
+                       Isd->size       = ISDSIZE_TEXT;
+                       Isd->pagcnt     = 1;
+                       Isd->vpnpfc.vpn = (((unsigned)curhbeg) & (~pagrnd)) >> 9;
+                       Isd->flags.type = ISD_NORMAL;
+                       Isd->flags.crf  = 1;
+                       Isd->flags.wrt  = 1;
+                       Isd->vbn        = (workp->a_text >> 9) + 3;
+                       Isd = (ISD *)((char *)Isd + Isd->size);
+               }
+               /* Demand Zero ISD for rest of Hole */
+               Isd->size       = ISDSIZE_DZRO;
+               Isd->pagcnt     =
+                       ((((unsigned)&holend)
+                               - (unsigned)curhbeg) & (~pagrnd)) >> 9;
+               Isd->vpnpfc.vpn =
+                       ((((unsigned)curhbeg) & (~pagrnd)) >> 9) + extra_cref_page;
+               Isd->flags.type = ISD_NORMAL;
+               Isd->flags.dzro = 1;
+               Isd->flags.wrt  = 1;
+               Isd = (ISD *)((char *)Isd + Isd->size);
+       }
+               /* Data ISD */
+       Isd->size       = ISDSIZE_TEXT;
+       Isd->pagcnt     = workp->a_data >> 9;
+       Isd->vpnpfc.vpn = ((unsigned)start_of_data) >> 9;
+       Isd->flags.type = ISD_NORMAL;
+       Isd->flags.crf  = 1;
+       Isd->flags.wrt  = 1;
+       Isd->vbn        = (workp->a_text >> 9) + 3;
+       if (holesize) {
+               /*
+                *      Correct the Data ISD
+                */
+               Isd->vbn        += extra_cref_page;
+       }
+       Isd = (ISD *)((char *)Isd + Isd->size);
+               /* Stack ISD */
+       Isd->size       = ISDSIZE_DZRO;
+       Isd->pagcnt     = ISDSTACK_SIZE;
+       Isd->vpnpfc.vpn = ISDSTACK_BASE;
+       Isd->flags.type = ISD_USERSTACK;
+       Isd->flags.dzro = 1;
+       Isd->flags.wrt  = 1;
+       Isd = (ISD *)((char *)Isd + Isd->size);
+               /* End of ISD List */
+       Isd->size = 0;
+       Isd = (ISD *)((char *)Isd + 2);
+       /*
+        *      Make the rest of the header -1s
+        */
+       for (i = ((char *)Isd - Buffer.Buffer); i < 512; i++)
+                                               Buffer.Buffer[i] = -1;
+       /*
+        *      Write the VMS Header
+        */
+       if (write(descrip,Buffer.Buffer,512) == -1)
+                                       error("Dumplisp failed",FALSE);
+#if    EUNICE_UNIX_OBJECT_FILE_CFASL
+       /*
+        *      Get the UNIX symbol table file header
+        */
+       des2 = open(gstab(),0);
+       if (des2 >= 0) {
+               old.a_magic = 0;
+               if (read(des2,(char *)&old,sizeof(old)) >= 0) {
+                       if (N_BADMAG(old)) {
+                               lseek(des2,512,0);      /* Try block #1 */
+                               read(des2,(char *)&old,sizeof(old));
+                       }
+                       if (!N_BADMAG(old)) work.a_syms = old.a_syms;
+               }
+       }
+#endif EUNICE_UNIX_OBJECT_FILE_CFASL
+       /*
+        *      Update the UNIX header so that the extra cref page is
+        *      considered part of data space.
+        */
+       if (extra_cref_page) work.a_data += 512;
+       /*
+        *      Write the UNIX header
+        */
+       if (write(descrip,&work,sizeof(work)) == -1)
+                               error("Dumplisp failed",FALSE);
+       /*
+        *      seek to 1024 (end of headers)
+        */
+       if (lseek(descrip,1024,0) == -1)
+                               error("Dumplisp failed",FALSE);
+       /*
+        *      write the world
+        */
+       if (write(descrip,0,workp->a_text) == -1)
+                               error("Dumplisp failed",FALSE);
+       if (extra_cref_page)
+               if (write(descrip,(((unsigned)curhbeg) & pagrnd), pagsiz) == -1)
+                               error("Dumplisp failed",FALSE);
+       if (write(descrip,start_of_data,workp->a_data) == -1)
+                               error("Dumplisp failed",FALSE);
+
+#if    !EUNICE_UNIX_OBJECT_FILE_CFASL
+       /*
+        *      VMS OBJECT files: We are done with the executable file
+        */
+       close(descrip);
+       /*
+        *      Now try to write the symbol table file!
+        */
+       strcpy(buf,gstab());
+
+       strcpy(stabname,fname);
+       if (index(stabname,'.') == 0) strcat(stabname,".stb");
+       else strcpy(index(stabname,'.'), ".stb");
+
+       /* Use Link/Unlink to rename the symbol table */
+       if (!strncmp(gstab(),"tmp:",4))
+               if (link(buf,stabname) >= 0)
+                       if (unlink(buf) >= 0) return(nil);
+
+       /* Copy the symbol table */
+       if ((fp  = open(buf,0)) < 0)
+                       error("Symbol table file not there\n",FALSE);
+       fp1 = creat(stabname,0666,"var");
+       while((i = read(fp,buf,5000)) > 0)
+               if (write(fp1,buf,i) == -1) {
+                       close(fp); close(fp1);
+                       error("Error writing symbol table\n",FALSE);
+               }
+       close(fp); close(fp1);
+       if (i < 0) error("Error reading symbol table\n",FALSE);
+       if (!strncmp(gstab(),"tmp:",4)) unlink(gstab);
+       /*
+        *      Done
+        */
+       reborn = 0;
+       return(nil);
+#else  EUNICE_UNIX_OBJECT_FILE_CFASL
+       /*
+        *      UNIX OBJECT files: append the new symbol table
+        */
+       if(des2>0  && work.a_syms) {
+               count = old.a_text + old.a_data + (old.a_magic == 0413 ? 1024
+                                                              : sizeof(old));
+               if(-1==lseek(des2,count,0))
+                       error("Could not seek to stab",FALSE);
+               for(count = old.a_syms;count > 0; count -=BUFSIZ) {
+                       ax = read(des2,tbuf,(int)(count < BUFSIZ ? count : BUFSIZ));
+                       if(ax==0) {
+                               printf("Unexpected end of syms",count);
+                               fflush(stdout);
+                               break;
+                       } else if(ax >  0)
+                               write(descrip,tbuf,ax);
+                       else 
+                               error("Failure to write dumplisp stab",FALSE);
+               }
+               if(-1 == lseek(des2,(long)
+                       ((old.a_magic == 0413 ? 1024 : sizeof(old))
+                       + old.a_text + old.a_data
+                               + old.a_trsize + old.a_drsize + old.a_syms),
+                              0))
+                       error(" Could not seek to string table ",FALSE);
+               for( ax = 1 ; ax > 0;) {
+                    ax = read(des2,tbuf,BUFSIZ);
+                    if(ax > 0)
+                        write(descrip,tbuf,ax);
+                    else if (ax < 0)
+                        error("Error in string table read ",FALSE);
+               }
+       }
+       close(descrip);
+       if(des2>0) close(des2);
+       reborn = 0;
+
+       return(nil);
+#endif EUNICE_UNIX_OBJECT_FILE_CFASL
+}
+#endif
+#if (os_4_1 | os_4_1a | os_4_1c | os_4_2| os_4_3)
+
+#if (os_4_2 | os_4_3)
+#include <sys/vadvise.h>
+#else
+#include <vadvise.h>
+#endif
+
+pagerand() { vadvise(VA_ANOM); }
+pageseql() { vadvise(VA_SEQL); }
+pagenorm() { vadvise(VA_NORM); }
+#endif
+#if (os_unisoft | os_vms | os_unix_ts | os_masscomp)
+pagerand() { }
+pageseql() { }
+pagenorm() { }
+#endif
+
+/* getaddress --
+ *
+ * (getaddress '|_entry1| 'fncname1 '|_entry2| 'fncname2 ...)
+ *
+ * binds value of symbol |_entry1| to function defition of atom fncname1, etc.
+ *
+ * returns fnc-binding of fncname1.
+ *
+ */
+#if os_unisoft || os_unix_ts
+#define N_name n_name
+#define STASSGN(p,q) strncpy(NTABLE[(p)].n_name,(q),8)
+#else
+#define N_name n_un.n_name
+#define STASSGN(p,q) (NTABLE[p].N_name = (q))
+#endif
+
+lispval
+Lgetaddress(){
+       register struct argent *mlbot = lbot;
+       register lispval work;
+       register int numberofargs, i;
+       char ostabf[128];
+       struct nlist NTABLE[100];
+       lispval dispget();
+
+       Savestack(4);
+
+       if(np-lbot == 2) protect(nil);  /* allow 2 args */
+       numberofargs = (np - lbot)/3;
+       if(numberofargs * 3 != np-lbot)
+          error("getaddress: arguments must come in triples ",FALSE);
+
+       for ( i=0; i<numberofargs; i++,mlbot += 3) {
+               NTABLE[i].n_value = 0;
+               mlbot[0].val = verify(mlbot[0].val,"Incorrect entry specification for binding");
+               STASSGN(i,(char *) mlbot[0].val);
+               while(TYPE(mlbot[1].val) != ATOM)
+                       mlbot[1].val = errorh1(Vermisc,
+                                       "Bad associated atom name for binding",
+                                         nil,TRUE,0,mlbot[1].val);
+               mlbot[2].val = dispget(mlbot[2].val,"getaddress: Incorrect discipline specification ",(lispval)Vsubrou->a.pname);
+       }
+               STASSGN(numberofargs,"");
+       strncpy(ostabf,gstab(),128);
+       if ( nlist(ostabf,NTABLE) == -1 ) {
+           errorh1(Vermisc,"Getaddress: Bad file",nil,FALSE,0,inewstr(ostabf));
+       } else 
+           for (i=0,mlbot=lbot+1; i<numberofargs; i++,mlbot+=3) {
+               if ( NTABLE[i].n_value == 0 )
+                   fprintf(stderr,"Undefined symbol: %s\n",
+                             NTABLE[i].N_name);
+               else {
+                   work= newfunct();
+                   work->bcd.start = (lispval (*) ())NTABLE[i].n_value;
+                   work->bcd.discipline = mlbot[1].val;
+                   mlbot->val->a.fnbnd = work;
+               }
+           };
+       Restorestack();
+       return(lbot[1].val->a.fnbnd);
+};
+
+Igtpgsz()
+{
+#if (os_4_1c | os_4_2 | os_4_3)
+       return(getpagesize());
+#else
+#if (vax_eunice_vms | os_unisoft)
+       return(512);
+#else
+#if os_masscomp
+       return(4096);
+#else
+       return(1024);
+#endif
+#endif
+#endif
+}
diff --git a/usr/src/pgrm/lisp/franz/fex4.c b/usr/src/pgrm/lisp/franz/fex4.c
new file mode 100644 (file)
index 0000000..4656afc
--- /dev/null
@@ -0,0 +1,434 @@
+#ifndef lint
+static char *rcsid =
+   "$Header: fex4.c,v 1.5 85/03/13 17:19:04 sklower Exp $";
+#endif
+
+/*                                     -[Sat Jan 29 12:40:56 1983 by jkf]-
+ *     fex4.c                          $Locker:  $
+ * nlambda functions
+ *
+ * (c) copyright 1982, Regents of the University of California
+ */
+
+
+#include "global.h"
+#include "lfuncs.h"
+#include "chkrtab.h"
+#include <signal.h>
+#include <sys/types.h>
+
+#if (os_4_2 || os_4_3)
+#include <sys/time.h>
+#else
+#include <time.h>
+#endif
+
+/* this is now a lambda function instead of a nlambda.
+   the only reason that it wasn't a lambda to begin with is that 
+   the person who wrote it didn't know how to write a lexpr
+                                               - jkf
+*/
+lispval
+Lsyscall() {
+       register lispval temp;
+       register struct argent *aptr;
+       register int acount = 1;
+       extern syscall();
+       int args[50];
+       Savestack(3);
+
+       /* there must be at least one argument */
+
+       if (np==lbot) { chkarg(1,"syscall"); }
+
+       aptr = lbot;
+       temp = lbot->val;
+       if (TYPE(temp) != INT) {
+               Restorestack();
+               return(error("syscall: bad first argument ", FALSE));
+       }
+       args[acount++] = temp->i;
+       while( ++aptr < np && acount < 48) {
+               temp = aptr->val;
+               switch(TYPE(temp)) {
+
+                       case ATOM:      
+                               args[acount++] = (int)temp->a.pname;
+                               break;
+
+                       case STRNG:
+                               args[acount++] = (int) temp;
+                               break;
+
+                       case INT:
+                               args[acount++] = (int)temp->i;
+                               break;
+
+                       default:
+                               Restorestack();
+                               return(error("syscall: arg not symbol, string or fixnum", FALSE));
+               }
+       }
+
+       Restorestack();
+       args[0] = acount - 1;
+       return(inewint(callg_(syscall,args)));
+}
+
+/* eval-when: this has the form (eval-when <list> <form1> <form2> ...)
+   where the list may contain any combination of `eval', `load', `compile'.
+   The interpreter (us) looks for the atom `eval', if it is present
+   we treat the rest of the forms as a progn.
+*/
+
+lispval
+Nevwhen()
+{
+       register lispval handy;
+       register lispval handy2;
+       Savestack(2);
+
+       for (handy=(lbot->val)->d.car ; handy != nil ; handy = handy->d.cdr) {
+          if (handy->d.car == (lispval) Veval) {
+               lbot=np;
+               protect(((lbot-1)->val)->d.cdr);
+               handy2 = Nprogn();
+               Restorestack();
+               return(handy2);
+           }
+       }
+
+
+       Restorestack();
+       return(nil);    /* eval not seen */
+}
+
+
+/*     Status functions. 
+ *  These operate on the statuslist stlist which has the form:
+ *     ( status_elem_1 status_elem_2 status_elem_3 ...)
+ *  where each status element has the form:
+ *     ( name readcode setcode .  readvalue)
+ *  where
+ *     name - name of the status feature (the first arg to the status
+ *             function).
+ *     readcode - fixnum which tells status how to read the value of
+ *             this status name.  The codes are #defined.
+ *     setcode - fixnum which tells sstatus how to set the value of
+ *             this status name
+ *     readvalue - the value of the status feature is usually stored
+ *             here.
+ *     
+ * Readcodes:
+ *
+ *     ST_READ - if no second arg, return readvalue.
+ *               if the second arg is given, we return t if it is eq to
+ *               the readvalue.
+ *     ST_FEATR - used in (status feature xxx) where we test for xxx being
+ *               in the status features list
+ *     ST_SYNT - used in (status syntax c) where we return c's syntax code
+ *     ST_INTB - read stattab entry
+ *     ST_NFETR - used in (status nofeature xxx) where we test for xxx not
+ *               being in the status features list
+ *     ST_DMPR - read the dumpmode 
+ *     ST_UNDEF - return the undefined functions in the transfer table
+ * 
+ * Setcodes:
+ *     ST_NO -  if not allowed to set this status through sstatus.
+ *     ST_SET - if the second arg is made the readvalue.
+ *     ST_FEATW - for (sstatus feature xxx), we add xxx to the 
+ *               (status features) list.
+ *     ST_TOLC - if non nil, map upper case chars in atoms to lc.
+ *     ST_CORE - if non nil, have bus errors and segmentation violations
+ *               dump core, if nil have them produce a bad-mem err msg
+ *     ST_INTB - set stattab table entry
+ *     ST_NFETW - use in (sstatus nofeature xxx) where we wish to remove xxx
+ *                from the status feature list.
+ *     ST_DMPW - set the dumpmode
+ *     ST_BCDTR - (ifdef RSET) if non nil, creat trace stack entries for
+ *                calls from BCD functions to BCD functions
+ *     ST_GCSTR - (ifdef GCSTRINGS) garbage collect strings
+ */
+
+lispval
+Nstatus()
+{
+       register lispval handy,curitm,valarg;
+       int indx,ctim;
+       int typ;
+       char *cp;
+       char *ctime();
+       struct tm *lctime,*localtime();
+       extern unsigned char *ctable;
+       extern int dmpmode;
+       extern lispval chktt();
+       lispval Istsrch();
+       Savestack(3);
+
+       if(lbot->val == nil) return(nil);
+       handy = lbot->val;              /* arg list */
+
+       while(TYPE(handy) != DTPR) handy = error("status: bad arg list",TRUE); 
+       
+       curitm = Istsrch(handy->d.car); /* look for feature */
+
+       if( curitm == nil ) return(nil);        /* non existant */
+
+       if( handy->d.cdr == nil ) valarg = (lispval) CNIL;
+       else valarg = handy->d.cdr->d.car;
+
+       /* now do the processing with curitm pointing to the requested
+          item in the status list 
+        */
+       
+       switch( typ = curitm->d.cdr->d.car->i ) {       /* look at readcode */
+
+
+       case ST_READ:
+               curitm = Istsrch(handy->d.car); /* look for name */
+               if(curitm == nil) return(nil);
+               if( valarg != (lispval) CNIL) 
+                   error("status: Second arg not allowed.",FALSE);
+               else return(curitm->d.cdr->d.cdr->d.cdr);
+
+       case ST_NFETR:                          /* look for feature present */
+       case ST_FEATR:                          /* look for feature */
+               curitm = Istsrch(matom("features"));
+               if( valarg == (lispval) CNIL) 
+                   error("status: need second arg",FALSE);
+
+               for( handy = curitm->d.cdr->d.cdr->d.cdr;
+                    handy != nil;
+                    handy = handy->d.cdr)
+                  if(handy->d.car == valarg) 
+                        return(typ == ST_FEATR ? tatom : nil);
+               
+               return(typ == ST_FEATR ? nil : tatom);
+
+       case ST_SYNT:                           /* want character syntax */
+               handy = Vreadtable->a.clb;
+               chkrtab(handy);
+               if( valarg == (lispval) CNIL)
+                       error("status: need second arg",FALSE);
+               
+               while (TYPE(valarg) != ATOM) 
+                   valarg = error("status: second arg must be atom",TRUE);
+               
+               indx = valarg->a.pname[0];      /* get first char */
+
+               if(valarg->a.pname[1] != '\0')
+                       error("status: only one character atom allowed",FALSE);
+
+               handy = inewint((long) ctable[indx]);
+               return(handy);
+
+       case ST_RINTB:
+               return(stattab[curitm->d.cdr->d.cdr->d.cdr->i]);
+
+       case ST_DMPR:
+               return(inewint(dmpmode));
+               
+       case ST_CTIM:
+                ctim = time((time_t *)0);
+                cp = ctime(&ctim);
+                cp[24] = '\0';
+                return(matom(cp));
+
+       case ST_LOCT:
+                ctim = time((time_t *)0);
+                lctime = localtime(&ctim);
+                (handy = newdot())->d.car = inewint(lctime->tm_sec);
+                protect(handy);
+                handy->d.cdr =  (valarg = newdot());
+                valarg->d.car = inewint(lctime->tm_min);
+                valarg->d.cdr = (curitm = newdot());
+                curitm->d.car = inewint(lctime->tm_hour);
+                curitm->d.cdr = (valarg = newdot());
+                valarg->d.car = inewint(lctime->tm_mday);
+                valarg->d.cdr = (curitm = newdot());
+                curitm->d.car = inewint(lctime->tm_mon);
+                curitm->d.cdr = (valarg = newdot());
+                valarg->d.car = inewint(lctime->tm_year);
+                valarg->d.cdr = (curitm = newdot());
+                curitm->d.car = inewint(lctime->tm_wday);
+                curitm->d.cdr = (valarg = newdot());
+                valarg->d.car = inewint(lctime->tm_yday);
+                valarg->d.cdr = (curitm = newdot());
+                curitm->d.car = inewint(lctime->tm_isdst);
+                Restorestack();
+                return(handy);
+
+       case ST_ISTTY:
+               return( (isatty(0) == TRUE ? tatom : nil));
+
+       case ST_UNDEF:
+               return(chktt());
+       }
+       error("Internal error in status: Couldn't figure out request",FALSE);
+       /* NOTREACHED */
+}
+lispval
+Nsstatus()
+{
+       register lispval handy;
+       lispval Isstatus();
+
+       handy = lbot->val;
+
+       while( TYPE(handy) != DTPR || TYPE(handy->d.cdr) != DTPR)
+            handy = error("sstatus: Bad args",TRUE);
+       
+       return(Isstatus(handy->d.car,handy->d.cdr->d.car));
+}
+
+/* Isstatus - internal routine to do a set status.     */
+lispval
+Isstatus(curnam,curval)
+lispval curnam,curval;
+{
+       register lispval curitm,head;
+       lispval Istsrch(),Iaddstat();
+       int badmr(),clrtt();
+       extern int uctolc, dmpmode, bcdtrsw, gcstrings;
+
+       curitm = Istsrch(curnam);
+       /* if doesnt exist, make one up */
+
+       if(curitm == nil) curitm = Iaddstat(curnam,ST_READ,ST_SET,nil);
+
+       switch (curitm->d.cdr->d.cdr->d.car->i) {
+
+       case ST_NO: error("sstatus: cannot set this status",FALSE);
+
+       case ST_SET: goto setit;
+
+       case ST_FEATW: curitm = Istsrch(matom("features"));
+                     (curnam = newdot())->d.car = curval;
+                     curnam->d.cdr = curitm->d.cdr->d.cdr->d.cdr;      /* old val */
+                     curitm->d.cdr->d.cdr->d.cdr = curnam;
+                     return(curval);
+
+       case ST_NFETW:  /* remove from features list */
+                     curitm = Istsrch(matom("features"))->d.cdr->d.cdr;
+                     for(head = curitm->d.cdr; head != nil; head = head->d.cdr)
+                     {
+                          if(head->d.car == curval) curitm->d.cdr = head->d.cdr;
+                          else curitm = head;
+                     }
+                     return(nil);
+
+                     
+       case ST_TOLC: if(curval == nil) uctolc = FALSE;
+                     else uctolc = TRUE;       
+                     goto setit;
+
+       case ST_CORE: if(curval == nil)
+                     {
+                       signal(SIGBUS,badmr);    /* catch bus errors */
+                       signal(SIGSEGV,badmr); /* and segmentation viols */
+                     }
+                     else {
+                       signal(SIGBUS,SIG_DFL); /* let them core dump */
+                       signal(SIGSEGV,SIG_DFL);
+                     }
+                     goto setit;
+
+       case ST_INTB: 
+                     stattab[curitm->d.cdr->d.cdr->d.cdr->i] = curval;
+                     return(curval);
+
+       case ST_DMPW:   
+                     if(TYPE(curval) != INT ||
+                        (curval->i != 413    &&
+                         curval->i != 407    &&
+                         curval->i != 410)) errorh1(Vermisc,"sstatus: bad dump mode:",
+                                                 nil,FALSE,0,curval);
+                     dmpmode= curval->i;       
+                     return(curval);
+
+        case ST_AUTR:
+                     if(curval != nil) Sautor = (lispval) TRUE;
+                     else Sautor = FALSE;
+                     goto setit;
+                       
+        case ST_TRAN:
+                     if(curval != nil) 
+                     {     
+                            Strans = (lispval) TRUE;
+                            /* the atom `on' set to set up all table
+                             * to their bcd fcn if possible
+                             */
+                            if(curval == matom("on")) clrtt(1);
+                     } 
+                     else { 
+                            Strans = (lispval) FALSE;
+                            clrtt(0);  /* clear all transfer tables */
+                     }
+                     goto setit;
+       case ST_BCDTR:
+                     if(curval == nil) bcdtrsw = FALSE;
+                     else bcdtrsw = TRUE;
+                     goto setit;
+       case ST_GCSTR:
+                     if(curval == nil) gcstrings = FALSE;
+                     else gcstrings = TRUE;
+                     goto setit;
+       }
+
+    setit:           /* store value in status list */
+                     curitm->d.cdr->d.cdr->d.cdr = curval;
+                     return(curval);
+
+
+}
+
+/* Istsrch - utility routine to search the status list for the
+   name given as an argument.  If such an entry is not found,
+   we return nil
+ */
+                       
+lispval Istsrch(nam)
+lispval nam;
+{
+       register lispval handy; 
+
+       for(handy = stlist ; handy != nil ; handy = handy->d.cdr)
+         if(handy->d.car->d.car == nam) return(handy->d.car);
+
+       return(nil);
+}
+
+/* Iaddstat - add a status entry to the status list    */
+/*     return new entry in status list */
+
+lispval
+Iaddstat(name,readcode,setcode,valu)
+lispval name,valu;
+int readcode,setcode;
+{
+       register lispval handy,handy2;
+       Savestack(2);
+
+
+       protect(handy=newdot());        /* build status list here */
+
+       (handy2 = newdot())->d.car = name;
+
+       handy->d.car = handy2;
+
+       ((handy2->d.cdr = newdot())->d.car = newint())->i = readcode;
+
+       handy2 = handy2->d.cdr;
+
+       ((handy2->d.cdr = newdot())->d.car = newint())->i = setcode;
+
+       handy2->d.cdr->d.cdr = valu;
+
+       /* link this one in */
+
+       handy->d.cdr = stlist;  
+       stlist = handy;
+
+       Restorestack();
+       return(handy->d.car);   /* return new item in stlist */
+}
diff --git a/usr/src/pgrm/lisp/franz/lam9.c b/usr/src/pgrm/lisp/franz/lam9.c
new file mode 100644 (file)
index 0000000..7930745
--- /dev/null
@@ -0,0 +1,276 @@
+#ifndef lint
+static char *rcsid =
+   "$Header: lam9.c,v 1.7 85/03/13 17:19:15 sklower Exp $";
+#endif
+
+/*                                     -[Sat Oct  1 19:44:47 1983 by jkf]-
+ *     lam9.c                          $Locker:  $
+ * lambda functions
+ *
+ * (c) copyright 1982, Regents of the University of California
+ */
+
+#include "global.h"
+/*
+ * These routines writen in C will allow use of the termcap file
+ * by any lisp program. They are very basic routines which initialize
+ * termcap and allow the lisp to execute any of the termcap functions.
+ */
+
+#include <stdio.h>             /*add definations for I/O and bandrate */
+#include <sgtty.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <pwd.h>
+
+
+#undef putchar
+int    putchar();              /* functions used from the termlib */
+int    tgetflag();
+char   *getenv();
+char   *tgoto();
+char   *tgetstr();
+
+char   bpbuf[1024];
+char   tstrbuf[100];
+extern short   ospeed;
+extern char    PC;
+extern char   *BC;
+extern char   *UP;
+
+/*
+/*     This routine will initialize the termcap for the lisp programs.
+/*     If the termcap file is not found, or terminal type is undefined,
+/*     it will print out an error mesg.                                */
+
+lispval
+Ltci()
+{
+char *cp = getenv("TERM");
+char *pc;
+int found;
+struct sgttyb tty;
+
+found = tgetent(bpbuf,cp);             /* open ther termcap file */
+switch(found) {
+      case -1:         printf("\nError Termcap File not found \n");break;
+      case 0 : printf("\nError No Termcap Entry for this terminal \n");
+               break;
+      case 1 : {                       /* everything was ok    */
+               gtty(1, &tty);
+               ospeed = tty.sg_ospeed;
+               }
+               break;
+       }
+cp = tstrbuf;
+BC = tgetstr("bc", &cp);
+UP = tgetstr("up", &cp);
+pc = tgetstr("pc", &cp);
+if (pc)
+    PC = *pc;
+return(nil);
+}
+/* This routine will execute any of the termcap functions used by the lisp
+/* program. If the feature is not include in the terminal defined it will
+/* ignore the call.
+/*             option  : feature to execute
+/*             line    : line if is nessery
+/*             colum   : colum if is nessaery
+/*                                                                     */
+lispval
+Ltcx()
+{
+       register struct argent *mylbot = lbot;
+       int line, column;
+
+       switch(np-lbot) {
+       case 1:
+               line = column = 0;
+               break;
+       case 2:
+               error("Wrong number of Arguments to Termcapexecute",FALSE);
+               break;
+       case 3:
+               line = mylbot[1].val->i;
+               column = mylbot[2].val->i;
+       }
+       return(inewint(show((char *) mylbot->val,&line,&column)));
+}
+
+
+static
+show(option,line,colum)
+char *option;
+int  *line,*colum;
+{
+int found;
+char clbuf[20];
+char *clbp = clbuf;
+char *clear;
+
+/* the tegetflag doesnot work ? */
+clear = tgetstr(option,&clbp);  
+/*printf("option = %d , %s \n",clear,option);*/
+if (!clear) 
+       {found = tgetnum(option);
+        if (found)
+               return(found);
+         return(-1);
+       }
+PC = ' ';
+if (strcmp(option, "cm") == 0) {               /* if cursor motion, do it */
+       clear=tgoto(clear,*colum,*line);
+               if (*clear == 'O')
+               clear = 0;
+       }
+if (clear)                                     /* execute the feature */
+     tputs(clear,0,putchar);
+return (0);
+}
+
+
+
+/*
+ * LIfranzcall :: lisp function int:franz-call
+ *   this function serves many purposes.  It provides access to
+ *   those things that are best done in C or which required a
+ *   C access to unix system calls.
+ *
+ *   Calls to this routine are not error checked, for the most part
+ *   because this is only called from trusted lisp code.
+ *
+ *   The functions in this file may or may not be documented in the manual.
+ *   See the lisp interface to this function for more details. (common2.l)
+ *
+ *  the first argument is always a fixnum index, the other arguments
+ *   depend on the function.
+ */
+
+#define fc_getpwnam 1
+#define fc_access   2 
+#define fc_chdir    3
+#define fc_unlink   4
+#define fc_time            5
+#define fc_chmod    6
+#define fc_getpid   7
+#define fc_stat     8
+#define fc_gethostname 9
+#define fc_link     10
+#define fc_sleep    11
+#define fc_nice            12
+
+lispval
+LIfranzcall()
+{
+    register lispval handy;
+    
+    if((np-lbot) <= 0) argerr("int:franz-call");
+
+    switch (lbot[0].val->i) {
+    
+    case fc_getpwnam:
+       /* arg 1 = user name
+        * return vector of name, uid, gid, dir
+        * or nil if doesn't exist.
+        */
+        {
+            struct passwd *pw, *getpwnam();
+            lispval newvec(), inewint();
+            struct argent *oldnp;
+
+            pw = getpwnam(verify(lbot[1].val,"int:franz-call: invalid name"));
+            if(pw)
+            {
+                handy =  newvec(4 * sizeof(long));
+                oldnp = np;
+                protect(handy);
+                handy->v.vector[0] = (lispval) inewstr(pw->pw_name);
+                handy->v.vector[1] = inewint(pw->pw_uid);
+                handy->v.vector[2] = inewint(pw->pw_gid);
+                handy->v.vector[3] = (lispval) inewstr(pw->pw_dir);
+                np = oldnp;
+                return(handy);
+            }
+            return(nil);
+        }
+        case fc_access:
+               return(inewint
+                       (access
+                          (verify(lbot[1].val, "i:fc,access: non string"),
+                           lbot[2].val->i)));
+        case fc_chdir:
+               return(inewint
+                      (chdir(verify(lbot[1].val,"i:fc,chdir: non string"))));
+
+        case fc_unlink:
+               return(inewint
+                      (unlink(verify(lbot[1].val,"i:fc,unlink: non string"))));
+
+        case fc_time:
+               return(inewint(time(0)));
+
+        case fc_chmod:
+               return(inewint(chmod(verify(lbot[1].val,
+                                               "i:fc,chmod: non string"),
+                                    lbot[2].val->i)));
+
+        case fc_getpid:
+               return(inewint(getpid()));
+
+        case fc_stat:
+               {
+                   struct argent *oldnp;
+                   struct stat statbuf;
+
+                   if(stat(verify(lbot[1].val,"ifc:stat bad file name "),
+                           &statbuf)
+                       != 0) return(nil);      /* nil on error */
+                   handy = newvec(12 * sizeof(long));
+                   oldnp = np;
+                   protect(handy);
+                   handy->v.vector[0] = inewint(statbuf.st_mode & 07777);
+                   handy->v.vector[1] = inewint(
+                                          (statbuf.st_mode & S_IFMT) >> 12 );
+                   handy->v.vector[2] = inewint(statbuf.st_nlink);
+                   handy->v.vector[3] = inewint(statbuf.st_uid);
+                   handy->v.vector[4] = inewint(statbuf.st_gid);
+                   handy->v.vector[5] = inewint(statbuf.st_size);
+                   handy->v.vector[6] = inewint(statbuf.st_atime);
+                   handy->v.vector[7] = inewint(statbuf.st_mtime);
+                   handy->v.vector[8] = inewint(statbuf.st_ctime);
+                   handy->v.vector[9] = inewint(statbuf.st_dev);
+                   handy->v.vector[10] = inewint(statbuf.st_rdev);
+                   handy->v.vector[11] = inewint(statbuf.st_ino);
+                   np = oldnp;
+                   return(handy);
+               }
+        case fc_gethostname:
+           {
+#if os_4_1a || os_4_1c || os_4_2 || os_4_3
+               char hostname[32];
+               gethostname(hostname,sizeof(hostname));
+               return((lispval) inewstr(hostname));
+#else
+               return((lispval) inewstr(SITE));
+#endif         
+           }
+        case fc_link:
+           return(inewint
+                   (link(verify(lbot[1].val,"i:fc,link: non string"),
+                         verify(lbot[2].val,"i:fc,link: non string"))));
+
+        /* sleep for the given number of seconds */
+        case fc_sleep:
+           return(inewint(sleep(lbot[1].val->i)));
+
+        case fc_nice:
+           return(inewint(nice(lbot[1].val->i)));
+           
+        default:
+               return(inewint(-1));
+       } /* end of switch */
+}
+
+                
+
+                
diff --git a/usr/src/pgrm/lisp/franz/sysat.c b/usr/src/pgrm/lisp/franz/sysat.c
new file mode 100644 (file)
index 0000000..a33d659
--- /dev/null
@@ -0,0 +1,793 @@
+#ifndef lint
+static char *rcsid =
+   "$Header: sysat.c,v 1.20 85/03/13 17:19:21 sklower Exp $";
+#endif
+
+/*                                     -[Thu Sep 29 14:05:32 1983 by jkf]-
+ *     sysat.c                         $Locker:  $
+ * startup data structure creation
+ *
+ * (c) copyright 1982, Regents of the University of California
+ */
+
+#include "global.h"
+#include "lfuncs.h"
+#define FIDDLE(z,b,c,y) z->a.clb=newdot(); (z->a.clb->d.car=newint())->i=b->i; \
+       z->a.clb->d.cdr=newdot(); (z->a.clb->d.cdr->d.car=newint())->i=c->i; \
+       z->a.clb->d.cdr->d.cdr=newdot(); (z->a.clb->d.cdr->d.cdr->d.car=newint())->i=y; \
+       b = z->a.clb->d.car; c = z->a.clb->d.cdr->d.car; \
+       copval(z,z->a.clb); z->a.clb = nil;
+
+#define cforget(x) protect(x); Lforget(); unprot();
+
+/*  The following array serves as the temporary counters of the items  */
+/*  and pages used in each space.                                      */
+
+long int tint[2*NUMSPACES];
+
+extern int tgcthresh; 
+extern int initflag;   /*  starts off TRUE to indicate unsafe to gc  */
+
+extern int *beginsweep;        /* place for garbage collector to begin sweeping */
+extern int page_limit;  /* begin warning messages about running out of space */
+extern char purepage[]; /* which pages should not be swept by gc */
+extern int ttsize;     /* need to know how much of pagetable to set to other */
+
+extern lispval Iaddstat(), Isstatus();
+lispval inewatom();
+
+makevals()
+       {
+       int i;
+       lispval temp;
+
+       /*  system list structure and atoms are initialized.  */
+
+       /*  Before any lisp data can be created, the space usage */
+       /*  counters must be set up, temporarily in array tint.  */
+
+       atom_items = (lispval) &tint[0];
+       atom_pages = (lispval) &tint[1];
+       str_items = (lispval) &tint[2];
+       str_pages = (lispval) &tint[3];
+       int_items = (lispval) &tint[4];
+       int_pages = (lispval) &tint[5];
+       dtpr_items = (lispval) &tint[6];
+       dtpr_pages = (lispval) &tint[7];
+       doub_items = (lispval) &tint[8];
+       doub_pages = (lispval) &tint[9];
+       sdot_items = (lispval) &tint[10];
+       sdot_pages = (lispval) &tint[11];
+       array_items = (lispval) &tint[12];
+       array_pages = (lispval) &tint[13];
+       val_items = (lispval) &tint[14];
+       val_pages = (lispval) &tint[15];
+       funct_items = (lispval) &tint[16];
+       funct_pages = (lispval) &tint[17];
+
+       for (i=0; i < 7; i++)
+       {
+               hunk_pages[i] = (lispval) &tint[18+i*2];
+               hunk_items[i] = (lispval) &tint[19+i*2];
+       }
+
+       vect_items = (lispval) &tint[34];
+       vecti_items = (lispval) &tint[35];
+       vect_pages = (lispval) &tint[36];
+       vecti_pages = (lispval) &tint[37];
+       other_items = (lispval) &tint[38];
+       other_pages = (lispval) &tint[39];
+       
+       /*  This also applies to the garbage collection threshhold  */
+
+       gcthresh = (lispval) &tgcthresh;
+
+       /*  Now we commence constructing system lisp structures.  */
+
+       /*  nil is a special case, constructed especially at location zero  */
+
+       hasht[hashfcn("nil")] = (struct atom *)nil;
+
+
+       /* allocate space for namestack and bindstack first
+        * then set up beginsweep variable so that the sweeper will
+        * ignore these `always in use' pages
+        */
+
+       lbot = orgnp = np = ((struct argent *)csegment(VALUE,NAMESIZE,FALSE));
+       orgbnp = bnp = ((struct nament *)csegment(DTPR,NAMESIZE,FALSE));
+       /* since these dtpr pages will not be swept, we don't want them
+        * to show up in count of dtpr pages allocated or it will confuse
+        * gcafter when it tries to determine how much space is free
+        */
+       dtpr_pages->i = 0;
+       beginsweep = (int *) xsbrk(0);
+
+       /*
+        *  patching up info in type and pure tables
+        */
+#if unisys3botch
+       /*
+        * This code is in here because Schriebman made Romberger tend
+        * more important things for too long for Apple and Fateman to
+        * wait
+        */
+       {extern int dmpmode; int jj = ATOX(beginsweep);
+       dmpmode = 407; for(i=19;i < jj; i++) typetable[i] = 0; }
+#endif
+       for(i=ATOX(beginsweep); i < ttsize; i++) (typetable+1)[i] = OTHER;
+       purepage[ATOX(np)] = 1;  /* Mark these as non-gc'd arrays */
+       purepage[ATOX(bnp)] = 1;
+
+       /*
+        * Names of various spaces and things
+        */
+
+       atom_name = inewatom("symbol");
+       str_name = inewatom("string");
+       int_name = inewatom("fixnum");
+       dtpr_name = inewatom("list");
+       doub_name = inewatom("flonum");
+       sdot_name = inewatom("bignum");
+       array_name = inewatom("array");
+       val_name = inewatom("value");
+       funct_name = inewatom("binary");
+       port_name = inewatom("port");           /* not really a space */
+       vect_name = inewatom("vector");
+       vecti_name = inewatom("vectori");
+       other_name = inewatom("other");
+
+       {
+           char name[6], *strcpy();
+
+           strcpy(name, "hunk0");
+           for (i=0; i< 7; i++) {
+               hunk_name[i] = matom(name);
+               name[4]++;
+           }
+       }
+       
+       /*  set up the name stack as an array of pointers */
+       nplim = orgnp+NAMESIZE-6*NAMINC;
+       temp = inewatom("namestack");
+       nstack = temp->a.fnbnd = newarray();
+       nstack->ar.data = (char *) (np);
+       (nstack->ar.length = newint())->i = NAMESIZE;
+       (nstack->ar.delta = newint())->i = sizeof(struct argent);
+       Vnogbar = inewatom("unmarked_array");
+       /* marking of the namestack will be done explicitly in gc1 */
+       (nstack->ar.aux = newdot())->d.car = Vnogbar; 
+                                               
+
+       /* set up the binding stack as an array of dotted pairs */
+
+       bnplim = orgbnp+NAMESIZE-5;
+       temp = inewatom("bindstack");
+       bstack = temp->a.fnbnd = newarray();
+       bstack->ar.data = (char *) (bnp);
+       (bstack->ar.length = newint())->i = NAMESIZE;
+       (bstack->ar.delta = newint())->i = sizeof(struct nament);
+       /* marking of the bindstack will be done explicitly in gc1 */
+       (bstack->ar.aux = newdot())->d.car = Vnogbar; 
+
+       /* more atoms */
+
+       tatom = inewatom("t");
+       tatom->a.clb = tatom;
+       lambda = inewatom("lambda");
+       nlambda = inewatom("nlambda");
+       cara = inewatom("car");
+       cdra = inewatom("cdr");
+       Veval = inewatom("eval");
+       quota = inewatom("quote");
+       reseta = inewatom("reset");
+       gcafter = inewatom("gcafter");  /* garbage collection wind-up */
+       macro = inewatom("macro");
+       ibase = inewatom("ibase");              /* base for input conversion */
+       ibase->a.clb = inewint(10);
+       (inewatom("base"))->a.clb = ibase->a.clb;
+       fclosure = inewatom("fclosure");
+       clos_marker = inewatom("int:closure-marker");
+       Vpbv = inewatom("value-structure-argument");
+       rsetatom = inewatom("*rset");
+       rsetatom->a.clb = nil;
+       Vsubrou = inewatom("subroutine");
+       Vpiport = inewatom("piport");
+       Vpiport->a.clb = P(piport = stdin);     /* standard input */
+       Vpoport = inewatom("poport");
+       Vpoport->a.clb = P(poport = stdout);    /* stand. output */
+       inewatom("errport")->a.clb = (P(errport = stderr));/* stand. err. */
+       ioname[PN(stdin)]  = (lispval) pinewstr("$stdin");
+       ioname[PN(stdout)] = (lispval) pinewstr("$stdout");
+       ioname[PN(stderr)] = (lispval) pinewstr("$stderr");
+       inewatom("Standard-Input")->a.clb = Vpiport->a.clb;
+       inewatom("Standard-Output")->a.clb = Vpoport->a.clb;
+       inewatom("Standard-Error")->a.clb = P(errport);
+       (Vreadtable = inewatom("readtable"))->a.clb  = Imkrtab(0);
+       strtab = Imkrtab(0);
+       Vptport = inewatom("ptport");
+       Vptport->a.clb = nil;                           /* protocal port */
+
+       Vcntlw = inewatom("^w");        /* when non nil, inhibits output to term */
+       Vcntlw->a.clb = nil;
+
+       Vldprt = inewatom("$ldprint");  
+                       /* when nil, inhibits printing of fasl/autoload   */
+                                               /* cfasl messages to term */
+       Vldprt->a.clb = tatom;
+
+       Vprinlevel = inewatom("prinlevel");     /* printer recursion count */
+       Vprinlevel->a.clb = nil;                /* infinite recursion */
+
+       Vprinlength = inewatom("prinlength");   /* printer element count */
+       Vprinlength->a.clb = nil;               /* infinite elements */
+
+       Vfloatformat = inewatom("float-format");
+       Vfloatformat->a.clb = (lispval) pinewstr("%.16g");
+
+       Verdepth = inewatom("Error-Depth");
+       Verdepth->a.clb = inewint(0);           /* depth of error */
+
+       Vpurcopylits = inewatom("$purcopylits");
+       Vpurcopylits->a.clb = tatom;            /* tells fasl to purcopy
+                                                *  literals it reads
+                                                */
+       Vdisplacemacros = inewatom("displace-macros");
+        Vdisplacemacros->a.clb = nil;          /* replace macros calls
+                                                * with their expanded forms
+                                                */
+
+       Vprintsym = inewatom("print");
+       
+       atom_buffer = (lispval) strbuf;
+       Vlibdir = inewatom("lisp-library-directory");
+       Vlibdir->a.clb = inewatom("/usr/lib/lisp");
+       /*  The following atoms are used as tokens by the reader  */
+
+       perda = inewatom(".");
+       lpara = inewatom("(");
+       rpara = inewatom(")");
+       lbkta = inewatom("[");
+       rbkta = inewatom("]");
+       snqta = inewatom("'");
+       exclpa = inewatom("!");
+
+
+       (Eofa = inewatom("eof"))->a.clb = eofa;
+
+       /*  The following few atoms have values the reader tokens.  */
+       /*  Perhaps this is a kludge which should be abandoned.  */
+       /*  On the other hand, perhaps it is an inspiration.    */
+
+       inewatom("perd")->a.clb = perda;
+       inewatom("lpar")->a.clb = lpara;
+       inewatom("rpar")->a.clb = rpara;
+       inewatom("lbkt")->a.clb = lbkta;
+       inewatom("rbkt")->a.clb = rbkta;
+
+       noptop = inewatom("noptop");
+
+       /*  atoms used in connection with comments.  */
+
+       commta = inewatom("comment");
+       rcomms = inewatom("readcomments");
+
+       /*  the following atoms are used for lexprs */
+
+       lexpr_atom = inewatom("last lexpr binding\7");
+       lexpr = inewatom("lexpr");
+
+       /* the following atom is used to reference the bind stack for eval */
+       bptr_atom = inewatom("eval1 binding pointer\7");
+       bptr_atom->a.clb = nil;
+
+       /* the following atoms are used for evalhook hackery */
+       evalhatom = inewatom("evalhook");
+       evalhatom->a.clb = nil;
+       evalhcallsw = FALSE;
+
+       funhatom = inewatom("funcallhook");
+       funhatom->a.clb = nil;
+       funhcallsw = FALSE;
+
+       Vevalframe = inewatom("evalframe");
+
+       sysa = inewatom("sys");
+       plima = inewatom("pagelimit");  /*  max number of pages  */
+
+
+       startup = inewatom("startup");  /*  used by save and restore  */
+       sysa = inewatom("sys"); /*  sys indicator for system variables  */
+       splice = inewatom("splicing");
+
+
+       
+       /* vector stuff */
+
+       odform = inewatom("odformat");  /* format for printf's used in od */
+       rdrsdot = newsdot();            /* used in io conversions of bignums */
+       rdrsdot2 = newsdot();           /* used in io conversions of bignums */
+       rdrint = newint();              /* used as a temporary integer */
+       (nilplist = newdot())->d.cdr = newdot();
+                                       /* used as property list for nil,
+                                          since nil will eventually be put at
+                                          0 (consequently in text and not
+                                          writable) */
+
+       /* error variables */
+       (Vererr = inewatom("ER%err"))->a.clb = nil;
+       (Vertpl = inewatom("ER%tpl"))->a.clb = nil;
+       (Verall = inewatom("ER%all"))->a.clb = nil;
+       (Vermisc = inewatom("ER%misc"))->a.clb = nil;
+       (Verbrk = inewatom("ER%brk"))->a.clb = nil;
+       (Verundef = inewatom("ER%undef"))->a.clb = nil;
+       (Vlerall = newdot())->d.car = Verall;   /* list (ER%all) */
+       (Veruwpt = inewatom("ER%unwind-protect"))->a.clb = nil;
+       (Verrset = inewatom("errset"))->a.clb = nil;
+
+
+       /* set up the initial status list */
+
+       stlist = nil;                   /* initially nil */
+       {
+           lispval feature, dom;
+           Iaddstat(inewatom("features"),ST_READ,ST_NO,nil);
+           Iaddstat(feature = inewatom("feature"),ST_FEATR,ST_FEATW,nil);
+           Isstatus(feature,inewatom("franz"));
+           Isstatus(feature,inewatom("Franz"));
+           Isstatus(feature,inewatom(OS));
+           Isstatus(feature,inewatom("string"));
+           Isstatus(feature,dom = inewatom(DOMAIN));
+           Iaddstat(inewatom("domain"),ST_READ,ST_NO,dom);
+           Isstatus(feature,inewatom(MACHINE));
+#ifdef PORTABLE
+           Isstatus(feature,inewatom("portable"));
+#endif
+#ifdef unisoft
+           Isstatus(feature,inewatom("unisoft"));
+#endif
+#ifdef sun
+           Isstatus(feature,inewatom("sun"));
+#endif
+#ifdef os_masscomp
+           Isstatus(feature,inewatom("mc500"));
+#endif
+#if os_4_1c | os_4_2 | os_4_3
+           Isstatus(feature,inewatom("long-filenames"));
+#endif
+       }
+       Iaddstat(inewatom("nofeature"),ST_NFETR,ST_NFETW,nil);
+       Iaddstat(inewatom("syntax"),ST_SYNT,ST_NO,nil);
+       Iaddstat(inewatom("uctolc"),ST_READ,ST_TOLC,nil);
+       Iaddstat(inewatom("dumpcore"),ST_READ,ST_CORE,nil);
+       Isstatus(inewatom("dumpcore"),nil);     /*set up signals*/
+
+       Iaddstat(inewatom("chainatom"),ST_RINTB,ST_INTB,inewint(0));
+       Iaddstat(inewatom("dumpmode"),ST_DMPR,ST_DMPW,nil);
+       Iaddstat(inewatom("appendmap"),ST_READ,ST_SET,nil);  /* used by fasl */
+       Iaddstat(inewatom("debugging"),ST_READ,ST_SET,nil);  
+       Iaddstat(inewatom("evalhook"),ST_RINTB,ST_INTB,inewint(3));
+       Isstatus(inewatom("evalhook"),nil); /*evalhook switch off */
+       Iaddstat(inewatom("bcdtrace"),ST_READ,ST_BCDTR,nil);
+       Iaddstat(inewatom("ctime"),ST_CTIM,ST_NO,nil);
+       Iaddstat(inewatom("localtime"),ST_LOCT,ST_NO,nil);
+       Iaddstat(inewatom("isatty"),ST_ISTTY,ST_NO,nil);
+       Iaddstat(inewatom("ignoreeof"),ST_READ,ST_SET,nil);
+       Iaddstat(inewatom("version"),ST_READ,ST_NO,mstr("Franz Lisp, Opus 38"));
+       Iaddstat(inewatom("automatic-reset"),ST_READ,ST_AUTR,nil);
+       Iaddstat(inewatom("translink"),ST_READ,ST_TRAN,nil);
+       Isstatus(inewatom("translink"),nil);            /* turn off tran links */
+       Iaddstat(inewatom("undeffunc"),ST_UNDEF,ST_NO,nil); /* list undef funcs */
+       Iaddstat(inewatom("gcstrings"),ST_READ,ST_GCSTR,nil); /* gc strings */
+
+       /* garbage collector things */
+
+       gcport = inewatom("gcport");    /* port for gc dumping */
+       gccheck = inewatom("gccheck");  /* flag for checking during gc */
+       gcdis = inewatom("gcdisable");  /* variable for disabling the gc */
+       gcdis->a.clb = nil;
+       gcload = inewatom("gcload");    /* option for gc while loading */
+       loading = inewatom("loading");  /* flag--in loader if = t  */
+       noautot = inewatom("noautotrace");      /* option to inhibit auto-trace */
+       Vgcprint = inewatom("$gcprint");        /* if t then pring gc messages */
+       Vgcprint->a.clb = nil;
+       
+       (gcthresh = newint())->i = tgcthresh;
+       gccall1 = newdot();  gccall2 = newdot();  /* used to call gcafter */
+       gccall1->d.car = gcafter;  /* start constructing a form for eval */
+
+       arrayst = mstr("ARRAY");        /* array marker in name stack */
+       bcdst = mstr("BINARY");         /* binary function marker */
+       listst = mstr("INTERPRETED");   /* interpreted function marker */
+       macrost = mstr("MACRO");        /* macro marker */
+       protst = mstr("PROTECTED");     /* protection marker */
+       badst = mstr("BADPTR");         /* bad pointer marker */
+       argst = mstr("ARGST");          /* argument marker */
+       hunkfree = mstr("EMPTY");       /* empty hunk cell value */
+
+       /* type names */
+
+       FIDDLE(atom_name,atom_items,atom_pages,ATOMSPP);
+       FIDDLE(str_name,str_items,str_pages,STRSPP);
+       FIDDLE(other_name,other_items,other_pages,STRSPP);
+       FIDDLE(int_name,int_items,int_pages,INTSPP);
+       FIDDLE(dtpr_name,dtpr_items,dtpr_pages,DTPRSPP);
+       FIDDLE(doub_name,doub_items,doub_pages,DOUBSPP);
+       FIDDLE(sdot_name,sdot_items,sdot_pages,SDOTSPP);
+       FIDDLE(array_name,array_items,array_pages,ARRAYSPP);
+       FIDDLE(val_name,val_items,val_pages,VALSPP);
+       FIDDLE(funct_name,funct_items,funct_pages,BCDSPP);
+
+       FIDDLE(hunk_name[0], hunk_items[0], hunk_pages[0], HUNK2SPP);
+       FIDDLE(hunk_name[1], hunk_items[1], hunk_pages[1], HUNK4SPP);
+       FIDDLE(hunk_name[2], hunk_items[2], hunk_pages[2], HUNK8SPP);
+       FIDDLE(hunk_name[3], hunk_items[3], hunk_pages[3], HUNK16SPP);
+       FIDDLE(hunk_name[4], hunk_items[4], hunk_pages[4], HUNK32SPP);
+       FIDDLE(hunk_name[5], hunk_items[5], hunk_pages[5], HUNK64SPP);
+       FIDDLE(hunk_name[6], hunk_items[6], hunk_pages[6], HUNK128SPP);
+       
+       FIDDLE(vect_name, vect_items, vect_pages, VECTORSPP)
+       FIDDLE(vecti_name, vecti_items, vecti_pages, VECTORSPP)
+
+       (plimit = newint())->i = page_limit;
+       copval(plima,plimit);  /*  default value  */
+
+       /* the following atom is used when reading caar, cdar, etc. */
+
+       xatom = inewatom("??");
+       dofuns();
+#if sun_4_1c ||sun_4_2 || sun_4_2beta
+       hookupcore();
+#endif
+       /*  now it is OK to collect garbage  */
+
+       initflag = FALSE;
+       }
+
+/*  matom("name")  ******************************************************/
+/*                                                                     */
+/*  simulates an atom being read in from the reader and returns a      */
+/*  pointer to it.                                                     */
+/*                                                                     */
+/*  BEWARE:  if an atom becomes "truly worthless" and is collected,    */
+/*  the pointer becomes obsolete.                                      */
+/*                                                                     */
+lispval
+matom(string)
+char *string;
+       {
+       strbuf[0] = 0;
+       strncat(strbuf,string,STRBLEN-1); /* strcpyn always pads to n */
+       strbuf[STRBLEN-1] = 0;
+       return(getatom(TRUE));
+       }
+
+/*  mstr  ***************************************************************/
+/*                                                                     */
+/*  Makes a string.  Uses matom.                                       */
+/*  Not the most efficient but will do until the string from the code  */
+/*  itself can be used as a lispval.                                   */
+
+lispval mstr(string) char *string;
+       {
+       return((lispval)(pinewstr(string)));
+       }
+
+/*  mfun("name",start)  *************************************************/
+/*                                                                     */
+/*  Same as matom, but entry point to c code is associated with                */
+/*  "name" as function binding.                                                */
+/*  A pointer to the atom is returned.                                 */
+/*                                                                     */
+lispval mfun(string,start,discip) char *string; lispval (*start)(), discip;
+       {
+       lispval v;
+       v = inewatom(string);
+       v->a.fnbnd = newfunct();
+       v->a.fnbnd->bcd.start = start;
+       v->a.fnbnd->bcd.discipline = discip;
+       return(v);
+       }
+
+struct ftab {
+       char *string;
+       lispval (*start)();
+       lispval *discip;
+};
+
+lispval
+mftab(table)
+register struct ftab *table;
+{
+       register lispval v;
+       for(;table->string;table++) {
+               v = inewatom(table->string);
+               v = v->a.fnbnd = newfunct();
+               v->bcd.start = table->start;
+               v->bcd.discipline = *table->discip;
+       }
+}
+
+static struct ftab cfuns[] = {
+  {"car", Lcar, &(lambda)},
+  {"cdr", Lcdr, &(lambda)},
+  {"eval", Leval1, &(lambda)},
+  {"asin", Lasin, &(lambda)},
+  {"acos", Lacos, &(lambda)},
+  {"atan", Latan, &(lambda)},
+  {"cos", Lcos, &(lambda)},
+  {"sin", Lsin, &(lambda)},
+  {"sqrt", Lsqrt, &(lambda)},
+  {"exp", Lexp, &(lambda)},
+  {"log", Llog, &(lambda)},
+  {"lsh", Llsh, &(lambda)},
+  {"bignum-leftshift", Lbiglsh, &(lambda)},
+  {"sticky-bignum-leftshift", Lsbiglsh, &(lambda)},
+  {"frexp", Lfrexp, &(lambda)},
+  {"rot", Lrot, &(lambda)},
+  {"random", Lrandom, &(lambda)},
+  {"atom", Latom, &(lambda)},
+  {"apply", Lapply, &(lambda)},
+  {"funcall", Lfuncal, &(lambda)},
+  {"lexpr-funcall", Llexfun, &(lambda)},
+  {"return", Lreturn, &(lambda)},
+/*     MK("cont",Lreturn,lambda),  */
+  {"cons", Lcons, &(lambda)},
+  {"scons", Lscons, &(lambda)},
+  {"bignum-to-list", Lbigtol, &(lambda)},
+  {"cadr", Lcadr, &(lambda)},
+  {"caar", Lcaar, &(lambda)},
+  {"cddr", Lc02r, &(lambda)},
+  {"caddr", Lc12r, &(lambda)},
+  {"cdddr", Lc03r, &(lambda)},
+  {"cadddr", Lc13r, &(lambda)},
+  {"cddddr", Lc04r, &(lambda)},
+  {"caddddr", Lc14r, &(lambda)},
+  {"nthelem", Lnthelem, &(lambda)},
+  {"eq", Leq, &(lambda)},
+  {"equal", Lequal, &(lambda)},
+/**    MK("zqual",Zequal,lambda),      */
+  {"numberp", Lnumberp, &(lambda)},
+  {"dtpr", Ldtpr, &(lambda)},
+  {"bcdp", Lbcdp, &(lambda)},
+  {"portp", Lportp, &(lambda)},
+  {"arrayp", Larrayp, &(lambda)},
+  {"valuep", Lvaluep, &(lambda)},
+  {"get_pname", Lpname, &(lambda)},
+  {"ptr", Lptr, &(lambda)},
+  {"arrayref", Larayref, &(lambda)},
+  {"marray", Lmarray, &(lambda)},
+  {"getlength", Lgetl, &(lambda)},
+  {"putlength", Lputl, &(lambda)},
+  {"getaccess", Lgeta, &(lambda)},
+  {"putaccess", Lputa, &(lambda)},
+  {"getdelta", Lgetdel, &(lambda)},
+  {"putdelta", Lputdel, &(lambda)},
+  {"getaux", Lgetaux, &(lambda)},
+  {"putaux", Lputaux, &(lambda)},
+  {"getdata", Lgetdata, &(lambda)},
+  {"putdata", Lputdata, &(lambda)},
+  {"mfunction", Lmfunction, &(lambda)},
+  {"getentry", Lgtentry, &(lambda)},
+  {"getdisc", Lgetdisc, &(lambda)},
+  {"putdisc", Lputdisc, &(lambda)},
+  {"segment", Lsegment, &(lambda)},
+  {"rplaca", Lrplca, &(lambda)},
+  {"rplacd", Lrplcd, &(lambda)},
+  {"set", Lset, &(lambda)},
+  {"replace", Lreplace, &(lambda)},
+  {"infile", Linfile, &(lambda)},
+  {"outfile", Loutfile, &(lambda)},
+  {"terpr", Lterpr, &(lambda)},
+  {"print", Lprint, &(lambda)},
+  {"close", Lclose, &(lambda)},
+  {"patom", Lpatom, &(lambda)},
+  {"pntlen", Lpntlen, &(lambda)},
+  {"read", Lread, &(lambda)},
+  {"ratom", Lratom, &(lambda)},
+  {"readc", Lreadc, &(lambda)},
+  {"truename", Ltruename, &(lambda)},
+  {"implode", Limplode, &(lambda)},
+  {"maknam", Lmaknam, &(lambda)},
+  {"deref", Lderef, &(lambda)},
+  {"concat", Lconcat, &(lambda)},
+  {"uconcat", Luconcat, &(lambda)},
+  {"putprop", Lputprop, &(lambda)},
+  {"monitor", Lmonitor, &(lambda)},
+  {"get", Lget, &(lambda)},
+  {"getd", Lgetd, &(lambda)},
+  {"putd", Lputd, &(lambda)},
+  {"prog", Nprog, &(nlambda)},
+  {"quote", Nquote, &(nlambda)},
+  {"function", Nfunction, &(nlambda)},
+  {"go", Ngo, &(nlambda)},
+  {"*catch", Ncatch, &(nlambda)},
+  {"errset", Nerrset, &(nlambda)},
+  {"status", Nstatus, &(nlambda)},
+  {"sstatus", Nsstatus, &(nlambda)},
+  {"err-with-message", Lerr, &(lambda)},
+  {"*throw", Nthrow, &(lambda)},       /* this is a lambda now !! */
+  {"reset", Nreset, &(nlambda)},
+  {"break", Nbreak, &(nlambda)},
+  {"exit", Lexit, &(lambda)},
+  {"def", Ndef, &(nlambda)},
+  {"null", Lnull, &(lambda)},
+               /*{"framedump", Lframedump, &(lambda)},*/
+  {"and", Nand, &(nlambda)},
+  {"or", Nor, &(nlambda)},
+  {"setq", Nsetq, &(nlambda)},
+  {"cond", Ncond, &(nlambda)},
+  {"list", Llist, &(lambda)},
+  {"load", Lload, &(lambda)},
+  {"nwritn", Lnwritn, &(lambda)},
+  {"*process", Lprocess, &(lambda)},   /*  execute a shell command  */
+  {"allocate", Lalloc, &(lambda)},     /*  allocate a page  */
+  {"sizeof", Lsizeof, &(lambda)},      /*  size of one item of a data type  */
+  {"dumplisp", Ndumplisp, &(nlambda)}, /*  NEW save the world  */
+  {"top-level", Ntpl, &(nlambda)},     /*  top level eval-print read loop  */
+  {"mapcar", Lmpcar, &(lambda)},
+  {"maplist", Lmaplist, &(lambda)},
+  {"mapcan", Lmapcan, &(lambda)},
+  {"mapcon", Lmapcon, &(lambda)},
+  {"assq", Lassq, &(lambda)},
+  {"mapc", Lmapc, &(lambda)},
+  {"map", Lmap, &(lambda)},
+  {"flatc", Lflatsi, &(lambda)},
+  {"alphalessp", Lalfalp, &(lambda)},
+  {"drain", Ldrain, &(lambda)},
+  {"killcopy", Lkilcopy, &(lambda)}, /*  forks aand aborts for adb */
+  {"opval", Lopval, &(lambda)},        /*  sets and retrieves system variables  */
+  {"ncons", Lncons, &(lambda)},
+  {"remob", Lforget, &(lambda)},       /*  function to take atom out of hash table  */
+  {"not", Lnull, &(lambda)},
+  {"plus", Ladd, &(lambda)},
+  {"add", Ladd, &(lambda)},
+  {"times", Ltimes, &(lambda)},
+  {"difference", Lsub, &(lambda)},
+  {"quotient", Lquo, &(lambda)},
+  {"+", Lfp, &(lambda)},
+  {"-", Lfm, &(lambda)},
+  {"*", Lft, &(lambda)},
+  {"/", Lfd, &(lambda)},
+  {"1+", Lfadd1, &(lambda)},
+  {"1-", Lfsub1, &(lambda)},
+  {"^", Lfexpt, &(lambda)},
+  {"double-to-float", Ldbtofl, &(lambda)},
+  {"float-to-double", Lfltodb, &(lambda)},
+  {"<", Lflessp, &(lambda)},
+  {"mod", Lmod, &(lambda)},
+  {"minus", Lminus, &(lambda)},
+  {"absval", Labsval, &(lambda)},
+  {"add1", Ladd1, &(lambda)},
+  {"sub1", Lsub1, &(lambda)},
+  {"greaterp", Lgreaterp, &(lambda)},
+  {"lessp", Llessp, &(lambda)},
+  {"any-zerop", Lzerop, &(lambda)},   /* used when bignum arg possible */
+  {"zerop", Lzerop, &(lambda)},
+  {"minusp", Lnegp, &(lambda)},
+  {"onep", Lonep, &(lambda)},
+  {"sum", Ladd, &(lambda)},
+  {"product", Ltimes, &(lambda)},
+  {"do", Ndo, &(nlambda)},
+  {"progv", Nprogv, &(nlambda)},
+  {"progn", Nprogn, &(nlambda)},
+  {"prog2", Nprog2, &(nlambda)},
+  {"oblist", Loblist, &(lambda)},
+  {"baktrace", Lbaktrace, &(lambda)},
+  {"tyi", Ltyi, &(lambda)},
+  {"tyipeek", Ltyipeek, &(lambda)},
+  {"untyi", Luntyi, &(lambda)},
+  {"tyo", Ltyo, &(lambda)},
+  {"termcapinit", Ltci, &(lambda)},
+  {"termcapexe", Ltcx, &(lambda)},
+  {"int:setsyntax", Lsetsyn, &(lambda)},       /* an internal function */
+  {"int:getsyntax", Lgetsyntax, &(lambda)},
+  {"int:showstack", LIshowstack, &(lambda)},
+  {"int:franz-call", LIfranzcall, &(lambda)},
+  {"makereadtable", Lmakertbl, &(lambda)},
+  {"zapline", Lzapline, &(lambda)},
+  {"aexplode", Lxplda, &(lambda)},
+  {"aexplodec", Lxpldc, &(lambda)},
+  {"aexploden", Lxpldn, &(lambda)},
+  {"hashtabstat", Lhashst, &(lambda)},
+#ifdef METER
+  {"gcstat", Lgcstat, &(lambda)},
+#endif
+  {"argv", Largv, &(lambda)},
+  {"arg", Larg, &(lambda)},
+  {"setarg", Lsetarg, &(lambda)},
+  {"showstack", Lshostk, &(lambda)},
+  {"freturn", Lfretn, &(lambda)},
+  {"*rset", Lrset, &(lambda)},
+  {"eval1", Leval1, &(lambda)},
+  {"evalframe", Levalf, &(lambda)},
+  {"evalhook", Levalhook, &(lambda)},
+  {"funcallhook", Lfunhook, &(lambda)},
+  {"int:fclosure-stack-stuff", LIfss, &(lambda)},
+  {"resetio", Nioreset, &(nlambda)},
+  {"chdir", Lchdir, &(lambda)},
+  {"ascii", Lascii, &(lambda)},
+  {"boole", Lboole, &(lambda)},
+  {"type", Ltype, &(lambda)},  /* returns type-name of argument */
+  {"fix", Lfix, &(lambda)},
+  {"float", Lfloat, &(lambda)},
+  {"fact", Lfact, &(lambda)},
+  {"cpy1", Lcpy1, &(lambda)},
+  {"Divide", LDivide, &(lambda)},
+  {"Emuldiv", LEmuldiv, &(lambda)},
+  {"readlist", Lreadli, &(lambda)},
+  {"plist", Lplist, &(lambda)},        /* gives the plist of an atom */
+  {"setplist", Lsetpli, &(lambda)},    /* get plist of an atom  */
+  {"eval-when", Nevwhen, &(nlambda)},
+  {"syscall", Lsyscall, &(lambda)},
+  {"intern", Lntern, &(lambda)},
+  {"ptime", Lptime, &(lambda)},        /* return process user time */
+  {"fork", Lfork, &(lambda)},  /* turn on fork and wait */
+  {"wait", Lwait, &(lambda)},
+/*     MK("pipe",Lpipe,lambda),        */
+/*     MK("fdopen",Lfdopen,lambda), */
+  {"exece", Lexece, &(lambda)},
+  {"gensym", Lgensym, &(lambda)},
+  {"remprop", Lremprop, &(lambda)},
+  {"bcdad", Lbcdad, &(lambda)},
+  {"symbolp", Lsymbolp, &(lambda)},
+  {"stringp", Lstringp, &(lambda)},
+  {"rematom", Lrematom, &(lambda)},
+/**    MK("prname",Lprname,lambda),    */
+  {"getenv", Lgetenv, &(lambda)},
+  {"I-throw-err", Lctcherr, &(lambda)}, /* directly force a throw or error */
+  {"makunbound", Lmakunb, &(lambda)},
+  {"haipart", Lhaipar, &(lambda)},
+  {"haulong", Lhau, &(lambda)},
+  {"signal", Lsignal, &(lambda)},
+  {"fasl", Lfasl, &(lambda)},  /* NEW - new fasl loader */
+  {"cfasl", Lcfasl, &(lambda)},        /* read in compiled C file */
+  {"getaddress", Lgetaddress, &(lambda)},
+  {"removeaddress", Lrmadd, &(lambda)},        /* unbind symbols    */
+  {"make-c-thunk", Lmkcth, &(lambda)},         /* make wrappers    */
+  {"boundp", Lboundp, &(lambda)},      /* tells if an atom is bound */
+  {"fake", Lfake, &(lambda)},  /* makes a fake lisp pointer */
+/***   MK("od",Lod,lambda),            /* dumps info */
+  {"maknum", Lmaknum, &(lambda)},      /* converts a pointer to an integer */
+  {"*mod", LstarMod, &(lambda)},               /* return fixnum modulus */
+  {"*invmod", Lstarinvmod, &(lambda)}, /* return fixnum modulus ^-1 */
+  {"fseek", Lfseek, &(lambda)},        /* seek to a specific byte in a file */
+  {"fileopen",  Lfileopen, &( lambda)},
+  {"pv%", Lpolyev, &(lambda)}, /* polynomial evaluation instruction*/
+  {"cprintf", Lcprintf, &(lambda)},  /* formatted print                    */
+  {"sprintf", Lsprintf, &(lambda)},  /* formatted print to string          */
+  {"copyint*", Lcopyint, &(lambda)},   /* copyint*  */
+  {"purcopy", Lpurcopy, &(lambda)},    /* pure copy */
+  {"purep", Lpurep, &(lambda)},        /* check if pure */
+  {"int:memreport", LImemory, &(lambda)}, /* dump memory stats */
+/*
+ * Hunk stuff
+ */
+  {"*makhunk", LMakhunk, &(lambda)},           /* special hunk creater */
+  {"hunkp", Lhunkp, &(lambda)},                /* test a hunk */
+  {"cxr", Lcxr, &(lambda)},                    /* cxr of a hunk */
+  {"rplacx", Lrplcx, &(lambda)},               /* replace element of a hunk */
+  {"*rplacx", Lstarrpx, &(lambda)},            /* rplacx used by hunk */
+  {"hunksize", Lhunksize, &(lambda)},  /* size of a hunk */
+  {"hunk-to-list", Lhtol, &(lambda)},  /* hunk to list */
+  {"new-vector", Lnvec, &(lambda)},
+  {"new-vectori-byte", Lnvecb, &(lambda)},
+  {"new-vectori-word", Lnvecw, &(lambda)},
+  {"new-vectori-long", Lnvecl, &(lambda)},
+  {"vectorp", Lvectorp, &(lambda)},
+  {"vectorip", Lpvp, &(lambda)},
+  {"int:vref", LIvref, &(lambda)},
+  {"int:vset", LIvset, &(lambda)},
+  {"int:vsize", LIvsize, &(lambda)},
+  {"vsetprop", Lvsp, &(lambda)},
+  {"vprop", Lvprop, &(lambda)},
+  {"probef", Lprobef, &(lambda)},      /* test file existance */
+  {"substring", Lsubstring, &(lambda)},
+  {"substringn", Lsstrn, &(lambda)},
+  {"character-index", Lcharindex, &(lambda)}, /* index of char in string */
+  {"time-string", Ltymestr, &(lambda)},
+  {"gc", Ngc, &(nlambda)},
+  {"gcafter", Ngcafter, &(nlambda)},   /* garbage collection wind-up */
+  {0}
+};
+static dofuns(){mftab(cfuns);}