zstd/contrib/declib
2019-08-27 16:57:23 +02:00
..
examples Added clarification 2019-08-27 15:53:26 +02:00
.gitignore Added Emscripten example, removed Buck, minor tidy 2019-08-26 21:28:19 +02:00
build.sh Added test script; tidied and documented 2019-08-27 15:36:06 +02:00
combine.sh Able to test combine script; minor tidy 2019-08-26 07:48:57 +02:00
README.md Minor repetition 2019-08-27 16:57:23 +02:00
zstddeclib-in.c Added test script; tidied and documented 2019-08-27 15:36:06 +02:00

Single File Zstandard Decompression Library

The script combine.sh creates an amalgamated source file that can be used with or without zstd.h. This isn't a header-only file but it does offer a similar level of simplicity when integrating into a project.

Create zstddeclib.c from the Zstd source using:

cd zstd/contrib/declib
./combine.sh -r ../../lib -r ../../lib/common -r ../../lib/decompress -o zstddeclib.c zstddeclib-in.c

Then add the resulting file to your project (see the example files). build.sh will run the above script then compile and test the library.

Why

Because all it now takes to support decompressing Zstd is the addition of a single file, two if using the header, with no configuration or further build steps. The library is small, adding, for example, 25kB to an Emscripten compiled WebAssembly project. Native implementations add a little more, 40-70kB depending on the compiler and platform.