Lines Matching refs:oldsize
121 static void qsufsort(off_t *I,off_t *V,u_char *old,off_t oldsize) in qsufsort() argument
127 for(i=0;i<oldsize;i++) buckets[old[i]]++; in qsufsort()
132 for(i=0;i<oldsize;i++) I[++buckets[old[i]]]=i; in qsufsort()
133 I[0]=oldsize; in qsufsort()
134 for(i=0;i<oldsize;i++) V[i]=buckets[old[i]]; in qsufsort()
135 V[oldsize]=0; in qsufsort()
139 for(h=1;I[0]!=-(oldsize+1);h+=h) { in qsufsort()
141 for(i=0;i<oldsize+1;) { in qsufsort()
156 for(i=0;i<oldsize+1;i++) I[V[i]]=i; in qsufsort()
159 static off_t matchlen(u_char *olddata,off_t oldsize,u_char *newdata,off_t newsize) in matchlen() argument
163 for(i=0;(i<oldsize)&&(i<newsize);i++) in matchlen()
169 static off_t search(off_t *I,u_char *old,off_t oldsize, in search() argument
175 x=matchlen(old+I[st],oldsize-I[st],newdata,newsize); in search()
176 y=matchlen(old+I[en],oldsize-I[en],newdata,newsize); in search()
188 if(memcmp(old+I[x],newdata,MIN(oldsize-I[x],newsize))<0) { in search()
189 return search(I,old,oldsize,newdata,newsize,x,en,pos); in search()
191 return search(I,old,oldsize,newdata,newsize,st,x,pos); in search()
224 int bsdiff(u_char* old, off_t oldsize, off_t** IP, u_char* newdata, off_t newsize, in bsdiff() argument
245 *IP = reinterpret_cast<off_t*>(malloc((oldsize+1) * sizeof(off_t))); in bsdiff()
246 V = reinterpret_cast<off_t*>(malloc((oldsize+1) * sizeof(off_t))); in bsdiff()
247 qsufsort(*IP, V, old, oldsize); in bsdiff()
287 len=search(I,old,oldsize,newdata+scan,newsize-scan, in bsdiff()
288 0,oldsize,&pos); in bsdiff()
291 if((scsc+lastoffset<oldsize) && in bsdiff()
298 if((scan+lastoffset<oldsize) && in bsdiff()
305 for(i=0;(lastscan+i<scan)&&(lastpos+i<oldsize);) { in bsdiff()