9 if(n < 256 || n > VtMaxLumpSize) {
10 werrstr("bad block size %#ux", n);
17 vtentrypack(VtEntry *e, uchar *p, int index)
24 p += index * VtEntrySize;
33 depth = e->type&VtTypeDepthMask;
34 flags = (e->flags&~(_VtEntryDir|_VtEntryDepthMask));
35 flags |= depth << _VtEntryDepthShift;
36 if(e->type - depth == VtDirType)
42 U48PUT(p, e->size, t32);
44 memmove(p, e->score, VtScoreSize);
47 assert(p-op == VtEntrySize);
51 vtentryunpack(VtEntry *e, uchar *p, int index)
55 p += index * VtEntrySize;
65 e->type = (e->flags&_VtEntryDir) ? VtDirType : VtDataType;
66 e->type += (e->flags & _VtEntryDepthMask) >> _VtEntryDepthShift;
67 e->flags &= ~(_VtEntryDir|_VtEntryDepthMask);
72 memmove(e->score, p, VtScoreSize);
75 assert(p-op == VtEntrySize);
77 if(!(e->flags & VtEntryActive))
81 * Some old vac files use psize==0 and dsize==0 when the
82 * file itself has size 0 or is zeros. Just to make programs not
83 * have to figure out what block sizes of 0 means, rewrite them.
85 if(e->psize == 0 && e->dsize == 0
86 && memcmp(e->score, vtzeroscore, VtScoreSize) == 0){
90 if(checksize(e->psize) < 0 || checksize(e->dsize) < 0)