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


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