diff --git a/examples/Makefile b/examples/Makefile index fa7328fbd..f568bc00c 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -67,7 +67,7 @@ test: all ./streaming_decompression tmp.zst > /dev/null @echo starting streaming compression ./streaming_compression tmp - ./streaming_decompression tmp.zst + ./streaming_decompression tmp.zst > /dev/null @echo starting dictionary compression ./dictionary_compression tmp README.md ./dictionary_decompression tmp.zst README.md diff --git a/examples/README.md b/examples/README.md index 2f4603881..d00fa0d76 100644 --- a/examples/README.md +++ b/examples/README.md @@ -7,6 +7,8 @@ Zstandard library : usage examples - [Simple decompression](simple_decompression.c) Decompress a single file compressed by zstd. + Only compatible with simple compression. + Result remains in memory. Introduces usage of : `ZSTD_decompress()` - [Dictionary compression](dictionary_compression.c) @@ -15,4 +17,15 @@ Zstandard library : usage examples - [Dictionary decompression](dictionary_decompression.c) Decompress multiple files using the same dictionary. + Result remains in memory. Introduces usage of : `ZSTD_createDDict()` and `ZSTD_decompress_usingDDict()` + +- [Streaming compression](streaming_compression.c) + Compress a single file. + Introduces usage of : `ZSTD_compressStream()` + +- [Streaming decompression](streaming_decompression.c) + Decompress a single file compressed by zstd. + Compatible with simple and streaming compression. + Result is sent to stdout. + Introduces usage of : `ZSTD_decompressStream()` diff --git a/examples/streaming_decompression.c b/examples/streaming_decompression.c index 62c780267..2966ec6ea 100644 --- a/examples/streaming_decompression.c +++ b/examples/streaming_decompression.c @@ -99,14 +99,12 @@ int main(int argc, const char** argv) const char* const inFilename = argv[1]; if (argc!=2) { - printf("wrong arguments\n"); - printf("usage:\n"); - printf("%s FILE\n", exeName); + fprintf(stderr, "wrong arguments\n"); + fprintf(stderr, "usage:\n"); + fprintf(stderr, "%s FILE\n", exeName); return 1; } decompressFile_orDie(inFilename); - printf("%s correctly decoded (in memory). \n", inFilename); - return 0; }