Added test script; tidied and documented

The test script combines the sources then builds and runs an example. A futher example is built if the Emscripten compiler is available on the system. Documentation covers building.
This commit is contained in:
Carl Woffenden
2019-08-27 15:36:06 +02:00
parent 7c6fa81579
commit a57de4ac89
7 changed files with 94 additions and 23 deletions
+7
View File
@@ -0,0 +1,7 @@
# Single File ZStandard Examples
The examples `#include` the generated `zstddeclib.c` directly but work equally as well when including `zstd.h` and compiling the amalgamated source separately.
`simple.c` is the most basic example of decompressing content and verifying the result.
`emscripten.c` is a bare-bones [Emscripten](https://github.com/emscripten-core/emscripten) compiled WebGL demo using Zstd to further compress a DXT1 texture. The 256x256 texture would normally be 32kB, but even when bundled with the Zstd decompressor the resulting WebAssembly weighs in at 45kB.