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 
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);
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);
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;
565  v=makevector(C_INTVECTOR, n);
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 
578  v=makevector(C_INTVECTOR, 1);
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 
592  v=makevector(C_INTVECTOR, 2);
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  int 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 
pointer IOSTREAM
Definition: eus.c:151
pointer used_by
Definition: eus.h:225
context * euscontexts[MAXTHREAD]
Definition: eus.c:105
pointer K_IN
Definition: eus.c:130
Definition: eus.h:561
eusinteger_t iv[1]
Definition: eus.h:303
struct closure clo
Definition: eus.h:409
pointer speval
Definition: eus.h:201
Definition: eus.h:366
pointer * stack
Definition: eus.h:523
int nextcix
Definition: eus.c:139
pointer count
Definition: eus.h:282
pointer entry
Definition: eus.h:263
pointer makematrix(context *ctx, int row, int column)
Definition: makes.c:467
pointer * env2
Definition: eus.h:269
pointer symtab
Definition: eus.h:255
pointer cix
Definition: eus.h:325
pointer intern(context *, char *, int, pointer)
Definition: intern.c:105
pointer * env1
Definition: eus.h:268
Definition: eus.h:259
struct vector vec
Definition: eus.h:412
struct fletframe * dynlink
Definition: eus.h:512
float ckfltval(int p)
Definition: makes.c:25
pointer mkstream(context *ctx, pointer dir, pointer string)
Definition: makes.c:241
pointer * stacklimit
Definition: eus.h:523
struct chunk * chunklist
Definition: memory.c:57
struct _class cls
Definition: eus.h:416
struct protectframe * protfp
Definition: eus.h:532
cixpair iostreamcp
Definition: eus.c:76
#define makeint(v)
Definition: sfttest.c:2
struct cell * pointer
Definition: eus.h:163
pointer plist
Definition: eus.h:310
struct fletframe * fletfp
Definition: eus.h:533
pointer makebig1(long x)
Definition: makes.c:573
pointer C_VECTOR
Definition: eus.c:144
short high
Definition: eus.h:431
pointer K_OUT
Definition: eus.c:130
struct fletframe * makeflet(context *ctx, pointer nm, pointer def, struct fletframe *scp, struct fletframe *link)
Definition: makes.c:782
pointer makebig2(long hi, long lo)
Definition: makes.c:587
Definition: eus.h:522
struct filestream fstream
Definition: eus.h:404
cixpair packagecp
Definition: eus.c:73
struct string str
Definition: eus.h:400
pointer vars
Definition: eus.h:326
eusfloat_t fval
Definition: eus.h:428
pointer entry2
Definition: eus.h:234
int slashflag
Definition: eus.h:542
pointer mkiostream(context *ctx, pointer in, pointer out)
Definition: makes.c:269
struct threadport thrp
Definition: eus.h:419
void recixobj(int newcix)
Definition: makes.c:312
byte chars[1]
Definition: eus.h:210
int sema_init(sema_t *, unsigned int, int, void *)
Definition: pthreads.c:111
pointer stacknlist(context *ctx, int n)
Definition: makes.c:129
pointer * vsp
Definition: eus.h:523
pointer kind
Definition: eus.h:488
pointer fillpointer
Definition: eus.h:311
Definition: eus.h:193
struct bcell * bpointer
Definition: eus.h:443
pointer runsem
Definition: eus.h:356
pointer objname
Definition: eus.h:256
pointer names
Definition: eus.h:218
context * makelispcontext(int bs_size)
Definition: makes.c:840
GLfloat n[6][3]
Definition: cube.c:15
struct bignum bgnm
Definition: eus.h:422
struct arrayheader ary
Definition: eus.h:411
pointer symvector
Definition: eus.h:220
pointer intsymvector
Definition: eus.h:222
struct specialbindframe * sbindfp
Definition: eus.h:530
bpointer bp
Definition: eus.h:563
pointer makeclosure(pointer code, pointer quote, pointer(*f)(), pointer e0, pointer *e1, pointer *e2)
Definition: makes.c:506
pointer defunpkg(context *ctx, char *name, pointer mod, pointer(*f)(), pointer pkg)
Definition: makes.c:636
pointer next
Definition: eus.h:295
struct blockframe * blkfp
Definition: eus.h:531
pointer BIGNUM
Definition: eus.c:156
pointer SYMBOL
Definition: eus.c:151
pointer VECCLASS
Definition: eus.c:154
cixpair codecp
Definition: eus.c:79
pointer bv
Definition: eus.h:376
pointer unsolved
Definition: eus.h:294
struct fletframe * newfletfp
Definition: eus.h:533
struct code code
Definition: eus.h:406
eusinteger_t hide_ptr(pointer p)
Definition: eus.c:1398
cixpair conscp
Definition: eus.c:70
pointer make_foreign_string(eusinteger_t addr, int size)
Definition: makes.c:157
cixpair symbolcp
Definition: eus.c:72
struct blockframe * lexklink
Definition: eus.h:489
pointer CODE
Definition: eus.c:151
pointer putprop()
#define intval(p)
Definition: sfttest.c:1
pointer requester
Definition: eus.h:354
pointer stackrawlist(context *ctx, int n)
Definition: makes.c:121
pointer findpkg(pointer pkgname)
Definition: makes.c:194
cixpair filestreamcp
Definition: eus.c:75
pointer errhandler
Definition: eus.h:535
pointer label
Definition: eus.h:292
int next_special_index
Definition: makes.c:658
pointer use
Definition: eus.h:219
struct blockframe * makeblock(context *ctx, pointer kind, pointer name, jmp_buf *jbuf, struct blockframe *link)
Definition: makes.c:766
pointer METACLASS
Definition: eus.c:151
pointer * gcstack
Definition: eus.h:525
pointer READTABLE
Definition: eus.c:154
pointer name
Definition: eus.h:508
Definition: eus.h:1002
Definition: eus.h:287
pointer entry
Definition: eus.h:232
pointer plist
Definition: eus.h:288
pointer codevec
Definition: eus.h:229
Definition: eus.h:445
pointer syntax
Definition: eus.h:346
struct blockframe * dynklink
Definition: eus.h:489
int my_gc_pri
Definition: eus.h:551
short cix
Definition: eus.h:566
pointer numerator
Definition: eus.h:367
pointer defkeyword(context *ctx, char *name)
Definition: makes.c:733
struct symbol sym
Definition: eus.h:399
pointer args
Definition: eus.h:359
pointer handle
Definition: eus.h:257
Definition: eus.h:970
pointer offset
Definition: eus.h:311
pointer compmacro(context *ctx, pointer sym, pointer mod, pointer(*entry)(), pointer doc)
Definition: makes.c:754
int intsig
Definition: eus.h:544
pointer cdr
Definition: eus.h:194
pointer makevector(pointer vclass, int size)
Definition: makes.c:417
Definition: eus_thr.h:96
pointer defconst(context *ctx, char *name, pointer val, pointer pkg)
Definition: makes.c:693
pointer plist
Definition: eus.h:217
pointer wait
Definition: eus.h:363
Definition: eus.h:332
struct vecclass vcls
Definition: eus.h:417
pointer reqsem
Definition: eus.h:355
short low
Definition: eus.h:431
struct ldmodule ldmod
Definition: eus.h:408
pointer RATIO
Definition: eus.c:156
struct cons cons
Definition: eus.h:398
struct callframe * cf
Definition: eus.h:497
struct intvector ivec
Definition: eus.h:414
pointer deflocal(context *ctx, char *name, pointer val, pointer pkg)
Definition: makes.c:716
pointer plist
Definition: eus.h:279
pointer makereadtable(context *ctx)
Definition: makes.c:523
void rgc_add_to_classtable(pointer newclass)
Definition: collector.c:518
pointer THREAD
Definition: eus.c:153
pointer forwards
Definition: eus.h:328
union cell::cellunion c
Definition: eus.h:374
pointer contex
Definition: eus.h:361
pointer types
Definition: eus.h:327
int special_index()
Definition: makes.c:661
pointer out
Definition: eus.h:289
struct numunion::@11 sval
pointer quote(context *, pointer)
Definition: specials.c:33
cixpair vecclasscp
Definition: eus.c:78
pointer result
Definition: eus.h:360
pointer label
Definition: eus.h:495
pointer iv[2]
Definition: eus.h:319
pointer ownerclass
Definition: eus.h:517
pointer method
Definition: eus.h:517
pointer PKGCLASS
Definition: eus.c:151
short subcix
Definition: eus.h:567
pointer entity
Definition: eus.h:311
pointer donesem
Definition: eus.h:357
pointer lastalloc
Definition: eus.h:534
Definition: eus.h:426
struct fletframe * ff
Definition: eus.h:498
struct stream stream
Definition: eus.h:403
long l
Definition: structsize.c:3
pointer homepkg
Definition: eus.h:201
pointer dispatch
Definition: eus.h:348
byte * get_string(pointer s)
Definition: makes.c:67
pointer makeobject(pointer class)
Definition: makes.c:407
pointer denominator
Definition: eus.h:368
pointer intsymcount
Definition: eus.h:223
pointer ARRAY
Definition: eus.c:155
pointer makebuffer(int size)
Definition: makes.c:140
struct readtable rdtab
Definition: eus.h:418
struct labref lab
Definition: eus.h:410
cixpair closurecp
Definition: eus.c:83
Definition: eus.h:379
Definition: eus.h:516
pointer * gcstacklimit
Definition: eus.h:525
pointer makebig(int n)
Definition: makes.c:561
pointer fname
Definition: eus.h:285
pointer cons(context *ctx, pointer a, pointer d)
Definition: makes.c:97
static mutex_t spex_lock
Definition: makes.c:659
struct cellheader h
Definition: eus.h:438
pointer LDMODULE
Definition: eus.c:151
pointer alloc(int, int, int, int)
Definition: memory.mutex.c:241
pointer value
Definition: eus.h:293
pointer CLOSURE
Definition: eus.c:151
pointer quotevec
Definition: eus.h:261
int chunkbix
Definition: eus.h:447
struct callframe * callfp
Definition: eus.h:527
pointer entry2
Definition: eus.h:265
pointer size
Definition: eus.h:375
long buddysize[MAXBUDDY+1]
Definition: eus.c:103
pointer subrtype
Definition: eus.h:262
struct ratio ratio
Definition: eus.h:420
pointer QINTEGER
Definition: eus.c:120
pointer makefvector(int s)
Definition: makes.c:438
pointer fclosure
Definition: eus.h:509
short s
Definition: structsize.c:2
cixpair metaclasscp
Definition: eus.c:77
cixpair streamcp
Definition: eus.c:74
pointer buffer
Definition: eus.h:274
pointer makepkg(context *ctx, pointer namestr, pointer nicks, pointer uses)
Definition: makes.c:201
pointer makelabref(pointer n, pointer v, pointer nxt)
Definition: makes.c:538
pointer size
Definition: eus.h:298
pointer elmtype
Definition: eus.h:341
pointer subrtype
Definition: eus.h:231
pointer entry
Definition: eus.h:251
pointer plist
Definition: eus.h:352
cixpair labrefcp
Definition: eus.c:84
pointer lisppkg
Definition: eus.c:109
short cix
Definition: eus.h:396
pointer vtype
Definition: eus.h:201
short sub
Definition: eus.h:452
struct fletframe * scope
Definition: eus.h:510
pointer K_FUNCTION_DOCUMENTATION
Definition: eus.c:175
struct methdef * methcache
Definition: eus.h:537
pointer defvector(context *ctx, char *name, pointer super, int elm, int size)
Definition: makes.c:446
pointer codevec
Definition: eus.h:260
pointer makecode(pointer mod, pointer(*f)(), pointer ftype)
Definition: makes.c:282
struct fletframe * lexlink
Definition: eus.h:511
cixpair ratiocp
Definition: eus.c:95
pointer methods
Definition: eus.h:329
pointer rank
Definition: eus.h:311
pointer searchpkg(byte *token, int leng)
Definition: makes.c:180
pointer error(enum errorcode ec,...) pointer error(va_alist) va_dcl
Definition: eus.c:297
static char * rcsid
Definition: makes.c:5
Definition: eus.h:271
long eusinteger_t
Definition: eus.h:19
pointer plist
Definition: eus.h:201
void mkcatchframe(context *ctx, pointer lab, jmp_buf *jbuf)
Definition: makes.c:801
struct catchframe * nextcatch
Definition: eus.h:494
pointer dim[ARRAYRANKLIMIT]
Definition: eus.h:311
pointer plist
Definition: eus.h:322
pointer func
Definition: eus.h:358
cixpair stringcp
Definition: eus.c:91
pointer makeratio(int num, int denom)
Definition: makes.c:552
pointer buffer
Definition: eus.h:281
void deletecontext(int id, context *ctx)
Definition: makes.c:908
struct bcell rootcell
Definition: eus.h:448
pointer PACKAGE
Definition: eus.c:110
pointer direction
Definition: eus.h:273
pointer quotevec
Definition: eus.h:230
Definition: eus.h:228
int alloc_small_count
Definition: eus.h:540
void init(void)
Definition: cube.c:48
cixpair readtablecp
Definition: eus.c:87
pointer defun(context *ctx, char *name, pointer mod, pointer(*f)(), char *doc)
Definition: makes.c:606
struct catchframe * catchfp
Definition: eus.h:528
jmp_buf * jbp
Definition: eus.h:499
pointer compfun(context *ctx, pointer sym, pointer mod, pointer(*entry)(), pointer doc)
Definition: makes.c:746
pointer specials
Definition: eus.h:543
rbar_t rbar
Definition: eus.h:546
tail(char *cp)
Definition: eustags.c:1181
unsigned bix
Definition: eus.h:183
void allocate_stack(context *ctx, int n)
Definition: makes.c:822
pointer defmacro(context *ctx, char *name, pointer mod, pointer(*f)())
Definition: makes.c:646
pointer idle
Definition: eus.h:362
cixpair bignumcp
Definition: eus.c:97
int count
Definition: thrtest.c:11
short cix
Definition: eus.h:188
cixpair threadcp
Definition: eus.c:85
void bumpcix(int m, int n)
Definition: makes.c:304
pointer makethreadport(context *ctx)
Definition: makes.c:916
pointer env0
Definition: eus.h:267
Definition: eus.h:216
pointer tail
Definition: eus.h:276
pointer shadows
Definition: eus.h:224
struct buddyfree * thr_buddy
Definition: eus.h:538
pointer macro
Definition: eus.h:347
int alloc_big_count
Definition: eus.h:539
#define max(I1, I2)
Definition: eustags.c:134
pointer makesymbol(context *ctx, char *str, int leng, pointer home)
Definition: makes.c:164
#define NULL
Definition: transargv.c:8
pointer mkfilestream(context *ctx, pointer dir, pointer string, int fno, pointer fname)
Definition: makes.c:253
struct iostream iostream
Definition: eus.h:405
pointer C_INTVECTOR
Definition: eus.c:146
struct object obj
Definition: eus.h:415
pointer super
Definition: eus.h:324
pointer pname
Definition: eus.h:201
pointer fd
Definition: eus.h:284
GLfloat v[8][3]
Definition: cube.c:21
pointer makeclass(context *ctx, pointer name, pointer superobj, pointer vars, pointer types, pointer forwards, int tag, pointer metaclass)
Definition: makes.c:375
float fltval(int p)
Definition: makes.c:38
pointer count
Definition: eus.h:275
pointer LAMCLOSURE
Definition: eus.c:170
Definition: eus.h:950
pointer direction
Definition: eus.h:280
pointer QCONS
Definition: eus.c:151
pointer in
Definition: eus.h:289
jmp_buf * jbp
Definition: eus.h:491
Definition: eus.h:437
int special_bind_count
Definition: eus.h:541
pointer FILESTREAM
Definition: eus.c:151
pointer makeflt(double d)
Definition: makes.c:48
unsigned char byte
Definition: eus.h:161
Definition: eus.h:200
pointer subrtype
Definition: eus.h:250
unsigned int thr_self()
Definition: eus.c:25
Definition: eus.h:450
pointer Getstring(pointer s)
Definition: makes.c:61
pointer STREAM
Definition: eus.c:151
pointer plist
Definition: eus.h:345
pointer codevec
Definition: eus.h:248
pointer * gsp
Definition: eus.h:525
struct chunk * nextchunk
Definition: eus.h:446
pointer plist
Definition: eus.h:272
pointer symcount
Definition: eus.h:221
pointer def
Definition: eus.h:568
pointer rawcons(context *ctx, pointer a, pointer d)
Definition: makes.c:86
context * mainctx
Definition: eus.c:57
pointer spefunc
Definition: eus.h:201
short cix
Definition: eus.h:451
Definition: eus.h:321
pointer quotevec
Definition: eus.h:249
struct class_desc classtab[MAXCLASS]
Definition: eus.c:138
pointer pkglist
Definition: eus.c:109
struct bindframe * bf
Definition: eus.h:496
int nextbclass
Definition: eus.c:101
Definition: eus.h:291
Definition: eus.old.h:207
struct bindframe * bindfp
Definition: eus.h:529
pointer NIL
Definition: eus.c:110
cixpair ldmodulecp
Definition: eus.c:82
Definition: eus.h:507
pointer defvar(context *ctx, char *name, pointer val, pointer pkg)
Definition: makes.c:704
pointer defspecial(context *ctx, char *name, pointer mod, pointer(*f)())
Definition: makes.c:682
pointer selector
Definition: eus.h:517
int count
Definition: eus.h:562
pointer v[1]
Definition: eus.h:299
pointer makemodule(context *ctx, int size)
Definition: makes.c:486
pointer class
Definition: eus.h:517
cixpair arraycp
Definition: eus.c:86
pointer makestring(char *s, int l)
Definition: makes.c:147
pointer car
Definition: eus.h:194
struct built_in_cid builtinclass[64]
Definition: eus.c:100
pointer entry2
Definition: eus.h:253
Definition: eus.h:247
pointer keywordpkg
Definition: eus.c:109
pointer threadobj
Definition: eus.h:536
void resetcix(pointer class, cixpair *p)
Definition: makes.c:336
pointer tail
Definition: eus.h:283
void enterclass(pointer classobj)
Definition: makes.c:343
char a[26]
Definition: freq.c:4
Definition: eus.h:344
pointer length
Definition: eus.h:209
struct package pkg
Definition: eus.h:402
eusinteger_t ival
Definition: eus.h:429
pointer name
Definition: eus.h:490
cixpair fltvectorcp
Definition: eus.c:89


euslisp
Author(s): Toshihiro Matsui
autogenerated on Fri Feb 21 2020 03:20:54