int check() { int i=0,j=0;char s[MAXL+1]; decod(s,e[begin],f[begin]); while(s[i]!='B') { if(s[i]=='A')j++; i++; } if(j==N-1) return 1; else return 0; }
void gener() { int i,j=0;int x;char y,a[MAXL],b[MAXL]; decod(a,e[begin],f[begin]); //printf("gener a=%s\n",a); while(a[j]!='O') j++; for(i=0;i<2*N-1;i++) { if(a[i]!='O'&& a[i+1]!='O') { strcpy(b,a); b[j]=a[i];b[j+1]=a[i+1];b[i]='O';b[i+1]='O'; encod(b,&x,&y); // printf("gener %d %d\n",x,y); if(!used[x][y]) { e[++end]=x;f[end]=y;used[x][y]=1;D[end]=begin; // printf("e=%d f=%d\n",e[end],f[end]); } } } }
/*----------------------------------------------------------------------------------------------------------*/ void readline_array(FILE *f, double *a, long offset, long ncol, double ndef, short *endoffile){ long i,j,k; char *ch; if(f){ *endoffile=0; i=0; do{ //printf("%ld %ld",offset,i); //stop_execution(); ch = (char *) malloc(sizeof(char)); do{ ch[0]=fgetc(f); //printf("00. %ld i:%ld\n",ch[0],i); //stop_execution(); if(ch[0]==47){ //comment do{ ch[0]=fgetc(f); //printf("0. %ld i:%ld\n",ch[0],i); if(ch[0]==-1) t_error("ERROR: COMMENT NOT CLOSED"); //stop_execution(); }while(ch[0]!=47); } //printf("1. %ld i:%ld\n",ch[0],i); if(i==0 && ch[0]==10) ch[0]=32; if(i==0 && ch[0]==-1) printf("\nWarning: END OF FILE ENCOUNTERED WHILE READING\n"); if(ch[0]<44 || ch[0]>57){ if(ch[0]!=32 && ch[0]!=-1) t_error("ERROR: NOT ADMITTED COMMENTS NOT PROCEDED BY THE CHARACTER '/' OR COMMENTS NOT CLOSED"); } }while(ch[0]<-1 || (ch[0]>-1 && ch[0]<10) || (ch[0]>10 && ch[0]<13) || (ch[0]>13 && ch[0]<42) || ch[0]==47 || ch[0]>57); j=0; if(ch[j]!=44 && ch[j]!=10 && ch[j]!=13 && ch[j]!=-1){ do{ j+=1; ch = (char *)realloc(ch,(j+1)*sizeof(char)); ch[j]=fgetc(f); //printf("2. %ld j:%ld\n",ch[j],j); //stop_execution(); }while(ch[j]!=44 && ch[j]!=10 && ch[j]!=13 && ch[j]!=-1); } if(ch[j]==-1) *endoffile=1; if(i>=offset){ a[i-offset]=decod(ch, j, ndef); //printf("J:%ld a(%ld)=%f",j,i-offset,a[i-offset]); //stop_execution(); } i++; }while(i<ncol+offset && (ch[j]!=10 && ch[j]!=13 && ch[j]!=-1)); if(ch[j]==44){ free(ch); ch = (char *) malloc(sizeof(char)); do{ ch[0]=fgetc(f); //printf("...%ld",ch[0]); //stop_execution(); }while(ch[0]!=10 && ch[j]!=13 && ch[0]!=-1); if(ch[j]==-1) *endoffile=1; }else{ for(k=i;k<=ncol+offset-1;k++){ a[k-offset]=ndef; //printf("==a(%ld)=%f",k-offset,a[k-offset]); //stop_execution(); } } free(ch); }else{ t_error("ERROR: ATTEMPTING TO READ A CLOSED FILE"); } }
bool wxGIFHandler::DoCanRead( wxInputStream& stream ) { wxGIFDecoder decod(&stream); return decod.CanRead(); }