From 193fbd30f236ddee04d85aece12465b13aa10335 Mon Sep 17 00:00:00 2001 From: Yi Jin Date: Thu, 13 Dec 2018 22:51:35 -0800 Subject: [PATCH] WIP --- examples/simple_compressionCCtx.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/examples/simple_compressionCCtx.c b/examples/simple_compressionCCtx.c index 0193dd40..17255cba 100644 --- a/examples/simple_compressionCCtx.c +++ b/examples/simple_compressionCCtx.c @@ -62,6 +62,17 @@ int main(int argc, const char** argv) const char* const inFilename = argv[1]; + /** copied code + ZSTD_CCtx* const cctx = ZSTD_createCCtx(); + if (cctx==NULL) { fprintf(stderr, "ZSTD_createCCtx() error \n"); exit(10); } + size_t const cSize = ZSTD_compress_usingCDict(cctx, cBuff, cBuffSize, fBuff, fSize, cdict); + if (ZSTD_isError(cSize)) { + fprintf(stderr, "error compressing %s : %s \n", fname, ZSTD_getErrorName(cSize)); + exit(7); + } + **/ + + char* const outFilename = createOutFilename_orDie(inFilename); compress_orDie(inFilename, outFilename); free(outFilename);