static char *sccsid
= "@(#)lam7.c 34.2 11/7/80";
register lispval ret
, temp
;
register lispval ret
, temp
;
register lispval fd
, type
;
if ( (ptr
=fdopen((int)fd
->i
, (char *)type
->a
.pname
))==NULL
)
lispval fname
, arglist
, envlist
, temp
;
char *args
[100], *envs
[100], estrs
[1024];
while (TYPE(fname
)!=ATOM
)
fname
= error("exece: non atom function name",TRUE
);
while (TYPE(arglist
)!=DTPR
&& arglist
!=nil
)
arglist
= error("exece: non list arglist",TRUE
);
for (sp
=args
; arglist
!=nil
; arglist
=arglist
->d
.cdr
) {
error("exece: non atom argument seen",FALSE
);
if (TYPE(envlist
)!=DTPR
&& envlist
!=nil
)
for (sp
=envs
,cp
=estrs
; envlist
!=nil
; envlist
=envlist
->d
.cdr
) {
if (TYPE(temp
)!=DTPR
|| TYPE(temp
->d
.car
)!=ATOM
|| TYPE(temp
->d
.cdr
)!=ATOM
)
error("exece: Bad enviroment list",FALSE
);
for (p
=temp
->d
.car
->a
.pname
; (*cp
++ = *p
++);) ;
for (p
=temp
->d
.cdr
->a
.pname
; (*cp
++ = *p
++);) ;
return(inewint(execve(fname
->a
.pname
, args
, envs
)));
int gensymcounter
= 0; /* should really be in data.c */
if(lbot
-np
==0)protect(nil
);
if (arg
!= nil
&& TYPE(arg
)==ATOM
)
leader
= arg
->a
.pname
[0];
sprintf(strbuf
, "%c%05d", leader
, gensymcounter
++);
return((lispval
)newatom());
type_len
; /* note type_len is in units of int */
register struct argent
*argp
;
register lispval pptr
, ind
, opptr
;
register struct argent
*lbot
, *np
;
errorh(Vermisc
, "remprop: Illegal first argument :",
if (TYPE(pptr
->d
.cdr
)!=DTPR
)
errorh(Vermisc
, "remprop: Bad property list",
if (pptr
->d
.car
== ind
) {
opptr
->d
.cdr
= pptr
->d
.cdr
->d
.cdr
;
atm
->d
.cdr
= pptr
->d
.cdr
->d
.cdr
;
nilplist
= pptr
->d
.cdr
->d
.cdr
;
atm
->a
.plist
= pptr
->d
.cdr
->d
.cdr
;
if ((pptr
->d
.cdr
)->d
.cdr
== nil
) return(nil
);
pptr
= (pptr
->d
.cdr
)->d
.cdr
;
error("ONLY ATOMS HAVE FUNCTION BINDINGS", FALSE
);
if (TYPE(lbot
->val
)==STRNG
)
if (TYPE(lbot
->val
)==ATOM
)
temp
->a
.pname
= (char *)CNIL
;
temp
->a
.clb
=(lispval
)atom_str
.next_free
;
atom_str
.next_free
=(char *) temp
;
register lispval work
, prev
;
char *front
, *temp
; int clean
;
sprintf(ctemp
,"%d",a
->i
);
sprintf(ctemp
,"%f",a
->r
);
temp
= front
= a
->a
.pname
;
if (*temp
== '-') temp
++;
clean
= clean
&& (ctable
[*temp
] != VNUM
);
clean
= (!(ctable
[*temp
++] & QUTMASK
));
strcpyn(ctemp
, front
, 99);
sprintf(ctemp
,"\"%s\"",front
);
error("prname does not support this type", FALSE
);
protect(ret
= prev
= newdot());
prev
->d
.cdr
= work
= newdot();
register lispval handy
, work
;
register char *cp
= strbuf
;
extern int atmlen
; /* used by newatom and getatom */
for(handy
= lbot
->val
; handy
!=nil
; handy
= handy
->d
.cdr
)
errorh(Vermisc
,"maknam/impode argument exceeds buffer",nil
,FALSE
,43,lbot
->val
);
*cp
++ = work
->a
.pname
[0];
work
= errorh(Vermisc
,"implode/maknam: Illegal type for this arg:",nil
,FALSE
,44,work
);
if(unintern
) return((lispval
)newatom());
else return((lispval
) getatom());
return(Iimplode(TRUE
)); /* unintern result */
return(Iimplode(FALSE
)); /* intern result */
register lispval handy
,atpr
;
if(TYPE(handy
=lbot
->val
) != ATOM
)
errorh(Vermisc
,"non atom to intern ",nil
,FALSE
,0,handy
);
/* compute hash of pname of arg */
hash
= hashfcn(handy
->a
.pname
);
/* search for atom with same pname on hash list */
atpr
= (lispval
) hasht
[hash
];
for(atpr
= (lispval
) hasht
[hash
]
; atpr
= (lispval
)atpr
->a
.hshlnk
)
if(strcmp(atpr
->a
.pname
,handy
->a
.pname
) == 0) return(atpr
);
/* not there yet, put the given one on */
handy
->a
.hshlnk
= hasht
[hash
];
hasht
[hash
] = (struct atom
*)handy
;