newstr.c
Go to the documentation of this file.
00001 #include "/tmp_mnt/net/etlic2/usr/local/eus/c/eus.h"
00002 #include "newstr.h"
00003 extern pointer loadglobal(),storeglobal();
00004 static pointer module,*qv,codevec,quotevec;
00005 
00006 
00007 /*newstr1*/
00008 static pointer F50(n,argv,env)
00009 register int n; register pointer argv[]; pointer env;
00010 { register pointer *local=vsp, w, *fqv=qv;
00011         if (n!=1) maerror();
00012         local[0]= argv[0];
00013         vsp=local+1;
00014         w=(pointer)LENGTH(1,local+0); /*length*/
00015         local[0]= w;
00016         local[1]= makeint(0);
00017         local[2]= makeint(0);
00018         local[3]= local[0];
00019         vsp=local+4;
00020         w=fcall(1,local+3,fqv[0]); /*make-string*/
00021         local[3]= w;
00022 whl52:
00023         local[4]= local[1];
00024         local[5]= (pointer)((int)(local[0])-4);
00025         vsp=local+6;
00026         w=(pointer)LESSP(2,local+4); /*<*/
00027         if (w==NIL) goto whx53;
00028         local[4]= makeint(94);
00029         local[5]= argv[0];
00030         { register int i=intval(local[1]);
00031           w=makeint(local[5]->c.str.chars[i]);}
00032         local[5]= w;
00033         vsp=local+6;
00034         w=(pointer)NUMEQUAL(2,local+4); /*=*/
00035         if (w==NIL) goto con56;
00036         local[4]= makeint(73);
00037         local[5]= argv[0];
00038         { register int i=intval((pointer)((int)(local[1])+4));
00039           w=makeint(local[5]->c.str.chars[i]);}
00040         local[5]= w;
00041         vsp=local+6;
00042         w=(pointer)NUMEQUAL(2,local+4); /*=*/
00043         if (w==NIL) goto con56;
00044         local[4]= local[3];
00045         local[5]= local[2];
00046         w = makeint(9);
00047         { register int i; register pointer v;
00048           i=intval(local[5]); v=local[4];
00049           v->c.str.chars[i]=intval(w);}
00050         local[1] = (pointer)((int)(local[1])+4);
00051         local[4]= local[1];
00052         goto con55;
00053 con56:
00054         local[4]= local[3];
00055         local[5]= local[2];
00056         local[6]= argv[0];
00057         { register int i=intval(local[1]);
00058           w=makeint(local[6]->c.str.chars[i]);}
00059         { register int i; register pointer v;
00060           i=intval(local[5]); v=local[4];
00061           v->c.str.chars[i]=intval(w);}
00062         local[4]= w;
00063         goto con55;
00064 con57:
00065         local[4]= NIL;
00066 con55:
00067         local[1] = (pointer)((int)(local[1])+4);
00068         local[2] = (pointer)((int)(local[2])+4);
00069         goto whl52;
00070 whx53:
00071         local[4]= NIL;
00072 blk54:
00073         local[4]= local[3];
00074         local[5]= makeint(0);
00075         local[6]= local[2];
00076         vsp=local+7;
00077         w=(pointer)SUBSEQ(3,local+4); /*subseq*/
00078         local[0]= w;
00079 blk51:
00080         vsp=local; return(local[0]);}
00081 
00082 /*newstr*/
00083 static pointer F58(n,argv,env)
00084 register int n; register pointer argv[]; pointer env;
00085 { register pointer *local=vsp, w, *fqv=qv;
00086         if (n!=1) maerror();
00087         w = argv[0];
00088         if (!isstring(w)) goto if60;
00089         local[0]= argv[0];
00090         vsp=local+1;
00091         w=(pointer)F50(1,local+0); /*newstr1*/
00092         local[0]= w;
00093         goto if61;
00094 if60:
00095         w = argv[0];
00096         if (!iscons(w)) goto if62;
00097         local[0]= xcar(argv[0]);
00098         vsp=local+1;
00099         w=(pointer)F58(1,local+0); /*newstr*/
00100         local[0]= w;
00101         local[1]= xcdr(argv[0]);
00102         vsp=local+2;
00103         w=(pointer)F58(1,local+1); /*newstr*/
00104         vsp=local+1;
00105         local[0]= cons(local[0],w);
00106         goto if63;
00107 if62:
00108         local[0]= argv[0];
00109 if63:
00110 if61:
00111         w = local[0];
00112         local[0]= w;
00113 blk59:
00114         vsp=local; return(local[0]);}
00115 
00116 /*newstrfile*/
00117 static pointer F64(n,argv,env)
00118 register int n; register pointer argv[]; pointer env;
00119 { register pointer *local=vsp, w, *fqv=qv;
00120         if (n!=2) maerror();
00121         local[0]= NIL;
00122         vsp=local+1;
00123         w=(pointer)GENSYM(0,local+1); /*gensym*/
00124         local[1]= w;
00125         local[2]= argv[1];
00126         local[3]= fqv[1];
00127         local[4]= fqv[2];
00128         vsp=local+5;
00129         w=fcall(3,local+2,fqv[3]); /*open*/
00130         local[2]= w;
00131         vsp=local+3;
00132         w = makeclosure(codevec,quotevec,uwp66,argv,local);
00133         local[3]=(pointer)(protfp); local[4]=w; protfp=(struct protectframe *)(local+3);
00134         local[5]= argv[0];
00135         vsp=local+6;
00136         w=fcall(1,local+5,fqv[3]); /*open*/
00137         local[5]= w;
00138         vsp=local+6;
00139         w = makeclosure(codevec,quotevec,uwp67,argv,local);
00140         local[6]=(pointer)(protfp); local[7]=w; protfp=(struct protectframe *)(local+6);
00141 tag70:
00142         local[8]= local[5];
00143         local[9]= NIL;
00144         local[10]= local[1];
00145         vsp=local+11;
00146         w=(pointer)READ(3,local+8); /*read*/
00147         local[0] = w;
00148         local[8]= local[0];
00149         if (local[1]!=local[8]) goto if71;
00150         w = NIL;
00151         vsp=local+8;
00152         unwind(local+0);
00153         local[0]=w;
00154         goto blk65;
00155         goto if72;
00156 if71:
00157         local[8]= NIL;
00158 if72:
00159         local[8]= local[0];
00160         vsp=local+9;
00161         w=(pointer)F58(1,local+8); /*newstr*/
00162         local[8]= w;
00163         local[9]= local[2];
00164         vsp=local+10;
00165         w=(pointer)PRINT(2,local+8); /*print*/
00166         vsp=local+8;
00167         goto tag70;
00168         local[8]= NIL;
00169 blk69:
00170         w = local[8];
00171         vsp=local+8;
00172         uwp67(0,local+8,protfp->cleaner);
00173         protfp=protfp->protlink;
00174         vsp=local+5;
00175         uwp66(0,local+5,protfp->cleaner);
00176         protfp=protfp->protlink;
00177         local[0]= w;
00178 blk65:
00179         vsp=local; return(local[0]);}
00180 
00181 /*closure or cleaner*/
00182 static pointer uwp66(n,argv,env)
00183 register int n; register pointer argv[]; pointer env;
00184 { register pointer *local=vsp, w, *fqv=qv;
00185         local[0]= env->c.clo.env2[2];
00186         vsp=local+1;
00187         w=(pointer)CLOSE(1,local+0); /*close*/
00188         local[0]= w;
00189         vsp=local; return(local[0]);}
00190 
00191 /*closure or cleaner*/
00192 static pointer uwp67(n,argv,env)
00193 register int n; register pointer argv[]; pointer env;
00194 { register pointer *local=vsp, w, *fqv=qv;
00195         local[0]= env->c.clo.env2[5];
00196         vsp=local+1;
00197         w=(pointer)CLOSE(1,local+0); /*close*/
00198         local[0]= w;
00199         vsp=local; return(local[0]);}
00200 
00201 /*allnewstrfile*/
00202 static pointer F73(n,argv,env)
00203 register int n; register pointer argv[]; pointer env;
00204 { register pointer *local=vsp, w, *fqv=qv;
00205         if (n!=1) maerror();
00206         local[0]= NIL;
00207         local[1]= argv[0];
00208         vsp=local+2;
00209         w=fcall(1,local+1,fqv[4]); /*directory*/
00210         local[1]= w;
00211 whl76:
00212         if (local[1]==NIL) goto whx77;
00213         local[2]= xcar(local[1]);
00214         local[1] = xcdr(local[1]);
00215         w = local[2];
00216         local[0] = w;
00217         local[2]= fqv[5];
00218         local[3]= local[0];
00219         vsp=local+4;
00220         w=fcall(2,local+2,fqv[6]); /*substringp*/
00221         if (w==NIL) goto if80;
00222         local[2]= fqv[7];
00223         vsp=local+3;
00224         w=(pointer)UNLINK(1,local+2); /*unix:unlink*/
00225         local[2]= local[0];
00226         local[3]= fqv[8];
00227         vsp=local+4;
00228         w=(pointer)F64(2,local+2); /*newstrfile*/
00229         local[2]= local[0];
00230         vsp=local+3;
00231         w=(pointer)UNLINK(1,local+2); /*unix:unlink*/
00232         local[2]= NIL;
00233         local[3]= fqv[9];
00234         local[4]= local[0];
00235         vsp=local+5;
00236         w=(pointer)XFORMAT(3,local+2); /*format*/
00237         local[2]= w;
00238         vsp=local+3;
00239         w=(pointer)SYSTEM(1,local+2); /*unix:system*/
00240         local[2]= w;
00241         goto if81;
00242 if80:
00243         local[2]= NIL;
00244 if81:
00245         goto whl76;
00246 whx77:
00247         local[2]= NIL;
00248 blk78:
00249         w = NIL;
00250         local[0]= w;
00251 blk74:
00252         vsp=local; return(local[0]);}
00253 
00254 /* initializers*/
00255 pointer eusmain(mod)
00256 pointer mod;
00257 { register pointer *local=vsp, w, *fqv; pointer *argv;
00258   module=mod; quotevec=mod->c.code.quotevec;
00259   codevec=mod->c.code.codevec;
00260   fqv=qv=quotevec->c.vec.v;
00261         vsp=local+0;
00262         compfun(fqv[10],mod,F50,fqv[11]);
00263         vsp=local+0;
00264         compfun(fqv[12],mod,F58,fqv[11]);
00265         vsp=local+0;
00266         compfun(fqv[13],mod,F64,fqv[11]);
00267         vsp=local+0;
00268         compfun(fqv[14],mod,F73,fqv[11]);
00269         local[0]= NIL;
00270         vsp=local; return(local[0]);}


euslisp
Author(s): Toshihiro Matsui
autogenerated on Thu Mar 9 2017 04:57:50