9 static char *
rcsid=
"@(#) $Id$";
21 #include <lwp/stackdep.h> 29 #if Linux && !OLD_LINUX && !Darwin 48 #define DEFAULT_MAX_GCSTACK 16384 203 "attempt to set to constant",
205 "undefined function",
214 "illegal lambda form",
215 "illegal lambda parameter syntax",
219 "illegal stream direction keyword",
222 "error in open file",
225 "class table overflow",
228 "array size must be positive",
229 "duplicated object variable name",
230 "cannot make instance",
231 "array index out of range",
232 "cannot find method",
234 "unknown sharp macro",
235 "list expected for an element of an alist",
239 "invalid lisp object form",
240 "no such object variable",
242 "illegal start/end index",
244 "invalid format string",
245 "float vector expected",
246 "char code out of range",
247 "vector dimension mismatch",
250 "declaration is not allowed here",
251 "illegal declaration form",
252 "cannot be used for a variable",
253 "illegal rotation axis",
254 "multiple variable declaration",
255 "illegal #n= or #n= label",
256 "illegal #f( expression",
257 "illegal #v or #j expression",
258 "invalid socket address",
260 "array dimension mismatch",
261 "keyword expected for arguments",
263 "integer vector expected",
264 "sequence index out of range",
266 "no such external symbol",
279 cleanup=ctx->protfp->cleaner;
280 ctx->protfp=ctx->protfp->protlink;
289 while (ctx->blkfp>(
struct blockframe *)p) ctx->blkfp=ctx->blkfp->dynklink;
291 while (ctx->catchfp>(
struct catchframe *)p) ctx->catchfp=ctx->catchfp->nextcatch;
293 while (ctx->fletfp>(
struct fletframe *)p) ctx->fletfp=ctx->fletfp->dynlink;
305 register char *errstr;
324 n=
intval(Spevalof(MAXCALLSTACKDEPTH));
326 fprintf( stderr,
"Call Stack (max depth: %d):\n", n );
329 fprintf( stderr,
" %d: at ", i );
330 prinx(ctx, vf->form, ERROUT);
332 fprintf( stderr,
"\n" ); }
333 if (vf->vlink !=
NULL) {
334 fprintf (stderr,
" And more...\n"); }}
339 fprintf( stderr,
"Internal warning: error: ec will be string.(%lx)\n",
345 if ((
unsigned int)ec<=E_FATAL) {
347 if (speval(FATALERROR) != NIL) {
348 fprintf(stderr,
"exiting\n"); exit(ec);}
349 else throw(ctx,
makeint(0),NIL);}
352 switch((
unsigned int)ec) {
358 msg = va_arg(args,
pointer);
break;
363 if (errhandler==NIL || errhandler==
NULL) errhandler=Spevalof(ERRHANDLER);
364 Spevalof(QEVALHOOK)=
NIL;
365 if (errhandler!=NIL) {
366 vpush(
makeint((
unsigned int)ec));
369 switch((
unsigned int)ec) {
374 vpush(msg); argc=4;
break;
376 vpush(
makestring((
char*)msg,strlen((
char*)msg))); argc=4;
break;
377 default: argc=3;
break;}
393 fprintf( stderr,
"%s",(
char*)msg );
flushstream(ERROUT); }
396 fprintf(stderr,
" in ");
415 pointer classsym,
class,varvector,superv,typevector,forwardvector;
425 name=va_arg(ap,
byte *);
428 cixp=va_arg(ap,
cixpair *); n=va_arg(ap,
int);
431 classsym=
intern(ctx,(
char *)name,strlen(name),lisppkg);
436 svcount=vecsize(superv);}
439 varvector=
makevector(C_VECTOR,svcount+n); vpush(varvector);
440 typevector=
makevector(C_VECTOR,svcount+n); vpush(typevector);
441 forwardvector=
makevector(C_VECTOR,svcount+n); vpush(forwardvector);
442 for (i=0; i<svcount; i++) {
446 for (i=0; i<
n; i++) {
447 vname=va_arg(ap,
byte *);
448 varvector->
c.
vec.
v[i+svcount]=
intern(ctx,(
char *)vname,strlen((
char *)vname),lisppkg);
450 typevector->
c.
vec.
v[i+svcount]=
T;
451 forwardvector->
c.
vec.
v[i+svcount]=
NIL;}
452 class=
makeclass(ctx,classsym,super,varvector,typevector,forwardvector,ELM_FIXED,0);
470 for (i=2; i<MAXBUDDY; i++) {
475 #if (WORD_SIZE == 64) 494 for (i=2; i<MAXBUDDY; i++) {
499 #if (WORD_SIZE == 64) 508 fprintf(stderr,
"allocate_heap: %d bytes\n", tmp*4);
522 objectcp.
cix=0; objectcp.
sub=0;
523 conscp.
cix=1; conscp.
sub=1;
524 propobjcp.
cix=2; propobjcp.
sub=12;
525 symbolcp.
cix=3; symbolcp.
sub=3;
526 packagecp.
cix=4; packagecp.
sub=4;
527 streamcp.
cix=5; streamcp.
sub=6;
528 filestreamcp.
cix=6; filestreamcp.
sub=6;
529 iostreamcp.
cix=7; iostreamcp.
sub=7;
530 metaclasscp.
cix=8; metaclasscp.
sub=9;
531 vecclasscp.
cix=9; vecclasscp.
sub=9;
532 readtablecp.
cix=10; readtablecp.
sub=10;
533 arraycp.
cix=11; arraycp.
sub=11;
534 threadcp.
cix=12; threadcp.
sub=12;
536 codecp.
cix=13; codecp.
sub=16;
537 fcodecp.
cix=14; fcodecp.
sub=14;
538 closurecp.
cix=15; closurecp.
sub=15;
539 ldmodulecp.
cix=16; ldmodulecp.
sub=16;
541 labrefcp.
cix=17; labrefcp.
sub=17;
543 vectorcp.
cix=18; vectorcp.
sub=21;
544 fltvectorcp.
cix=19; fltvectorcp.
sub=19;
545 intvectorcp.
cix=20; intvectorcp.
sub=20;
546 stringcp.
cix=21; stringcp.
sub=21;
563 NIL=
defconst(ctx,
"NIL",NIL,lisppkg);
594 PACKAGE=
deflocal(ctx,
"*PACKAGE*",lisppkg,lisppkg);
595 OPTIONAL=
intern(ctx,
"&OPTIONAL",9,lisppkg);
596 REST=
intern(ctx,
"&REST",5,lisppkg);
597 KEY=
intern(ctx,
"&KEY",4,lisppkg);
598 AUX=
intern(ctx,
"&AUX",4,lisppkg);
599 ALLOWOTHERKEYS=
intern(ctx,
"&ALLOW-OTHER-KEYS",17,lisppkg);
600 LAMBDA=
intern(ctx,
"LAMBDA",6,lisppkg);
601 MACRO=
intern(ctx,
"MACRO",5,lisppkg);
602 FUNCTION=
intern(ctx,
"FUNCTION",8,lisppkg);
603 LAMCLOSURE=
intern(ctx,
"LAMBDA-CLOSURE",14,lisppkg);
604 COMCLOSURE=
intern(ctx,
"COMPILED-CLOSURE",16,lisppkg);
605 QDECLARE=
intern(ctx,
"DECLARE",7,lisppkg);
606 QSPECIAL=
intern(ctx,
"SPECIAL",7,lisppkg);
608 QSELF=
intern(ctx,
"SELF",4,lisppkg);
610 SELF=
intern(ctx,
"SELF",4,lisppkg);
612 CLASS=
intern(ctx,
"CLASS",5,lisppkg);
638 K_FOREIGN_STRING=
defkeyword(ctx,
"FOREIGN-STRING");
639 K_ALLOWOTHERKEYS=
defkeyword(ctx,
"ALLOW-OTHER-KEYS");
642 K_FUNCTION_DOCUMENTATION=
defkeyword(ctx,
"FUNCTION-DOCUMENTATION");
643 K_CLASS_DOCUMENTATION=
defkeyword(ctx,
"CLASS-DOCUMENTATION");
644 K_VARIABLE_DOCUMENTATION=
defkeyword(ctx,
"VARIABLE-DOCUMENTATION");
645 K_METHOD_DOCUMENTATION=
defkeyword(ctx,
"METHOD-DOCUMENTATION");
647 QINTEGER=
intern(ctx,
"INTEGER",7,lisppkg);
648 QFLOAT=
intern(ctx,
"FLOAT",5,lisppkg);
649 QFIXNUM=
intern(ctx,
"FIXNUM",6,lisppkg);
650 QNUMBER=
intern(ctx,
"NUMBER",6,lisppkg);
651 QDEBUG=
defvar(ctx,
"*DEBUG*",NIL,lisppkg);
653 PRCASE=
deflocal(ctx,
"*PRINT-CASE*",K_DOWNCASE,lisppkg);
654 PRCIRCLE=
deflocal(ctx,
"*PRINT-CIRCLE*",NIL,lisppkg);
655 PROBJECT=
deflocal(ctx,
"*PRINT-OBJECT*",NIL,lisppkg);
656 PRSTRUCTURE=
deflocal(ctx,
"*PRINT-STRUCTURE*",NIL,lisppkg);
657 PRLENGTH=
deflocal(ctx,
"*PRINT-LENGTH*",NIL,lisppkg);
658 PRLEVEL=
deflocal(ctx,
"*PRINT-LEVEL*",NIL,lisppkg);
659 QREADTABLE=
deflocal(ctx,
"*READTABLE*",NIL,lisppkg);
660 TOPLEVEL=
defvar(ctx,
"*TOPLEVEL*",NIL,lisppkg);
661 ERRHANDLER=
deflocal(ctx,
"*ERROR-HANDLER*",NIL,lisppkg);
662 QEVALHOOK=
deflocal(ctx,
"*EVALHOOK*",NIL,lisppkg);
663 QUNBOUND=
intern(ctx,
"*UNBOUND*",9,lisppkg);
664 RANDSTATE=
deflocal(ctx,
"*RANDOM-STATE*",UNBOUND,lisppkg);
665 FEATURES=
defvar(ctx,
"*FEATURES*",NIL,lisppkg);
668 MAXCALLSTACKDEPTH=
deflocal(ctx,
"*MAX-CALLSTACK-DEPTH*",
makeint(20),lisppkg);
671 QSTDIN=
deflocal(ctx,
"*STANDARD-INPUT*",STDIN,lisppkg);
673 QSTDOUT=
deflocal(ctx,
"*STANDARD-OUTPUT*",STDOUT,lisppkg);
675 QERROUT=
deflocal(ctx,
"*ERROR-OUTPUT*",ERROUT,lisppkg);
676 QTERMIO=
deflocal(ctx,
"*TERMINAL-IO*",NIL,lisppkg);
679 QLDENT=
defvar(ctx,
"*LOAD-ENTRIES*", NIL, syspkg);
680 QTHREADS=
defvar(ctx,
"*THREADS*", NIL, syspkg);
681 QPARAGC=
defvar(ctx,
"*PARALLEL-GC*", NIL, syspkg);
682 QGCHOOK=
defvar(ctx,
"*GC-HOOK*",NIL,syspkg);
683 QEXITHOOK=
defvar(ctx,
"*EXIT-HOOK*",NIL,syspkg);
684 FATALERROR=
defvar(ctx,
"*EXIT-ON-FATAL-ERROR*",NIL,lisppkg);
687 for (i=0; i<256; i++) charmacro[i]=sharpmacro[i]=NIL;
690 for (i=0; i<NSIG; i++) eussigvec[i]=NIL;
701 C_OBJECT=speval(OBJECT);
703 QCONS=
basicclass(
"CONS",C_OBJECT,&conscp,2,
"CAR",
"CDR");
704 C_CONS=speval(QCONS);
706 PROPOBJ=
basicclass(
"PROPERTIED-OBJECT",C_OBJECT, &propobjcp,1,
"PLIST");
707 C_PROPOBJ=speval(PROPOBJ);
709 SYMBOL=
basicclass(
"SYMBOL",C_PROPOBJ,&symbolcp,5,
710 "VALUE",
"VTYPE",
"FUNCTION",
"PNAME",
"HOMEPKG");
711 C_SYMBOL=speval(SYMBOL);
713 PKGCLASS=
basicclass(
"PACKAGE",C_PROPOBJ,&packagecp,
714 8,
"NAMES",
"USE",
"SYMVECTOR",
"SYMCOUNT",
715 "INTSYMVECTOR",
"INTSYMCOUNT",
"SHADOWS",
"USED-BY");
716 C_PACKAGE=speval(PKGCLASS);
718 STREAM=
basicclass(
"STREAM",C_PROPOBJ,&streamcp,
719 4,
"DIRECTION",
"BUFFER",
"COUNT",
"TAIL");
720 C_STREAM=speval(STREAM);
722 FILESTREAM=
basicclass(
"FILE-STREAM",C_STREAM,&filestreamcp,2,
"FD",
"FNAME");
723 C_FILESTREAM=speval(FILESTREAM);
725 IOSTREAM=
basicclass(
"IO-STREAM",C_PROPOBJ,&iostreamcp,2,
"INSTREAM",
"OUTSTREAM");
726 C_IOSTREAM=speval(IOSTREAM);
728 METACLASS=
basicclass(
"METACLASS",C_PROPOBJ,&metaclasscp,
729 7,
"NAME",
"SUPER",
"CIX",
"VARS",
"TYPES",
"FORWARDS",
"METHODS");
730 C_METACLASS=speval(METACLASS);
732 VECCLASS=
basicclass(
"VECTORCLASS",C_METACLASS,&vecclasscp,
733 2,
"ELEMENT-TYPE",
"SIZE");
734 C_VCLASS=speval(VECCLASS);
736 READTABLE=
basicclass(
"READTABLE",C_PROPOBJ,&readtablecp,
737 4,
"SYNTAX",
"MACRO",
"DISPATCH-MACRO",
"CASE");
738 C_READTABLE=speval(READTABLE);
741 11,
"ENTITY",
"RANK",
"FILL-POINTER",
"DISPLACED-INDEX-OFFSET",
742 "DIM0",
"DIM1",
"DIM2",
"DIM3",
"DIM4",
"DIM5",
"DIM6");
743 C_ARRAY=speval(ARRAY);
745 THREAD=
basicclass(
"THREAD", C_PROPOBJ, &threadcp,
746 10,
"ID",
"REQUESTER",
"REQUEST-SEM",
"DONE-SEM",
747 "FUNC",
"ARGS",
"RESULT",
"CONTEXT",
749 C_THREAD=speval(THREAD);
751 CODE=
basicclass(
"COMPILED-CODE",C_OBJECT,&codecp,4,
"CODEVECTOR",
"QUOTEVECTOR",
755 FCODE=
basicclass(
"FOREIGN-CODE",C_CODE,&fcodecp,3,
"ENTRY2",
"PARAMTYPES",
"RESULTTYPE");
756 C_FCODE=speval(FCODE);
758 #if (WORD_SIZE == 64) 759 CLOSURE=
basicclass(
"CLOSURE",C_CODE,&closurecp,
765 "ENV0",
"ENV1",
"ENV2");
767 CLOSURE=
basicclass(
"CLOSURE",C_CODE,&closurecp,
775 C_CLOSURE=speval(CLOSURE);
777 LDMODULE=
basicclass(
"LOAD-MODULE",C_CODE, &ldmodulecp,
783 "SYMBOL-TABLE",
"OBJECT-FILE",
"HANDLE");
784 C_LDMOD=speval(LDMODULE);
786 LABREF=
basicclass(
"LABEL-REFERENCE",C_OBJECT,&labrefcp,4,
787 "LABEL",
"VALUE",
"UNSOLVED",
"NEXT");
788 C_LABREF=speval(LABREF);
790 VECTOR=
defvector(ctx,
"VECTOR",C_OBJECT,ELM_POINTER, 0);
791 C_VECTOR=speval(VECTOR);
795 FLTVECTOR=
defvector(ctx,
"FLOAT-VECTOR",C_VECTOR,ELM_FLOAT, 0);
796 C_FLTVECTOR=speval(FLTVECTOR);
800 INTVECTOR=
defvector(ctx,
"INTEGER-VECTOR",C_VECTOR,ELM_INT, 0);
801 C_INTVECTOR=speval(INTVECTOR);
805 STRING=
defvector(ctx,
"STRING",C_VECTOR,ELM_CHAR, 0);
806 C_STRING=speval(STRING);
810 BITVECTOR=
defvector(ctx,
"BIT-VECTOR",C_VECTOR,ELM_BIT, 0);
811 C_BITVECTOR=speval(BITVECTOR);
816 EXTNUM=
basicclass(
"EXTENDED-NUMBER",C_OBJECT,&extnumcp,0);
817 C_EXTNUM=speval(EXTNUM);
818 RATIO=
basicclass(
"RATIO",C_EXTNUM, &ratiocp,2,
"NUMERATOR",
"DENOMINATOR");
819 C_RATIO=speval(RATIO);
820 COMPLEX=
basicclass(
"COMPLEX", C_EXTNUM, &complexcp, 2,
"REAL",
"IMAGINARY");
821 C_COMPLEX=speval(COMPLEX);
822 BIGNUM=
basicclass(
"BIGNUM", C_EXTNUM, &bignumcp, 2,
"SIZE",
"BV");
823 C_BIGNUM=speval(BIGNUM);
825 for (i=0;i<MAXTHREAD;i++) {
827 sysobj=
cons(ctx,oblabels[i],sysobj);
834 extern char *makedate;
835 extern char *gitrevision;
836 extern char *compilehost;
840 p=
makestring(compilehost,strlen(compilehost));
844 p=
makestring(gitrevision,strlen(gitrevision));
847 QVERSION=
defvar(ctx,
"LISP-IMPLEMENTATION-VERSION", p,lisppkg);
859 p=
cons(ctx,
intern(ctx,
"APOLLO",6,keywordpkg),p);
862 p=
cons(ctx,
intern(ctx,
"MIPS",4,keywordpkg),p);
865 p=
cons(ctx,
intern(ctx,
"SUN3",4,keywordpkg),p);
868 p=
cons(ctx,
intern(ctx,
"SUN4",4,keywordpkg),p);
871 p=
cons(ctx,
intern(ctx,
"NEWS",4,keywordpkg),p);
874 p=
cons(ctx,
intern(ctx,
"SANYO",5,keywordpkg),p);
877 p=
cons(ctx,
intern(ctx,
"BSD4_2",6,keywordpkg),p);
880 p=
cons(ctx,
intern(ctx,
"SUNOS4",6,keywordpkg),p);
883 p=
cons(ctx,
intern(ctx,
"SUNOS4.1",8,keywordpkg),p);
886 p=
cons(ctx,
intern(ctx,
"SYSTEM5",7,keywordpkg),p);
889 p=
cons(ctx,
intern(ctx,
"COFF",4,keywordpkg),p);
892 p=
cons(ctx,
intern(ctx,
"SOLARIS2",8,keywordpkg),p);
898 p=
cons(ctx,
intern(ctx,
"GCC3",4,keywordpkg),p);
901 p=
cons(ctx,
intern(ctx,
"I386",4,keywordpkg),p);
904 p=
cons(ctx,
intern(ctx,
"LINUX",5,keywordpkg),p);
910 p=
cons(ctx,
intern(ctx,
"IA32",4,keywordpkg),p);
916 p=
cons(ctx,
intern(ctx,
"IRIX",4,keywordpkg),p);
919 p=
cons(ctx,
intern(ctx,
"IRIX6",5,keywordpkg),p);
922 p=
cons(ctx,
intern(ctx,
"ALPHA",5,keywordpkg),p);
925 p=
cons(ctx,
intern(ctx,
"CYGWIN",6,keywordpkg),p);
928 p=
cons(ctx,
intern(ctx,
"DARWIN",6,keywordpkg),p);
931 p=
cons(ctx,
intern(ctx,
"THREAD",6,keywordpkg),p);
934 p=
cons(ctx,
intern(ctx,
"PTHREAD",7,keywordpkg),p);
937 p=
cons(ctx,
intern(ctx,
"X11R6.1",7,keywordpkg),p);
946 p=
cons(ctx,
intern(ctx,
"X86_64",6,keywordpkg),p);
952 p=
cons(ctx,
intern(ctx,
"AARCH64",7,keywordpkg),p);
956 sprintf(tmp,
"WORD-SIZE=%zd",
sizeof(
void*)*8);
957 p=
cons(ctx,
intern(ctx,tmp,strlen(tmp),keywordpkg),p);
960 defvar(ctx,
"*FEATURES*",p,lisppkg);
966 sysobj=
cons(ctx,sysmod, sysobj);
974 #include <sys/wait.h> 985 fprintf(stderr,
";; eusint: sig=%d, %d; thr=%d ctx=%p\n",
994 fprintf(stderr,
";; child proc terminated; wait=0x%x\n",stat);
998 fprintf(stderr,
";; floating exception\n");
1002 fprintf(stderr,
";; pipe broken %d %x %lx\n",code,x,(
unsigned long)addr);
1003 throw(mainctx,
makeint(0),NIL);
1006 fprintf(stderr,
";; Segmentation Fault.\n");
1009 fprintf(stderr,
";; Bus Error.\n");
1013 if (speval(FATALERROR) != NIL) exit(s);
1015 fprintf(stderr,
";; in ");
1018 fprintf(stderr,
"\n");}
1019 fprintf(stderr,
";; You are still in a signal handler.\n;;Try reset or throw to upper level as soon as possible.\n");
1020 fprintf(stderr,
";; code=%d x=%x addr=%lx\n",code,x,(
unsigned long)addr);
1022 fprintf(stderr,
";; No, you cannot continue the previous evaluation.\n");
1028 #if Solaris2 || system5 1029 signal(s,(
void (*)())
eusint);
1033 if (isintvector(eussigvec[s])) {
1039 if (debug) { fprintf(stderr,
";; eusint exit: intsig=%d\n",ctx->
intsig);}
1049 Spevalof(QSTDOUT)=
STDOUT;
1050 Spevalof(QSTDIN)=
STDIN;
1051 Spevalof(QERROUT)=
ERROUT;
1052 if ((val=(
pointer)eussetjmp(brkjmp))==0) val=
reploop(ctx,prompt);
1054 ctx->callfp=ctx->catchfp->cf;
1055 ctx->bindfp=ctx->catchfp->bf;
1056 ctx->vsp=(
pointer *)ctx->catchfp;
1057 ctx->catchfp=(
struct catchframe *)*(ctx->vsp);
1061 {
pointer sighandler,*vspsave;
1066 if (debug) printf(
"sigbreak: intsig=%d thr_self=%d\n", is,
thr_self());
1067 sighandler=eussigvec[is];
1068 if (isintvector(sighandler))
return;
1072 if (sighandler!=NIL) {
1077 fprintf(stderr,
"signal=%d to thread %d, \n",is,
thr_self());
1094 p=Spevalof(PACKAGE);
1096 printf(
"%s:",ccar(p->
c.
pkg.
names)->c.str.chars);}
1097 printf(
"%s",prompt);
1100 if (p==(
pointer)EOF)
return(NIL);
1103 if (q!=UNBOUND) {
prinx(ctx,q,STDOUT);
terpri(STDOUT);}}
1115 ctx->vsp=ctx->stack;
1123 topform=speval(TOPLEVEL);
1126 for (i=0; i<
argc; i++) vpush(
makestring(argv[i],strlen(argv[i])));
1131 fprintf(stderr,
"entering reploop\n");
1140 char *eusdir, *eusrt;
1146 eusdir=(
char *)getenv(
"EUSDIR");
1148 fprintf(stderr,
"EUSDIR is not setenved, assuming /usr/local/eus\n");
1149 eusdir=
"/usr/local/eus/"; }
1150 sprintf(fname,
"%s/lib/eus.init.l", eusdir);
1152 #if !Solaris2 || GCC 1157 "$EUSDIR/lib/eus.init.l was not found\nfailed to initialize.\n" 1158 "Entering raweus.\n" 1159 "To exit, type (unix::exit)\n");
1174 eusrt=(
char *)getenv(
"EUSRT");
1175 if (eusrt==
NULL) sprintf(fname,
"%s/lib/eusrt.l", eusdir);
1176 else strcpy(fname, eusrt);
1178 fprintf(stderr,
"configuring by \"%s\"\n", fname); }
1191 #pragma GCC push_options 1192 #pragma GCC optimize ("no-tree-dce") 1199 m=(
unsigned char *)malloc(4*1024*1024);
1213 specialtab=
alloc(MAX_SPECIALS+1,ELM_POINTER,vectorcp.
cix,MAX_SPECIALS+1);
1215 for (i=0; i<MAX_SPECIALS; i++) specialtab->
c.
vec.
v[i]=NIL;
1216 ctx->specials=specialtab; }
1244 speval(QTHREADS)=
cons(ctx, mainport, speval(QTHREADS));
1260 ctx->vsp=ctx->stack;
1263 signal(SIGCHLD, (
void (*)())
eusint);
1264 signal(SIGFPE, (
void (*)())
eusint);
1265 signal(SIGPIPE, (
void (*)())
eusint);
1269 signal(SIGSEGV, (
void (*)())
eusint);
1271 signal(SIGBUS, (
void (*)())
eusint);
1275 {
pointer exithook=speval(QEXITHOOK);
1276 if (exithook != NIL) {
1301 for (i=0; i<
argc; i++) mainargv[i]=argv[i];
1305 #if Linux && !OLD_LINUX && !Darwin 1306 mallopt(M_MMAP_MAX,0);
1311 m=(
unsigned char *)malloc(4*1024*1024);
1320 for (i=0; i<MAXTHREAD; i++) euscontexts[i]=0;
1324 mutex_init(&
mark_lock, USYNC_THREAD, 0);
1327 { sigset_t mainsig, omainsig;
1328 sigemptyset(&mainsig);
1329 sigaddset(&mainsig, SIGINT);
1331 thr_sigsetmask(SIG_BLOCK, &mainsig, &omainsig);
1335 #if SunOS4_1 || alpha || PTHREAD 1336 mthread_init( mainctx );
1347 {
pointer exithook=speval(QEXITHOOK);
1348 if (exithook != NIL) {
1354 #pragma GCC pop_options 1356 #if (WORD_SIZE == 64) 1360 return(mkbigint(v));
1363 else return((
pointer)((v<<2)+2));
1368 fprintf(stderr,
"p=null\n");
1371 else if ((i&0x3L)==0x3L) {
1373 else if (isbignum(p)) {
1374 return (bigintval(p)); }
1375 else if ((i&0x7)==0x0L) {
1376 fprintf(stderr,
";p=pointer?(%p)\n", p);
1382 if (v>(
int)MAXPOSFIXNUM || v<(
int)MINNEGFIXNUM) {
1386 return(mkbigint(v));
1389 else return((
pointer)((v<<2)+2));
1394 fprintf(stderr,
"p=null\n");
1396 else if ((i&0x3)==0x3) {
1398 else if (isbignum(p)) {
1399 return (bigintval(p)); }
1400 else if ((i&0x3)==0x0) {
1401 fprintf(stderr,
";p=pointer?(%p)\n", p);
context * euscontexts[MAXTHREAD]
pointer prinx(context *, pointer, pointer)
pointer defconst(context *, char *, pointer, pointer)
pointer rawcons(context *, pointer, pointer)
pointer intern(context *, char *, int, pointer)
pointer list_module_initializers(context *, pointer)
pointer makeint(eusinteger_t v)
pointer K_CLASS_DOCUMENTATION
pointer cons(context *, pointer, pointer)
int mthread(context *ctx, pointer mod)
struct filestream fstream
void specials(context *, pointer)
pointer mkfilestream(context *, pointer, pointer, int, pointer)
pointer SRCLOAD(context *, int, pointer *)
pointer openfile(context *, char *, int, int, int)
void sysfunc(context *, pointer)
int thr_join(int tid, int *depature, void **status)
unsigned long euspointer_t
pointer makethreadport(context *)
pointer makepkg(context *, pointer, pointer, pointer)
pointer defkeyword(context *, char *)
void eusioctl(context *, pointer)
eusinteger_t hide_ptr(pointer p)
void leo(context *, pointer)
context * makelispcontext(int)
pointer ufuncall(context *, pointer, pointer, pointer, struct bindframe *, int)
pointer K_METHOD_DOCUMENTATION
void mainthread(context *ctx)
static pointer reploop(context *, char *)
void rgcfunc(register context *ctx, pointer mod)
pointer makevector(pointer, int)
pointer makemodule(context *, int)
pointer K_FUNCTION_DOCUMENTATION
static void initfeatures()
void initreader(context *)
void foreign(context *ctx, pointer mod)
static void initclassid()
void lispio(context *, pointer)
void unbindspecial(context *, struct specialbindframe *)
pointer deflocal(context *, char *, pointer, pointer)
static void initclasses()
pointer MAXCALLSTACKDEPTH
pointer defvar(context *, char *, pointer, pointer)
void predicates(context *, pointer)
void unixcall(context *, pointer)
pointer alloc(int, int, int, int)
struct callframe * callfp
long buddysize[MAXBUDDY+1]
pointer makelabref(pointer, pointer, pointer)
void lists(context *, pointer)
void vectorarray(context *, pointer)
int thr_create(void *, size_t, void(*)(), void *, long, int *)
pointer error(enum errorcode ec,...) pointer error(va_alist) va_dcl
pointer stacknlist(context *, int)
void unwind(context *ctx, pointer *p)
void sequence(context *, pointer)
struct buddyfree buddy[MAXBUDDY+1]
void arith(context *ctx, pointer mod)
void eusint(int s, int code, int x, eusinteger_t addr)
pointer makestring(char *, int)
void loadsave(context *, pointer)
pointer makeclass(context *, pointer, pointer, pointer, pointer, pointer, int, pointer)
static void toplevel(context *ctx, int argc, argv)
void matrix(context *, pointer)
void charstring(context *ctx, pointer mod)
int sema_post(sema_t *sem)
pointer basicclass(char *name,...) pointer basicclass(va_alist) va_dcl
eusinteger_t intval(pointer p)
struct class_desc classtab[MAXCLASS]
unsigned int allocate_heap()
void mkcatchframe(context *, pointer, jmp_buf *)
struct bindframe * bindfp
pointer eval(context *, pointer)
struct built_in_cid builtinclass[64]
pointer reader(context *, pointer, pointer)
pointer K_VARIABLE_DOCUMENTATION
static void initsymbols()
static void initpackage()
static void configure_eus(context *ctx)