| if(n < 256 || n > VtMaxLumpSize) { |
| werrstr("bad block size"); |
| vtentrypack(VtEntry *e, uchar *p, int index) |
| p += index * VtEntrySize; |
| depth = e->type&VtTypeDepthMask; |
| flags = (e->flags&~(VtEntryDir|VtEntryDepthShift)); |
| flags |= depth << VtEntryDepthShift; |
| if(e->type - depth == VtEntryDir) |
| memmove(p, e->score, VtScoreSize); |
| assert(p-op == VtEntrySize); |
| vtentryunpack(VtEntry *e, uchar *p, int index) |
| p += index * VtEntrySize; |
| e->type = (e->flags&VtEntryDir) ? VtDirType : VtDataType; |
| e->type += (e->flags & VtEntryDepthMask) >> VtEntryDepthShift; |
| e->flags &= ~(VtEntryDir|VtEntryDepthMask); |
| memmove(e->score, p, VtScoreSize); |
| assert(p-op == VtEntrySize); |
| if(!(e->flags & VtEntryActive)) |
| if(checksize(e->psize) < 0 || checksize(e->dsize) < 0) |