register FILE *p
= stderr
;
/* find free file descriptor */
for(;p
->_flag
&(_IOREAD
|_IOWRT
);p
++)
error("Too many open files to do readlist",FALSE
);
p
->_flag
= _IOSTRG
| flag
;
register lispval work
, handy
;
register struct argent
*lbot
, *np
;
if(lbot
->val
==nil
) { /*effectively, return(matom(""));*/
/* compute length of list */
for(work
= lbot
->val
; TYPE(work
)==DTPR
; work
=work
->cdr
)
string
= (char *) alloca(count
);
p
= mkstFI(string
, count
- 1, _IOREAD
);
for(work
= lbot
->val
; TYPE(work
)==DTPR
; work
=work
->cdr
) {
*string
++ = *(handy
->pname
);
error("Non atom or int to readlist",FALSE
);
register struct argent
*mylbot
=lbot
;
if((TYPE(mylbot
->val
))!=ATOM
)
error("argument to getenv must be atom",FALSE
);
strcpy(strbuf
,getenv(mylbot
->val
->pname
));
register struct argent
*mynp
=lbot
;
register lispval result
, handy
;
if((TYPE(mynp
->val
))!=ATOM
)
error("argument to boundp must be atom",FALSE
);
if( (handy
= mynp
->val
)->clb
==CNIL
)
(result
= newdot())->cdr
= handy
->clb
;
/* get property list of an atom or disembodied property list */
error("Only Atoms and disembodied property lists allowed for plist",FALSE
);
if(atm
==nil
) return(nilplist
);
{ /* set the property list of the given atom to the given list */
register lispval atm
, vall
;
register lispval dum1
, dum2
;
register struct argent
*lbot
, *np
;
if (TYPE(atm
) != ATOM
) error("First argument must be an atom",FALSE
);
if (TYPE(vall
)!= DTPR
&& vall
!=nil
)
error("Second argument must be a list",FALSE
);
register struct argent
*mylbot
= lbot
;
extern lispval sigacts
[16];
int i
; register lispval handy
, old
;
error("First arg to signal must be an int",FALSE
);
handy
= mylbot
[AD
+1].val
;
error("Second arg to signal must be an atom",FALSE
);
sigacts
[i
]=((lispval
) 0);
register lispval work
, handy
, dum1
, dum2
;
register struct argent
*lbot
, *np
;
for(work
= lbot
[AD
+1].val
;
work
->car
->car
!=lbot
->val
&& work
!=nil
;
register lispval handy
; register offset
, count
;
if(handy
==CNIL
|| TYPE(handy
)!=DTPR
)
error("Arg: not in context of Lexpr.",FALSE
);
count
= ((long *)handy
->cdr
) - (long *)handy
->car
;
if(np
==lbot
|| lbot
->val
==nil
)
if(TYPE(lbot
->val
)!=INT
|| (offset
= lbot
->val
->i
- 1) > count
|| offset
< 0 )
error("Out of bonds: arg to \"Arg\"",FALSE
);
return( ((struct argent
*)handy
->car
)[offset
].val
);
register lispval result
, handy
;
result
->car
= inewint(current
.mytime
);
handy
->car
= inewint(lgctime
);
where if value is present, it is the value to throw to the errset.
flag if present must evaluate to nil, as we always evaluate value
char *mesg
= "call to err"; /* default message */
if ((np
>= lbot
+ 2) && ((lbot
+1)->val
!= nil
))
error("Second arg to err must be nil",FALSE
);
if ((lbot
->val
!= nil
) && (TYPE(lbot
->val
) == ATOM
))
mesg
= lbot
->val
->pname
; /* new message if atom */
return(errorh(Vererr
,mesg
,lbot
->val
,nil
));
port
= okport(lbot
->val
,okport(Vpiport
->clb
,stdin
));
fflush(stdout
); /* flush any pending output characters */
port
= okport(lbot
->val
,okport(Vpiport
->clb
,stdin
));
fflush(stdout
); /* flush any pending output characters */
register lispval handy
, where
;
register struct argent
*lbot
, *np
;
error("Tyo demands number for 1st arg",FALSE
);
port
= (FILE *) okport(where
,okport(Vpoport
->clb
,stdout
));
register lispval handy
; extern lispval lastrtab
;
nextfree
= (char *) csegment(int_name
,128);
*(struct rtab
*)nextfree
= initread
;
*(struct rtab
*)nextfree
= *(struct rtab
*)ctable
;
handy
->delta
= inewint(4);
handy
->length
= inewint(sizeof(struct rtab
)/sizeof(int));
handy
->accfun
= handy
->aux
= nil
;
nextfree
+= sizeof(struct rtab
);
/* makereadtable - arg : t or nil
returns a readtable, t means return a copy of the initial readtable
nil means return a copy of the current readtable
if(lbot
==np
) error("makereadtable: wrong number of args",FALSE
);
if(TYPE(lbot
->val
) != ATOM
)
error("makereadtable: arg must be atom",FALSE
);
if(lbot
->val
== nil
) return(Imkrtab(1));
register lispval handy
= lbot
->val
, result
= handy
;
result
= inewint(handy
->i
);
(result
= newval())->l
= handy
->l
;
(result
= newdoub())->r
= handy
->r
;
errorh(Vermisc
,"Bad arg to cpy1",nil
,TRUE
,67,handy
);