Open pothos opened 8 years ago
You're right, we don't expose a lot of ZPAQ's flexibility, and we should. I don't know when I'll get to this, so in case you would like to take a stab at it:
The relevant code is at plugins/zpaq/squash-zpaq.cpp:49 and :151 (C++ makes this harder, sorry. With C you wouldn't need the second bit). Basically, there should be one option for each thing you're trying to set; LZHAM has lots of options so it should be a good example, and the options API is in squash-options.h. If you need any help, just ask here or drop by #squash on FreeNode.
If you decide to wait, I should warn you that it might be a while. There is a lot of stuff I want to do in Squash first, and ZPAQ isn't very interesting to me since it's not safe for decompression (an attacker can create an archive which causes an infinite loop).
Not only "1" and "5" are valid parameters, but also e.g. "x6.0ci1.1.1.1.2aw2mm16tst" for text (see libzpaq.h), so only an integer from 1 to 5 is not enough. Lateron even c.startBlock(const char* config, …) could also be used instead of compress() to allow usage of own algorithms through their ZPAQL config file .