lispio.c
Go to the documentation of this file.
1 /****************************************************************/
2 /* lisp I/O functions
3 /* Copyright Toshihiro MATSUI, ETL, 1987
4 /****************************************************************/
5 static char *rcsid="@(#)$Id$";
6 
7 #include "eus.h"
8 #include <ctype.h>
9 
10 #if vxworks
11 #undef READ
12 #else
13 #include <fcntl.h>
14 #endif
15 
16 extern int errno;
17 extern enum ch_type chartype[256];
19 extern byte *current_syntax[MAXTHREAD];
20 extern int written_count[MAXTHREAD];
21 extern pointer read_delimited_list(context*,pointer,int,char *);
22 
23 pointer OPENFILE(ctx,n,argv)
24 register context *ctx;
25 int n;
26 register pointer argv[];
27 { pointer s;
28  extern pointer openfile();
29  s=openfile(ctx,(char*)get_string(argv[0]), ckintval(argv[1]),
30  ckintval(argv[2]),ckintval(argv[3]));
31  if (s==0) return(makeint(errno));
32  return(s);}
33 
34 pointer CLOSE(ctx,n,argv)
35 register context *ctx;
36 int n;
37 pointer argv[];
38 { register pointer s=argv[0];
39  if (n!=1) error(E_MISMATCHARG);
40  if (isiostream(s)) {
41  if (closestream(s->c.iostream.in)<0) return(NIL);
42  if (closestream(s->c.iostream.out)<0) return(NIL);
43  return(T);}
44  else if (isfilestream(s)) {
45  if (closestream(s)<0) return(NIL);
46  return(T);}
47  else error(E_USER,(pointer)"file stream expected");}
48 
50 context *ctx;
51 int n;
52 register pointer strm;
53 { if (n==1 || strm==NIL) strm=Spevalof(QSTDOUT);
54  if (strm==T) strm=Spevalof(QTERMIO);
55  if (isiostream(strm)) strm=strm->c.iostream.out;
56  if (!isstream(strm)) error(E_STREAM);
57  if (strm->c.stream.direction!=K_OUT) error(E_IODIRECTION);
58  return(strm);}
59 
61 context *ctx;
62 int n;
63 register pointer strm;
64 { if (n<1 || strm==NIL) strm=Spevalof(QSTDIN);
65  if (strm==T) strm=Spevalof(QTERMIO);
66  if (isiostream(strm)) strm=strm->c.iostream.in;
67  if (!isstream(strm)) error(E_STREAM);
68  if (strm->c.stream.direction!=K_IN) error(E_IODIRECTION);
69  return(strm);}
70 
71 /****************************************************************/
72 
73 pointer PRINT(ctx,n,argv)
74 register context *ctx;
75 int n;
76 pointer argv[];
77 { pointer s;
78  int osf;
79  ckarg2(1,2);
80  osf=ctx->slashflag;
81  ctx->slashflag=0;
82  prinx(ctx,argv[0],s=getoutstream(ctx,n,argv[1])); terpri(s);
83  ctx->slashflag=osf;
84  return(argv[0]);}
85 
86 pointer PRIN1(ctx,n,argv)
87 register context *ctx;
88 int n;
89 pointer argv[];
90 { ckarg2(1,2);
91  int osf;
92  osf=ctx->slashflag;
93  ctx->slashflag=0;
94  prinx(ctx,argv[0],getoutstream(ctx,n,argv[1]));
95  ctx->slashflag=osf;
96  return(argv[0]);}
97 
98 pointer PRINC(ctx,n,argv)
99 register context *ctx;
100 int n;
101 pointer argv[];
102 { int osf;
103  ckarg2(1,2);
104  osf=ctx->slashflag;
105  ctx->slashflag=1;
106  prinx(ctx,argv[0],getoutstream(ctx,n,argv[1]));
107  ctx->slashflag=osf;
108  return(argv[0]);}
109 
110 pointer TERPRI(ctx,n,argv)
111 register context *ctx;
112 int n;
113 pointer argv[];
114 { pointer strm;
115  ckarg2(0,1);
116  strm=getoutstream(ctx,n+1,argv[0]);
117  terpri(strm);
118  return(NIL);}
119 
120 static int prsize[MAXTHREAD];
121 
122 void prntsize(s,lim)
123 register pointer s;
124 int lim;
125 { char buf[16];
126  register int i,n,etype;
127  numunion nu;
128  if (prsize[thr_self()]>=lim) return;
129  else if (isint(s)) { sprintf(buf,"%ld",intval(s)); prsize[thr_self()]+=strlen(buf);}
130  else if (isflt(s)) prsize[thr_self()]+=7;
131  else if (piscons(s)) {
132  if (ccar(s)==QUOTE && islist(ccdr(s)) && ccdr(ccdr(s))==NIL) {
133  prsize[thr_self()]++; prntsize(ccar(ccdr(s)),lim);} /* ???? */
134  else {
135  prsize[thr_self()]+=2;
136  while (islist(s)) {
137  prntsize(ccar(s),lim);
138  if (prsize[thr_self()]>lim) return;
139  s=ccdr(s);
140  if (s!=NIL) prsize[thr_self()]++;}
141  if (s!=NIL) { prntsize(s,lim); prsize[thr_self()]+=2;}}}
142  else if (pisstring(s)) prsize[thr_self()]+=strlength(s);
143  else if (pissymbol(s)) prsize[thr_self()]+=strlength(s->c.sym.pname);
144  else if (pisvector(s)) {
145  n=vecsize(s); i=0; etype=elmtypeof(s);
146  switch(etype) {
147  case ELM_BIT: case ELM_CHAR: case ELM_FOREIGN: prsize[thr_self()]+=2+n; break;
148  case ELM_BYTE: prsize[thr_self()]+=20; break; /*detarame*/
149  case ELM_FLOAT: case ELM_INT: prsize[thr_self()]++;
150  case ELM_POINTER:
151  prsize[thr_self()]+=3;
152  while (i<n) {
153  if (etype==ELM_FLOAT) prntsize(makeflt(s->c.fvec.fv[i]),lim);
154  else if (etype==ELM_INT) prntsize(makeint(s->c.ivec.iv[i]),lim);
155  else prntsize(s->c.vec.v[i],lim);
156  if (prsize[thr_self()]>lim) return;
157  prsize[thr_self()]++; i++;}
158  break;} }
159  else prsize[thr_self()]+=strlength(classof(s)->c.cls.name->c.sym.pname)+12;}
160 
161 pointer PRNTSIZE(ctx,n,argv)
162 register context *ctx;
163 int n;
164 pointer argv[];
165 { int lim;
166  prsize[thr_self()]=0;
167  ckarg2(1,2);
168  if (n==2) lim=ckintval(argv[1]); else lim=256;
169  prntsize(argv[0],lim);
170  return(makeint(prsize[thr_self()]));}
171 
172 pointer READ(ctx,n,argv)
173 register context *ctx;
174 int n;
175 pointer argv[];
176 { pointer strm,eoferrorp=T,eofvalue=NIL,result,recursivep=NIL;
177  ckarg2(0,4);
178  strm=getinstream(ctx,n,argv[0]);
179  if (n>=2) eoferrorp=argv[1];
180  if (n>=3) eofvalue=argv[2];
181  if (n==4) recursivep=argv[3];
182  result=reader(ctx,strm,recursivep);
183  if (result==(pointer)EOF)
184  if (eoferrorp==NIL) return(eofvalue);
185  else error(E_EOF);
186  return(result);}
187 
189 register context *ctx;
190 int n;
191 pointer argv[];
192 { pointer strm,result,recursivep=NIL;
193  int delim_char;
194  char token[1024];
195 
196  ckarg2(1,3);
197  delim_char=ckintval(argv[0]);
198  strm=getinstream(ctx,n-1,argv[1]);
199  if (n==3) recursivep=argv[2];
200 
201  current_syntax[thr_self()]=Spevalof(QREADTABLE)->c.rdtab.syntax->c.str.chars;
202  if (recursivep==NIL) {
203  pointer_update(oblabels->c.lab.next,NIL);
204  result=read_delimited_list(ctx,strm,delim_char,token);
205  pointer_update(oblabels->c.lab.next,NIL);}
206  else result=read_delimited_list(ctx,strm,delim_char,token); /*preserve #n= scope*/
207  return(result);}
208 
209 #define READLINE_BUF_LENGTH 8192
210 pointer READLINE(ctx,n,argv)
211 register context *ctx;
212 int n;
213 pointer argv[];
214 { register pointer strm;
215  pointer eoferrorp=T,eofvalue=NIL,ret=NIL;
216  byte *cb = (byte *) malloc(READLINE_BUF_LENGTH);
217  register int i=0,ch,buflength=READLINE_BUF_LENGTH;
218  ckarg2(0,3);
219  strm=getinstream(ctx,n,argv[0]);
220  if (n>=2) eoferrorp=argv[1];
221  if (n==3) eofvalue=argv[2];
222  while (1) {
223  ch=readch(strm);
224  if (ch=='\n') break;
225  else if (ch==EOF) {
226  if (i>0) break;
227  free(cb);
228  if (eoferrorp==NIL) return(eofvalue);
229  else error(E_EOF);}
230  cb[i++]=ch;
231  if (i >= buflength) {
232  byte *newcb = malloc(buflength+READLINE_BUF_LENGTH);
233  if (newcb == NULL) {
234  free(cb);
235  error(E_USER, (pointer)"Memory allocation error by read-line");
236  break;
237  }
238  memcpy(newcb, cb, buflength);
239  buflength += READLINE_BUF_LENGTH;
240  free(cb);
241  cb = newcb;
242  }
243  }
244  if ((i>=1) && cb[i-1]=='\r') i=i-1;
245  ret = makestring((char *)cb,i);
246  free(cb);
247  return(ret);}
248 
249 pointer READCH(ctx,n,argv)
250 register context *ctx;
251 register int n;
252 register pointer argv[];
253 { pointer strm,eoferrorp=T,eofvalue=NIL;
254  register eusinteger_t result;
255  ckarg2(0,3);
256  strm=getinstream(ctx,n,argv[0]);
257  if (n>=2) eoferrorp=argv[1];
258  if (n==3) eofvalue=argv[2];
259  result=readch(strm);
260  if (result==EOF)
261  if (eoferrorp==NIL) return(eofvalue);
262  else error(E_EOF);
263  return(makeint(result));}
264 
265 pointer UNREADCH(ctx,n,argv)
266 register context *ctx;
267 int n;
268 register pointer argv[];
269 { pointer strm;
270  byte ch;
271  ckarg2(1,2);
272  strm=getinstream(ctx,n-1,argv[1]);
273  ch=ckintval(argv[0]);
274  unreadch(strm,ch);
275  return(argv[0]);}
276 
277 pointer PEEKCH(ctx,n,argv)
278 register context *ctx;
279 int n;
280 pointer argv[];
281 { pointer strm,eoferrorp=T,eofvalue=NIL;
282  eusinteger_t result;
283  ckarg2(0,3);
284  strm=getinstream(ctx,n,argv[0]);
285  if (n>=2) eoferrorp=argv[1];
286  if (n==3) eofvalue=argv[2];
287  result=readch(strm);
288  if (result==EOF)
289  if (eoferrorp==NIL) return(eofvalue);
290  else error(E_EOF);
291  unreadch(strm,result);
292  return(makeint(result));}
293 
294 pointer FINOUT(ctx,n,argv) /*finish-output*/
295 register context *ctx;
296 int n;
297 pointer argv[];
298 { pointer strm;
299  strm=getoutstream(ctx,n+1,argv[0]);
300  flushstream(strm);
301  return(NIL);}
302 
303 pointer WRTBYTE(ctx,n,argv)
304 register context *ctx;
305 int n;
306 pointer *argv;
307 { register pointer bytes,strm;
308  ckarg(2);
309  strm=getoutstream(ctx,n,argv[1]);
310  bytes=argv[0];
311  if (islist(bytes))
312  while (islist(bytes)) {
313  writech(strm,ckintval(ccar(bytes)));
314  bytes=ccdr(bytes);}
315  else writech(strm,ckintval(bytes));
316  return(argv[0]);}
317 
318 pointer WRTWORD(ctx,n,argv)
319 register context *ctx;
320 int n;
321 pointer *argv;
322 { register pointer bytes,strm;
323  union {
324  short s;
325  char b[2];} buf;
326  ckarg(2);
327  strm=getoutstream(ctx,n,argv[1]);
328  bytes=argv[0];
329  if (islist(bytes))
330  while (islist(bytes)) {
331  buf.s=ckintval(ccar(bytes));
332  writestr(strm,(byte *)buf.b,2);
333  bytes=ccdr(bytes);}
334  else {
335  buf.s=ckintval(bytes);
336  writestr(strm,(byte *)buf.b,2);}
337  return(argv[0]);}
338 
339 pointer WRTLONG(ctx,n,argv)
340 register context *ctx;
341 int n;
342 pointer *argv;
343 { register pointer bytes,strm;
344  union {
345  int i;
346  byte b[4];} buf;
347  ckarg(2);
348  strm=getoutstream(ctx,n,argv[1]);
349  bytes=argv[0];
350  if (islist(bytes))
351  while (islist(bytes)) {
352  buf.i=bigintval(ccar(bytes));
353  writestr(strm,buf.b,4);
354  bytes=ccdr(bytes);}
355  else {
356  buf.i=bigintval(bytes);
357  writestr(strm,buf.b,4);}
358  return(argv[0]);}
359 
361 register context *ctx;
362 int n;
363 pointer argv[];
364 { int ch;
365  pointer nontermp=NIL,rdtable;
366  ckarg2(2,4);
367  if (isstring(argv[0])) ch=argv[0]->c.str.chars[0];
368  else ch=ckintval(argv[0]);
369  if (ch<0 || 256<ch) error(E_CHARRANGE);
370  if (n>=3) nontermp=argv[2];
371  if (n==4) rdtable=argv[3];
372  else rdtable=Spevalof(QREADTABLE);
373  if (!isreadtable(rdtable)) error(E_USER,(pointer)"readtable expected");
374  pointer_update(rdtable->c.rdtab.macro->c.vec.v[ch],argv[1]);
375  if (argv[1]==NIL) rdtable->c.rdtab.syntax->c.str.chars[ch]=(byte)chartype[ch];
376  else if (nontermp==NIL) rdtable->c.rdtab.syntax->c.str.chars[ch]=(int)ch_termmacro;
377  else rdtable->c.rdtab.syntax->c.str.chars[ch]=(int)ch_nontermacro;
378  return(T);}
379 
381 register context *ctx;
382 int n;
383 pointer argv[];
384 { pointer rdtable;
385  ckarg2(1,2);
386  if (n==2) rdtable=argv[1];
387  else rdtable=Spevalof(QREADTABLE);
388  if (!isreadtable(rdtable)) error(E_USER,(pointer)"readtable expected");
389  return(rdtable->c.rdtab.macro->c.vec.v[max(0,min(255,ckintval(argv[0])))]);}
390 
392 register context *ctx;
393 int n;
394 register pointer argv[];
395 { int ch;
396  pointer rdtable,func;
397  ckarg2(3,4);
398  if (isstring(argv[1])) ch=argv[1]->c.str.chars[0];
399  else ch=ckintval(argv[1]);
400  if (ch<0 || 256<ch) error(E_CHARRANGE);
401  if (n==4) rdtable=argv[3];
402  else rdtable=Spevalof(QREADTABLE);
403  if (!isreadtable(rdtable)) error(E_USER,(pointer)"readtable expected");
404  pointer_update(rdtable->c.rdtab.dispatch->c.vec.v[ch],/*(pointer (*)())*/argv[2]);
405  return(T);}
406 
408 register context *ctx;
409 int n;
410 pointer argv[];
411 { int ch;
412  pointer rdtable,func;
413  ckarg2(2,3);
414  if (isstring(argv[1])) ch=argv[1]->c.str.chars[0];
415  else ch=ckintval(argv[1]);
416  if (ch<0 || 256<ch) error(E_CHARRANGE);
417  if (n==3) rdtable=argv[2];
418  else rdtable=Spevalof(QREADTABLE);
419  if (!isreadtable(rdtable)) error(E_USER,(pointer)"readtable expected");
420  func=rdtable->c.rdtab.dispatch->c.vec.v[ch];
421  return(func);}
422 
424 register context *ctx;
425 int n; /* unused argument */
426 pointer *argv; /* unused argument */
427 { initreader(ctx); return(T);} /* ???? */
428 
429 /*****************************************************************/
430 /* FORMAT
431 /* 1986-Nov
432 /* T.Matsui
433 */
434 
435 #define nextcch() ((cx>=cmax)?(byte)((eusinteger_t)error(E_FORMATSTRING)):cstr[cx++])
436 
437 #define nextfarg() ((fargx>=fargc)?(pointer)error(E_MISMATCHARG):fargv[fargx++])
438 
439 /*extern void printnum(context *, pointer, pointer, int, int, int);*/
440 
441 pointer XFORMAT(ctx,n,argv)
442 register context *ctx;
443 int n;
444 pointer argv[];
445 {
446  register pointer dest,a;
447  register int i,j,px,l;
448  int param[10],par;
449  char buf[256];
450  eusfloat_t fval;
451  byte *cstr,cch;
452  int cx,cmax;
453  pointer *fargv, varg;
454  int fargc,fargx;
455  int wcount, osf;
456  numunion nu;
457  extern double fabs();
458 
459  if (n<2) error(E_MISMATCHARG);
460  dest=argv[0]; a=argv[1];
461  if (!isstring(a)) error(E_NOSTRING);
462  cx=0; cstr=a->c.str.chars; cmax=intval(a->c.str.length);
463  fargv=argv; fargc=n; fargx=2;
464 
465  if (dest==NIL) dest=(pointer)mkstream(ctx,K_OUT,makebuffer(64));
466  else {
467  if (dest==T) dest=Spevalof(QSTDOUT);
468  if (isiostream(dest)) dest=dest->c.iostream.out;
469  if (!isstream(dest)) error(E_STREAM);
470  if (dest->c.stream.direction!=K_OUT) error(E_IODIRECTION);}
471  vpush(dest);
472 
473  written_count[thr_self()]=0;
474  while (cx<cmax) {
475  cch=nextcch();
476  if (cch=='~') { /*tilda*/
477  cch=nextcch();
478  px=0; param[0]=0; param[1]=1; param[2]=0;
479  while (isdigit(cch)) {
480  param[px]=0;
481  while (isdigit(cch)) {
482  param[px]=param[px]*10+(cch-'0');
483  cch=nextcch();}
484  px++;
485  if (cch==',') cch=nextcch();}
486  if (islower(cch)) cch=toupper(cch);
487  if (cch=='V') {
488  varg=nextfarg();
489  param[px++]=ckintval(varg);
490  cch=nextcch();
491  if (islower(cch)) cch=toupper(cch);}
492  switch(cch) {
493  case 'A': /*Ascii*/
494  osf=ctx->slashflag;
495  ctx->slashflag=1;
496  written_count[thr_self()]=0;
497  prinx(ctx,(pointer)nextfarg(),dest);
498  while (param[0]>written_count[thr_self()]) writech(dest,' ');
499  ctx->slashflag=osf;
500  break;
501  case 'S': /*S-expression*/
502  written_count[thr_self()]=0;
503  prinx(ctx,nextfarg(),dest);
504  while (param[0]>written_count[thr_self()]) writech(dest,' ');
505  break;
506  case 'D': /*Decimal*/
507  a=nextfarg();
508  printnum(ctx,a,dest,10,param[0],param[1]);
509  break;
510  case 'X': /*heXadecimal*/
511  a=nextfarg();
512  printnum(ctx,a,dest,16,param[0],param[1]);
513  break;
514  case 'O': /*Octal*/
515  a=nextfarg();
516  printnum(ctx,a,dest,8,param[0],param[1]);
517  break;
518  case 'C': /*Character*/
519  a=nextfarg();
520  writech(dest,ckintval(a)); break;
521  case 'F': /*Fixed-format floating-point*/
522  a=nextfarg();
523  fval=ckfltval(a);
524  sprintf(buf,"%*.*f",param[0],param[1],fval);
525  writestr(dest,(byte *)buf,strlen(buf)); break;
526  case 'E': /*Exponential floating-point*/
527  a=nextfarg();
528  fval=ckfltval(a);
529  sprintf(buf,"%*.*e",param[0],param[1],fval);
530  writestr(dest,(byte *)buf,strlen(buf)); break;
531  case 'G': /*General floating-point*/
532  a=nextfarg();
533  fval=ckfltval(a);
534  if (fval==0.0) writestr(dest,(byte *)"0.0",3);
535  else {
536  if (fabs(fval)<0.0001 || fabs(fval)>1.0e+05) {
537  sprintf(buf,"%*.*e",param[0],param[1],fval); l=strlen(buf);}
538  else {
539  sprintf(buf,"%*.*f",param[0],param[1],fval);
540  l=strlen(buf);
541  while (l>2 && buf[l-1]=='0' && buf[l-2]!='.') l--;}
542  writestr(dest,(byte *)buf,l); }
543  break;
544  case '%': case '&': /*newline*/
545  for (j=0; j<=param[0]; j++) writech(dest,'\n');
546  if (argv[0]!=NIL)
547  if (flushstream(dest)!=0) error(E_USER,(pointer)"cannot flush stream");
548  break;
549  case '~': /*tilda*/
550  writech(dest,'~'); break;
551  case 'T': /*tabulate*/
552  writech(dest,9); break;;
553  default: break;
554  }
555  }
556  else writech(dest,cch);}
557  if (argv[0]==NIL) {
558  a=makestring((char *)dest->c.stream.buffer->c.str.chars,
559  intval(dest->c.stream.count));
560  vpop();
561  return(a);}
562  else { vpop(); return(NIL);}
563  }
564 
565 pointer SIGERROR(ctx,n,argv)
566 register context *ctx;
567 register int n;
568 register pointer *argv;
569 { register int i;
570  pointer msg;
571  pointer *argb=ctx->vsp;
572  if (isstring(argv[0])) {
573  vpush(NIL);
574  for (i=0; i<n; i++) vpush(argv[i]);
575  msg=XFORMAT(ctx,n+1,argb);
576  error(E_USER,(pointer)(msg->c.str.chars),argv[1]);}
577  else error((enum errorcode)(ckintval(argv[0])),argv[1]);}
578 
580 register context *ctx;
581 register int n;
582 register pointer *argv;
583 { ckarg(1);
584  ctx->errhandler=argv[0];
585  return(argv[0]);}
586 
587 
588 void lispio(ctx,mod)
589 register context *ctx;
590 pointer mod;
591 {
592  pointer_update(Spevalof(PACKAGE),syspkg);
593  defun(ctx,"OPENFILE",mod,OPENFILE,NULL);
594  pointer_update(Spevalof(PACKAGE),lisppkg);
595 /* defun(ctx,"OPEN",mod,OPEN,NULL); */
596  defun(ctx,"CLOSE",mod,CLOSE,NULL);
597  defun(ctx,"READ",mod,READ,NULL);
598  defun(ctx,"READ-DELIMITED-LIST",mod,READ_DELIMITED_LIST,NULL);
599  defun(ctx,"READ-LINE",mod,READLINE,NULL);
600  defun(ctx,"READ-CHAR",mod,READCH,NULL);
601  defun(ctx,"UNREAD-CHAR",mod,UNREADCH,NULL);
602  defun(ctx,"PEEK-CHAR",mod,PEEKCH,NULL);
603  defun(ctx,"PRINT",mod,PRINT,NULL);
604  defun(ctx,"PRIN1",mod,PRIN1,NULL);
605  defun(ctx,"PRINC",mod,PRINC,NULL);
606  defun(ctx,"TERPRI",mod,TERPRI,NULL);
607  defun(ctx,"PRINT-SIZE",mod,PRNTSIZE,NULL);
608  defun(ctx,"FINISH-OUTPUT",mod,FINOUT,NULL);
609  defun(ctx,"WRITE-BYTE",mod,WRTBYTE,NULL);
610  defun(ctx,"WRITE-WORD",mod,WRTWORD,NULL);
611  defun(ctx,"WRITE-LONG",mod,WRTLONG,NULL);
612  defun(ctx,"SET-MACRO-CHARACTER",mod,SETMACROCH,NULL);
613  defun(ctx,"GET-MACRO-CHARACTER",mod,GETMACROCH,NULL);
614  defun(ctx,"SET-DISPATCH-MACRO-CHARACTER",mod,SETDISPMACRO,NULL);
615  defun(ctx,"GET-DISPATCH-MACRO-CHARACTER",mod,GETDISPMACRO,NULL);
616  defunpkg(ctx,"RESET-READTABLE",mod,RESETREADTABLE,syspkg);
617  defun(ctx,"FORMAT",mod,XFORMAT,NULL);
618  defun(ctx,"ERROR",mod,SIGERROR,NULL);
619  defun(ctx,"INSTALL-ERROR-HANDLER",mod,INSTALL_ERRHANDLER,NULL);
620  }
621 
pointer K_IN
Definition: eus.c:130
static char buf[CHAR_SIZE]
pointer prinx(context *, pointer, pointer)
Definition: printer.c:611
pointer PRIN1(context *ctx, int n, argv)
Definition: lispio.c:86
pointer PEEKCH(context *ctx, int n, argv)
Definition: lispio.c:277
int readch(pointer)
Definition: eusstream.c:114
struct vector vec
Definition: eus.h:412
pointer getoutstream(context *ctx, int n, pointer strm)
Definition: lispio.c:49
#define makeint(v)
Definition: sfttest.c:2
struct cell * pointer
Definition: eus.h:163
pointer K_OUT
Definition: eus.c:130
Definition: eus.h:522
void prntsize(pointer s, int lim)
Definition: lispio.c:122
int ch[MAXTHREAD]
Definition: eusstream.c:23
struct string str
Definition: eus.h:400
pointer SETDISPMACRO(context *ctx, int n, argv)
Definition: lispio.c:391
byte chars[1]
Definition: eus.h:210
pointer openfile(context *, char *, int, int, int)
Definition: eusstream.c:30
int closestream(pointer)
Definition: eusstream.c:53
pointer T
Definition: eus.c:110
GLfloat n[6][3]
Definition: cube.c:15
pointer read_delimited_list(context *, pointer, int, char *)
pointer next
Definition: eus.h:295
pointer defunpkg(context *, char *, pointer, pointer(*)(), pointer)
Definition: makes.c:636
void printnum(context *, pointer, pointer, int, int, int)
Definition: printer.c:274
pointer oblabels
Definition: reader.c:42
#define intval(p)
Definition: sfttest.c:1
pointer PRINC(context *ctx, int n, argv)
Definition: lispio.c:98
defun("ADR_TO_STRING", mod, ADR_TO_STRING)
enum ch_type chartype[256]
Definition: reader.c:49
static float * fargv
Definition: transargv.c:57
static char * rcsid
Definition: lispio.c:5
void lispio(context *ctx, pointer mod)
Definition: lispio.c:588
pointer TERPRI(context *ctx, int n, argv)
Definition: lispio.c:110
static int prsize[MAXTHREAD]
Definition: lispio.c:120
Definition: eus.h:1002
pointer QTERMIO
Definition: eus.c:172
byte * current_syntax[MAXTHREAD]
Definition: reader.c:41
pointer OPENFILE(context *ctx, int n, argv)
Definition: lispio.c:23
pointer INSTALL_ERRHANDLER(context *ctx, int n, pointer *argv)
Definition: lispio.c:579
ckarg(2)
pointer READ_DELIMITED_LIST(context *ctx, int n, argv)
Definition: lispio.c:188
float ckfltval()
#define min(x, y)
Definition: rmflags.c:17
pointer QUOTE
Definition: eus.c:110
pointer mkstream(context *, pointer, pointer)
Definition: makes.c:241
void initreader(context *)
Definition: reader.c:1034
pointer GETMACROCH(context *ctx, int n, argv)
Definition: lispio.c:380
union cell::cellunion c
pointer out
Definition: eus.h:289
pointer CLOSE(context *ctx, int n, argv)
Definition: lispio.c:34
int writestr(pointer, byte *, int)
Definition: eusstream.c:218
pointer getinstream(context *ctx, int n, pointer strm)
Definition: lispio.c:60
Definition: eus.h:426
struct stream stream
Definition: eus.h:403
ch_type
Definition: eus.h:454
int written_count[MAXTHREAD]
Definition: eusstream.c:24
long l
Definition: structsize.c:3
pointer dispatch
Definition: eus.h:348
pointer SETMACROCH(context *ctx, int n, argv)
Definition: lispio.c:360
struct readtable rdtab
Definition: eus.h:418
struct labref lab
Definition: eus.h:410
Definition: eus.h:379
pointer SIGERROR(context *ctx, int n, pointer *argv)
Definition: lispio.c:565
pointer READCH(context *ctx, int n, argv)
Definition: lispio.c:249
short s
Definition: structsize.c:2
pointer buffer
Definition: eus.h:274
pointer makebuffer(int)
Definition: makes.c:140
errorcode
Definition: eus.h:915
pointer lisppkg
Definition: eus.c:109
pointer WRTWORD(context *ctx, int n, pointer *argv)
Definition: lispio.c:318
pointer error(enum errorcode ec,...) pointer error(va_alist) va_dcl
Definition: eus.c:297
pointer GETDISPMACRO(context *ctx, int n, argv)
Definition: lispio.c:407
long eusinteger_t
Definition: eus.h:19
byte * get_string()
pointer PACKAGE
Definition: eus.c:110
pointer direction
Definition: eus.h:273
int flushstream(pointer)
Definition: eusstream.c:159
pointer QREADTABLE
Definition: eus.c:172
pointer PRNTSIZE(context *ctx, int n, argv)
Definition: lispio.c:161
pointer WRTBYTE(context *ctx, int n, pointer *argv)
Definition: lispio.c:303
pointer FINOUT(context *ctx, int n, argv)
Definition: lispio.c:294
void terpri(pointer)
Definition: printer.c:637
pointer makestring(char *, int)
Definition: makes.c:147
pointer READLINE(context *ctx, int n, argv)
Definition: lispio.c:210
pointer macro
Definition: eus.h:347
#define max(I1, I2)
Definition: eustags.c:134
Definition: eus.h:955
pointer UNREADCH(context *ctx, int n, argv)
Definition: lispio.c:265
#define NULL
Definition: transargv.c:8
struct iostream iostream
Definition: eus.h:405
int writech(pointer, int)
pointer READ(context *ctx, int n, argv)
Definition: lispio.c:172
pointer count
Definition: eus.h:275
pointer QSTDOUT
Definition: eus.c:119
Definition: eus.h:950
int unreadch(pointer, int)
Definition: eusstream.c:138
pointer in
Definition: eus.h:289
pointer XFORMAT(context *ctx, int n, argv)
Definition: lispio.c:441
unsigned char byte
Definition: eus.h:161
unsigned int thr_self()
Definition: eus.c:25
pointer RESETREADTABLE(context *ctx, int n, pointer *argv)
Definition: lispio.c:423
double eusfloat_t
Definition: eus.h:20
pointer NIL
Definition: eus.c:110
pointer syspkg
Definition: eus.c:109
pointer v[1]
Definition: eus.h:299
pointer QSTDIN
Definition: eus.c:119
pointer PRINT(context *ctx, int n, argv)
Definition: lispio.c:73
pointer WRTLONG(context *ctx, int n, pointer *argv)
Definition: lispio.c:339
pointer reader(context *, pointer, pointer)
Definition: reader.c:1016
char a[26]
Definition: freq.c:4
int errno
pointer length
Definition: eus.h:209
pointer makeflt()


euslisp
Author(s): Toshihiro Matsui
autogenerated on Thu Jun 6 2019 20:00:44