Skip to content

Standardize compression decoders' dictionary / history APIs #73

Open

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions