lispio.c
Go to the documentation of this file.
00001 /****************************************************************/
00002 /* lisp I/O functions
00003 /*      Copyright Toshihiro MATSUI, ETL, 1987 
00004 /****************************************************************/
00005 static char *rcsid="@(#)$Id$";
00006 
00007 #include "eus.h"
00008 #include <ctype.h>
00009 
00010 #if vxworks
00011 #undef READ
00012 #else
00013 #include <fcntl.h>
00014 #endif
00015 
00016 extern int errno;
00017 extern enum ch_type chartype[256];
00018 extern pointer QREADTABLE,QTERMIO, oblabels;
00019 extern byte *current_syntax[MAXTHREAD];
00020 extern int written_count[MAXTHREAD];
00021 extern pointer read_delimited_list(context*,pointer,int,char *);
00022 
00023 pointer OPENFILE(ctx,n,argv)
00024 register context *ctx;
00025 int n;
00026 register pointer argv[];
00027 { pointer s;
00028   extern pointer openfile();
00029   s=openfile(ctx,(char*)get_string(argv[0]), ckintval(argv[1]),
00030              ckintval(argv[2]),ckintval(argv[3]));
00031   if (s==0) return(makeint(errno));
00032   return(s);}
00033 
00034 pointer CLOSE(ctx,n,argv)
00035 register context *ctx;
00036 int n;
00037 pointer argv[];
00038 { register pointer s=argv[0];
00039   if (n!=1) error(E_MISMATCHARG);
00040   if (isiostream(s)) {
00041     if (closestream(s->c.iostream.in)<0) return(NIL);
00042     if (closestream(s->c.iostream.out)<0) return(NIL);
00043     return(T);}
00044   else if (isfilestream(s)) {
00045     if (closestream(s)<0) return(NIL);
00046     return(T);}
00047   else error(E_USER,(pointer)"file stream expected");}
00048 
00049 pointer getoutstream(ctx,n,strm)
00050 context *ctx;
00051 int n;
00052 register pointer strm;
00053 { if (n==1 || strm==NIL)  strm=Spevalof(QSTDOUT);
00054   if (strm==T) strm=Spevalof(QTERMIO);
00055   if (isiostream(strm)) strm=strm->c.iostream.out;
00056   if (!isstream(strm)) error(E_STREAM);
00057   if (strm->c.stream.direction!=K_OUT) error(E_IODIRECTION);
00058   return(strm);}
00059 
00060 pointer getinstream(ctx,n,strm)
00061 context *ctx;
00062 int n;
00063 register pointer strm;
00064 { if (n<1 || strm==NIL) strm=Spevalof(QSTDIN);
00065   if (strm==T) strm=Spevalof(QTERMIO);
00066   if (isiostream(strm)) strm=strm->c.iostream.in;
00067   if (!isstream(strm)) error(E_STREAM);
00068   if (strm->c.stream.direction!=K_IN) error(E_IODIRECTION);
00069   return(strm);}
00070 
00071 /****************************************************************/
00072 
00073 pointer PRINT(ctx,n,argv)
00074 register context *ctx;
00075 int n;
00076 pointer argv[];
00077 { pointer s;
00078   int osf;
00079   ckarg2(1,2);
00080   osf=ctx->slashflag;
00081   ctx->slashflag=0;
00082   prinx(ctx,argv[0],s=getoutstream(ctx,n,argv[1])); terpri(s);
00083   ctx->slashflag=osf;
00084   return(argv[0]);}
00085 
00086 pointer PRIN1(ctx,n,argv)
00087 register context *ctx;
00088 int n;
00089 pointer argv[];
00090 { ckarg2(1,2);
00091   int osf;
00092   osf=ctx->slashflag;
00093   ctx->slashflag=0;
00094   prinx(ctx,argv[0],getoutstream(ctx,n,argv[1]));
00095   ctx->slashflag=osf;
00096   return(argv[0]);}
00097 
00098 pointer PRINC(ctx,n,argv)
00099 register context *ctx;
00100 int n;
00101 pointer argv[];
00102 { int osf;
00103   ckarg2(1,2);
00104   osf=ctx->slashflag;
00105   ctx->slashflag=1;
00106   prinx(ctx,argv[0],getoutstream(ctx,n,argv[1]));
00107   ctx->slashflag=osf;
00108   return(argv[0]);}
00109 
00110 pointer TERPRI(ctx,n,argv)
00111 register context *ctx;
00112 int n;
00113 pointer argv[];
00114 { pointer strm;
00115   ckarg2(0,1);
00116   strm=getoutstream(ctx,n+1,argv[0]);
00117   terpri(strm);
00118   return(NIL);}
00119 
00120 static int prsize[MAXTHREAD];
00121 
00122 void prntsize(s,lim)
00123 register pointer s;
00124 int lim;
00125 { char buf[16];
00126   register int i,n,etype;
00127   numunion nu;
00128   if (prsize[thr_self()]>=lim) return;
00129   else if (isint(s)) { sprintf(buf,"%ld",intval(s)); prsize[thr_self()]+=strlen(buf);}
00130   else if (isflt(s)) prsize[thr_self()]+=7;
00131   else if (piscons(s)) {
00132     if (ccar(s)==QUOTE && islist(ccdr(s)) && ccdr(ccdr(s))==NIL) {
00133       prsize[thr_self()]++; prntsize(ccar(ccdr(s)),lim);}  /* ???? */
00134     else {
00135       prsize[thr_self()]+=2;
00136       while (islist(s)) {
00137         prntsize(ccar(s),lim);
00138         if (prsize[thr_self()]>lim) return;
00139         s=ccdr(s);
00140         if (s!=NIL) prsize[thr_self()]++;}
00141       if (s!=NIL) { prntsize(s,lim); prsize[thr_self()]+=2;}}}
00142   else if (pisstring(s)) prsize[thr_self()]+=strlength(s);
00143   else if (pissymbol(s)) prsize[thr_self()]+=strlength(s->c.sym.pname);
00144   else if (pisvector(s)) {
00145     n=vecsize(s); i=0; etype=elmtypeof(s);
00146     switch(etype) {
00147       case ELM_BIT: case ELM_CHAR: case ELM_FOREIGN: prsize[thr_self()]+=2+n; break;
00148       case ELM_BYTE: prsize[thr_self()]+=20; break;     /*detarame*/
00149       case ELM_FLOAT: case ELM_INT: prsize[thr_self()]++;
00150       case ELM_POINTER:
00151             prsize[thr_self()]+=3;
00152             while (i<n) {
00153               if (etype==ELM_FLOAT) prntsize(makeflt(s->c.fvec.fv[i]),lim);
00154               else if (etype==ELM_INT) prntsize(makeint(s->c.ivec.iv[i]),lim);
00155               else prntsize(s->c.vec.v[i],lim);
00156               if (prsize[thr_self()]>lim) return;
00157               prsize[thr_self()]++; i++;}
00158             break;} }
00159   else prsize[thr_self()]+=strlength(classof(s)->c.cls.name->c.sym.pname)+12;}
00160 
00161 pointer PRNTSIZE(ctx,n,argv)
00162 register context *ctx;
00163 int n;
00164 pointer argv[];
00165 { int lim;
00166   prsize[thr_self()]=0;
00167   ckarg2(1,2);
00168   if (n==2) lim=ckintval(argv[1]); else lim=256;
00169   prntsize(argv[0],lim);
00170   return(makeint(prsize[thr_self()]));}
00171 
00172 pointer READ(ctx,n,argv)
00173 register context *ctx;
00174 int n;
00175 pointer argv[];
00176 { pointer strm,eoferrorp=T,eofvalue=NIL,result,recursivep=NIL;
00177   ckarg2(0,4);
00178   strm=getinstream(ctx,n,argv[0]);
00179   if (n>=2) eoferrorp=argv[1];
00180   if (n>=3) eofvalue=argv[2];
00181   if (n==4) recursivep=argv[3];
00182   result=reader(ctx,strm,recursivep);
00183   if (result==(pointer)EOF)
00184     if (eoferrorp==NIL) return(eofvalue);
00185     else error(E_EOF);
00186   return(result);}
00187 
00188 pointer READ_DELIMITED_LIST(ctx,n,argv)
00189 register context *ctx;
00190 int n;
00191 pointer argv[];
00192 { pointer strm,result,recursivep=NIL;
00193   int delim_char;
00194   char token[1024];
00195 
00196   ckarg2(1,3);
00197   delim_char=ckintval(argv[0]);
00198   strm=getinstream(ctx,n-1,argv[1]);
00199   if (n==3) recursivep=argv[2];
00200 
00201   current_syntax[thr_self()]=Spevalof(QREADTABLE)->c.rdtab.syntax->c.str.chars;
00202   if (recursivep==NIL) {
00203     pointer_update(oblabels->c.lab.next,NIL);
00204     result=read_delimited_list(ctx,strm,delim_char,token);
00205     pointer_update(oblabels->c.lab.next,NIL);}
00206   else result=read_delimited_list(ctx,strm,delim_char,token); /*preserve #n= scope*/
00207   return(result);}
00208 
00209 #define READLINE_BUF_LENGTH 8192
00210 pointer READLINE(ctx,n,argv)
00211 register context *ctx;
00212 int n;
00213 pointer argv[];
00214 { register pointer strm;
00215   pointer eoferrorp=T,eofvalue=NIL,ret=NIL;
00216   byte *cb = (byte *) malloc(READLINE_BUF_LENGTH);
00217   register int i=0,ch,buflength=READLINE_BUF_LENGTH;
00218   ckarg2(0,3);
00219   strm=getinstream(ctx,n,argv[0]);
00220   if (n>=2) eoferrorp=argv[1];
00221   if (n==3) eofvalue=argv[2];
00222   while (1) {
00223     ch=readch(strm);
00224     if (ch=='\n') break;
00225     else if (ch==EOF) {
00226       if (i>0) break;
00227       free(cb);
00228       if (eoferrorp==NIL) return(eofvalue);
00229       else error(E_EOF);}
00230     cb[i++]=ch;
00231     if (i >= buflength) {
00232       byte *newcb = malloc(buflength+READLINE_BUF_LENGTH);
00233       if (newcb == NULL) {
00234         free(cb);
00235         error(E_USER, (pointer)"Memory allocation error by read-line");
00236         break;
00237       }
00238       memcpy(newcb, cb, buflength);
00239       buflength += READLINE_BUF_LENGTH;
00240       free(cb);
00241       cb = newcb;
00242     }
00243   }
00244   if ((i>=1) && cb[i-1]=='\r') i=i-1;
00245   ret = makestring((char *)cb,i);
00246   free(cb);
00247   return(ret);}
00248 
00249 pointer READCH(ctx,n,argv)
00250 register context *ctx;
00251 register int n;
00252 register pointer argv[];
00253 { pointer strm,eoferrorp=T,eofvalue=NIL;
00254   register eusinteger_t result;
00255   ckarg2(0,3);
00256   strm=getinstream(ctx,n,argv[0]);
00257   if (n>=2) eoferrorp=argv[1];
00258   if (n==3) eofvalue=argv[2];
00259   result=readch(strm);
00260   if (result==EOF)
00261     if (eoferrorp==NIL) return(eofvalue);
00262     else error(E_EOF);
00263   return(makeint(result));}
00264 
00265 pointer UNREADCH(ctx,n,argv)
00266 register context *ctx;
00267 int n;
00268 register pointer argv[];
00269 { pointer strm;
00270   byte ch;
00271   ckarg2(1,2);
00272   strm=getinstream(ctx,n-1,argv[1]);
00273   ch=ckintval(argv[0]);
00274   unreadch(strm,ch);
00275   return(argv[0]);}
00276 
00277 pointer PEEKCH(ctx,n,argv)
00278 register context *ctx;
00279 int n;
00280 pointer argv[];
00281 { pointer strm,eoferrorp=T,eofvalue=NIL;
00282   eusinteger_t result;
00283   ckarg2(0,3);
00284   strm=getinstream(ctx,n,argv[0]);
00285   if (n>=2) eoferrorp=argv[1];
00286   if (n==3) eofvalue=argv[2];
00287   result=readch(strm);
00288   if (result==EOF)
00289     if (eoferrorp==NIL) return(eofvalue);
00290     else error(E_EOF);
00291   unreadch(strm,result);
00292   return(makeint(result));}
00293 
00294 pointer FINOUT(ctx,n,argv)      /*finish-output*/
00295 register context *ctx;
00296 int n;
00297 pointer argv[];
00298 { pointer strm;
00299   strm=getoutstream(ctx,n+1,argv[0]);
00300   flushstream(strm);
00301   return(NIL);}
00302 
00303 pointer WRTBYTE(ctx,n,argv)
00304 register context *ctx;
00305 int n;
00306 pointer *argv;
00307 { register pointer bytes,strm;
00308   ckarg(2);
00309   strm=getoutstream(ctx,n,argv[1]);
00310   bytes=argv[0];
00311   if (islist(bytes)) 
00312     while (islist(bytes)) {
00313       writech(strm,ckintval(ccar(bytes)));
00314       bytes=ccdr(bytes);}
00315   else writech(strm,ckintval(bytes));
00316   return(argv[0]);}      
00317 
00318 pointer WRTWORD(ctx,n,argv)
00319 register context *ctx;
00320 int n;
00321 pointer *argv;
00322 { register pointer bytes,strm;
00323   union {
00324     short s;
00325     char b[2];} buf;
00326   ckarg(2);
00327   strm=getoutstream(ctx,n,argv[1]);
00328   bytes=argv[0];
00329   if (islist(bytes)) 
00330     while (islist(bytes)) {
00331       buf.s=ckintval(ccar(bytes));
00332       writestr(strm,(byte *)buf.b,2);
00333       bytes=ccdr(bytes);}
00334   else {
00335     buf.s=ckintval(bytes);
00336     writestr(strm,(byte *)buf.b,2);}
00337   return(argv[0]);}
00338 
00339 pointer WRTLONG(ctx,n,argv)
00340 register context *ctx;
00341 int n;
00342 pointer *argv;
00343 { register pointer bytes,strm;
00344   union {
00345     int i;
00346     byte b[4];} buf;
00347   ckarg(2);
00348   strm=getoutstream(ctx,n,argv[1]);
00349   bytes=argv[0];
00350   if (islist(bytes)) 
00351     while (islist(bytes)) {
00352       buf.i=bigintval(ccar(bytes));
00353       writestr(strm,buf.b,4);
00354       bytes=ccdr(bytes);}
00355   else {
00356     buf.i=bigintval(bytes);
00357     writestr(strm,buf.b,4);}
00358   return(argv[0]);}
00359 
00360 pointer SETMACROCH(ctx,n,argv)
00361 register context *ctx;
00362 int n;
00363 pointer argv[];
00364 { int ch;
00365   pointer nontermp=NIL,rdtable;
00366   ckarg2(2,4);
00367   if (isstring(argv[0])) ch=argv[0]->c.str.chars[0];
00368   else ch=ckintval(argv[0]);
00369   if (ch<0 || 256<ch) error(E_CHARRANGE);
00370   if (n>=3) nontermp=argv[2];
00371   if (n==4) rdtable=argv[3];
00372   else rdtable=Spevalof(QREADTABLE);
00373   if (!isreadtable(rdtable)) error(E_USER,(pointer)"readtable expected");
00374   pointer_update(rdtable->c.rdtab.macro->c.vec.v[ch],argv[1]);
00375   if (argv[1]==NIL) rdtable->c.rdtab.syntax->c.str.chars[ch]=(byte)chartype[ch];
00376   else if (nontermp==NIL) rdtable->c.rdtab.syntax->c.str.chars[ch]=(int)ch_termmacro;
00377   else rdtable->c.rdtab.syntax->c.str.chars[ch]=(int)ch_nontermacro;
00378   return(T);}  
00379 
00380 pointer GETMACROCH(ctx,n,argv)
00381 register context *ctx;
00382 int n;
00383 pointer argv[];
00384 { pointer rdtable;
00385   ckarg2(1,2);
00386   if (n==2) rdtable=argv[1];
00387   else rdtable=Spevalof(QREADTABLE);
00388   if (!isreadtable(rdtable)) error(E_USER,(pointer)"readtable expected");
00389   return(rdtable->c.rdtab.macro->c.vec.v[max(0,min(255,ckintval(argv[0])))]);}
00390 
00391 pointer SETDISPMACRO(ctx,n,argv)
00392 register context *ctx;
00393 int n;
00394 register pointer argv[];
00395 { int ch;
00396   pointer rdtable,func;
00397   ckarg2(3,4);
00398   if (isstring(argv[1])) ch=argv[1]->c.str.chars[0];
00399   else ch=ckintval(argv[1]);
00400   if (ch<0 || 256<ch) error(E_CHARRANGE);
00401   if (n==4) rdtable=argv[3];
00402   else rdtable=Spevalof(QREADTABLE);
00403   if (!isreadtable(rdtable)) error(E_USER,(pointer)"readtable expected");
00404   pointer_update(rdtable->c.rdtab.dispatch->c.vec.v[ch],/*(pointer (*)())*/argv[2]);
00405   return(T);}
00406 
00407 pointer GETDISPMACRO(ctx,n,argv)
00408 register context *ctx;
00409 int n;
00410 pointer argv[];
00411 { int ch;
00412   pointer rdtable,func;
00413   ckarg2(2,3);
00414   if (isstring(argv[1])) ch=argv[1]->c.str.chars[0];
00415   else ch=ckintval(argv[1]);
00416   if (ch<0 || 256<ch) error(E_CHARRANGE);
00417   if (n==3) rdtable=argv[2];
00418   else rdtable=Spevalof(QREADTABLE);
00419   if (!isreadtable(rdtable)) error(E_USER,(pointer)"readtable expected");
00420   func=rdtable->c.rdtab.dispatch->c.vec.v[ch];
00421   return(func);}
00422 
00423 pointer RESETREADTABLE(ctx,n,argv)
00424 register context *ctx;
00425 int n; /* unused argument */
00426 pointer *argv; /* unused argument */
00427 { initreader(ctx); return(T);}  /* ???? */
00428 
00429 /*****************************************************************/
00430 /*      FORMAT
00431 /*      1986-Nov
00432 /*      T.Matsui
00433 */
00434 
00435 #define nextcch() ((cx>=cmax)?(byte)((eusinteger_t)error(E_FORMATSTRING)):cstr[cx++])
00436 
00437 #define nextfarg() ((fargx>=fargc)?(pointer)error(E_MISMATCHARG):fargv[fargx++])
00438 
00439 /*extern void printnum(context *, pointer, pointer, int, int, int);*/
00440 
00441 pointer XFORMAT(ctx,n,argv)
00442 register context *ctx;
00443 int n;
00444 pointer argv[];
00445 {
00446   register pointer dest,a;
00447   register int i,j,px,l;
00448   int param[10],par;
00449   char buf[256];
00450   eusfloat_t fval;
00451   byte *cstr,cch;
00452   int  cx,cmax;
00453   pointer *fargv, varg;
00454   int fargc,fargx;
00455   int wcount, osf;
00456   numunion nu;
00457   extern double fabs();
00458 
00459   if (n<2) error(E_MISMATCHARG);
00460   dest=argv[0]; a=argv[1];
00461   if (!isstring(a)) error(E_NOSTRING);
00462   cx=0; cstr=a->c.str.chars; cmax=intval(a->c.str.length);
00463   fargv=argv; fargc=n; fargx=2;
00464   
00465   if (dest==NIL) dest=(pointer)mkstream(ctx,K_OUT,makebuffer(64));
00466   else {
00467     if (dest==T) dest=Spevalof(QSTDOUT);
00468     if (isiostream(dest)) dest=dest->c.iostream.out;
00469     if (!isstream(dest)) error(E_STREAM);
00470     if (dest->c.stream.direction!=K_OUT) error(E_IODIRECTION);}
00471   vpush(dest);
00472 
00473   written_count[thr_self()]=0;
00474   while (cx<cmax) {
00475     cch=nextcch();
00476     if (cch=='~') {     /*tilda*/
00477       cch=nextcch();
00478       px=0; param[0]=0; param[1]=1; param[2]=0;
00479       while (isdigit(cch)) {
00480         param[px]=0;
00481         while (isdigit(cch)) {
00482           param[px]=param[px]*10+(cch-'0');
00483           cch=nextcch();}
00484         px++;
00485         if (cch==',') cch=nextcch();}
00486       if (islower(cch)) cch=toupper(cch);
00487       if (cch=='V') {
00488         varg=nextfarg();
00489         param[px++]=ckintval(varg);
00490         cch=nextcch();
00491         if (islower(cch)) cch=toupper(cch);}
00492       switch(cch) {
00493         case 'A':       /*Ascii*/
00494           osf=ctx->slashflag;
00495           ctx->slashflag=1;
00496           written_count[thr_self()]=0;
00497           prinx(ctx,(pointer)nextfarg(),dest);
00498           while (param[0]>written_count[thr_self()]) writech(dest,' ');
00499           ctx->slashflag=osf;
00500           break;
00501         case 'S':       /*S-expression*/
00502           written_count[thr_self()]=0;
00503           prinx(ctx,nextfarg(),dest);
00504           while (param[0]>written_count[thr_self()]) writech(dest,' ');
00505           break;
00506         case 'D':       /*Decimal*/
00507           a=nextfarg();
00508           printnum(ctx,a,dest,10,param[0],param[1]);
00509           break;
00510         case 'X':       /*heXadecimal*/
00511           a=nextfarg();
00512           printnum(ctx,a,dest,16,param[0],param[1]);
00513           break;
00514         case 'O':       /*Octal*/
00515           a=nextfarg();
00516           printnum(ctx,a,dest,8,param[0],param[1]);
00517           break;
00518         case 'C':       /*Character*/
00519           a=nextfarg();
00520           writech(dest,ckintval(a)); break;
00521         case 'F':       /*Fixed-format floating-point*/
00522           a=nextfarg();
00523           fval=ckfltval(a);
00524           sprintf(buf,"%*.*f",param[0],param[1],fval);
00525           writestr(dest,(byte *)buf,strlen(buf)); break;
00526         case 'E':       /*Exponential floating-point*/
00527           a=nextfarg();
00528           fval=ckfltval(a);
00529           sprintf(buf,"%*.*e",param[0],param[1],fval);
00530           writestr(dest,(byte *)buf,strlen(buf)); break;
00531         case 'G':       /*General floating-point*/
00532           a=nextfarg();
00533           fval=ckfltval(a);
00534           if (fval==0.0) writestr(dest,(byte *)"0.0",3);
00535           else {
00536             if (fabs(fval)<0.0001 || fabs(fval)>1.0e+05) {
00537               sprintf(buf,"%*.*e",param[0],param[1],fval); l=strlen(buf);}
00538             else {
00539               sprintf(buf,"%*.*f",param[0],param[1],fval);
00540               l=strlen(buf);
00541               while (l>2 && buf[l-1]=='0' && buf[l-2]!='.') l--;} 
00542             writestr(dest,(byte *)buf,l); }
00543           break;
00544         case '%': case '&':     /*newline*/
00545           for (j=0; j<=param[0]; j++) writech(dest,'\n');
00546           if (argv[0]!=NIL) 
00547             if (flushstream(dest)!=0) error(E_USER,(pointer)"cannot flush stream");
00548           break;
00549         case '~':       /*tilda*/
00550           writech(dest,'~'); break;
00551         case 'T':       /*tabulate*/
00552           writech(dest,9); break;;
00553         default:        break;
00554         }  
00555       }
00556     else writech(dest,cch);}
00557   if (argv[0]==NIL) {
00558     a=makestring((char *)dest->c.stream.buffer->c.str.chars,
00559                  intval(dest->c.stream.count));
00560     vpop();
00561     return(a);}
00562   else { vpop(); return(NIL);}
00563   }
00564 
00565 pointer SIGERROR(ctx,n,argv)
00566 register context *ctx;
00567 register int n;
00568 register pointer *argv;
00569 { register int i;
00570   pointer  msg;
00571   pointer *argb=ctx->vsp;
00572   if (isstring(argv[0])) {
00573      vpush(NIL);
00574      for (i=0; i<n; i++) vpush(argv[i]);
00575      msg=XFORMAT(ctx,n+1,argb);
00576      error(E_USER,(pointer)(msg->c.str.chars),argv[1]);}
00577   else error((enum errorcode)(ckintval(argv[0])),argv[1]);}
00578 
00579 pointer INSTALL_ERRHANDLER(ctx,n,argv)
00580 register context *ctx;
00581 register int n;
00582 register pointer *argv;
00583 { ckarg(1);
00584   ctx->errhandler=argv[0];
00585   return(argv[0]);}
00586 
00587 
00588 void lispio(ctx,mod)
00589 register context *ctx;
00590 pointer mod;
00591 {
00592   pointer_update(Spevalof(PACKAGE),syspkg);
00593   defun(ctx,"OPENFILE",mod,OPENFILE,NULL);
00594   pointer_update(Spevalof(PACKAGE),lisppkg);
00595 /*  defun(ctx,"OPEN",mod,OPEN,NULL); */
00596   defun(ctx,"CLOSE",mod,CLOSE,NULL);
00597   defun(ctx,"READ",mod,READ,NULL);
00598   defun(ctx,"READ-DELIMITED-LIST",mod,READ_DELIMITED_LIST,NULL);
00599   defun(ctx,"READ-LINE",mod,READLINE,NULL);
00600   defun(ctx,"READ-CHAR",mod,READCH,NULL);
00601   defun(ctx,"UNREAD-CHAR",mod,UNREADCH,NULL);
00602   defun(ctx,"PEEK-CHAR",mod,PEEKCH,NULL);
00603   defun(ctx,"PRINT",mod,PRINT,NULL);
00604   defun(ctx,"PRIN1",mod,PRIN1,NULL);
00605   defun(ctx,"PRINC",mod,PRINC,NULL);
00606   defun(ctx,"TERPRI",mod,TERPRI,NULL);
00607   defun(ctx,"PRINT-SIZE",mod,PRNTSIZE,NULL);
00608   defun(ctx,"FINISH-OUTPUT",mod,FINOUT,NULL);
00609   defun(ctx,"WRITE-BYTE",mod,WRTBYTE,NULL);
00610   defun(ctx,"WRITE-WORD",mod,WRTWORD,NULL);
00611   defun(ctx,"WRITE-LONG",mod,WRTLONG,NULL);
00612   defun(ctx,"SET-MACRO-CHARACTER",mod,SETMACROCH,NULL);
00613   defun(ctx,"GET-MACRO-CHARACTER",mod,GETMACROCH,NULL);
00614   defun(ctx,"SET-DISPATCH-MACRO-CHARACTER",mod,SETDISPMACRO,NULL);
00615   defun(ctx,"GET-DISPATCH-MACRO-CHARACTER",mod,GETDISPMACRO,NULL);
00616   defunpkg(ctx,"RESET-READTABLE",mod,RESETREADTABLE,syspkg);
00617   defun(ctx,"FORMAT",mod,XFORMAT,NULL);
00618   defun(ctx,"ERROR",mod,SIGERROR,NULL);
00619   defun(ctx,"INSTALL-ERROR-HANDLER",mod,INSTALL_ERRHANDLER,NULL);
00620   }
00621 


euslisp
Author(s): Toshihiro Matsui
autogenerated on Thu Jun 6 2019 18:05:53