def one.cap
bend-kit-archive@0.5.1.0 · archive.bend:326
import bend-kit-archive@0.5.1.0/archive.bend as Archive
import Base
import bend-kit-bytes@0.3.3.0/bytes.bend as Bytes
326
327def one.cap(over: Bool, input: Bytes.Bytes, +hd: Header, +left: U32, acc: List<&1, Entry>) -> IO(Bytes.Bytes & Result<&1, &1, U32 & String, U32 & List<&1, Entry>>):
328 match over:
329 case True{}:
330 IO.pure(Bytes.Bytes & Result<&1, &1, U32 & String, U32 & List<&1, Entry>>, (input, Fail{(27, "archive output is larger than max")}))
331 case False{}:
332 Header{+name, +nlen, +method, +crc, +packed, +size, +data} = hd
333 one.name(Bytes.slice(input, name, nlen), method, crc, packed, size, data, left, acc)