
Originally Posted by
Bulat Ziganshin
Squash command-line tool is very similar to fazip - it has limited options, but provides access to dozens of squash methods, and you just need to implement the Squash API in order to be included in this utility. Unfortunately, it's Unix-only
No it isn't. 0.7 didn't work on Windows, but 0.8 (unreleased, but quite usable) does. It also works on Linux, OS X, BSD, Solaris, and probably others.
[QUOTE=Bulat Ziganshin;51806]and seems not support method parameters in cmdline (such as lzma:d1g:fb128 in fazip).
Yes they are. Plugins can support whatever options they want; I'm not sure what the ones you provided above mean, but the currently supported options for lzma are level, dict-size, lc, lp, and pb on both the encoder and decoder, plus check on the encoder and mem-limit on the decoder. See https://quixdb.github.io/squash/api/c/md_plugins_lzma_lzma.html
For example:
Code:
squash -k -o level=3 -o dict-size=8388608 foo foo.lzma
There is actually a fairly expressive API which plugins can implement to accept different parameters and types. For example, LZMA's is in plugins/lzma/squash-lzma.c. There are several different potential types (dict-size is a size, level is an int, strings are also an option), you can require sizes and ints be a multiple of some value, fall within a specific range, allow zero (if it's outside the range), set the default value, etc. It's not perfect, but it takes a lot of the parsing load off of plugins.
The selling point, though, is that we need 2) standard API for compression libraries, so that compressors implementing this API can be used with our frameowrk automatically. I will make a separate topic to discuss APIs themself, so here we can discuss choosing API for this project or even implemention of support for multiple APIs
https://github.com/quixdb/squash/blob/master/squash/squash-codec.h#L63
I do have one more planned addition to that, but for the most part that should be pretty stable.
The difficult part is adding all the stuff on top to present that to the user nicely. You might want to take a look at https://github.com/quixdb/squash/blo...s/internals.md