Standardize compression decoders' dictionary / history APIs
- Dominant language
- C
- Stars
- 4.8k
- Forks
- 145
- Avg merge
- 11h 48m
- Merged PRs (30d)
- 1
Description
As of Wuffs v0.3, there is a `base.io_transformer` interface:
- `set_quirk_enabled!(quirk: u32, enabled: bool)`
- `transform_io?(dst: io_writer, src: io_reader, workbuf: slice u8)`
- `workbuf_len() range_ii_u64`
and every compression decoder is a `base.io_transformer`, but there isn't an additional `base.compression_decoder` interface. Instead, we have some ad hoc additional methods:
- `deflate.decoder.add_history!(hist: slice u8)`
- `lzw.decoder.flush!() slice u8`
- `lzw.decoder.set_literal_width!(lw: u32[..= 8])`
- `zlib.decoder.add_dictionary!(dict: slice u8)`
- `zlib.decoder.dictionary_id() u32`
- There's also the `gzip.decoder` struct, which doesn't export anything beyond the `base.io_transformer` methods.
It would be nice if there was a common API, at least for the dictionary / history concepts.
Contributor guide
Assessment
This issue has not been assessed yet.