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;}
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,3,
"ENV0",
"ENV1",
"ENV2");
761 CLOSURE=
basicclass(
"CLOSURE",C_CODE,&closurecp,2,
"ENV1",
"ENV2");
763 C_CLOSURE=speval(CLOSURE);
765 LDMODULE=
basicclass(
"LOAD-MODULE",C_CODE, &ldmodulecp, 3,
766 "SYMBOL-TABLE",
"OBJECT-FILE",
"HANDLE");
767 C_LDMOD=speval(LDMODULE);
769 LABREF=
basicclass(
"LABEL-REFERENCE",C_OBJECT,&labrefcp,4,
770 "LABEL",
"VALUE",
"UNSOLVED",
"NEXT");
771 C_LABREF=speval(LABREF);
773 VECTOR=
defvector(ctx,
"VECTOR",C_OBJECT,ELM_POINTER, 0);
774 C_VECTOR=speval(VECTOR);
778 FLTVECTOR=
defvector(ctx,
"FLOAT-VECTOR",C_VECTOR,ELM_FLOAT, 0);
779 C_FLTVECTOR=speval(FLTVECTOR);
783 INTVECTOR=
defvector(ctx,
"INTEGER-VECTOR",C_VECTOR,ELM_INT, 0);
784 C_INTVECTOR=speval(INTVECTOR);
788 STRING=
defvector(ctx,
"STRING",C_VECTOR,ELM_CHAR, 0);
789 C_STRING=speval(STRING);
793 BITVECTOR=
defvector(ctx,
"BIT-VECTOR",C_VECTOR,ELM_BIT, 0);
794 C_BITVECTOR=speval(BITVECTOR);
799 EXTNUM=
basicclass(
"EXTENDED-NUMBER",C_OBJECT,&extnumcp,0);
800 C_EXTNUM=speval(EXTNUM);
801 RATIO=
basicclass(
"RATIO",C_EXTNUM, &ratiocp,2,
"NUMERATOR",
"DENOMINATOR");
802 C_RATIO=speval(RATIO);
803 COMPLEX=
basicclass(
"COMPLEX", C_EXTNUM, &complexcp, 2,
"REAL",
"IMAGINARY");
804 C_COMPLEX=speval(COMPLEX);
805 BIGNUM=
basicclass(
"BIGNUM", C_EXTNUM, &bignumcp, 2,
"SIZE",
"BV");
806 C_BIGNUM=speval(BIGNUM);
808 for (i=0;i<MAXTHREAD;i++) {
810 sysobj=
cons(ctx,oblabels[i],sysobj);
817 extern char *makedate;
818 extern char *gitrevision;
819 extern char *compilehost;
823 p=
makestring(compilehost,strlen(compilehost));
827 p=
makestring(gitrevision,strlen(gitrevision));
830 QVERSION=
defvar(ctx,
"LISP-IMPLEMENTATION-VERSION", p,lisppkg);
842 p=
cons(ctx,
intern(ctx,
"APOLLO",6,keywordpkg),p);
845 p=
cons(ctx,
intern(ctx,
"MIPS",4,keywordpkg),p);
848 p=
cons(ctx,
intern(ctx,
"SUN3",4,keywordpkg),p);
851 p=
cons(ctx,
intern(ctx,
"SUN4",4,keywordpkg),p);
854 p=
cons(ctx,
intern(ctx,
"NEWS",4,keywordpkg),p);
857 p=
cons(ctx,
intern(ctx,
"SANYO",5,keywordpkg),p);
860 p=
cons(ctx,
intern(ctx,
"BSD4_2",6,keywordpkg),p);
863 p=
cons(ctx,
intern(ctx,
"SUNOS4",6,keywordpkg),p);
866 p=
cons(ctx,
intern(ctx,
"SUNOS4.1",8,keywordpkg),p);
869 p=
cons(ctx,
intern(ctx,
"SYSTEM5",7,keywordpkg),p);
872 p=
cons(ctx,
intern(ctx,
"COFF",4,keywordpkg),p);
875 p=
cons(ctx,
intern(ctx,
"SOLARIS2",8,keywordpkg),p);
881 p=
cons(ctx,
intern(ctx,
"GCC3",4,keywordpkg),p);
884 p=
cons(ctx,
intern(ctx,
"I386",4,keywordpkg),p);
887 p=
cons(ctx,
intern(ctx,
"LINUX",5,keywordpkg),p);
893 p=
cons(ctx,
intern(ctx,
"IA32",4,keywordpkg),p);
899 p=
cons(ctx,
intern(ctx,
"IRIX",4,keywordpkg),p);
902 p=
cons(ctx,
intern(ctx,
"IRIX6",5,keywordpkg),p);
905 p=
cons(ctx,
intern(ctx,
"ALPHA",5,keywordpkg),p);
908 p=
cons(ctx,
intern(ctx,
"CYGWIN",6,keywordpkg),p);
911 p=
cons(ctx,
intern(ctx,
"DARWIN",6,keywordpkg),p);
914 p=
cons(ctx,
intern(ctx,
"THREAD",6,keywordpkg),p);
917 p=
cons(ctx,
intern(ctx,
"PTHREAD",7,keywordpkg),p);
920 p=
cons(ctx,
intern(ctx,
"X11R6.1",7,keywordpkg),p);
929 p=
cons(ctx,
intern(ctx,
"X86_64",6,keywordpkg),p);
935 p=
cons(ctx,
intern(ctx,
"AARCH64",7,keywordpkg),p);
938 defvar(ctx,
"*FEATURES*",p,lisppkg);
944 sysobj=
cons(ctx,sysmod, sysobj);
952 #include <sys/wait.h> 963 fprintf(stderr,
";; eusint: sig=%d, %d; thr=%d ctx=%p\n",
972 fprintf(stderr,
";; child proc terminated; wait=0x%x\n",stat);
976 fprintf(stderr,
";; floating exception\n");
980 fprintf(stderr,
";; pipe broken %d %x %lx\n",code,x,(
unsigned long)addr);
984 fprintf(stderr,
";; Segmentation Fault.\n");
987 fprintf(stderr,
";; Bus Error.\n");
991 if (speval(FATALERROR) != NIL) exit(s);
993 fprintf(stderr,
";; in ");
996 fprintf(stderr,
"\n");}
997 fprintf(stderr,
";; You are still in a signal handler.\n;;Try reset or throw to upper level as soon as possible.\n");
998 fprintf(stderr,
";; code=%d x=%x addr=%lx\n",code,x,(
unsigned long)addr);
1000 fprintf(stderr,
";; No, you cannot continue the previous evaluation.\n");
1006 #if Solaris2 || system5 1007 signal(s,(
void (*)())
eusint);
1011 if (isintvector(eussigvec[s])) {
1017 if (debug) { fprintf(stderr,
";; eusint exit: intsig=%d\n",ctx->
intsig);}
1027 Spevalof(QSTDOUT)=
STDOUT;
1028 Spevalof(QSTDIN)=
STDIN;
1029 Spevalof(QERROUT)=
ERROUT;
1030 if ((val=(
pointer)eussetjmp(brkjmp))==0) val=
reploop(ctx,prompt);
1032 ctx->callfp=ctx->catchfp->cf;
1033 ctx->bindfp=ctx->catchfp->bf;
1034 ctx->vsp=(
pointer *)ctx->catchfp;
1035 ctx->catchfp=(
struct catchframe *)*(ctx->vsp);
1039 {
pointer sighandler,*vspsave;
1044 if (debug) printf(
"sigbreak: intsig=%d thr_self=%d\n", is,
thr_self());
1045 sighandler=eussigvec[is];
1046 if (isintvector(sighandler))
return;
1050 if (sighandler!=NIL) {
1055 fprintf(stderr,
"signal=%d to thread %d, \n",is,
thr_self());
1072 p=Spevalof(PACKAGE);
1074 printf(
"%s:",ccar(p->
c.
pkg.
names)->c.str.chars);}
1075 printf(
"%s",prompt);
1078 if (p==(
pointer)EOF)
return(NIL);
1081 if (q!=UNBOUND) {
prinx(ctx,q,STDOUT);
terpri(STDOUT);}}
1093 ctx->vsp=ctx->stack;
1101 topform=speval(TOPLEVEL);
1104 for (i=0; i<
argc; i++) vpush(
makestring(argv[i],strlen(argv[i])));
1109 fprintf(stderr,
"entering reploop\n");
1118 char *eusdir, *eusrt;
1124 eusdir=(
char *)getenv(
"EUSDIR");
1126 fprintf(stderr,
"EUSDIR is not setenved, assuming /usr/local/eus\n");
1127 eusdir=
"/usr/local/eus/"; }
1128 sprintf(fname,
"%s/lib/eus.init.l", eusdir);
1130 #if !Solaris2 || GCC 1135 "$EUSDIR/lib/eus.init.l was not found\nfailed to initialize.\n" 1136 "Entering raweus.\n" 1137 "To exit, type (unix::exit)\n");
1152 eusrt=(
char *)getenv(
"EUSRT");
1153 if (eusrt==
NULL) sprintf(fname,
"%s/lib/eusrt.l", eusdir);
1154 else strcpy(fname, eusrt);
1156 fprintf(stderr,
"configuring by \"%s\"\n", fname); }
1183 specialtab=
alloc(MAX_SPECIALS+1,ELM_POINTER,vectorcp.
cix,MAX_SPECIALS+1);
1185 for (i=0; i<MAX_SPECIALS; i++) specialtab->
c.
vec.
v[i]=NIL;
1186 ctx->specials=specialtab; }
1214 speval(QTHREADS)=
cons(ctx, mainport, speval(QTHREADS));
1230 ctx->vsp=ctx->stack;
1233 signal(SIGCHLD, (
void (*)())
eusint);
1234 signal(SIGFPE, (
void (*)())
eusint);
1235 signal(SIGPIPE, (
void (*)())
eusint);
1239 signal(SIGSEGV, (
void (*)())
eusint);
1241 signal(SIGBUS, (
void (*)())
eusint);
1245 {
pointer exithook=speval(QEXITHOOK);
1246 if (exithook != NIL) {
1271 for (i=0; i<
argc; i++) mainargv[i]=argv[i];
1275 #if Linux && !OLD_LINUX && !Darwin 1276 mallopt(M_MMAP_MAX,0);
1281 m=(
unsigned char *)malloc(4*1024*1024);
1290 for (i=0; i<MAXTHREAD; i++) euscontexts[i]=0;
1294 mutex_init(&
mark_lock, USYNC_THREAD, 0);
1297 { sigset_t mainsig, omainsig;
1298 sigemptyset(&mainsig);
1299 sigaddset(&mainsig, SIGINT);
1301 thr_sigsetmask(SIG_BLOCK, &mainsig, &omainsig);
1305 #if SunOS4_1 || alpha || PTHREAD 1306 mthread_init( mainctx );
1317 {
pointer exithook=speval(QEXITHOOK);
1318 if (exithook != NIL) {
1325 #if (WORD_SIZE == 64) 1329 return(mkbigint(v));
1332 else return((
pointer)((v<<2)+2));
1337 fprintf(stderr,
"p=null\n");
1340 else if ((i&0x3L)==0x3L) {
1342 else if (isbignum(p)) {
1343 return (bigintval(p)); }
1344 else if ((i&0x7)==0x0L) {
1345 fprintf(stderr,
";p=pointer?(%p)\n", p);
1351 if (v>(
int)MAXPOSFIXNUM || v<(
int)MINNEGFIXNUM) {
1355 return(mkbigint(v));
1358 else return((
pointer)((v<<2)+2));
1363 fprintf(stderr,
"p=null\n");
1365 else if ((i&0x3)==0x3) {
1367 else if (isbignum(p)) {
1368 return (bigintval(p)); }
1369 else if ((i&0x3)==0x0) {
1370 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)
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)
pointer export(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)