![]() |
Parolin 0.7.9 6796
Console (soon DLLs) to do a tar like job
|
#include <stddef.h>#include <stdint.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include "../zstddeclib.c"#include "testcard-dxt1.inl"#include "testcard-zstd.inl"Functions | |
| size_t | ZSTD_decompress (void *dst, size_t dstLen, const void *src, size_t srcLen) |
| int | main () |
Simple standalone example of using the single-file zstddeclib.
zstd.h and compile both this file and zstddeclib.c (the resulting binaries differ slightly in size but perform the same).| int main | ( | void | ) |
Simple single-file test to decompress srcZstd into # dstDxt1 then compare the resulting bytes with rawDxt1.
As a (naive) comparison, removing Zstd and building with "-Os -g0 simple.c" results in a 44kB binary (macOS 10.14, Clang 10); re-adding Zstd increases the binary by 56kB (after calling strip).
| size_t ZSTD_decompress | ( | void * | dst, |
| size_t | dstLen, | ||
| const void * | src, | ||
| size_t | srcLen ) |
For the case where the decompression library hasn't been included we add a dummy function to fake the process and stop the buffers being optimised out.