Go to the documentation of this file.
5 static char *
rcsid=
"@(#)$Id$";
16 #define nextbuddy(p) ((bpointer)((eusinteger_t)p+(buddysize[p->h.bix]*sizeof(pointer))))
29 nu.
ival = p & 0xfffffffc;
41 nu.
ival= p & 0xfffffffc;
63 {
if (issymbol(
s))
s=
s->c.sym.pname;
69 {
if (isstring(
s))
return(
s->c.str.chars);
70 if (issymbol(
s))
return(
s->c.sym.pname->c.str.chars);
77 #define allocobj(class,builtin,cid) \
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)))
91 wordsizeof(
struct cons));
113 c=
alloc(vecsize(speval(
QCONS)->c.cls.vars), ELM_FIXED,
115 wordsizeof(
struct cons));
124 while (
n-->0) r=
rawcons(ctx,*--fsp,r);
132 while (
n-->0) r=
cons(ctx,*--fsp,r);
181 while (pkgs && islist(pkgs)) {
182 pkg=ccar(pkgs); pkgs=ccdr(pkgs);
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);}
192 {
register pointer pkg,pkgs,names;
193 if (ispackage(pkgname))
return(pkgname);
195 return(
searchpkg(pkgname->c.str.chars,strlength(pkgname)));}
199 register pointer namestr,nicks,uses;
200 {
register pointer pkg,symvec,pkgs,names,p;
205 vpush(namestr); vpush(nicks); vpush(uses);
207 while (islist(nicks)) {
213 while (islist(uses)) {
214 if (p=
findpkg(ccar(uses))) { vpush(p); i++; uses=ccdr(uses);}
227 for (i=0; i<SYMBOLHASH; i++) symvec->
c.
vec.
v[i]=
makeint(0);
230 for (i=0; i<SYMBOLHASH; i++) symvec->
c.
vec.
v[i]=
makeint(0);
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;
255 vpush(
string); vpush(fname);
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();
262 s->c.fstream.plist=
NIL;
270 vpush(in); vpush(out);
307 {
register struct chunk *cp;
310 #if defined(BIX_DEBUG) || defined(DEBUG_COUNT)
311 static int count = 0;
323 printf(
"recixobj:%d:p=0x%lx, bix = %d\n",
339 register int i,newcix,temp,supercix;
343 if (isclass(super)) {
346 for (i=
nextcix-1; i>=newcix; i--) {
367 pointer name,superobj,vars,types,metaclass,forwards;
373 vpush(vars); vpush(types);
374 if (metaclass && isclass(metaclass))
class=
makeobject(metaclass);
380 class->c.cls.name=name;
389 class->c.vcls.size=
makeint(-1);}
404 while (size>0)
v[--size]=
NIL;
411 register int n,etype;
413 etype=
intval(vclass->c.vcls.elmtype);
415 case ELM_BIT:
n=(size+WORD_SIZE-1)/WORD_SIZE;
init=0;
break;
419 case ELM_INT:
n=size;
init=0;
break;
420 case ELM_FOREIGN:
n=1;
init=0;
break;
425 while (--
n>=0) vv[
n]=
init;
441 {
pointer classsym,
class,varvector,typevector,forwardvector;
451 vpush(forwardvector);
453 class=
makeclass(ctx,classsym,super,varvector,typevector,forwardvector,elm,0);
472 for (i=2; i<ARRAYRANKLIMIT; i++) m->
c.
ary.
dim[i]=
NIL;
481 elmtypeof(cvec)=ELM_BYTE;
509 {
pointer rdtable,rdsyntax,rdmacro,rddispatch;
526 wordsizeof(
struct labref));
530 l->c.lab.unsolved=
NIL;
597 #if defined(DEFUN_DEBUG) || defined(DEBUG_COUNT)
603 printf(
"defun:%d:%s:",
count, name );
607 sym=
intern(ctx,name,strlen(name),pkg);
620 sym=
intern(ctx,name,strlen(name),pkg);
631 sym=
intern(ctx,name,strlen(name),pkg);
667 sym=
intern(ctx,name,strlen(name),pkg);
677 sym=
intern(ctx,name,strlen(name),pkg);
689 sym=
intern(ctx,name,strlen(name),pkg);
701 sym=
intern(ctx,name,strlen(name),pkg);
707 ctx->specials->c.vec.v[x]=vpop();
789 cfp->
jbp=(jmp_buf *)jbuf;
807 i=(int)malloc((
n+1)*
sizeof(
pointer));
816 printf(
"allocate_stack: 0x%lx -- 0x%lx\n", ctx->
stack, ctx->
stacklimit );
825 struct buddy_free *thrbuddy;
829 if (bs_size<4096) bs_size=4096;
836 printf(
"makelispcontext: stack: 0x%lx -- 0x%lx\n", cntx->
stack, cntx->
stacklimit );
858 for (i=0; i<MAX_SPECIALS; i++)
866 for (i=0; i<MAXMETHCACHE; i++) {
870 malloc(
sizeof(
struct buddyfree) * (MAXTHRBUDDY+1));
873 for (i=0; i<MAXTHRBUDDY; i++) {
920 ctx->threadobj=thrport;
921 ctx->lastalloc=thrport;
pointer alloc(int, int, int, int)
pointer mkiostream(context *ctx, pointer in, pointer out)
pointer makebuffer(int size)
pointer stacknlist(context *ctx, int n)
pointer defvar(context *ctx, char *name, pointer val, pointer pkg)
pointer searchpkg(byte *token, int leng)
pointer cons(context *ctx, pointer a, pointer d)
pointer makevector(pointer vclass, int size)
pointer defvector(context *ctx, char *name, pointer super, int elm, int size)
struct fletframe * lexlink
struct catchframe * catchfp
pointer defconst(context *ctx, char *name, pointer val, pointer pkg)
pointer defkeyword(context *ctx, char *name)
pointer makefvector(int s)
pointer quote(context *, pointer)
pointer compfun(context *ctx, pointer sym, pointer mod, pointer(*entry)(), pointer doc)
struct built_in_cid builtinclass[64]
pointer makestring(char *s, int l)
struct buddyfree * thr_buddy
struct blockframe * dynklink
struct blockframe * lexklink
int sema_init(sema_t *, unsigned int, int, void *)
pointer deflocal(context *ctx, char *name, pointer val, pointer pkg)
pointer findpkg(pointer pkgname)
pointer intern(context *, char *, int, pointer)
pointer makecode(pointer mod, pointer(*f)(), pointer ftype)
pointer defspecial(context *ctx, char *name, pointer mod, pointer(*f)())
pointer mkfilestream(context *ctx, pointer dir, pointer string, int fno, pointer fname)
struct bindframe * bindfp
pointer defmacro(context *ctx, char *name, pointer mod, pointer(*f)())
pointer makeobject(pointer class)
pointer defun(context *ctx, char *name, pointer mod, pointer(*f)())
pointer makemodule(context *ctx, int size)
struct protectframe * protfp
pointer makelabref(pointer n, pointer v, pointer nxt)
pointer compmacro(context *ctx, pointer sym, pointer mod, pointer(*entry)(), pointer doc)
pointer stackrawlist(context *ctx, int n)
pointer make_foreign_string(eusinteger_t addr, int size)
struct fletframe * fletfp
context * euscontexts[MAXTHREAD]
struct class_desc classtab[MAXCLASS]
pointer makepkg(context *ctx, pointer namestr, pointer nicks, pointer uses)
pointer makethreadport(context *ctx)
struct catchframe * nextcatch
struct fletframe * dynlink
pointer mkstream(context *ctx, pointer dir, pointer string)
struct specialbindframe * sbindfp
pointer rawcons(context *ctx, pointer a, pointer d)
struct fletframe * newfletfp
pointer makeclosure(pointer code, pointer quote, pointer(*f)(), pointer e0, pointer *e1, pointer *e2)
pointer error(enum errorcode ec,...) pointer error(va_alist) va_dcl
pointer makereadtable(context *ctx)
pointer makeratio(int num, int denom)
void mkcatchframe(context *ctx, pointer lab, jmp_buf jbuf)
struct blockframe * blkfp
pointer K_FUNCTION_DOCUMENTATION
allocate_stack(context *ctx, int n)
pointer makeclass(context *ctx, pointer name, pointer superobj, pointer vars, pointer types, pointer forwards, int tag, pointer metaclass)
context * makelispcontext(int bs_size)
long buddysize[MAXBUDDY+1]
pointer makematrix(context *ctx, int row, int column)
pointer Getstring(pointer s)
struct blockframe * makeblock(context *ctx, pointer kind, pointer name, jmp_buf *jbuf, struct blockframe *link)
struct callframe * callfp
pointer defunpkg(context *ctx, char *name, pointer mod, pointer(*f)(), pointer pkg)
enterclass(pointer classobj)
pointer makeflt(double d)
struct numunion::@11 sval
struct fletframe * makeflet(context *ctx, pointer nm, pointer def, struct fletframe *scp, struct fletframe *link)
resetcix(pointer class, cixpair *p)
void deletecontext(id, context *ctx)
pointer makebig2(long hi, long lo)
pointer makesymbol(context *ctx, char *str, int leng, pointer home)
byte * get_string(pointer s)
struct methdef * methcache
euslisp
Author(s): Toshihiro Matsui
autogenerated on Thu Jun 15 2023 02:06:43