bend-kit-zlib Releases (15): 0.5.1.0 0x476832d338c78d06c0da54e8958c113f indexed https://jend.leeeet.dev/files.txt?path=bend-kit-zlib@0.5.1.0 0.5.0.2 0x509aee542b17a8d931c76f13570d49f9 unindexed https://jend.leeeet.dev/files.txt?path=bend-kit-zlib@0.5.0.2 0.5.0.1 0xa9835c8fbe54573067f3b8d8bdaa8741 unindexed https://jend.leeeet.dev/files.txt?path=bend-kit-zlib@0.5.0.1 0.5.0.0 0xa3cff66158b5b1820363721823ad9877 unindexed https://jend.leeeet.dev/files.txt?path=bend-kit-zlib@0.5.0.0 0.4.0.1 0xe5d0a585cffc5fcbf26663e9a92c6b76 unindexed https://jend.leeeet.dev/files.txt?path=bend-kit-zlib@0.4.0.1 0.4.0.0 0xe3a38695c12f855a9b789f2ccc68c54d unindexed https://jend.leeeet.dev/files.txt?path=bend-kit-zlib@0.4.0.0 0.3.0.0 0x04a64175142f737348703d0d63c51493 unindexed https://jend.leeeet.dev/files.txt?path=bend-kit-zlib@0.3.0.0 0.2.0.1 0xcc180113489c489d3f5cdc852e6806f9 unindexed https://jend.leeeet.dev/files.txt?path=bend-kit-zlib@0.2.0.1 0.2.0.0 0xaca98ab7f724003ea421c18792cafe52 unindexed https://jend.leeeet.dev/files.txt?path=bend-kit-zlib@0.2.0.0 0.1.6.0 0x0b9edfd8f6cd7a13ede14e4494345f6f unindexed https://jend.leeeet.dev/files.txt?path=bend-kit-zlib@0.1.6.0 0.1.5.0 0x58bd522479d133cfe1b2c4451fc1a28f unindexed https://jend.leeeet.dev/files.txt?path=bend-kit-zlib@0.1.5.0 0.1.4.0 0x75c2684a397346a1303cfc2abde9df46 unindexed https://jend.leeeet.dev/files.txt?path=bend-kit-zlib@0.1.4.0 0.1.3.0 0x9d101c075b333e2b07242347f7c35b1c unindexed https://jend.leeeet.dev/files.txt?path=bend-kit-zlib@0.1.3.0 0.1.2.0 0xb9f9c651eeabd1f0640295ef9e84caad unindexed https://jend.leeeet.dev/files.txt?path=bend-kit-zlib@0.1.2.0 0.1.1.0 0x7ddf89f328febf5475ed450b64226ef2 unindexed https://jend.leeeet.dev/files.txt?path=bend-kit-zlib@0.1.1.0 Definitions (196, 1 to 100 shown): Zlib.bits (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=bits) def bits(+n: U32) -> Nat: Zlib.Br (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=Br) # Bit reader. bad: a read ran past the end, so the input was cut short. type Br is Type: Br{r: Bits.Reader, bad: Bool} Zlib.br.got (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=br.got) def br.got(+bad: Bool, rm: Bits.Reader & Maybe<&2, U32>) -> Br & U32: Zlib.br.take (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=br.take) def br.take(b: Br, +n: U32) -> Br & U32: Zlib.br.sym.got (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=br.sym.got) # No code: 9999, never a symbol. def br.sym.got(+bad: Bool, r: Bits.Huff & Bits.Reader & Maybe<&2, U32>) -> Bits.Huff & Br & U32: Zlib.br.sym (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=br.sym) def br.sym(h: Bits.Huff, b: Br) -> Bits.Huff & Br & U32: Zlib.br.align (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=br.align) # RFC 1951 §3.2.4: a stored block starts on a byte boundary. def br.align(b: Br) -> Br: Zlib.nth (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=nth) def nth(xs: List<&2, U32>, +i: U32) -> U32: Zlib.rep (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=rep) def rep(k: Nat, +v: U32, acc: List<&2, U32>) -> List<&2, U32>: Zlib.take.n (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=take.n) def take.n(k: Nat, xs: List<&2, U32>) -> List<&2, U32>: Zlib.drop.n (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=drop.n) def drop.n(k: Nat, xs: List<&2, U32>) -> List<&2, U32>: Zlib.len.base (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=len.base) # RFC 1951 §3.2.5 def len.base() -> List<&2, U32>: Zlib.len.extra (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=len.extra) def len.extra() -> List<&2, U32>: Zlib.dist.base (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=dist.base) def dist.base() -> List<&2, U32>: Zlib.dist.extra (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=dist.extra) def dist.extra() -> List<&2, U32>: Zlib.fixed.lit (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=fixed.lit) # RFC 1951 §3.2.6 def fixed.lit() -> Maybe<&1, Bits.Huff>: Zlib.fixed.dist (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=fixed.dist) def fixed.dist() -> Maybe<&1, Bits.Huff>: Zlib.Out (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=Out) # Output: 2^dep words of packed bytes, n of them written. Matches copy from the output itself. type Out is Type: Out{buf: Array, dep: U32, n: U32} Zlib.out.fits (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=out.fits) def out.fits(+dep: U32, +want: U32) -> Bool: Zlib.out.dep (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=out.dep) def out.dep(f: Nat, fits: Bool, +dep: U32, +want: U32) -> U32: Zlib.out.grow (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=out.grow) def out.grow(fits: Bool, o: Out, +want: U32) -> Out: Zlib.out.room (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=out.room) # The buffer doubles until k more bytes fit, so output is O(total), and it ends as the # fewest 2^dep words that hold n, as Bytes expects. def out.room(o: Out, +k: U32) -> Out: Zlib.out.put (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=out.put) def out.put(o: Out, +c: U32) -> Out: Zlib.out.size (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=out.size) def out.size(o: Out) -> Out & U32: Zlib.out.bytes (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=out.bytes) def out.bytes(o: Out) -> Bytes.Bytes: Zlib.Mo (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=Mo) type Mo is Type: MoHead{} MoCodes{lit: Bits.Huff, dist: Bits.Huff} MoDone{} MoBad{} Zlib.Is (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=Is) type Is is Type: Is{br: Br, o: Out, mode: Mo, last: Bool} Zlib.inf.next (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=inf.next) def inf.next(last: Bool) -> Mo: Zlib.inf.bad (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=inf.bad) def inf.bad(b: Br, o: Out) -> Is: Zlib.sb.put (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=sb.put) # Stored block (§3.2.4): LEN, then NLEN (its complement), then LEN raw bytes. def sb.put(bv: Br & U32, o: Out) -> Br & Out: Zlib.sb.go (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=sb.go) def sb.go(k: Nat, st: Br & Out) -> Br & Out: Zlib.sb.done (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=sb.done) def sb.done(st: Br & Out, +last: Bool) -> Is: Zlib.sb.ok (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=sb.ok) def sb.ok(ok: Bool, b: Br, +len: U32, o: Out, +last: Bool) -> Is: Zlib.sb.nlen (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=sb.nlen) def sb.nlen(bv: Br & U32, +len: U32, o: Out, +last: Bool) -> Is: Zlib.sb.len (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=sb.len) def sb.len(bv: Br & U32, o: Out, +last: Bool) -> Is: Zlib.inf.stored (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=inf.stored) def inf.stored(b: Br, o: Out, +last: Bool) -> Is: Zlib.cl.slot (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=cl.slot) # Dynamic block (§3.2.7): code lengths for the code-length code, then the lengths themselves. # cl.slot[i]: where symbol i's length sits in the order the stream sends them. def cl.slot() -> List<&2, U32>: Zlib.cl.place (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=cl.place) def cl.place(xs: List<&2, U32>, +vals: List<&2, U32>) -> List<&2, U32>: Zlib.cl.push (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=cl.push) def cl.push(bv: Br & U32, acc: List<&2, U32>) -> Br & List<&2, U32>: Zlib.cl.one (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=cl.one) def cl.one(st: Br & List<&2, U32>) -> Br & List<&2, U32>: Zlib.cl.read (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=cl.read) def cl.read(k: Nat, st: Br & List<&2, U32>) -> Br & List<&2, U32>: Zlib.Cd (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=Cd) # The code-length code, lengths so far (reversed), how many, the last one (for code 16), and whether it went wrong. type Cd is Type: Cd{h: Bits.Huff, br: Br, acc: List<&2, U32>, n: U32, prev: U32, bad: Bool} Zlib.cd.fill (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=cd.fill) def cd.fill(over: Bool, h: Bits.Huff, b: Br, acc: List<&2, U32>, +n: U32, +v: U32, +cnt: U32) -> Cd: Zlib.cd.rep (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=cd.rep) def cd.rep(h: Bits.Huff, bv: Br & U32, +v: U32, +base: U32, acc: List<&2, U32>, +n: U32, +total: U32) -> Cd: Zlib.cd.prev (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=cd.prev) def cd.prev(ok: Bool, h: Bits.Huff, b: Br, acc: List<&2, U32>, +n: U32, +prev: U32, +total: U32) -> Cd: Zlib.cd.z18 (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=cd.z18) def cd.z18(ok: Bool, h: Bits.Huff, b: Br, acc: List<&2, U32>, +n: U32, +total: U32) -> Cd: Zlib.cd.z17 (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=cd.z17) def cd.z17(ok: Bool, h: Bits.Huff, b: Br, acc: List<&2, U32>, +n: U32, +s: U32, +total: U32) -> Cd: Zlib.cd.c16 (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=cd.c16) def cd.c16(ok: Bool, h: Bits.Huff, b: Br, acc: List<&2, U32>, +n: U32, +prev: U32, +s: U32, +total: U32) -> Cd: Zlib.cd.lit (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=cd.lit) def cd.lit(ok: Bool, h: Bits.Huff, b: Br, acc: List<&2, U32>, +n: U32, +prev: U32, +s: U32, +total: U32) -> Cd: Zlib.cd.sym.at (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=cd.sym.at) # A + binder in a nested tuple does not check (bendlang/bend#1077), so a helper takes it. def cd.sym.at(h: Bits.Huff, b: Br, +s: U32, acc: List<&2, U32>, +n: U32, +prev: U32, +total: U32) -> Cd: Zlib.cd.sym (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=cd.sym) def cd.sym(r: Bits.Huff & Br & U32, acc: List<&2, U32>, +n: U32, +prev: U32, +total: U32) -> Cd: Zlib.cd.step (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=cd.step) def cd.step(stop: Bool, h: Bits.Huff, b: Br, acc: List<&2, U32>, +n: U32, +prev: U32, +bad: Bool, +total: U32) -> Cd: Zlib.cd.go (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=cd.go) # Each step adds at least one length, so total steps suffice. def cd.go(k: Nat, +total: U32, st: Cd) -> Cd: Zlib.dyn.dist (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=dyn.dist) def dyn.dist(lit: Bits.Huff, m: Maybe<&1, Bits.Huff>) -> Mo: Zlib.dyn.mo (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=dyn.mo) def dyn.mo(l: Maybe<&1, Bits.Huff>, d: Maybe<&1, Bits.Huff>) -> Mo: Zlib.dyn.tables (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=dyn.tables) def dyn.tables(bad: Bool, b: Br, +lens: List<&2, U32>, +hlit: U32) -> Br & Mo: Zlib.dyn.done (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=dyn.done) def dyn.done(st: Cd, +hlit: U32, +total: U32) -> Br & Mo: Zlib.dyn.cl (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=dyn.cl) def dyn.cl(m: Maybe<&1, Bits.Huff>, b: Br, +hlit: U32, +total: U32) -> Br & Mo: Zlib.dyn.lens (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=dyn.lens) def dyn.lens(st: Br & List<&2, U32>, +hlit: U32, +hdist: U32) -> Br & Mo: Zlib.dyn.clen (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=dyn.clen) def dyn.clen(bv: Br & U32, +hlit: U32, +hdist: U32) -> Br & Mo: Zlib.dyn.hdist (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=dyn.hdist) def dyn.hdist(bv: Br & U32, +hlit: U32) -> Br & Mo: Zlib.dyn.hlit (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=dyn.hlit) def dyn.hlit(bv: Br & U32) -> Br & Mo: Zlib.dyn.read (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=dyn.read) def dyn.read(b: Br) -> Br & Mo: Zlib.cp.of (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=cp.of) # A match copies len bytes from d back in the output, one at a time, so it may overlap itself. # ponytail: byte-at-a-time copy; use Bytes.copy when d >= len if long matches dominate. def cp.of(+dep: U32, +n: U32, r: Array & U32) -> Out: Zlib.cp.one (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=cp.one) def cp.one(+d: U32, o: Out) -> Out: Zlib.cp.go (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=cp.go) def cp.go(k: Nat, +d: U32, o: Out) -> Out: Zlib.inf.far (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=inf.far) # RFC 1951 §3.2.5: a distance may not reach before the first byte out. def inf.far(ok: Bool, lit: Bits.Huff, dist: Bits.Huff, b: Br, +len: U32, +d: U32, o: Out, +last: Bool) -> Is: Zlib.inf.dn (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=inf.dn) def inf.dn(lit: Bits.Huff, dist: Bits.Huff, b: Br, +len: U32, +d: U32, r: Out & U32, +last: Bool) -> Is: Zlib.inf.dx (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=inf.dx) def inf.dx(bv: Br & U32, +db: U32, +len: U32, lit: Bits.Huff, dist: Bits.Huff, o: Out, +last: Bool) -> Is: Zlib.inf.ds (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=inf.ds) def inf.ds(ok: Bool, lit: Bits.Huff, dist: Bits.Huff, b: Br, +ds: U32, +len: U32, o: Out, +last: Bool) -> Is: Zlib.inf.d.at (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=inf.d.at) # A + binder in a nested tuple does not check (bendlang/bend#1077), so a helper takes it. def inf.d.at(dist: Bits.Huff, b: Br, +ds: U32, +len: U32, lit: Bits.Huff, o: Out, +last: Bool) -> Is: Zlib.inf.d (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=inf.d) def inf.d(r: Bits.Huff & Br & U32, +len: U32, lit: Bits.Huff, o: Out, +last: Bool) -> Is: Zlib.inf.lx (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=inf.lx) def inf.lx(bv: Br & U32, +lb: U32, lit: Bits.Huff, dist: Bits.Huff, o: Out, +last: Bool) -> Is: Zlib.inf.ls (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=inf.ls) def inf.ls(ok: Bool, lit: Bits.Huff, dist: Bits.Huff, b: Br, +s: U32, o: Out, +last: Bool) -> Is: Zlib.inf.end (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=inf.end) def inf.end(eob: Bool, lit: Bits.Huff, dist: Bits.Huff, b: Br, +s: U32, o: Out, +last: Bool) -> Is: Zlib.inf.lit (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=inf.lit) def inf.lit(ok: Bool, lit: Bits.Huff, dist: Bits.Huff, b: Br, +s: U32, o: Out, +last: Bool) -> Is: Zlib.inf.sym.at (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=inf.sym.at) # A + binder in a nested tuple does not check (bendlang/bend#1077), so a helper takes it. def inf.sym.at(lit: Bits.Huff, b: Br, +s: U32, dist: Bits.Huff, o: Out, +last: Bool) -> Is: Zlib.inf.sym (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=inf.sym) def inf.sym(r: Bits.Huff & Br & U32, dist: Bits.Huff, o: Out, +last: Bool) -> Is: Zlib.inf.dyn (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=inf.dyn) def inf.dyn(bm: Br & Mo, o: Out, +last: Bool) -> Is: Zlib.inf.t2 (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=inf.t2) def inf.t2(is2: Bool, b: Br, o: Out, +last: Bool) -> Is: Zlib.inf.t1 (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=inf.t1) def inf.t1(is1: Bool, b: Br, o: Out, +last: Bool, +t: U32) -> Is: Zlib.inf.t0 (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=inf.t0) def inf.t0(is0: Bool, b: Br, o: Out, +last: Bool, +t: U32) -> Is: Zlib.inf.head (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=inf.head) # §3.2.3: BFINAL, then BTYPE. def inf.head(bv: Br & U32, o: Out) -> Is: Zlib.inf.go (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=inf.go) # Every step reads at least one bit or fails, so 8 steps per input byte always finish a valid stream. def inf.go(k: Nat, st: Is) -> Is: Zlib.Inflated (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=Inflated) # out: the bytes; src: the input back; at: the first byte after the stream. type Inflated is Type: Inflated{out: Bytes.Bytes, src: Bytes.Bytes, at: U32} Zlib.inf.done (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=inf.done) def inf.done(r: Bytes.Bytes & U32, o: Out) -> Maybe<&1, Inflated>: Zlib.inf.fin (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=inf.fin) def inf.fin(b: Br, o: Out) -> Maybe<&1, Inflated>: Zlib.inf.result (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=inf.result) def inf.result(st: Is) -> Maybe<&1, Inflated>: Zlib.inf.start (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=inf.start) def inf.start(ok: Bool, +len: U32, buf: Array, +at: U32) -> Maybe<&1, Inflated>: Zlib.inflate.at (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=inflate.at) # A raw DEFLATE stream that starts at byte at. def inflate.at(b: Bytes.Bytes, +at: U32) -> Maybe<&1, Inflated>: Zlib.inflate.out (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=inflate.out) def inflate.out(m: Maybe<&1, Inflated>) -> Maybe<&1, Bytes.Bytes>: Zlib.inflate (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=inflate) # Raw DEFLATE. None: malformed or cut short. def inflate(b: Bytes.Bytes) -> Maybe<&1, Bytes.Bytes>: Zlib.holds (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=holds) def holds(m: Maybe<&2, U32>, +v: U32) -> Bool: Zlib.keep (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=keep) def keep(ok: Bool, b: Bytes.Bytes) -> Maybe<&1, Bytes.Bytes>: Zlib.flag (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=flag) def flag(+f: U32, +bit: U32) -> Bool: Zlib.gz.xlen (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=gz.xlen) # RFC 1952 §2.3: after the fixed 10 bytes, optional FEXTRA, FNAME, FCOMMENT, FHCRC. # Each step takes the buffer and the offset so far; None once a field runs past the end. def gz.xlen(+off: U32, r: Bytes.Bytes & Maybe<&2, U32>) -> Bytes.Bytes & Maybe<&2, U32>: Zlib.gz.fextra.at (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=gz.fextra.at) def gz.fextra.at(m: Maybe<&2, U32>, b: Bytes.Bytes) -> Bytes.Bytes & Maybe<&2, U32>: Zlib.gz.fextra (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=gz.fextra) def gz.fextra(on: Bool, r: Bytes.Bytes & Maybe<&2, U32>) -> Bytes.Bytes & Maybe<&2, U32>: Zlib.gz.zero (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=gz.zero) def gz.zero(r: Bytes.Bytes & Maybe<&2, U32>) -> Bytes.Bytes & Maybe<&2, U32>: Zlib.gz.fstr.at (https://jend.leeeet.dev/definition.txt?path=bend-kit-zlib@0.5.1.0/zlib.bend&name=gz.fstr.at) def gz.fstr.at(m: Maybe<&2, U32>, b: Bytes.Bytes) -> Bytes.Bytes & Maybe<&2, U32>: More: https://jend.leeeet.dev/packages/bend-kit-zlib.txt?definitions_offset=100