File: README.md

package info (click to toggle)
mame 0.280%2Bdfsg.1-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 911,560 kB
  • sloc: cpp: 5,252,752; xml: 2,221,427; ansic: 750,970; sh: 34,449; lisp: 19,643; python: 16,304; makefile: 13,251; java: 8,492; yacc: 8,152; javascript: 7,069; cs: 6,013; asm: 4,786; ada: 1,681; pascal: 1,191; lex: 1,174; perl: 585; ruby: 373
file content (11 lines) | stat: -rw-r--r-- 1,031 bytes parent folder | download | duplicates (16)
1
2
3
4
5
6
7
8
9
10
11
# 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 (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).

`roundtrip.c` is an example to use with the optional [amalgamated library](../create_single_file_library.sh) showing compression the decompression.

The 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).