eus.old.h
Go to the documentation of this file.
1 /****************************************************************/
2 /* eus.h Etl, Umezono, Sakura-mura Lisp
3 /*
4 /* Copyright(c)1988, Toshihiro Matsui, Electrotechnical Laboratory,
5 /* all rights reserved, all wrongs left.
6 /* created on: 1986-May
7 /* needed to be included by all euslisp kernel (.c) files and
8 /* user functions compiled by euscomp.
9 /****************************************************************/
10 
11 #if vxworks
12 #include <vxWorks.h>
13 #include <stdioLib.h>
14 #define errno errnoGet()
15 #define _setjmp(buf) setjmp(buf)
16 #define _longjmp(buf,val) longjmp(buf,val)
17 #else
18 #include <stdio.h>
19 #define min(x,y) ((x<y)?x:y)
20 #define max(x,y) ((x<y)?y:x)
21 #endif
22 
23 #if Solaris2
24 #define _setjmp(buf) setjmp(buf)
25 #define _longjmp(buf,val) longjmp(buf,val)
26 #include <synch.h>
27 #endif
28 
29 #include <setjmp.h>
30 
31 #define ERR (-1)
32 #define STOPPER makepointer(0) /*impossible pointer object*/
33 #define UNBOUND makepointer(0)
34 
35 /* dynamic value type */
36 #define V_CONSTANT makeint(0)
37 #define V_VARIABLE makeint(1)
38 #define V_SPECIAL makeint(2)
39 
40 /* function types*/
41 #define SUBR_FUNCTION makeint(0)
42 #define SUBR_MACRO makeint(1)
43 #define SUBR_SPECIAL makeint(2)
44 #define SUBR_ENTRY makeint(3)
45 
46 /* stack frame types (lots more)*/
47 #define BLOCKFRAME makeint(0)
48 #define TAGBODYFRAME makeint(1)
49 
50 /*vector element types*/
51 #define ELM_FIXED 0
52 #define ELM_BIT 1
53 #define ELM_CHAR 2
54 #define ELM_BYTE 3
55 #define ELM_INT 4
56 #define ELM_FLOAT 5
57 #define ELM_FOREIGN 6
58 #define ELM_POINTER 7
59 
60 /****************************************************************/
61 /* configuration constants */
62 /****************************************************************/
63 
64 #define DEFAULTCHUNKINDEX 16 /*fib2(12)=754*/
65 #define MAXBUDDY 30 /*fib(30) is big enough*/
66 #define MAXSTACK 16384 /*can be expanded by sys:newstack*/
67 #define SYMBOLHASH 60 /*initial obvector size in package*/
68 #define MAXCLASS 256 /* by M.Inaba from 64 */
69 #define KEYWORDPARAMETERLIMIT 32 /*determined by bits in a long word*/
70 #define ARRAYRANKLIMIT 7 /*minimal requirement for CommonLisp*/
71 #define MAXTHREAD 64 /*maximum number of threads*/
72 
73 /* type definitions:
74  bix is buddy index,
75  and cix is class index, which is sometimes refered as cid */
76 
77 typedef unsigned char byte;
78 typedef unsigned short word; /*seldom used*/
79 typedef struct cell *pointer;
80 
81 struct cellheader {
82  unsigned mark:1; /* GC mark*/
83  unsigned b:1; /* buddy: indicates the side in which its buddy should be found */
84  unsigned m:1; /* memory: records b or m of parent cell when it's split*/
85  unsigned smark:1; /* shared mark*/
86  unsigned pmark:1; /* print mark*/
87  unsigned elmtype:3;
88  byte bix; /*5 bits are enough*/
89  short cix;}; /*8 bits may be enough*/
90 
91 /****************************************************************/
92 /* struct definition for lisp object cell
93 /****************************************************************/
94 struct cons {
95  pointer car, /*cons is made of a car and a cdr*/
96  cdr;}; /*what a familiar structure!*/
97 
98 struct propertied_object {
99  pointer plist;};
100 
101 struct symbol {
102  pointer plist, /*inherited from prop_obj*/
103  speval,
104  vtype, /*const,var,special*/
105  spefunc,
106  pname,
107  homepkg;};
108 
109 struct string { /*resembles with vector*/
110  pointer length; /*boxed*/
111  byte chars[1];}; /*long word aligned*/
112 
113 struct package {
114  pointer plist;
115  pointer names; /*package name at car, nicknames in cdr*/
116  pointer use; /*spreaded use-package list*/
117  pointer symvector; /*hashed obvector*/
118  pointer symcount; /*number of interned symbols in this package*/
119  pointer intsymvector;
120  pointer intsymcount;
121  pointer shadows;
122  pointer used_by;
123  };
124 
125 struct code {
126  pointer codevec;
127  pointer quotevec;
128  pointer subrtype; /*function,macro,special*/
129  pointer entry; /*offset from beginning of codevector*/
130  };
131 
132 struct fcode { /*foreign function code*/
133  pointer codevec;
134  pointer quotevec;
135  pointer subrtype;
136  pointer entry;
137  pointer paramtypes;
138  pointer resulttype;};
139 
140 struct ldmodule { /*foreign language object module*/
141  pointer codevec;
142  pointer quotevec;
143  pointer subrtype; /*function,macro,special*/
144  pointer entry;
145  pointer symtab;
146  pointer objname;
147  pointer handle;}; /* dl's handle */
148 
149 struct closure {
150  pointer codevec;
151  pointer quotevec;
152  pointer subrtype; /*function,macro,special*/
153  pointer entry; /*offset from beginning of codevector*/
154  pointer *env1; /*argument pointer: argv*/
155  pointer *env2;}; /*local variable frame: local*/
156 
157 struct stream {
158  pointer plist;
159  pointer direction;
160  pointer buffer;
161  pointer count;
162  pointer tail;};
163 
164 struct filestream {
165  pointer plist;
166  pointer direction;
167  pointer buffer;
168  pointer count;
169  pointer tail;
170  pointer fd;
171  pointer fname;};
172 
173 struct iostream {
174  pointer plist;
175  pointer in,out;};
176 
177 struct labref { /*used for reading labeled forms: #n#,#n=*/
178  pointer label;
179  pointer value;
180  pointer unsolved;
181  pointer next; };
182 
183 struct vector {
184  pointer size;
185  pointer v[1];};
186 
187 struct intvector {
188  pointer length;
189  long iv[1];};
190 
191 struct floatvector {
192  pointer length;
193  float fv[1];};
194 
195 struct arrayheader {
196  pointer plist;
197  pointer entity,
198  rank,
199  fillpointer,
200  offset,
201  dim[ARRAYRANKLIMIT];};
202 
203 /* structs for object oriented programming */
204 struct object {
205  pointer iv[2];}; /*instance variables*/
206 
207 struct class {
208  pointer plist;
209  pointer name; /*class name symbol*/
210  pointer super; /*super class*/
211  pointer cix;
212  pointer vars; /*var names including inherited ones*/
213  pointer types;
214  pointer forwards;
215  pointer methods; /*method list*/
216  };
217 
218 struct vecclass { /*vector class*/
219  pointer plist;
220  pointer name;
221  pointer super;
222  pointer cix;
223  pointer vars;
224  pointer types;
225  pointer forwards;
226  pointer methods;
227  pointer elmtype;
228  pointer size;};
229 
230 struct readtable {
231  pointer plist;
232  pointer syntax;
233  pointer macro;
234  pointer dispatch;};
235 
236 struct threadport {
237  pointer plist;
238  pointer id;
239  pointer requester;
240  pointer reqsem;
241  pointer donesem;
242  pointer func;
243  pointer args;
244  pointer result;
245  pointer contex;
246  pointer idle;
247  pointer wait;};
248 
249 /****************************************************************/
250 typedef
251  struct cell {
252 #if vax || sun4 || news || mips
253  unsigned mark:1;
254  unsigned b:1;
255  unsigned m:1;
256  unsigned smark:1;
257  unsigned pmark:1;
258  unsigned elmtype:3;
260 #endif
261  short cix;
262  union cellunion {
263  struct cons cons;
264  struct symbol sym;
265  struct string str;
266  struct package pkg;
267  struct stream stream;
268  struct filestream fstream;
269  struct iostream iostream;
270  struct code code;
271  struct fcode fcode;
272  struct ldmodule ldmod;
273  struct closure clo;
274  struct labref lab;
275  struct arrayheader ary;
276  struct vector vec;
277  struct floatvector fvec;
278  struct intvector ivec;
279  struct object obj;
280  struct class cls;
281  struct vecclass vcls;
282  struct readtable rdtab;
283  struct threadport thrp;
284  } c;
285  } cell;
286 
287 typedef
288  union numunion {
289  float fval;
290  int ival;
291  struct {short low,high;} sval;
292  } numunion;
293 
294 /* buddy cell */
295 struct bcell {
296  struct cellheader h;
297  union {
298  struct bcell *nextbcell;
299  struct cell *c[2];} b;} bcell;
300 
301 typedef struct bcell *bpointer;
302 
303 struct chunk {
304  struct chunk *nextchunk;
305  int chunkbix;
306  struct bcell rootcell;};
307 
308 typedef struct {
309  short cix;
310  short sub;} cixpair;
311 
312 enum ch_type {
322 
323 enum ch_attr {
325 
326 
327 /****************************************************************/
328 /* stack frames and context
329 /****************************************************************/
330 struct callframe {
331  struct callframe *vlink;
332  pointer form;
333  };
334 
335 struct bindframe { /*to achieve lexical binding in the interpreter*/
336  struct bindframe *dynblink, *lexblink; /*links to upper level*/
337  pointer sym; /*symbol*/
338  pointer val;}; /*bound value*/
339 
340 struct specialbindframe { /*special value binding frame*/
341  struct specialbindframe *sblink;
342  pointer sym; /*pointer to the symbol word(dynval or dynfunc)*/
343  pointer oldval;};
344 
345 struct blockframe {
346  pointer kind;
347  struct blockframe *dynklink,*lexklink;
348  pointer name;
349  jmp_buf *jbp;};
350 
351 struct catchframe {
352  struct catchframe *nextcatch;
353  pointer label;
354  struct bindframe *bf; /*bind frame save*/
355  struct callframe *cf; /*call frame save*/
356  struct fletframe *ff;
357  jmp_buf *jbp;
358  };
359 
360 struct protectframe {
361  struct protectframe *protlink;
362  pointer cleaner; /*cleanup form closure*/
363  };
364 
365 struct fletframe {
366  pointer name;
367  pointer fclosure;
368  struct fletframe *scope;
369  struct fletframe *lexlink;
370  struct fletframe *dynlink;};
371 
372 #define MAXMETHCACHE 256 /*must be power to 2*/
373 
374 struct methdef {
375  pointer selector,class,ownerclass,method;
376  } methcache[MAXMETHCACHE];
377 
378 typedef struct {
379  pointer *stack, *vsp,*stacklimit;
380  struct callframe *callfp;
381  struct catchframe *catchfp;
382  struct bindframe *bindfp;
383  struct specialbindframe *sbindfp;
384  struct blockframe *blkfp;
385  struct protectframe *protfp;
386  struct fletframe *fletfp, *newfletfp;
387  pointer lastalloc;
388  pointer errhandler;
389  struct methdef *methcache;
390  }
391  context;
392 
393 /****************************************************************
394 /* memory and class management structures
395 /****************************************************************/
396 struct buddybase {
397  int size;
398  bpointer bp;} buddy[MAXBUDDY+1];
399 
400 struct class_desc { /* per- class descripter */
401  short cix;
402  short subcix;
403  pointer def; };
404 
405 struct built_in_cid {
406  pointer cls;
407  cixpair *cp; };
408 
409 
410 /****************************************************************/
411 /* global variables for eus
412 /* date: 1986-Apr
413 /* 1987-Apr
414 /****************************************************************/
415 /* process id and program name*/
416 extern int mypid;
417 extern char *progname;
418 
419 /* heap management */
420 /* every free cell is linked to the buddybase structure*/
421 extern struct buddybase buddy[MAXBUDDY+1];
422 extern struct chunk *chunklist;
423 extern char *maxmemory;
424 extern long freeheap, totalheap; /*size of heap left and allocated*/
425 
426 /* memory management timers for performance evaluation */
427 extern long gccount,marktime,sweeptime;
428 extern long alloccount[MAXBUDDY];
429 
430 /* System internal objects are connected to sysobj list
431 /* to protect from garbage-collection */
432 extern pointer sysobj;
433 extern pointer lastalloc;
434 
435 /* thread euscontexts */
436 context *euscontexts[MAXTHREAD];
437 
438 /****************************************************************/
439 /* system defined (built-in) class index
440 /* modified to accept dynamic type extension (1987-Jan)
441 /****************************************************************/
442 
443 extern cixpair objectcp;
444 extern cixpair conscp;
445 extern cixpair propobjcp;
446 extern cixpair symbolcp;
447 extern cixpair packagecp;
448 extern cixpair streamcp;
449 extern cixpair filestreamcp;
450 extern cixpair iostreamcp;
451 extern cixpair metaclasscp;
452 extern cixpair vecclasscp;
453 extern cixpair codecp;
454 extern cixpair fcodecp;
455 /*cixpair modulecp; */
456 extern cixpair ldmodulecp;
457 extern cixpair closurecp;
458 extern cixpair labrefcp;
459 extern cixpair threadcp;
460 extern cixpair arraycp;
461 extern cixpair readtablecp;
462 extern cixpair vectorcp;
463 extern cixpair fltvectorcp;
464 extern cixpair intvectorcp;
465 extern cixpair stringcp;
466 extern cixpair bitvectorcp;
467 
468 extern struct built_in_cid builtinclass[64];
469 extern int nextbclass;
470 
471 
472 /*symbol management*/
474 extern pointer NIL,PACKAGE,T,QUOTE;
475 extern pointer FUNCTION;
476 extern pointer QDECLARE,QSPECIAL;
477 extern pointer SELF,CLASS;
478 extern pointer STDIN,STDOUT,ERROUT,QSTDIN,QSTDOUT,QERROUT;
479 extern pointer QINTEGER,QFIXNUM,QFLOAT,QNUMBER;
480 extern pointer TOPLEVEL,QEVALHOOK,ERRHANDLER;
481 extern pointer QUNBOUND,QDEBUG;
482 extern pointer QTHREADS;
483 
484 /*memory management parameters*/
485 extern pointer GCMERGE,GCMARGIN;
486 
487 /* keywords */
488 extern pointer K_IN,K_OUT,K_IO; /*direction keyword*/
489 extern pointer K_FLUSH,K_FILL,K_FILE,K_STRING;
491 extern pointer K_FLOAT,K_DOUBLE,K_FOREIGN;
492 extern pointer K_DOWNCASE,K_UPCASE;
493 
494 /*class management*/
495 extern struct class_desc classtab[MAXCLASS];
496 extern int nextcix;
497 
498 /*class cells*/
499 extern pointer C_CONS, C_OBJECT, C_SYMBOL, C_PACKAGE;
500 extern pointer C_STREAM, C_FILESTREAM, C_IOSTREAM, C_CODE, C_FCODE;
501 extern pointer C_LDMOD;
502 extern pointer C_VECTOR, C_METACLASS, C_CLOSURE, C_LABREF;
503 extern pointer C_THREAD;
505 extern pointer C_FOREIGNCODE,C_ARRAY,C_READTABLE;
506 
507 /*class names*/
508 extern pointer QCONS,STRING,STREAM,FILESTREAM,IOSTREAM,SYMBOL,
510 extern pointer THREAD;
512 extern pointer FOREIGNCODE,ARRAY,BITVECTOR;
513 
514 /*toplevel & evaluation control*/
515 extern int intsig,intcode;
516 extern int ehbypass;
517 
518 /*reader variables*/
519 extern pointer charmacro[256];
520 extern pointer sharpmacro[256];
521 extern int export_all;
522 
523 /****************************************************************/
524 /* macro definition for euslisp
525 /****************************************************************/
526 
527 #define carof(p,err) (islist(p)?(p)->c.cons.car:error(err))
528 #define cdrof(p,err) (islist(p)?(p)->c.cons.cdr:error(err))
529 #define ccar(p) ((p)->c.cons.car)
530 #define ccdr(p) ((p)->c.cons.cdr)
531 #define cixof(p) ((p)->cix)
532 #define classof(p) (classtab[(p)->cix].def)
533 #define subcixof(p) (classtab[(p)->cix].subcix)
534 #define spevalof(p) ((p)->c.sym.speval)
535 #define superof(p) ((p)->c.cls.super)
536 
537 #if sun3 || apollo || system5 || sanyo || vxworks || NEXT
538 #define makepointer(bp) ((pointer)((int)(bp) | 2))
539 #define isint(p) (!((int)(p) & 3))
540 #define isflt(p) (((int)(p) & 3)==1)
541 #define isnum(p) (((int)(p) & 2)==0)
542 #define ispointer(p) ((int)(p) & 2)
543 #define makeint(v) ((pointer)(((int)v)<<2))
544 #define bpointerof(p) ((bpointer)((int)(p)-2))
545 #endif
546 
547 #if vax || sun4 || news || mips
548 #define makepointer(bp) ((pointer)(bp))
549 #define isint(p) (((int)(p) & 3)==2)
550 #define isflt(p) (((int)(p) & 3)==1)
551 #define isnum(p) (((int)(p) & 3))
552 #define ispointer(p) (!((int)(p) & 3))
553 #define makeint(v) ((pointer)((((int)v)<<2)+2))
554 #define bpointerof(p) ((bpointer)(p))
555 #endif
556 
557 #define intval(p) (((int)(p))>>2)
558 #define ckintval(p) (isint(p)?intval(p):(int)error(E_NOINT))
559 #define elmtypeof(p) (bpointerof(p)->h.elmtype)
560 #define bixof(p) (bpointerof(p)->h.bix)
561 
562 #if sun3 || sun4 || system5 || apollo || news || sanyo || vxworks || mips || NEXT
563 #define fltval(p) (nu.ival=(int)p & 0xfffffffc, nu.fval)
564 #define makeflt(f) (nu.fval=(f), (pointer)((nu.ival & 0xfffffffc) | 1))
565 #define ckfltval(p) (isflt(p)?fltval(p):(isint(p)?intval(p):(int)error(E_NONUMBER)))
566 #endif
567 
568 /*predicates to test object type*/
569 #define pislist(p) (p->cix<=conscp.sub)
570 #define piscons(p) (p->cix<=conscp.sub)
571 #define pispropobj(p) (propobjcp.cix<=(p)->cix && (p)->cix<=propobjcp.sub)
572 #define ispropobj(p) (ispointer(p) && pispropobj(p))
573 #define pissymbol(p) (symbolcp.cix<=(p)->cix && (p)->cix<=symbolcp.sub)
574 #define issymbol(p) (ispointer(p) && pissymbol(p))
575 #define pisstring(p) (stringcp.cix<=(p)->cix && (p)->cix<=stringcp.sub)
576 #define isstring(p) (ispointer(p) && pisstring(p))
577 #define islist(p) (ispointer(p) && pislist(p))
578 #define iscons(p) (ispointer(p) && piscons(p))
579 #define piscode(p) (codecp.cix<=(p)->cix && (p)->cix<=codecp.sub)
580 #define iscode(p) (ispointer(p) && piscode(p))
581 #define pisfcode(p) (fcodecp.cix<=(p)->cix && (p)->cix<=fcodecp.sub)
582 #define isfcode(p) (ispointer(p) && pisfcode(p))
583 #define pisldmod(p) (ldmodulecp.cix<=(p)->cix && (p)->cix<=ldmodulecp.sub)
584 #define isldmod(p) (ispointer(p) && pisldmod(p))
585 #define pisstream(p) (streamcp.cix<=(p)->cix && (p)->cix<=streamcp.sub)
586 #define isstream(p) (ispointer(p) && pisstream(p))
587 #define pisfilestream(p) (filestreamcp.cix<=(p)->cix && (p)->cix<=filestreamcp.sub)
588 #define isfilestream(p) (ispointer(p) && pisfilestream(p))
589 #define pisiostream(p) (iostreamcp.cix<=(p)->cix && (p)->cix<=iostreamcp.sub)
590 #define isiostream(p) (ispointer(p) && pisiostream(p))
591 #define pisreadtable(p) (readtablecp.cix<=((p)->cix) && ((p)->cix)<=readtablecp.sub)
592 #define isreadtable(p) (ispointer(p) && pisreadtable(p))
593 #define pisarray(p) (arraycp.cix<=((p)->cix) && ((p)->cix)<=arraycp.sub)
594 #define isarray(p) (ispointer(p) && pisarray(p))
595 #define pisvector(p) (elmtypeof(p))
596 #define isvector(p) (ispointer(p) && pisvector(p))
597 #define isfltvector(p) (ispointer(p) && (elmtypeof(p)==ELM_FLOAT))
598 #define isptrvector(p) (ispointer(p) && (elmtypeof(p)==ELM_POINTER))
599 #define isintvector(p) (ispointer(p) && (elmtypeof(p)==ELM_INT))
600 #define pisclass(p) (metaclasscp.cix<=(p)->cix && (p)->cix<=metaclasscp.sub)
601 #define isclass(p) (ispointer(p) && pisclass(p))
602 #define pisvecclass(p) (vecclasscp.cix<=(p)->cix && (p)->cix<=vecclasscp.sub)
603 #define isvecclass(p) (ispointer(p) && pisvecclass(p))
604 #define pispackage(p) (packagecp.cix<=(p)->cix && (p)->cix<=packagecp.sub)
605 #define ispackage(p) (ispointer(p) && pispackage(p))
606 #define pisclosure(p) (closurecp.cix<=(p)->cix && (p)->cix<=closurecp.sub)
607 #define isclosure(p) (ispointer(p) && pisclosure(p))
608 #define pislabref(p) (labrefcp.cix<=(p)->cix && (p)->cix<=labrefcp.sub)
609 #define islabref(p) (ispointer(p) && pislabref(p))
610 
611 #define strlength(p) (intval((p)->c.str.length))
612 #define vecsize(p) (intval((p)->c.vec.size))
613 #define objsize(p) (vecsize(classof(p)->c.cls.vars))
614 
615 #define vpush(v) (*ctx->vsp++=((pointer)v))
616 #define ckpush(v) (ctx->vsp<ctx->stacklimit?vpush(v):error(E_STACKOVER))
617 #define vpop() (*(--(ctx->vsp)))
618 
619 #define ckarg(req) if (n!=(req)) error(E_MISMATCHARG)
620 #define ckarg2(req1,req2) if ((n<(req1))||((req2)<n)) error(E_MISMATCHARG)
621 
622 #define breakck if (intsig) sigbreak()
623 #define stackck if (ctx->vsp>ctx->stacklimit) error(E_STACKOVER)
624 #define debug (spevalof(QDEBUG)!=NIL)
625 
626 /****************************************************************/
627 /* error code definition
628 /* 1986-Jun-17
629 /****************************************************************/
630 
631 enum errorcode {
632  E_NORMAL, /*0*/
633  E_STACKOVER, /*stack overflow*/
643  E_SETCONST, /*11 attempt to set to constant*/
651  E_LONGSTRING, /*19: string too long*/
652  E_NOSYMBOL, /*20: symbol expected*/
653  E_NOLIST, /*list expected*/
654  E_LAMBDA, /*illegal lambda form*/
655  E_PARAMETER, /*illegal lambda parameter syntax*/
656  E_NOCATCHER, /*no catch block */
657  E_NOBLOCK, /*no block to return*/
658  E_STREAM, /*stream expected*/
659  E_IODIRECTION, /*io stream direction keyword*/
660  E_NOINT, /*integer value expected*/
661  E_NOSTRING, /*string expected*/
662  E_OPENFILE, /*30: error in open*/
663  E_EOF, /*EOF encountered*/
664  E_NONUMBER, /*number expected*/
665  E_CLASSOVER, /*class table overflow*/
666  E_NOCLASS, /*class expected*/
667  E_NOVECTOR, /*vector expected*/
668  E_VECSIZE, /*error of vector size*/
669  E_DUPOBJVAR, /*duplicated object variable name*/
670  E_INSTANTIATE, /*38: cannot make an instance*/
672  E_NOMETHOD, /*40*/
674  E_SHARPMACRO, /*unknown sharp macro*/
675  E_ALIST, /*list expected for an element of an alist*/
676  E_NOMACRO, /*macro expected*/
677  E_NOPACKAGE, /*no such package */
678  E_PKGNAME, /*the package already exists*/
679  E_NOOBJ, /*invalid form*/
680  E_NOOBJVAR, /*48: not an object variable*/
681  E_NOSEQ, /*sequence(list,string,vector) expected*/
682  E_STARTEND, /*illegal subsequence index*/
683  E_NOSUPER, /*no superclass*/
684  E_FORMATSTRING, /*invalid format string character*/
685  E_FLOATVECTOR, /*float vector expected*/
686  E_CHARRANGE, /*0..255*/
687  E_VECINDEX, /*vector index mismatch*/
688  E_NOOBJECT, /*other than numbers expected*/
689  E_TYPEMISMATCH, /*the: type mismatch*/
690  E_DECLARE, /*illegal declaration*/
691  E_DECLFORM, /*invalid declaration form*/
692  E_NOVARIABLE, /*constant is used in let or lambda*/
693  E_ROTAXIS, /*illegal rotation axis spec*/
695  E_READLABEL, /*illegal #n= or #n# label*/
696  E_READFVECTOR, /*error of #f( expression*/
697  E_READOBJECT, /*error in #V or #J format*/
698  E_SOCKET, /*error of socket address*/
699  E_NOARRAY, /*array expected*/
700  E_ARRAYDIMENSION, /*array dimension mismatch*/
701  E_KEYPARAM, /*keyword parameter*/
702  E_NOKEYPARAM, /*no such keyword*/
703  E_NOINTVECTOR, /*integer vector expected*/
704  E_SEQINDEX, /*sequence index out of range*/
705  E_BITVECTOR, /*not a bit vector*/
706  E_EXTSYMBOL, /*no such external symbol*/
707  E_SYMBOLCONFLICT, /*symbol conflict in a package*/
708  };
709 
710 /* function prototypes */
711 
712 /*system*/
713 extern pointer error(),alloc(),halloc();
714 
715 /*eval*/
716 extern pointer eval(context *, pointer);
717 extern pointer eval2(context *, pointer, pointer);
718 extern pointer ufuncall(context *, pointer, pointer, pointer,
719  struct bindframe *, int);
720 extern pointer progn(context *, pointer);
721 extern pointer csend();
722 extern pointer getval(context *, pointer);
723 extern pointer setval(context *, pointer, pointer);
724 extern pointer getfunc(context *, pointer);
725 extern struct bindframe *declare(context *, pointer, struct bindframe *);
726 extern struct bindframe *vbind(context *, pointer, pointer,
727  struct bindframe *, struct bindframe*);
728 extern struct bindframe *fastbind(context *, pointer, pointer,
729  struct bindframe *);
730 extern void bindspecial(context *, pointer, pointer);
731 extern void unbindspecial(context *, struct specialbindframe *);
732 extern struct bindframe *bindkeyparams(context *, pointer, pointer *,
733  int, struct bindframe *, struct bindframe *);
734 
735 extern pointer Getstring();
736 extern pointer findpkg();
737 extern pointer memq();
738 
739 /*allocater*/
740 extern pointer makebuffer(int);
741 extern pointer makevector(pointer, int);
742 extern pointer makeclass(context *, pointer, pointer, pointer,pointer, pointer,
743  int, pointer);
744 extern pointer makecode(pointer, pointer(*)(), pointer);
745 extern pointer makematrix(context *, int, int);
746 extern pointer makeobject(pointer);
747 extern pointer rawcons(context *, pointer, pointer);
748 extern pointer cons(context *, pointer, pointer);
749 extern pointer makestring(char *, int);
750 extern pointer makesymbol(context *, char *, int, pointer);
751 extern pointer intern(context *, char *, int, pointer);
752 extern pointer makepkg(context *, pointer, pointer, pointer);
753 extern pointer mkstream(context *, pointer, pointer);
754 extern pointer mkfilestream(context *, pointer,pointer,int,pointer);
755 extern pointer mkiostream(context *, pointer,pointer);
756 extern pointer makemodule(context *, int);
757 extern pointer defun(context *, char *, pointer, pointer(*)());
758 extern pointer defmacro(context *, char *, pointer, pointer(*)());
759 extern pointer defspecial(context *, char *, pointer, pointer(*)());
760 extern pointer defunpkg(context *, char *, pointer, pointer(*)(),pointer);
761 extern void addcmethod(context *, pointer, pointer (*)(),
762  pointer, pointer, pointer);
763 extern pointer defkeyword(context *, char *);
764 extern pointer defvar(context *, char *, pointer, pointer);
765 extern pointer defconst(context *, char *, pointer, pointer);
766 extern pointer stacknlist(context *, int);
767 #if Solaris2
768 extern makethreadport(context *);
769 #endif
770 
771 /*boxing,unboxing*/
772 #if vax
773 extern float fltval(),ckfltval();
774 extern pointer makeflt();
775 #endif
776 
777 /*io*/
778 extern pointer reader(context *, pointer, pointer);
779 extern pointer prinx(context *, pointer, pointer);
780 
781 /*for compiled code*/
782 extern pointer makeclosure(pointer,pointer,int,pointer*, pointer*);
783 extern pointer fcall();
784 extern pointer minilist();
785 extern pointer xcar(pointer), xcdr(pointer), xcadr(pointer);
786 extern pointer *ovafptr(pointer,pointer);
787 
788 /* mutex locks*/
789 
790 extern mutex_t mark_lock;
791 extern char *mark_locking;
792 extern int mark_lock_thread;
793 extern mutex_t p_mark_lock;
794 
795 
void idle(void)
Definition: scube.c:405
cixpair filestreamcp
Definition: eus.c:75
pointer K_UPCASE
Definition: eus.c:134
pointer error()
unsigned pmark
Definition: eus.h:181
pointer FLTVECTOR
Definition: eus.c:154
int mark_lock_thread
Definition: mthread.c:27
pointer THREAD
Definition: eus.c:153
pointer C_CLOSURE
Definition: eus.c:144
pointer STRING
Definition: eus.c:151
pointer GCMERGE
Definition: eus.c:173
Definition: eus.h:299
unsigned elmtype
Definition: eus.h:182
pointer xpkg
Definition: eus.c:109
pointer STDOUT
Definition: eus.c:119
cixpair arraycp
Definition: eus.c:86
cixpair streamcp
Definition: eus.c:74
Definition: eus.h:261
pointer plist
Definition: eus.old.h:208
pointer QUNBOUND
Definition: eus.c:123
struct fletframe * dynlink
Definition: eus.h:514
pointer C_ARRAY
Definition: eus.c:147
pointer LABREF
Definition: eus.c:151
unsigned short word
Definition: eus.old.h:78
pointer STDIN
Definition: eus.c:119
pointer ERROUT
Definition: eus.c:119
pointer defvar(context *, char *, pointer, pointer)
Definition: makes.c:704
Definition: eus.h:524
pointer K_BYTE
Definition: eus.c:132
pointer K_FOREIGN
Definition: eus.c:133
pointer VECCLASS
Definition: eus.c:154
cixpair packagecp
Definition: eus.c:73
pointer sharpmacro[256]
Definition: eus.c:164
pointer K_FILL
Definition: eus.c:131
pointer K_INTEGER
Definition: eus.c:132
struct bindframe * bindkeyparams(context *, pointer, pointer *, int, struct bindframe *, struct bindframe *)
Definition: eval.c:270
pointer FOREIGNCODE
Definition: eus.c:155
pointer C_CONS
Definition: eus.c:142
pointer eval(context *, pointer)
Definition: eval.c:1622
cixpair bitvectorcp
Definition: eus.c:92
pointer C_VECTOR
Definition: eus.c:144
pointer xcdr(pointer)
Definition: compsub.c:55
pointer val
Definition: eus.h:482
int rank(int n, int p, MATRIX s)
Definition: rank.c:3
pointer C_VCLASS
Definition: eus.c:146
Definition: eus.h:195
pointer METACLASS
Definition: eus.c:151
pointer cons(context *, pointer, pointer)
Definition: makes.c:97
void unbindspecial(context *, struct specialbindframe *)
Definition: eval.c:165
pointer QDEBUG
Definition: eus.c:123
int intcode
Definition: eus.c:159
pointer syspkg
Definition: eus.c:109
pointer csend()
struct cell cell
pointer unixpkg
Definition: eus.c:109
pointer C_FOREIGNCODE
Definition: eus.c:147
pointer CODE
Definition: eus.c:151
struct protectframe * protlink
Definition: eus.h:505
byte bix
Definition: eus.old.h:88
char * maxmemory
Definition: memory.c:50
struct blockframe * lexklink
Definition: eus.h:491
pointer FUNCTION
Definition: eus.c:111
int ival
Definition: eus.old.h:290
pointer K_SHORT
Definition: eus.c:132
float fltval()
pointer BITVECTOR
Definition: eus.c:155
cixpair closurecp
Definition: eus.c:83
int export_all
Definition: intern.c:11
Definition: eus.h:303
pointer FILESTREAM
Definition: eus.c:151
pointer memq()
pointer C_CODE
Definition: eus.c:143
Definition: eus.h:289
pointer QFIXNUM
Definition: eus.c:120
Definition: eus.h:447
struct blockframe * dynklink
Definition: eus.h:491
pointer K_NOMETHOD
Definition: eus.c:132
cixpair metaclasscp
Definition: eus.c:77
struct class_desc classtab[MAXCLASS]
Definition: eus.c:138
pointer K_DOWNCASE
Definition: eus.c:134
struct bindframe * declare(context *, pointer, struct bindframe *)
Definition: eval.c:220
pointer charmacro[256]
Definition: eus.c:163
long freeheap
Definition: memory.c:56
cixpair intvectorcp
Definition: eus.c:90
struct buddybase buddy[MAXBUDDY+1]
Definition: eus.old.h:421
pointer defun(context *, char *, pointer, pointer(*)())
Definition: makes.new.c:591
pointer defmacro(context *, char *, pointer, pointer(*)())
Definition: makes.c:646
ch_attr
Definition: eus.h:467
pointer makemodule(context *, int)
Definition: makes.c:486
struct chunk * chunklist
Definition: memory.c:57
pointer K_CHAR
Definition: eus.c:132
Definition: eus.h:320
pointer fcall()
Definition: eus.h:334
pointer oldval
Definition: eus.h:487
cixpair objectcp
Definition: eus.c:69
pointer PKGCLASS
Definition: eus.c:151
char * mark_locking
Definition: mthread.c:26
bpointer bp
Definition: eus.old.h:398
pointer C_PACKAGE
Definition: eus.c:142
cixpair symbolcp
Definition: eus.c:72
pointer QTHREADS
Definition: eus.c:124
union cell::cellunion c
pointer PACKAGE
Definition: eus.c:110
pointer C_SYMBOL
Definition: eus.c:142
pointer label
Definition: eus.h:497
pointer IOSTREAM
Definition: eus.c:151
Definition: eus.h:474
pointer C_STREAM
Definition: eus.c:143
pointer findpkg()
Definition: eus.h:479
pointer intern(context *, char *, int, pointer)
Definition: intern.c:105
pointer LDMODULE
Definition: eus.c:151
pointer SELF
Definition: eus.c:116
pointer QSTDIN
Definition: eus.c:119
Definition: eus.h:428
pointer makematrix(context *, int, int)
Definition: makes.c:467
pointer K_STRING
Definition: eus.c:131
pointer sym
Definition: eus.h:481
ch_type
Definition: eus.h:456
pointer cix
Definition: eus.old.h:211
pointer QFLOAT
Definition: eus.c:120
unsigned smark
Definition: eus.h:180
pointer C_FILESTREAM
Definition: eus.c:143
pointer QERROUT
Definition: eus.c:119
pointer C_THREAD
Definition: eus.c:145
pointer READTABLE
Definition: eus.c:154
pointer ARRAY
Definition: eus.c:155
struct callframe * vlink
Definition: eus.h:475
Definition: eus.h:381
Definition: eus.h:518
pointer defconst(context *, char *, pointer, pointer)
Definition: makes.c:693
pointer K_OUT
Definition: eus.c:130
pointer types
Definition: eus.old.h:213
cixpair threadcp
Definition: eus.c:85
long alloccount[MAXBUDDY]
Definition: memory.c:60
int nextcix
Definition: eus.c:139
int chunkbix
Definition: eus.h:449
cixpair conscp
Definition: eus.c:70
pointer form
Definition: eus.h:476
pointer C_METACLASS
Definition: eus.c:144
int mypid
Definition: eus.c:38
pointer makeobject(pointer)
Definition: makes.c:407
byte bix
Definition: eus.old.h:259
pointer QNUMBER
Definition: eus.c:120
struct bindframe * lexblink
Definition: eus.h:480
int ehbypass
Definition: eus.c:160
long marktime
Definition: memory.c:59
pointer INTVECTOR
Definition: eus.c:154
pointer eval2(context *, pointer, pointer)
Definition: eval.c:1664
cixpair vecclasscp
Definition: eus.c:78
struct bcell * nextbcell
Definition: eus.h:442
pointer K_DOUBLE
Definition: eus.c:133
pointer reader(context *, pointer, pointer)
Definition: reader.c:1016
static pointer quotevec
Definition: newstr.c:4
cixpair readtablecp
Definition: eus.c:87
pointer makepkg(context *, pointer, pointer, pointer)
Definition: makes.c:201
pointer C_INTVECTOR
Definition: eus.c:146
errorcode
Definition: eus.h:919
pointer sym
Definition: eus.h:486
int size
Definition: eus.old.h:397
struct bindframe * vbind(context *, pointer, pointer, struct bindframe *, struct bindframe *)
Definition: eval.c:194
pointer pkglist
Definition: eus.c:109
pointer setval(context *, pointer, pointer)
Definition: eval.c:68
makethreadport(context *)
Definition: makes.c:916
pointer alloc()
pointer K_FLOAT
Definition: eus.c:133
struct bcell * bpointer
Definition: eus.old.h:301
pointer K_LONG
Definition: eus.c:132
pointer progn(context *, pointer)
Definition: eval.c:1679
pointer QSTDOUT
Definition: eus.c:119
struct methdef methcache[MAXMETHCACHE]
struct fletframe * scope
Definition: eus.h:512
cixpair stringcp
Definition: eus.c:91
struct bindframe * dynblink
Definition: eus.h:480
pointer QEVALHOOK
Definition: eus.c:121
struct fletframe * lexlink
Definition: eus.h:513
pointer getval(context *, pointer)
Definition: eval.c:33
Definition: eus.h:273
pointer halloc()
pointer xcar(pointer)
Definition: compsub.c:49
struct bcell bcell
void addcmethod(context *, pointer, pointer(*)(), pointer, pointer, pointer)
Definition: leo.c:133
pointer getfunc(context *, pointer)
Definition: eval.c:97
void bindspecial(context *, pointer, pointer)
Definition: eval.c:131
pointer userpkg
Definition: eus.c:109
struct catchframe * nextcatch
Definition: eus.h:496
Definition: eus.old.h:663
pointer C_LABREF
Definition: eus.c:144
Definition: eus.h:210
context * euscontexts[MAXTHREAD]
Definition: eus.old.h:436
cixpair propobjcp
Definition: eus.c:71
pointer T
Definition: eus.c:110
Definition: eus.h:230
pointer VECTOR
Definition: eus.c:154
pointer makevector(pointer, int)
Definition: makes.c:417
unsigned mark
Definition: eus.h:177
int intsig
Definition: eus.c:159
cixpair labrefcp
Definition: eus.c:84
Definition: eus.h:240
pointer name
Definition: eus.old.h:209
cixpair fltvectorcp
Definition: eus.c:89
pointer defunpkg(context *, char *, pointer, pointer(*)(), pointer)
Definition: makes.c:636
union numunion numunion
pointer SYMBOL
Definition: eus.c:151
pointer C_OBJECT
Definition: eus.c:142
pointer minilist()
pointer QSPECIAL
Definition: eus.c:112
pointer C_IOSTREAM
Definition: eus.c:143
pointer makebuffer(int)
Definition: makes.c:140
pointer lisppkg
Definition: eus.c:109
tail(char *cp)
Definition: eustags.c:1181
long sweeptime
Definition: memory.c:59
cixpair iostreamcp
Definition: eus.c:76
pointer * ovafptr(pointer, pointer)
Definition: eval.c:120
pointer makecode(pointer, pointer(*)(), pointer)
Definition: makes.c:282
pointer OBJECT
Definition: eus.c:154
pointer rawcons(context *, pointer, pointer)
Definition: makes.c:86
pointer K_FLUSH
Definition: eus.c:131
int count
Definition: thrtest.c:11
short cix
Definition: eus.h:190
struct cell * pointer
Definition: eus.old.h:79
pointer forwards
Definition: eus.old.h:214
pointer keywordpkg
Definition: eus.c:109
struct specialbindframe * sblink
Definition: eus.h:485
Definition: eus.h:218
pointer C_BITVECTOR
Definition: eus.c:146
pointer CLASS
Definition: eus.c:118
pointer NIL
Definition: eus.c:110
pointer methods
Definition: eus.old.h:215
pointer makesymbol(context *, char *, int, pointer)
Definition: makes.c:164
long totalheap
Definition: memory.c:56
pointer stacknlist(context *, int)
Definition: makes.c:129
cixpair ldmodulecp
Definition: eus.c:82
GLfloat v[8][3]
Definition: cube.c:21
pointer QCONS
Definition: eus.c:151
pointer K_BIT
Definition: eus.c:132
unsigned b
Definition: eus.h:178
pointer lastalloc
pointer makeclass(context *, pointer, pointer, pointer, pointer, pointer, int, pointer)
Definition: makes.c:375
pointer C_READTABLE
Definition: eus.c:147
pointer K_FILE
Definition: eus.c:131
jmp_buf * jbp
Definition: eus.h:493
Definition: eus.h:439
pointer defkeyword(context *, char *)
Definition: makes.c:733
struct built_in_cid builtinclass[64]
Definition: eus.c:100
pointer K_IO
Definition: eus.c:130
pointer mkiostream(context *, pointer, pointer)
Definition: makes.c:269
pointer C_FCODE
Definition: eus.c:143
unsigned char byte
Definition: eus.h:163
pointer K_IN
Definition: eus.c:130
pointer prinx(context *, pointer, pointer)
Definition: printer.c:611
Definition: eus.h:202
pointer C_STRING
Definition: eus.c:146
pointer ERRHANDLER
Definition: eus.c:121
pointer makestring(char *, int)
Definition: makes.c:147
Definition: eus.h:452
pointer cleaner
Definition: eus.h:506
pointer makeflt()
struct chunk * nextchunk
Definition: eus.h:448
mutex_t p_mark_lock
struct bindframe * fastbind(context *, pointer, pointer, struct bindframe *)
Definition: eval.c:180
int nextbclass
Definition: eus.c:101
pointer mkstream(context *, pointer, pointer)
Definition: makes.c:241
pointer QUOTE
Definition: eus.c:110
pointer C_FLTVECTOR
Definition: eus.c:146
cixpair fcodecp
Definition: eus.c:80
pointer xcadr(pointer)
Definition: compsub.c:61
pointer CLOSURE
Definition: eus.c:151
unsigned m
Definition: eus.h:179
pointer super
Definition: eus.old.h:210
Definition: eus.h:293
Definition: eus.old.h:207
pointer FCODE
Definition: eus.c:151
pointer vars
Definition: eus.old.h:212
pointer defspecial(context *, char *, pointer, pointer(*)())
Definition: makes.c:682
Definition: eus.h:509
pointer mkfilestream(context *, pointer, pointer, int, pointer)
Definition: makes.c:253
pointer STREAM
Definition: eus.c:151
pointer TOPLEVEL
Definition: eus.c:121
float fval
Definition: eus.old.h:289
static pointer codevec
Definition: newstr.c:4
long gccount
Definition: memory.c:59
cixpair codecp
Definition: eus.c:79
cixpair vectorcp
Definition: eus.c:88
Definition: eus.h:249
pointer Getstring()
pointer ufuncall(context *, pointer, pointer, pointer, struct bindframe *, int)
Definition: eval.c:1469
float ckfltval()
pointer C_LDMOD
Definition: eus.c:143
pointer sysobj
Definition: eus.c:54
pointer QDECLARE
Definition: eus.c:112
Definition: eus.h:346
mutex_t mark_lock
Definition: mthread.c:25
pointer GCMARGIN
Definition: eus.c:173
pointer makeclosure(pointer, pointer, int, pointer *, pointer *)
pointer QINTEGER
Definition: eus.c:120
pointer name
Definition: eus.h:492
char * progname
Definition: eus.c:39
unsigned char byte
Definition: eus.old.h:77


euslisp
Author(s): Toshihiro Matsui
autogenerated on Mon Feb 28 2022 22:18:27