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

No way to fetch values from LzmaOptions struct #71

Open
zedseven opened this issue Jan 8, 2021 · 0 comments
Open

No way to fetch values from LzmaOptions struct #71

zedseven opened this issue Jan 8, 2021 · 0 comments

Comments

@zedseven
Copy link

zedseven commented Jan 8, 2021

Hi! I'm currently working on porting a C program using liblzma over to Rust, and I'm using this library as a substitute for raw unsafe bindings, so thank you for your work on it.

Unfortunately I've encountered two issues thus far - neither of which are major, but make the porting process more difficult than it needs to be.

The first is simply that liblzma has LZMA_VLI_UNKNOWN, but I can't find a related value or setting in xz2. I suspect this is just a lack of understanding on my part or something I've missed, but I'd appreciate some clarification as to where I can set the Variable-Length Integer setting to Unknown in this lib. I haven't seen any VLI options, but I also haven't seen any documentation on the matter.

The second is that the program I'm working with basically just initializes the LZMA options with a preset value (0-9) and after loading the preset, queries the dictionary size on said options for use in other things (since this is set within liblzma by the preset itself, the only access I have to dict_size is this way).

Would it be possible and/or reasonable to expose option values through xz2 in case of situations such as these? The library has the dict_size method already, so I suspect it shouldn't be unreasonable to expect access to a variable one can set. My only alternative as a user of the library is to create some kind of reference table mapping preset to dict size, but that's clunky and leaves room for future bugs on LZMA version changes.

If this is a simple enough change I would be open to doing a PR for it myself, but I wanted to ask first in case there's something I'm missing or a specific reason why it isn't included.

Thank you again for your work on the library and your time,
Z

Ayush1325 pushed a commit to Ayush1325/xz2-rs that referenced this issue Jul 29, 2024
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