Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standardize compression decoders' dictionary / history APIs #73

Open
nigeltao opened this issue Feb 8, 2022 · 0 comments
Open

Standardize compression decoders' dictionary / history APIs #73

nigeltao opened this issue Feb 8, 2022 · 0 comments

Comments

@nigeltao
Copy link
Collaborator

nigeltao commented Feb 8, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant