Tar.enc.room: def of bend-kit-tar@0.3.0.0 Import: import bend-kit-tar@0.3.0.0/tar.bend as Tar Lines 677-686 of bend-kit-tar@0.3.0.0/tar.bend: https://jend.leeeet.dev/read.txt?path=bend-kit-tar@0.3.0.0/tar.bend&start_line=677&end_line=686 import Base # Does an entry fit what is left of the U32 length, with room for the end blocks? Every step checks before it subtracts. def enc.room(+ol: U32, +dl: U32, +nl: U32, +long: Bool) -> Bool: +r0 = (4294967295 - ol : U32) +pd = pad(dl) +l = rec.len(nl) +pl = pad(l) +okd = U32.is_le(1536, r0) && (U32.is_le(dl, pd) && U32.is_le(pd, (r0 - 1536 : U32))) +r1 = (r0 - 1536 - pd : U32) +okl = Bool.not(long) || (U32.is_le(nl, 4294967040) && (U32.is_le(l, pl) && (U32.is_le(512, r1) && U32.is_le(pl, (r1 - 512 : U32))))) okd && okl Uses (9): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.and https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.not https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.or https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.is_le https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.sub https://jend.leeeet.dev/definition.txt?path=bend-kit-tar@0.3.0.0/tar.bend&name=pad https://jend.leeeet.dev/definition.txt?path=bend-kit-tar@0.3.0.0/tar.bend&name=rec.len