9 if(n < 256 || n > VtMaxLumpSize) {
10 werrstr("bad block size");
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))
80 if(checksize(e->psize) < 0 || checksize(e->dsize) < 0)