Lines Matching refs:blksz
83 ssize_t blksz; /* block size for signatures */
170 static int pfbuild(Pffile_t* pf, ssize_t blksz)
172 static int pfbuild(pf, blksz)
174 ssize_t blksz;
188 for(endo = (obj = pf->obj) + (size_t)(pf->sfsz/blksz); obj < endo; ++obj)
189 { if(!(dt = sfreserve(pf->sf, blksz, 0)) || sfvalue(pf->sf) < blksz)
191 if((k = pfhash(dt, blksz)) == PF_HUGE)
205 static ssize_t pfsegment(Pffile_t* pf, ssize_t ld, ssize_t lm, ssize_t mn, ssize_t blksz)
207 static ssize_t pfsegment(pf, ld, lm, mn, blksz)
212 ssize_t blksz;
219 lmt = ((Sfoff_t)lm)*blksz; rmt = lmt + mn;
223 lmt <= (seg->rmt+PFMERGE(blksz)) && rmt >= (seg->lmt-PFMERGE(blksz)) )
233 if(PFSMALL(mn,blksz)) /* too small to make a segment */
252 static ssize_t pfparse(Pffile_t* pf, Vchash_t* dt, ssize_t n, Sfoff_t pos, ssize_t blksz)
254 static ssize_t pfparse(pf, dt, n, pos, blksz)
259 ssize_t blksz;
270 for(d = 0, n -= (blksz-1); d < n; d = dd+mn)
277 for(; k < n && i < pf->maxo; k += blksz, i += 1)
284 if((k = (k-dd) - ucnt*blksz) > mn)
295 else if((k = pfsegment(pf, dd, mm, mn, blksz)) < 0)
305 static int pfwindow(Pffile_t* pf, Vcwmatch_t* wm, ssize_t blksz)
307 static int pfwindow(pf, wm, blksz)
310 ssize_t blksz;
345 if((seg->rmt += sz) > pf->maxo*blksz)
346 seg->rmt = ((Sfoff_t)pf->maxo)*blksz;
387 if((pf = pfx->srcf) && ((Sfoff_t)dtsz >= pf->sfsz/2 || dtsz < pfx->blksz) )
389 if(dtsz < pfx->blksz) /* small data, use matching window */
408 { if((rv = pfwindow(pf, wm, pfx->blksz)) < 0)
415 pf->maxo = here/pfx->blksz; /* can now match to here */
426 endd = (dt = (Vcchar_t*)data) + dtsz - (pfx->blksz-1);
427 k = pfhash(dt, pfx->blksz);
430 { k = pfnext(dt, pfx->blksz, k, pfx->coef);
432 /**/DEBUG_ASSERT(k == pfhash(dt, pfx->blksz));
437 if((pf ? pfparse(pf, pfx->key, dtsz, here, pfx->blksz) : 0) <= 0 )
440 pfparse(pf, pfx->key, dtsz, here, pfx->blksz) > 0 )
448 if((rv = pfwindow(pf, wm, pfx->blksz)) < 0)
461 else if(!pfx->tarf || wm->msize <= 2*pfx->blksz)
468 if(pfparse(pfx->tarf, key, dtsz, here, pfx->blksz) > 0 )
515 pfx->blksz = sz; /**/ DEBUG_PRINT(2,"blksz=%d\n",pfx->blksz);
522 { if(!(pfx->srcf = pfopen(vcw->disc->srcf, pfx->blksz, 1)) )
524 if(pfx->blksz > 0)
525 { if(pfbuild(pfx->srcf, pfx->blksz) < 0)
527 pfx->srcf->maxo = pfx->srcf->sfsz/pfx->blksz;
531 if(tarsz > 0 && pfx->blksz > 0)
532 { if(!(pfx->tarf = pfopen(vcw->disc->tarf, pfx->blksz, 0)) )
534 if(pfbuild(pfx->tarf, pfx->blksz) < 0)