Lines Matching refs:oldsize
53 static off_t matchlen(u_char *old, off_t oldsize, u_char *new_buf,
57 for(i=0;(i<oldsize)&&(i<newsize);i++)
63 static off_t search(saidx_t *I,u_char *old,off_t oldsize,
69 x=matchlen(old+I[st],oldsize-I[st],new_buf,newsize);
70 y=matchlen(old+I[en],oldsize-I[en],new_buf,newsize);
82 if(memcmp(old+I[x],new_buf,std::min(oldsize-I[x],newsize))<=0) {
83 return search(I,old,oldsize,new_buf,newsize,x,en,pos);
85 return search(I,old,oldsize,new_buf,newsize,st,x,pos);
111 off_t oldsize,newsize;
127 /* Allocate oldsize+1 bytes instead of oldsize bytes to ensure
130 ((oldsize=lseek(fd,0,SEEK_END))==-1) ||
131 ((old_buf=static_cast<u_char*>(malloc(oldsize+1)))==NULL) ||
133 (read(fd,old_buf,oldsize)!=oldsize) ||
136 if((I=static_cast<saidx_t*>(malloc((oldsize+1)*sizeof(saidx_t))))==NULL)
139 if(divsufsort(old_buf, I, oldsize)) err(1, "divsufsort");
195 len=search(I,old_buf,oldsize,new_buf+scan,newsize-scan,
196 0,oldsize,&pos);
199 if((scsc+lastoffset<oldsize) &&
206 if((scan+lastoffset<oldsize) &&
224 for(i=0;(lastscan+i<scan)&&(lastpos+i<oldsize);) {