makes.c
Go to the documentation of this file.
1 /****************************************************************/
2 /* make eulisp objects
3 /* Copyright Toshihiro MATSUI, ETL, 1987
4 /****************************************************************/
5 static char *rcsid="@(#)$Id$";
6 
7 #if Solaris2
8 #include <errno.h>
9 #include <synch.h>
10 #include <thread.h>
11 #endif
12 
13 #include "eus.h"
14 
15 #if 0 /* move to eus.h */
16 #define nextbuddy(p) ((bpointer)((eusinteger_t)p+(buddysize[p->h.bix]*sizeof(pointer))))
17 #endif
18 
20 
21 /****************************************************************/
22 /* boxing and unboxing
23 /****************************************************************/
24 #if vax
25 float ckfltval(p)
26 register int p;
27 { numunion nu;
28  if (isflt(p)) {
29  nu.ival = p & 0xfffffffc;
30 #if vax
31  { register short s;
32  s=nu.sval.low; nu.sval.low=nu.sval.high; nu.sval.high=s;}
33 #endif
34  return(nu.fval);}
35  else if (isint(p)) { nu.fval=intval(p); return(nu.fval);} /*coerce to float*/
36  else error(E_NONUMBER);}
37 
38 float fltval(p)
39 int p;
40 { numunion nu;
41  nu.ival= p & 0xfffffffc;
42 #if vax
43  { register short s;
44  s=nu.sval.low; nu.sval.low=nu.sval.high; nu.sval.high=s;}
45 #endif
46  return(nu.fval);}
47 
49 double d;
50 { numunion u;
51  u.fval=d; /*double to short float*/
52 #if vax
53  { register short s;
54  s=u.sval.low; /*swap upper and lower short*/
55  u.sval.low=u.sval.high;
56  u.sval.high=s;}
57 #endif
58  return((pointer)((u.ival & 0xfffffffc) | 1));}
59 #endif
60 
62 register pointer s;
63 { if (issymbol(s)) s=s->c.sym.pname;
64  if (!isstring(s)) error(E_NOSTRING);
65  return(s);}
66 
67 byte *get_string(s)
68 register pointer s;
69 { if (isstring(s)) return(s->c.str.chars);
70  if (issymbol(s)) return(s->c.sym.pname->c.str.chars);
71  else error(E_NOSTRING);}
72 
73 /****************************************************************/
74 /* cons & list
75 /****************************************************************/
76 
77 #define allocobj(class,builtin,cid) \
78  ((class)? \
79  alloc(vecsize(speval(class)->c.cls.vars), ELM_FIXED, \
80  intval(speval(class)->c.cls.cix), \
81  /*wordsizeof(struct builtin)*/ \
82  vecsize(speval(class)->c.cls.vars)) : \
83  alloc(wordsizeof(struct builtin), ELM_FIXED, cid, \
84  wordsizeof(struct builtin)))
85 
87 register context *ctx;
88 register pointer a,d;
89 { register pointer c;
90  vpush(a); vpush(d);
91  c = alloc(wordsizeof(struct cons), ELM_FIXED, conscp.cix,
92  wordsizeof(struct cons));
93  c->c.cons.cdr=vpop();
94  c->c.cons.car=vpop();
95  return(c);}
96 
97 pointer cons(ctx,a,d)
98 register context *ctx;
99 register pointer a,d;
100 {
101  register pointer c;
102  register bpointer b;
103  /*
104  if ((speval(QCONS)==C_CONS) && (b=buddy[1].bp)) {
105  b->h.elmtype=ELM_FIXED;
106  buddy[1].bp=b->b.nextbcell;
107  freeheap -= 3;
108  alloccount[1]++;
109  c=makepointer(b);
110  cixof(c)=conscp.cix;}
111  else*/
112  {
113  vpush(a); vpush(d); /*protect args from garbage collection*/
114  c=alloc(vecsize(speval(QCONS)->c.cls.vars), ELM_FIXED,
115  intval(speval(QCONS)->c.cls.cix),
116  wordsizeof(struct cons));
117  ctx->vsp-=2; }
118  c->c.cons.car=a; c->c.cons.cdr=d;
119  return(c);}
120 
121 pointer stackrawlist(ctx,n) /*make a list out of elements pushed on vstack*/
122 register context *ctx;
123 register int n;
124 { register pointer r=NIL, *fsp=ctx->vsp;
125  while (n-->0) r=rawcons(ctx,*--fsp,r);
126  ctx->vsp=fsp;
127  return(r);}
128 
129 pointer stacknlist(ctx,n) /*make a list out of elements pushed on vstack*/
130 register context *ctx;
131 register int n;
132 { register pointer r=NIL, *fsp=ctx->vsp;
133  while (n-->0) r=cons(ctx,*--fsp,r);
134  ctx->vsp=fsp;
135 #ifdef SAFETY
136  take_care(r);
137 #endif
138  return(r);}
139 
141 register int size;
142 { register pointer p;
143  p = alloc((size+2*sizeof(eusinteger_t))>>WORDSHIFT, ELM_CHAR, stringcp.cix, (size+2*sizeof(eusinteger_t))>>WORDSHIFT);
144  p->c.str.length=makeint(size);
145  return(p);}
146 
148 register char *s;
149 register int l;
150 { register pointer p;
151  p=alloc((l+2*sizeof(eusinteger_t))>>WORDSHIFT, ELM_CHAR, stringcp.cix, (l+2*sizeof(eusinteger_t))>>WORDSHIFT );
152  p->c.str.length=makeint(l);
153  p->c.ivec.iv[l/sizeof(long)]=0; /*terminator*/
154  memcpy((void *)p->c.str.chars, (void *)s, l);
155  return(p);}
156 
158 { register pointer p;
159  p=alloc(2, ELM_FOREIGN, stringcp.cix, 2);
160  p->c.str.length=makeint(size);
161  p->c.ivec.iv[0]=addr;
162  return(p);}
163 
164 pointer makesymbol(ctx,str,leng,home)
165 register context *ctx;
166 char *str;
167 int leng;
168 pointer home;
169 { register pointer sym;
170  int cid;
171  vpush(makestring(str,leng));
172  sym=allocobj(SYMBOL,symbol,symbolcp.cix);
173  sym->c.sym.speval=sym->c.sym.spefunc=UNBOUND;
174  sym->c.sym.vtype=V_VARIABLE;
175  sym->c.sym.homepkg=home;
176  sym->c.sym.plist=NIL;
177  sym->c.sym.pname=vpop();
178  return(sym);}
179 
180 pointer searchpkg(token,leng)
181 byte *token;
182 int leng;
183 { pointer pkg,pkgs,names;
184  pkgs=pkglist;
185  while (pkgs && islist(pkgs)) {
186  pkg=ccar(pkgs); pkgs=ccdr(pkgs);
187  names=pkg->c.pkg.names;
188  while (islist(names))
189  if (strlength(ccar(names))==leng &&
190  !memcmp((char *)ccar(names)->c.str.chars, (char *)token, leng)) return(pkg);
191  else names=ccdr(names);}
192  return(NULL);}
193 
194 pointer findpkg(pkgname)
195 register pointer pkgname; /*string or symbol*/
196 { register pointer pkg,pkgs,names;
197  if (ispackage(pkgname)) return(pkgname);
198  pkgname=Getstring(pkgname);
199  return(searchpkg(pkgname->c.str.chars,strlength(pkgname)));}
200 
201 pointer makepkg(ctx,namestr,nicks,uses)
202 register context *ctx;
203 register pointer namestr,nicks,uses;
204 { register pointer pkg,symvec,pkgs,names,p;
205  register int i;
206  /*check pkg name collision*/
207  namestr=Getstring(namestr);
208  if (findpkg(namestr)) error(E_PKGNAME,namestr);
209  vpush(namestr); vpush(nicks); vpush(uses);
210  i=0;
211  while (islist(nicks)) {
212  if (findpkg(ccar(nicks))) error(E_PKGNAME,ccar(nicks));
213  vpush(Getstring(ccar(nicks))); i++;
214  nicks=ccdr(nicks);}
215  nicks=stackrawlist(ctx,i); /*list up package nicknames*/
216  i=0;
217  while (islist(uses)) {
218  if ((p=findpkg(ccar(uses)))) { vpush(p); i++; uses=ccdr(uses);}
219  else error(E_PKGNAME,ccar(uses));}
220  uses=stackrawlist(ctx,i);
221  pkg=allocobj(PKGCLASS,package, packagecp.cix);
222  pkg->c.pkg.names=pkg->c.pkg.symvector=pkg->c.pkg.intsymvector=NULL;
223  pkg->c.pkg.symcount=pkg->c.pkg.intsymcount=makeint(0);
224  pkg->c.pkg.use=uses;
225  pkg->c.pkg.plist=NIL;
226  pkg->c.pkg.shadows=NIL;
227  pkg->c.pkg.used_by=NIL;
228  vpush(pkg);
229  pkg->c.pkg.names=rawcons(ctx,namestr,nicks);
230  symvec=makevector(C_VECTOR,SYMBOLHASH);
231  for (i=0; i<SYMBOLHASH; i++) symvec->c.vec.v[i]=makeint(0);
232  pkg->c.pkg.symvector=symvec;
233  symvec=makevector(C_VECTOR,SYMBOLHASH);
234  for (i=0; i<SYMBOLHASH; i++) symvec->c.vec.v[i]=makeint(0);
235  pkg->c.pkg.intsymvector=symvec;
236  pkglist=rawcons(ctx,pkg,pkglist);
237  ctx->lastalloc=pkg;
238  ctx->vsp -= 4;
239  return(pkg);}
240 
241 pointer mkstream(ctx,dir,string)
242 register context *ctx;
243 pointer dir,string;
244 { register pointer s;
245  vpush(string);
246  s=allocobj(STREAM, stream, streamcp.cix);
247  s->c.stream.direction=dir;
248  s->c.stream.count=s->c.stream.tail=makeint(0);
249  s->c.stream.buffer=vpop();
250  s->c.stream.plist=NIL;
251  return(s);}
252 
253 pointer mkfilestream(ctx,dir,string,fno,fname)
254 register context *ctx;
255 pointer dir,string,fname;
256 int fno;
257 { register pointer s;
258  if (dir!=K_IN && dir!=K_OUT) error(E_IODIRECTION);
259  vpush(string); vpush(fname);
260  s=allocobj(FILESTREAM, filestream, filestreamcp.cix);
261  s->c.fstream.direction=dir;
262  s->c.fstream.count=s->c.fstream.tail=makeint(0);
263  s->c.fstream.fname=vpop();
264  s->c.fstream.buffer=vpop();
265  s->c.fstream.fd=makeint(fno);
266  s->c.fstream.plist=NIL;
267  return(s);}
268 
269 pointer mkiostream(ctx,in,out)
270 register context *ctx;
271 register pointer in,out;
272 { register pointer ios;
273  if (!isstream(in) || !isstream(out)) error(E_STREAM);
274  vpush(in); vpush(out);
275  ios=allocobj(IOSTREAM, iostream, iostreamcp.cix);
276  ios->c.iostream.out=out;
277  ios->c.iostream.in=in;
278  ios->c.iostream.plist=NIL;
279  ctx->vsp -= 2;
280  return(ios);}
281 
282 pointer makecode(mod,f,ftype)
283 register pointer mod,ftype;
284 pointer (*f)();
285 /*actually, f is a pointer to a function returning a pointer*/
286 { register pointer cd;
287  eusinteger_t fentaddr;
288  cd=allocobj(CODE, code, codecp.cix);
289  cd->c.code.codevec=mod->c.code.codevec;
290  cd->c.code.quotevec=mod->c.code.quotevec;
291  cd->c.code.subrtype=ftype;
292  fentaddr= (eusinteger_t)f>>2;
293  cd->c.code.entry=makeint(fentaddr);
294 #if ARM
295  cd->c.code.entry2=makeint(((eusinteger_t)f)&0x3);
296 #endif
297  return(cd);}
298 
299 
300 /*
301 /* for DEFCLASS and INSTANTIATE
302 */
303 
304 void bumpcix(m,n)
305 int m,n;
306 { pointer super;
307  if (classtab[m].subcix<n) {
308  classtab[m].subcix=n;
309  super=classtab[m].def->c.cls.super;
310  if (isclass(super)) bumpcix(intval(super->c.cls.cix),n);}}
311 
312 void recixobj(newcix)
313 register int newcix;
314 { register struct chunk *cp;
315  register bpointer p,tail;
316  register int s;
317 #if defined(BIX_DEBUG) || defined(DEBUG_COUNT)
318  static int count = 0;
319 
320  count++;
321 #endif
322 
323  for (cp=chunklist; cp!=0; cp=cp->nextchunk) {
324  s=buddysize[cp->chunkbix];
325  p= &cp->rootcell;
326  tail=(bpointer)((eusinteger_t)p+(s<<WORDSHIFT));
327  while (p<tail) {
328  if (p->h.cix>=newcix) p->h.cix++;
329 #ifdef BIX_DEBUG
330  printf( "recixobj:%d:p=0x%lx, bix = %d\n",
331  count, p, p->h.bix );
332 #endif
333  p=nextbuddy(p);}
334  } }
335 
336 void resetcix(class,p)
337 pointer class;
338 cixpair *p;
339 { if (class) {
340  p->cix=intval(class->c.cls.cix);
341  p->sub=classtab[p->cix].subcix;} }
342 
343 void enterclass(classobj)
344 pointer classobj;
345 { pointer super;
346  register int i,newcix,temp,supercix;
347 
348  if (nextcix>=MAXCLASS) error(E_CLASSOVER);
349  super= /*spevalof*/ (classobj->c.cls.super);
350  if (isclass(super)) {
351  supercix=intval(super->c.cls.cix);
352  newcix=classtab[supercix].subcix+1;
353  for (i=nextcix-1; i>=newcix; i--) {
354  /*reconfigure class hierarchy*/
355  bumpcix(i,i+1);
356  classtab[i+1]=classtab[i]; /*bump classtab entry*/
357  temp=intval(classtab[i].def->c.cls.cix);
358  classtab[i].def->c.cls.cix=makeint(temp+1); }
359  bumpcix(supercix,newcix);
360  /*scan chunks and bumps object's cix which is greater than newcix*/
361  if (newcix<nextcix) recixobj(newcix);
362  /*reset system defined class's cix*/
363  for (i=0; i<nextbclass; i++)
364  resetcix(builtinclass[i].cls, builtinclass[i].cp);
365  }
366  else newcix=nextcix;
367  classobj->c.cls.cix=makeint(newcix);
368  classtab[newcix].def=classobj;
369  classtab[newcix].subcix=newcix;
370 #ifdef RGC
371  rgc_add_to_classtable(classobj);
372 #endif
373  nextcix++; }
374 
375 pointer makeclass(ctx,name,superobj,vars,types,forwards,tag,metaclass)
376 register context *ctx;
377 pointer name,superobj,vars,types,metaclass,forwards;
378 int tag;
379 { pointer class;
380  extern pointer makeobject();
381 
382  /* make metaclass cell */
383  vpush(vars); vpush(types);
384  if (metaclass && isclass(metaclass)) class=makeobject(metaclass);
385  else {
386  if (tag==0)
387  class=allocobj(METACLASS, _class, metaclasscp.cix);
388  else
389  class=allocobj(VECCLASS, vecclass, vecclasscp.cix);}
390  class->c.cls.name=name;
391  class->c.cls.super=superobj;
392  class->c.cls.methods=NIL;
393  class->c.cls.vars=vars;
394  class->c.cls.types=types;
395  class->c.cls.forwards=forwards;
396  class->c.cls.plist=NIL;
397  if (tag) { /*vector type class*/
398  class->c.vcls.elmtype=makeint(tag);
399  class->c.vcls.size=makeint(-1);}
400  pointer_update(name->c.sym.speval,class);
401 /* name->c.sym.vtype=V_SPECIAL; */
402  name->c.sym.vtype=V_GLOBAL;
403  enterclass(class); /*determine cix and fill it in the cix slot*/
404  vpop(); vpop();
405  return(class); }
406 
408 register pointer class;
409 { register pointer obj,*v;
410  register int size;
411  size=vecsize(class->c.cls.vars);
412  obj=alloc(size, ELM_FIXED, intval(class->c.cls.cix), size);
413  v=obj->c.obj.iv;
414  while (size>0) v[--size]=NIL;
415  return(obj);}
416 
417 pointer makevector(vclass,size)
418 register pointer vclass;
419 register int size;
420 { register pointer v,init,*vv;
421  register int n,etype;
422 
423  etype=intval(vclass->c.vcls.elmtype);
424  switch(etype) {
425  case ELM_BIT: n=(size+WORD_SIZE-1)/WORD_SIZE; init=0; break;
426  case ELM_CHAR:
427  case ELM_BYTE: n=(size+sizeof(eusinteger_t))/sizeof(eusinteger_t); init=0; break;
428  case ELM_FLOAT: n=size; init=(pointer)0; break;
429  case ELM_INT: n=size; init=0; break;
430  case ELM_FOREIGN: n=1; init=0; break;
431  default: n=size; init=NIL;}
432  v=alloc(n+1,etype, intval(vclass->c.vcls.cix),n+1);
433  v->c.vec.size=makeint(size);
434  vv=v->c.vec.v;
435  while (--n>=0) vv[n]=init;
436  return(v);}
437 
439 register int s;
440 { register pointer v;
441  register bpointer b;
442  v=alloc(s+1,ELM_FLOAT, fltvectorcp.cix,s+1);
443  v->c.vec.size=makeint(s);
444  return(v);}
445 
446 pointer defvector(ctx,name,super,elm,size) /*define vector class*/
447 register context *ctx;
448 char *name;
449 pointer super;
450 int elm,size;
451 { pointer classsym,class,varvector,typevector,forwardvector;
452  int i;
453  classsym=intern(ctx,name,strlen(name),lisppkg);
454  varvector=makevector(C_VECTOR,1);
455  vpush(varvector);
456  typevector=makevector(C_VECTOR,1);
457  typevector->c.vec.v[0]=QINTEGER;
458  vpush(typevector);
459  forwardvector=makevector(C_VECTOR,1);
460  forwardvector->c.vec.v[0]=NIL;
461  vpush(forwardvector);
462  varvector->c.vec.v[0]=intern(ctx,"LENGTH",6,lisppkg);
463  class=makeclass(ctx,classsym,super,varvector,typevector,forwardvector,elm,0);
464  ctx->vsp -= 3;
465  return(classsym);}
466 
467 pointer makematrix(ctx,row,column)
468 register context *ctx;
469 int row,column;
470 { register pointer v,m;
471  register int i;
472  v=makefvector(row*column);
473  vpush(v);
474  m=allocobj(ARRAY, arrayheader, arraycp.cix);
475  m->c.ary.entity=v;
476  m->c.ary.fillpointer=NIL;
477  m->c.ary.rank=makeint(2);
478  m->c.ary.offset=makeint(0);
479  m->c.ary.dim[0]=makeint(row);
480  m->c.ary.dim[1]=makeint(column);
481  m->c.ary.plist=NIL;
482  for (i=2; i<ARRAYRANKLIMIT; i++) m->c.ary.dim[i]=NIL;
483  vpop();
484  return(m);}
485 
486 pointer makemodule(ctx,size) /*size in bytes*/
487 register context *ctx;
488 int size;
489 { register pointer mod,cvec;
490  cvec=makebuffer(size);
491  elmtypeof(cvec)=ELM_BYTE;
492  vpush(cvec);
493  mod=allocobj(LDMODULE, ldmodule, ldmodulecp.cix);
494  mod->c.ldmod.codevec=vpop();
495  mod->c.ldmod.quotevec=NIL;
496  mod->c.ldmod.entry=NIL;
497 #if ARM
498  mod->c.ldmod.entry2=NIL;
499 #endif
500  mod->c.ldmod.subrtype=NIL;
501  mod->c.ldmod.symtab=NIL;
502  mod->c.ldmod.objname=NIL;
503  mod->c.ldmod.handle=NIL;
504  return(mod);}
505 
507 pointer code,quote,e0,*e1,*e2;
508 pointer (*f)();
509 { register pointer clo;
510  clo=allocobj(CLOSURE, closure, closurecp.cix);
511  clo->c.clo.codevec=code;
512  clo->c.clo.quotevec=quote;
513  clo->c.clo.subrtype=SUBR_FUNCTION;
514  clo->c.clo.entry=makeint((eusinteger_t)f>>2);
515 #if ARM
516  clo->c.clo.entry2=makeint(((eusinteger_t)f)&0x3);
517 #endif
518  clo->c.clo.env0=e0;
519  clo->c.clo.env1=e1; /*makeint((int)e1>>2);*/
520  clo->c.clo.env2=e2; /*makeint((int)e2>>2);*/
521  return(clo);}
522 
524 register context *ctx;
525 { pointer rdtable,rdsyntax,rdmacro,rddispatch;
526  vpush((rdsyntax=makebuffer(256)));
527  vpush((rdmacro=makevector(C_VECTOR,256)));
528  rddispatch=makevector(C_VECTOR,256);
529  rdtable=allocobj(READTABLE, readtable, readtablecp.cix);
530  vpush(rdtable);
531  rdtable->c.rdtab.dispatch=rddispatch;
532  rdtable->c.rdtab.macro=rdmacro;
533  rdtable->c.rdtab.syntax=rdsyntax;
534  rdtable->c.rdtab.plist=NIL;
535  ctx->vsp -= 3;
536  return(rdtable);}
537 
539 pointer n,v,nxt;
540 { pointer l;
541  l=alloc(wordsizeof(struct labref), ELM_FIXED, labrefcp.cix,
542  wordsizeof(struct labref));
543  l->c.lab.label=n;
544  l->c.lab.value=v;
545  l->c.lab.next=nxt;
546  l->c.lab.unsolved=NIL;
547  return(l);}
548 
549 /****************************************************************
550 /* extended numbers
551 /****************************************************************/
552 pointer makeratio(num, denom)
553 int num, denom;
554 { pointer r;
555  r=allocobj(RATIO, ratio, ratiocp.cix);
556  r->c.ratio.numerator=makeint(num);
557  r->c.ratio.denominator=makeint(denom);
558  /* printf("ratio cid= %d r=0x%x\n", ratiocp.cix, r); */
559  return(r);}
560 
562 int n;
563 { register context *ctx=euscontexts[thr_self()];
564  register pointer p,v;
566  vpush(v);
567  p=allocobj(BIGNUM, bignum, bignumcp.cix);
568  p->c.bgnm.size=makeint(n);
569  p->c.bgnm.bv=v;
570  vpop();
571  return(p);}
572 
574 long x;
575 { register context *ctx=euscontexts[thr_self()];
576  register pointer p,v;
577 
579  vpush(v);
580  p=allocobj(BIGNUM, bignum, bignumcp.cix);
581  p->c.bgnm.size=makeint(1);
582  p->c.bgnm.bv=v;
583  v->c.ivec.iv[0]=x;
584  vpop();
585  return(p);}
586 
588 long hi, lo;
589 { register context *ctx=euscontexts[thr_self()];
590  register pointer p,v;
591 
593  vpush(v);
594  p=allocobj(BIGNUM, bignum, bignumcp.cix);
595  p->c.bgnm.size=makeint(2);
596  p->c.bgnm.bv=v;
597  v->c.ivec.iv[0]=lo;
598  v->c.ivec.iv[1]=hi;
599  vpop();
600  return(p);}
601 
602 
603 /****************************************************************/
604 /* defines
605 /****************************************************************/
606 pointer defun(ctx,name,mod,f,doc)
607 register context *ctx;
608 char *name;
609 pointer mod;
610 pointer (*f)();
611 char *doc;
612 { register pointer sym,pkg,pdoc;
613 #if defined(DEFUN_DEBUG) || defined(DEBUG_COUNT)
614  static int count=0;
615 
616  count++;
617 #endif
618 #ifdef DEFUN_DEBUG
619  printf( "defun:%d:%s:", count, name );
620 #endif
621 
622  pkg=Spevalof(PACKAGE);
623  sym=intern(ctx,name,strlen(name),pkg);
624  pdoc = NIL;
625  if (doc != NULL) {
626  pdoc = makestring(doc,strlen(doc));
627  vpush(pdoc);
628  }
629  compfun(ctx, sym, mod, f, pdoc);
630  if (doc != NULL) vpop();
631 #ifdef DEFUN_DEBUG
632  printf( "0x%lx\n", sym->c.sym.spefunc->c.code.entry );
633 #endif
634  return(sym);}
635 
636 pointer defunpkg(ctx,name,mod,f,pkg)
637 register context *ctx;
638 char *name;
639 pointer mod,pkg;
640 pointer (*f)();
641 { pointer sym;
642  sym=intern(ctx,name,strlen(name),pkg);
643  pointer_update(sym->c.sym.spefunc,makecode(mod,f,SUBR_FUNCTION));
644  return(sym);}
645 
646 pointer defmacro(ctx,name,mod,f)
647 register context *ctx;
648 char *name;
649 pointer mod;
650 pointer (*f)();
651 { register pointer sym,pkg;
652  pkg=Spevalof(PACKAGE);
653  sym=intern(ctx,name,strlen(name),pkg);
654  pointer_update(sym->c.sym.spefunc,makecode(mod,f,SUBR_MACRO));
655  return(sym);}
656 
657 #if Solaris2 || PTHREAD
659 static mutex_t spex_lock;
660 
662 { int x;
663 
664  if (next_special_index==3) mutex_init(&spex_lock,USYNC_THREAD,NULL);
665  mutex_lock(&spex_lock);
666  x= next_special_index++;
667  mutex_unlock(&spex_lock);
668  if (x>=MAX_SPECIALS) { error(E_USER,(pointer)"too many special variables >=512"); }
669  return(x);}
670 #else
671 int next_special_index=3;
672 
674 { int x;
675 
676  x= next_special_index++;
677  if (x>=MAX_SPECIALS) { error(E_USER,(pointer)"too many special variables >=512"); }
678 
679  return(x);}
680 #endif
681 
682 pointer defspecial(ctx,name,mod,f) /*define special form*/
683 register context *ctx;
684 char *name;
685 pointer mod;
686 pointer (*f)();
687 { register pointer sym,pkg;
688  pkg=Spevalof(PACKAGE);
689  sym=intern(ctx,name,strlen(name),pkg);
690  pointer_update(sym->c.sym.spefunc,makecode(mod,f,SUBR_SPECIAL));
691  return(sym);}
692 
693 pointer defconst(ctx,name,val,pkg)
694 register context *ctx;
695 char *name;
696 pointer val,pkg;
697 { register pointer sym;
698  vpush(val);
699  sym=intern(ctx,name,strlen(name),pkg);
700  sym->c.sym.vtype=V_CONSTANT;
701  pointer_update(sym->c.sym.speval,vpop());
702  return(sym);}
703 
704 pointer defvar(ctx,name,val,pkg)
705 register context *ctx;
706 char *name;
707 pointer val,pkg;
708 { register pointer sym;
709  int x;
710  vpush(val);
711  sym=intern(ctx,name,strlen(name),pkg);
712  sym->c.sym.vtype=V_GLOBAL;
713  pointer_update(sym->c.sym.speval,vpop());
714  return(sym);}
715 
716 pointer deflocal(ctx,name,val,pkg)
717 register context *ctx;
718 char *name;
719 pointer val,pkg;
720 { register pointer sym;
721  int x;
722  vpush(val);
723  sym=intern(ctx,name,strlen(name),pkg);
724  x=special_index();
725  sym->c.sym.vtype=makeint(x);
726  /*sym->c.sym.speval=vpop();*/
727  /* put the same value in the global symbol-value
728  and in the thread's special binding table */
729  pointer_update(ctx->specials->c.vec.v[x],vpop());
730  pointer_update(sym->c.sym.speval,val);
731  return(sym);}
732 
734 register context *ctx;
735 char *name;
736 { register pointer sym;
737  sym=intern(ctx,name,strlen(name),keywordpkg);
738  return(sym);}
739 
740 /*
741 /* for making compiled function/macro
742 */
743 
744 extern pointer putprop();
745 
746 pointer compfun(ctx,sym,mod,entry,doc)
747 register context *ctx;
748 register pointer sym,mod,doc;
749 pointer (*entry)();
750 { pointer_update(sym->c.sym.spefunc,makecode(mod,entry,SUBR_FUNCTION));
751  if (doc!=NIL) putprop(ctx,sym,doc,K_FUNCTION_DOCUMENTATION);
752  return(sym);}
753 
754 pointer compmacro(ctx,sym,mod,entry,doc)
755 register context *ctx;
756 register pointer sym,mod,doc;
757 pointer (* entry)();
758 { pointer_update(sym->c.sym.spefunc,makecode(mod,entry,SUBR_MACRO));
759  if (doc!=NIL) putprop(ctx,sym, doc, K_FUNCTION_DOCUMENTATION);
760  return(sym);}
761 
762 /****************************************************************/
763 /* stack frames
764 /****************************************************************/
765 
766 struct blockframe *makeblock(ctx,kind,name,jbuf,link)
767 register context *ctx;
769 jmp_buf *jbuf;
770 struct blockframe *link;
771 { register struct blockframe *blk=ctx->blkfp;
772  *(ctx->vsp)=(pointer)ctx->blkfp; blk=(struct blockframe *)(ctx->vsp);
773  (ctx->vsp) += wordsizeof(struct blockframe);
774  blk->lexklink=link;
775  blk->dynklink=ctx->blkfp;
776  blk->kind=kind;
777  blk->name=name;
778  blk->jbp=jbuf;
779  ctx->blkfp=blk;
780  return(blk);}
781 
782 struct fletframe *makeflet(ctx,nm,def,scp,link)
783 register context *ctx;
784 pointer nm,def;
785 struct fletframe *scp,*link;
786 { register struct fletframe *ffp=(struct fletframe *)(ctx->vsp);
787  register pointer p;
788  size_t i;
789  for (i=0; i<sizeof(struct fletframe)/sizeof(pointer); i++)
790  vpush(makeint(0));
791  ffp->name=nm;
792  p=cons(ctx,makeint(hide_ptr((pointer)scp)),def);
793  p=cons(ctx,makeint(hide_ptr((pointer)(ctx->bindfp))),p);
794  p=cons(ctx,nm,p);
795  ffp->fclosure=cons(ctx,LAMCLOSURE,p);
796  ffp->scope=scp;
797  ffp->lexlink=link; ffp->dynlink=ctx->fletfp; /*dynlink is not used*/
798  ctx->fletfp=ffp;
799  return(ffp);}
800 
801 void mkcatchframe(ctx,lab,jbuf)
802 context *ctx;
803 pointer lab;
804 jmp_buf *jbuf;
805 { struct catchframe *cfp;
806  cfp=(struct catchframe *)ctx->vsp;
807  cfp->nextcatch=ctx->catchfp;
808  cfp->cf=ctx->callfp;
809  cfp->bf=ctx->bindfp;
810 /* cfp->blkf=blkfp; */
811  cfp->jbp=(jmp_buf *)jbuf;
812  cfp->label=lab;
813  cfp->ff=ctx->fletfp;
814  ctx->vsp += (sizeof(struct catchframe)/sizeof(pointer));
815  ctx->catchfp=cfp;}
816 
817 /****************************************************************/
818 /* new thread context
819 /****************************************************************/
820 extern context *mainctx;
821 
822 void allocate_stack(ctx,n)
823 context *ctx;
824 register int n;
825 { register int i;
826  if (ctx->stack) cfree(ctx->stack);
827  n=max(1024,n);
828 #if 0 /* ???? */
829  i=(int)malloc((n+1)*sizeof(pointer));
830  ctx->stack=(pointer *)i;
831 #else
832  ctx->stack=(pointer *)malloc((n+1)*sizeof(pointer));
833 #endif
834  ctx->stacklimit= &ctx->stack[n-100];
835 #if STACK_DEBUG
836  printf( "allocate_stack: 0x%lx -- 0x%lx\n", ctx->stack, ctx->stacklimit );
837 #endif
838  }
839 
841 int bs_size;
842 { pointer *stk, specialtab;
843  context *cntx;
844  int i;
845 
846  cntx=(context *)malloc(sizeof(context));
847  if (bs_size<4096) bs_size=4096;
848  stk=(pointer *)malloc(sizeof(pointer) * bs_size);
849  cntx->stack=stk;
850  cntx->vsp=stk;
851  cntx->stacklimit = stk+bs_size-64;
852 #if STACK_DEBUG
853  printf( "makelispcontext: stack: 0x%lx -- 0x%lx\n", cntx->stack, cntx->stacklimit );
854 #endif
855  cntx->callfp=NULL;
856  cntx->catchfp=NULL;
857  cntx->bindfp=NULL;
858  cntx->sbindfp=NULL;
859  cntx->blkfp=NULL;
860  cntx->protfp=NULL;
861  cntx->fletfp=NULL;
862  cntx->newfletfp=NULL;
863  cntx->lastalloc=NULL;
864  cntx->errhandler=NULL;
865  cntx->alloc_big_count=0;
866  cntx->alloc_small_count=0;
867  cntx->special_bind_count=0;
868  cntx->threadobj=NIL;
869 #ifdef RGC
870  stk = (pointer *)malloc(sizeof(pointer) * bs_size * 2);
871  cntx->gcstack = stk;
872  cntx->gsp = stk;
873  cntx->gcstacklimit = stk+bs_size*2-64;
874 #ifdef __GC_ALLOC_DRIVEN
875  cntx->my_gc_pri = 2;
876 #endif
877 #endif
878  cntx->slashflag=0;
879  cntx->intsig=0;
880 #ifdef __RETURN_BARRIER
881  cntx->rbar.pointer = NULL;
882  mutex_init(&cntx->rbar.lock, NULL);
883 #endif
884 
885  /* create a special variable table for this thread and link to specials slot*/
886  if (C_VECTOR) {
887  specialtab=makevector(C_VECTOR,MAX_SPECIALS);
888  /* copy initial values of special variables from the main context*/
889  for (i=0; i<MAX_SPECIALS; i++)
890  specialtab->c.vec.v[i]=mainctx->specials->c.vec.v[i];
891  cntx->specials=specialtab;}
892 
893  { register int i;
894  register struct methdef *mc;
895  mc=(struct methdef *)malloc(sizeof(struct methdef)*MAXMETHCACHE);
896  for (i=0; i<MAXMETHCACHE; i++) {
897  mc[i].selector=mc[i].class=mc[i].ownerclass=mc[i].method=NULL;}
898  cntx->methcache=mc;
899  cntx->thr_buddy=(struct buddyfree *)
900  malloc(sizeof(struct buddyfree) * (MAXTHRBUDDY+1));
901  for (i=0; i<MAXTHRBUDDY; i++) {
902  cntx->thr_buddy[i].bp=0;
903  cntx->thr_buddy[i].count=0;}
904  cntx->thr_buddy[MAXTHRBUDDY].bp= (bpointer)-1;
905  }
906  return(cntx);}
907 
908 void deletecontext(id,ctx)
909 int id;
910 register context *ctx;
911 { if (id<MAXTHREAD) euscontexts[id]=NULL;
912  cfree(ctx->stack);
913  cfree(ctx);}
914 
915 #if THREADED
917 context *ctx;
918 { sema_t *sem;
919  pointer s;
920  pointer thrport;
921  thrport=allocobj(THREAD, threadport, threadcp.cix);
922 
923  thrport->c.thrp.plist=NIL;
924  thrport->c.thrp.requester=makeint(0);
925  vpush(thrport);
926 
927  /* make three semaphores; reqsem, runsem, donesem */
928  s=makevector(C_INTVECTOR, (sizeof(sema_t)+3)/sizeof(long));
929  sema_init((sema_t *)s->c.ivec.iv, 0, USYNC_THREAD, 0);
930  thrport->c.thrp.reqsem=s;
931 
932  s=makevector(C_INTVECTOR, (sizeof(sema_t)+3)/sizeof(long));
933  sema_init((sema_t *)s->c.ivec.iv, 0, USYNC_THREAD, 0);
934  thrport->c.thrp.runsem=s;
935 
936  s=makevector(C_INTVECTOR, (sizeof(sema_t)+3)/sizeof(long));
937  sema_init((sema_t *)s->c.ivec.iv, 0, USYNC_THREAD, 0);
938  thrport->c.thrp.donesem=s;
939 
940 /* sem=(sema_t *)malloc(sizeof(sema_t));
941  sema_init(sem, 0, USYNC_THREAD, 0);
942  thrport->c.thrp.donesem=makeint(sem); */
943 
944  thrport->c.thrp.contex=makeint((eusinteger_t)ctx>>2);
945  thrport->c.thrp.func=NIL;
946  thrport->c.thrp.args=NIL;
947  thrport->c.thrp.result=NIL;
948  thrport->c.thrp.idle=NIL;
949  thrport->c.thrp.wait=NIL;
950  ctx->threadobj=thrport;
951  ctx->lastalloc=thrport;
952  vpop();
953  return(thrport);}
954 #endif
955 
alloc
pointer alloc(int, int, int, int)
Definition: memory.mutex.c:241
ldmodule
Definition: eus.h:249
defvar
pointer defvar(context *ctx, char *name, pointer val, pointer pkg)
Definition: makes.c:704
PKGCLASS
pointer PKGCLASS
Definition: eus.c:152
methdef::method
pointer method
Definition: eus.h:519
fletframe::fclosure
pointer fclosure
Definition: eus.h:511
numunion
Definition: eus.h:428
threadport::runsem
pointer runsem
Definition: eus.h:358
cell::cellunion::cls
struct _class cls
Definition: eus.h:418
hide_ptr
eusinteger_t hide_ptr(pointer p)
Definition: eus.c:1407
context::gcstack
pointer * gcstack
Definition: eus.h:527
ldmodule::subrtype
pointer subrtype
Definition: eus.h:252
blockframe::name
pointer name
Definition: eus.h:492
catchframe::bf
struct bindframe * bf
Definition: eus.h:498
iostreamcp
cixpair iostreamcp
Definition: eus.c:76
recixobj
void recixobj(int newcix)
Definition: makes.c:312
NIL
pointer NIL
Definition: eus.c:110
rawcons
pointer rawcons(context *ctx, pointer a, pointer d)
Definition: makes.c:86
defkeyword
pointer defkeyword(context *ctx, char *name)
Definition: makes.c:733
QCONS
pointer QCONS
Definition: eus.c:151
bignumcp
cixpair bignumcp
Definition: eus.c:97
l
long l
Definition: structsize.c:3
_class::types
pointer types
Definition: eus.h:329
make_foreign_string
pointer make_foreign_string(eusinteger_t addr, int size)
Definition: makes.c:157
LAMCLOSURE
pointer LAMCLOSURE
Definition: eus.c:170
mkfilestream
pointer mkfilestream(context *ctx, pointer dir, pointer string, int fno, pointer fname)
Definition: makes.c:253
fletframe::lexlink
struct fletframe * lexlink
Definition: eus.h:513
_class::methods
pointer methods
Definition: eus.h:331
BIGNUM
pointer BIGNUM
Definition: eus.c:156
filestream
Definition: eus.h:280
cons
pointer cons(context *ctx, pointer a, pointer d)
Definition: makes.c:97
cell::cellunion::thrp
struct threadport thrp
Definition: eus.h:421
rcsid
static char * rcsid
Definition: makes.c:5
context::catchfp
struct catchframe * catchfp
Definition: eus.h:530
symbol::vtype
pointer vtype
Definition: eus.h:205
context::special_bind_count
int special_bind_count
Definition: eus.h:543
next_special_index
int next_special_index
Definition: makes.c:658
Getstring
pointer Getstring(pointer s)
Definition: makes.c:61
QINTEGER
pointer QINTEGER
Definition: eus.c:120
blockframe::kind
pointer kind
Definition: eus.h:490
package::intsymcount
pointer intsymcount
Definition: eus.h:225
special_index
int special_index()
Definition: makes.c:661
chunk::rootcell
struct bcell rootcell
Definition: eus.h:450
makeint
#define makeint(v)
Definition: sfttest.c:2
threadport::requester
pointer requester
Definition: eus.h:356
context
Definition: eus.h:524
makereadtable
pointer makereadtable(context *ctx)
Definition: makes.c:523
threadport
Definition: eus.h:353
symbol::plist
pointer plist
Definition: eus.h:203
_class::super
pointer super
Definition: eus.h:326
chunk::nextchunk
struct chunk * nextchunk
Definition: eus.h:448
defvector
pointer defvector(context *ctx, char *name, pointer super, int elm, int size)
Definition: makes.c:446
s
short s
Definition: structsize.c:2
code::codevec
pointer codevec
Definition: eus.h:231
codecp
cixpair codecp
Definition: eus.c:79
ckfltval
float ckfltval(int p)
Definition: makes.c:25
methdef
Definition: eus.h:518
threadport::args
pointer args
Definition: eus.h:361
arrayheader::plist
pointer plist
Definition: eus.h:312
symbol::spefunc
pointer spefunc
Definition: eus.h:206
K_FUNCTION_DOCUMENTATION
pointer K_FUNCTION_DOCUMENTATION
Definition: makes.c:19
chunklist
struct chunk * chunklist
Definition: memory.c:57
fletframe::scope
struct fletframe * scope
Definition: eus.h:512
closure::quotevec
pointer quotevec
Definition: eus.h:263
closurecp
cixpair closurecp
Definition: eus.c:83
bcell::h
struct cellheader h
Definition: eus.h:440
PACKAGE
pointer PACKAGE
Definition: eus.c:110
ldmodule::quotevec
pointer quotevec
Definition: eus.h:251
searchpkg
pointer searchpkg(byte *token, int leng)
Definition: makes.c:180
closure::subrtype
pointer subrtype
Definition: eus.h:264
defspecial
pointer defspecial(context *ctx, char *name, pointer mod, pointer(*f)())
Definition: makes.c:682
readtable::syntax
pointer syntax
Definition: eus.h:348
get_string
byte * get_string(pointer s)
Definition: makes.c:67
defconst
pointer defconst(context *ctx, char *name, pointer val, pointer pkg)
Definition: makes.c:693
bignum::size
pointer size
Definition: eus.h:377
packagecp
cixpair packagecp
Definition: eus.c:73
defmacro
pointer defmacro(context *ctx, char *name, pointer mod, pointer(*f)())
Definition: makes.c:646
numunion::ival
eusinteger_t ival
Definition: eus.h:431
nextbclass
int nextbclass
Definition: eus.c:101
intval
#define intval(p)
Definition: sfttest.c:1
quote
pointer quote(context *, pointer)
Definition: specials.c:33
ldmodule::entry2
pointer entry2
Definition: eus.h:255
numunion::fval
eusfloat_t fval
Definition: eus.h:430
context::gcstacklimit
pointer * gcstacklimit
Definition: eus.h:527
makesymbol
pointer makesymbol(context *ctx, char *str, int leng, pointer home)
Definition: makes.c:164
pointer
struct cell * pointer
Definition: eus.h:165
builtinclass
struct built_in_cid builtinclass[64]
Definition: eus.c:100
context::thr_buddy
struct buddyfree * thr_buddy
Definition: eus.h:540
E_NONUMBER
@ E_NONUMBER
Definition: eus.h:960
context::alloc_big_count
int alloc_big_count
Definition: eus.h:541
conscp
cixpair conscp
Definition: eus.c:70
makebig
pointer makebig(int n)
Definition: makes.c:561
package::plist
pointer plist
Definition: eus.h:219
blockframe::dynklink
struct blockframe * dynklink
Definition: eus.h:491
context::gsp
pointer * gsp
Definition: eus.h:527
blockframe::lexklink
struct blockframe * lexklink
Definition: eus.h:491
makeblock
struct blockframe * makeblock(context *ctx, pointer kind, pointer name, jmp_buf *jbuf, struct blockframe *link)
Definition: makes.c:766
eus.h
string::length
pointer length
Definition: eus.h:211
cell::cellunion::sym
struct symbol sym
Definition: eus.h:401
stackrawlist
pointer stackrawlist(context *ctx, int n)
Definition: makes.c:121
C_VECTOR
pointer C_VECTOR
Definition: eus.c:144
ldmodule::symtab
pointer symtab
Definition: eus.h:257
package::shadows
pointer shadows
Definition: eus.h:226
sema_init
int sema_init(sema_t *, unsigned int, int, void *)
Definition: pthreads.c:111
SYMBOL
pointer SYMBOL
Definition: eus.c:151
ARRAY
pointer ARRAY
Definition: eus.c:155
deflocal
pointer deflocal(context *ctx, char *name, pointer val, pointer pkg)
Definition: makes.c:716
class::cix
pointer cix
Definition: eus.old.h:211
code::entry2
pointer entry2
Definition: eus.h:236
symbol::pname
pointer pname
Definition: eus.h:207
context::threadobj
pointer threadobj
Definition: eus.h:538
E_NOSTRING
@ E_NOSTRING
Definition: eus.h:957
compmacro
pointer compmacro(context *ctx, pointer sym, pointer mod, pointer(*entry)(), pointer doc)
Definition: makes.c:754
context::specials
pointer specials
Definition: eus.h:545
stream
Definition: eus.h:273
cell::cellunion::bgnm
struct bignum bgnm
Definition: eus.h:424
cell::cellunion::ary
struct arrayheader ary
Definition: eus.h:413
cell::cellunion::ivec
struct intvector ivec
Definition: eus.h:416
chunk
Definition: eus.h:447
class_desc::subcix
short subcix
Definition: eus.h:569
_class::cix
pointer cix
Definition: eus.h:327
makelispcontext
context * makelispcontext(int bs_size)
Definition: makes.c:840
E_CLASSOVER
@ E_CLASSOVER
Definition: eus.h:961
iostream::out
pointer out
Definition: eus.h:291
numunion::low
short low
Definition: eus.h:433
makeclass
pointer makeclass(context *ctx, pointer name, pointer superobj, pointer vars, pointer types, pointer forwards, int tag, pointer metaclass)
Definition: makes.c:375
mkcatchframe
void mkcatchframe(context *ctx, pointer lab, jmp_buf *jbuf)
Definition: makes.c:801
makeflet
struct fletframe * makeflet(context *ctx, pointer nm, pointer def, struct fletframe *scp, struct fletframe *link)
Definition: makes.c:782
intern
pointer intern(context *, char *, int, pointer)
Definition: intern.c:105
threadcp
cixpair threadcp
Definition: eus.c:85
THREAD
pointer THREAD
Definition: eus.c:153
makebig1
pointer makebig1(long x)
Definition: makes.c:573
string::chars
byte chars[1]
Definition: eus.h:212
readtablecp
cixpair readtablecp
Definition: eus.c:87
cons
Definition: eus.h:195
class_desc::cix
short cix
Definition: eus.h:568
makemodule
pointer makemodule(context *ctx, int size)
Definition: makes.c:486
makestring
pointer makestring(char *s, int l)
Definition: makes.c:147
cell::c
union cell::cellunion c
labrefcp
cixpair labrefcp
Definition: eus.c:84
cell::cellunion::code
struct code code
Definition: eus.h:408
makeratio
pointer makeratio(int num, int denom)
Definition: makes.c:552
threadport::result
pointer result
Definition: eus.h:362
context::alloc_small_count
int alloc_small_count
Definition: eus.h:542
fltvectorcp
cixpair fltvectorcp
Definition: eus.c:89
IOSTREAM
pointer IOSTREAM
Definition: eus.c:151
class_desc::def
pointer def
Definition: eus.h:570
context::bindfp
struct bindframe * bindfp
Definition: eus.h:531
cons::cdr
pointer cdr
Definition: eus.h:197
FILESTREAM
pointer FILESTREAM
Definition: eus.c:151
catchframe::ff
struct fletframe * ff
Definition: eus.h:500
closure::env1
pointer * env1
Definition: eus.h:270
vecclass
Definition: eus.h:334
cell::cellunion::ldmod
struct ldmodule ldmod
Definition: eus.h:410
cell::cellunion::vcls
struct vecclass vcls
Definition: eus.h:419
threadport::reqsem
pointer reqsem
Definition: eus.h:357
streamcp
cixpair streamcp
Definition: eus.c:74
closure::entry
pointer entry
Definition: eus.h:265
threadport::wait
pointer wait
Definition: eus.h:365
context::protfp
struct protectframe * protfp
Definition: eus.h:534
cell::cellunion::rdtab
struct readtable rdtab
Definition: eus.h:420
code::entry
pointer entry
Definition: eus.h:234
E_IODIRECTION
@ E_IODIRECTION
Definition: eus.h:955
cell::cix
short cix
Definition: eus.h:398
RATIO
pointer RATIO
Definition: eus.c:156
catchframe::cf
struct callframe * cf
Definition: eus.h:499
NULL
#define NULL
Definition: transargv.c:8
cixpair::cix
short cix
Definition: eus.h:453
threadport::contex
pointer contex
Definition: eus.h:363
iostream
Definition: eus.h:289
E_PKGNAME
@ E_PKGNAME
Definition: eus.h:974
bpointer
struct bcell * bpointer
Definition: eus.h:445
closure::env0
pointer env0
Definition: eus.h:269
makebuffer
pointer makebuffer(int size)
Definition: makes.c:140
defunpkg
pointer defunpkg(context *ctx, char *name, pointer mod, pointer(*f)(), pointer pkg)
Definition: makes.c:636
makematrix
pointer makematrix(context *ctx, int row, int column)
Definition: makes.c:467
symbolcp
cixpair symbolcp
Definition: eus.c:72
makeclosure
pointer makeclosure(pointer code, pointer quote, pointer(*f)(), pointer e0, pointer *e1, pointer *e2)
Definition: makes.c:506
context::fletfp
struct fletframe * fletfp
Definition: eus.h:535
cell::cellunion::ratio
struct ratio ratio
Definition: eus.h:422
threadport::donesem
pointer donesem
Definition: eus.h:359
cixpair::sub
short sub
Definition: eus.h:454
vector::v
pointer v[1]
Definition: eus.h:301
metaclasscp
cixpair metaclasscp
Definition: eus.c:77
arrayheader::offset
pointer offset
Definition: eus.h:316
euscontexts
context * euscontexts[MAXTHREAD]
Definition: eus.c:105
classtab
struct class_desc classtab[MAXCLASS]
Definition: eus.c:138
string
#define string
Definition: test_foreign.c:14
blockframe
Definition: eus.h:489
package::used_by
pointer used_by
Definition: eus.h:227
fltval
float fltval(int p)
Definition: makes.c:38
code::subrtype
pointer subrtype
Definition: eus.h:233
labref
Definition: eus.h:293
_class
Definition: eus.h:323
cell::cellunion::cons
struct cons cons
Definition: eus.h:400
context::slashflag
int slashflag
Definition: eus.h:544
pkglist
pointer pkglist
Definition: eus.c:109
STREAM
pointer STREAM
Definition: eus.c:151
object::iv
pointer iv[2]
Definition: eus.h:321
d
d
cellheader::bix
unsigned bix
Definition: eus.h:185
ratio::denominator
pointer denominator
Definition: eus.h:370
catchframe::nextcatch
struct catchframe * nextcatch
Definition: eus.h:496
tail
tail(char *cp)
Definition: eustags.c:1181
E_STREAM
@ E_STREAM
Definition: eus.h:954
catchframe::label
pointer label
Definition: eus.h:497
ldmodule::codevec
pointer codevec
Definition: eus.h:250
K_IN
pointer K_IN
Definition: eus.c:130
mkstream
pointer mkstream(context *ctx, pointer dir, pointer string)
Definition: makes.c:241
arrayheader::fillpointer
pointer fillpointer
Definition: eus.h:315
ldmodule::handle
pointer handle
Definition: eus.h:259
fletframe::dynlink
struct fletframe * dynlink
Definition: eus.h:514
ldmodule::entry
pointer entry
Definition: eus.h:253
ratiocp
cixpair ratiocp
Definition: eus.c:95
iostream::plist
pointer plist
Definition: eus.h:290
context::stack
pointer * stack
Definition: eus.h:525
readtable::dispatch
pointer dispatch
Definition: eus.h:350
nextcix
int nextcix
Definition: eus.c:139
filestreamcp
cixpair filestreamcp
Definition: eus.c:75
mainctx
context * mainctx
Definition: eus.c:57
closure::env2
pointer * env2
Definition: eus.h:271
context::sbindfp
struct specialbindframe * sbindfp
Definition: eus.h:532
vecclasscp
cixpair vecclasscp
Definition: eus.c:78
VECCLASS
pointer VECCLASS
Definition: eus.c:154
allocate_stack
void allocate_stack(context *ctx, int n)
Definition: makes.c:822
cell::cellunion::obj
struct object obj
Definition: eus.h:417
makevector
pointer makevector(pointer vclass, int size)
Definition: makes.c:417
lisppkg
pointer lisppkg
Definition: eus.c:109
CLOSURE
pointer CLOSURE
Definition: eus.c:152
readtable::macro
pointer macro
Definition: eus.h:349
context::newfletfp
struct fletframe * newfletfp
Definition: eus.h:535
context::stacklimit
pointer * stacklimit
Definition: eus.h:525
makeflt
pointer makeflt(double d)
Definition: makes.c:48
bignum::bv
pointer bv
Definition: eus.h:378
error
pointer error(enum errorcode ec,...) pointer error(va_alist) va_dcl
Definition: eus.c:297
count
int count
Definition: thrtest.c:11
package::symvector
pointer symvector
Definition: eus.h:222
ratio
Definition: eus.h:368
symbol::speval
pointer speval
Definition: eus.h:204
buddyfree
Definition: eus.h:563
vecclass::elmtype
pointer elmtype
Definition: eus.h:343
methdef::selector
pointer selector
Definition: eus.h:519
K_OUT
pointer K_OUT
Definition: eus.c:130
enterclass
void enterclass(pointer classobj)
Definition: makes.c:343
putprop
pointer putprop()
f
f
max
#define max(I1, I2)
Definition: eustags.c:134
symbol
Definition: eus.h:202
ldmodule::objname
pointer objname
Definition: eus.h:258
package::names
pointer names
Definition: eus.h:220
chunk::chunkbix
int chunkbix
Definition: eus.h:449
CODE
pointer CODE
Definition: eus.c:152
cell
Definition: eus.h:381
context::lastalloc
pointer lastalloc
Definition: eus.h:536
package::intsymvector
pointer intsymvector
Definition: eus.h:224
compfun
pointer compfun(context *ctx, pointer sym, pointer mod, pointer(*entry)(), pointer doc)
Definition: makes.c:746
context::blkfp
struct blockframe * blkfp
Definition: eus.h:533
_sema
Definition: eus_thr.h:96
eusinteger_t
long eusinteger_t
Definition: eus.h:19
threadport::plist
pointer plist
Definition: eus.h:354
findpkg
pointer findpkg(pointer pkgname)
Definition: makes.c:194
context::vsp
pointer * vsp
Definition: eus.h:525
iostream::in
pointer in
Definition: eus.h:291
keywordpkg
pointer keywordpkg
Definition: eus.c:109
class::vars
pointer vars
Definition: eus.old.h:212
methdef::class
pointer class
Definition: eus.h:519
bumpcix
void bumpcix(int m, int n)
Definition: makes.c:304
METACLASS
pointer METACLASS
Definition: eus.c:152
cons::car
pointer car
Definition: eus.h:196
buddysize
long buddysize[MAXBUDDY+1]
Definition: eus.c:103
READTABLE
pointer READTABLE
Definition: eus.c:154
defun
pointer defun(context *ctx, char *name, pointer mod, pointer(*f)(), char *doc)
Definition: makes.c:606
threadport::func
pointer func
Definition: eus.h:360
closure
Definition: eus.h:261
makecode
pointer makecode(pointer mod, pointer(*f)(), pointer ftype)
Definition: makes.c:282
code::quotevec
pointer quotevec
Definition: eus.h:232
_class::plist
pointer plist
Definition: eus.h:324
spex_lock
static mutex_t spex_lock
Definition: makes.c:659
arrayheader::entity
pointer entity
Definition: eus.h:313
context::callfp
struct callframe * callfp
Definition: eus.h:529
ratio::numerator
pointer numerator
Definition: eus.h:369
stringcp
cixpair stringcp
Definition: eus.c:91
C_INTVECTOR
pointer C_INTVECTOR
Definition: eus.c:146
package::use
pointer use
Definition: eus.h:221
makebig2
pointer makebig2(long hi, long lo)
Definition: makes.c:587
cell::cellunion::iostream
struct iostream iostream
Definition: eus.h:407
cixpair
Definition: eus.h:452
makefvector
pointer makefvector(int s)
Definition: makes.c:438
ldmodulecp
cixpair ldmodulecp
Definition: eus.c:82
readtable
Definition: eus.h:346
arrayheader::dim
pointer dim[ARRAYRANKLIMIT]
Definition: eus.h:317
fletframe::name
pointer name
Definition: eus.h:510
buddyfree::bp
bpointer bp
Definition: eus.h:565
E_USER
@ E_USER
Definition: eus.h:1006
makethreadport
pointer makethreadport(context *ctx)
Definition: makes.c:916
makelabref
pointer makelabref(pointer n, pointer v, pointer nxt)
Definition: makes.c:538
bcell
Definition: eus.h:439
stacknlist
pointer stacknlist(context *ctx, int n)
Definition: makes.c:129
catchframe::jbp
jmp_buf * jbp
Definition: eus.h:501
makepkg
pointer makepkg(context *ctx, pointer namestr, pointer nicks, pointer uses)
Definition: makes.c:201
_class::forwards
pointer forwards
Definition: eus.h:330
package
Definition: eus.h:218
code
Definition: eus.h:230
mkiostream
pointer mkiostream(context *ctx, pointer in, pointer out)
Definition: makes.c:269
threadport::idle
pointer idle
Definition: eus.h:364
intvector::iv
eusinteger_t iv[1]
Definition: eus.h:305
blockframe::jbp
jmp_buf * jbp
Definition: eus.h:493
closure::codevec
pointer codevec
Definition: eus.h:262
readtable::plist
pointer plist
Definition: eus.h:347
cell::cellunion::vec
struct vector vec
Definition: eus.h:414
a
char a[26]
Definition: freq.c:4
numunion::sval
struct numunion::@11 sval
deletecontext
void deletecontext(int id, context *ctx)
Definition: makes.c:908
context::errhandler
pointer errhandler
Definition: eus.h:537
cellheader::cix
short cix
Definition: eus.h:190
class
Definition: eus.old.h:207
closure::entry2
pointer entry2
Definition: eus.h:267
cell::cellunion::pkg
struct package pkg
Definition: eus.h:404
n
GLfloat n[6][3]
Definition: cube.c:15
methdef::ownerclass
pointer ownerclass
Definition: eus.h:519
rgc_add_to_classtable
void rgc_add_to_classtable(pointer newclass)
Definition: collector.c:518
arrayheader::rank
pointer rank
Definition: eus.h:314
makeobject
pointer makeobject(pointer class)
Definition: makes.c:407
buddyfree::count
int count
Definition: eus.h:564
symbol::homepkg
pointer homepkg
Definition: eus.h:208
bignum
Definition: eus.h:376
context::my_gc_pri
int my_gc_pri
Definition: eus.h:553
cell::cellunion::clo
struct closure clo
Definition: eus.h:411
arrayheader
Definition: eus.h:311
catchframe
Definition: eus.h:495
v
GLfloat v[8][3]
Definition: cube.c:21
resetcix
void resetcix(pointer class, cixpair *p)
Definition: makes.c:336
_class::vars
pointer vars
Definition: eus.h:328
cell::cellunion::str
struct string str
Definition: eus.h:402
package::symcount
pointer symcount
Definition: eus.h:223
init
void init(void)
Definition: cube.c:48
thr_self
unsigned int thr_self()
Definition: eus.c:25
LDMODULE
pointer LDMODULE
Definition: eus.c:152
fletframe
Definition: eus.h:509
context::intsig
int intsig
Definition: eus.h:546
arraycp
cixpair arraycp
Definition: eus.c:86
numunion::high
short high
Definition: eus.h:433
context::rbar
rbar_t rbar
Definition: eus.h:548
context::methcache
struct methdef * methcache
Definition: eus.h:539


euslisp
Author(s): Toshihiro Matsui
autogenerated on Thu Jun 15 2023 02:06:43