google / google/wuffs

Standardize compression decoders' dictionary / history APIs

Open
#73 0 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.