1
0
mirror of https://github.com/facebook/zstd.git synced 2025-08-01 09:47:01 +03:00

a new ZWRAP API

This commit is contained in:
inikep
2016-09-23 09:08:40 +02:00
parent 16fa12a51a
commit 252c20dd34
6 changed files with 88 additions and 87 deletions

View File

@ -152,7 +152,7 @@ int main(int argc, char **argv)
size = (unsigned)ret;
printf("zlib version %s\n", ZLIB_VERSION);
if (isUsingZSTDcompression()) printf("zstd version %s\n", zstdVersion());
if (ZWRAP_isUsingZSTDcompression()) printf("zstd version %s\n", zstdVersion());
/* allocate memory for buffers and compression engine */
blk = malloc(size + EXCESS);
@ -162,9 +162,9 @@ int main(int argc, char **argv)
ret = deflateInit(&def, Z_DEFAULT_COMPRESSION);
if (ret != Z_OK || blk == NULL)
quit("out of memory");
ret = ZSTD_setPledgedSrcSize(&def, 1<<16);
ret = ZWRAP_setPledgedSrcSize(&def, 1<<16);
if (ret != Z_OK)
quit("ZSTD_setPledgedSrcSize");
quit("ZWRAP_setPledgedSrcSize");
/* compress from stdin until output full, or no more input */
def.avail_out = size + EXCESS;