Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | - | - | ||||
README.md | D | 23-Nov-2023 | 1 KiB | 12 | 6 | |
emscripten.c | D | 23-Nov-2023 | 8.5 KiB | 341 | 196 | |
roundtrip.c | D | 23-Nov-2023 | 2.5 KiB | 84 | 51 | |
shell.html | D | 23-Nov-2023 | 982 | 32 | 30 | |
simple.c | D | 23-Nov-2023 | 2.3 KiB | 76 | 28 | |
testcard-dxt1.inl | D | 23-Nov-2023 | 192 KiB | 2,731 | 2,731 | |
testcard-zstd.inl | D | 23-Nov-2023 | 18.3 KiB | 261 | 261 | |
testcard.png | D | 23-Nov-2023 | 12.4 KiB |
README.md
1# Single File ZStandard Examples 2 3The examples `#include` the generated `zstddeclib.c` directly but work equally as well when including `zstd.h` and compiling the amalgamated source separately. 4 5`simple.c` is the most basic example of decompressing content and verifying the result. 6 7`emscripten.c` is a bare-bones [Emscripten](https://github.com/emscripten-core/emscripten) compiled WebGL demo using Zstd to further compress a DXT1 texture (see the [original PNG image](testcard.png)). The 256x256 texture would normally be 32kB, but even when bundled with the Zstd decompressor the resulting WebAssembly weighs in at 41kB (`shell.html` is a support file to run the Wasm). 8 9`roundtrip.c` is an example to use with the optional [amalgamated library](../create_single_file_library.sh) showing compression the decompression. 10 11The example files in this directory are released under a [Creative Commons Zero license](https://creativecommons.org/publicdomain/zero/1.0/) (or Public Domain, whichever is applicable in your jurisdiction). 12