|
|
@ -36,12 +36,12 @@ static uLong dictId; /* Adler32 value of the dictionary */ |
|
|
|
|
|
|
|
|
|
|
|
#ifdef Z_SOLO |
|
|
|
#ifdef Z_SOLO |
|
|
|
|
|
|
|
|
|
|
|
void *myalloc(void *q, unsigned n, unsigned m) { |
|
|
|
static void *myalloc(void *q, unsigned n, unsigned m) { |
|
|
|
(void)q; |
|
|
|
(void)q; |
|
|
|
return calloc(n, m); |
|
|
|
return calloc(n, m); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void myfree(void *q, void *p) { |
|
|
|
static void myfree(void *q, void *p) { |
|
|
|
(void)q; |
|
|
|
(void)q; |
|
|
|
free(p); |
|
|
|
free(p); |
|
|
|
} |
|
|
|
} |
|
|
@ -57,7 +57,7 @@ static free_func zfree = (free_func)0; |
|
|
|
/* ===========================================================================
|
|
|
|
/* ===========================================================================
|
|
|
|
* Test compress() and uncompress() |
|
|
|
* Test compress() and uncompress() |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
void test_compress(Byte *compr, uLong comprLen, Byte *uncompr, |
|
|
|
static void test_compress(Byte *compr, uLong comprLen, Byte *uncompr, |
|
|
|
uLong uncomprLen) { |
|
|
|
uLong uncomprLen) { |
|
|
|
int err; |
|
|
|
int err; |
|
|
|
uLong len = (uLong)strlen(hello)+1; |
|
|
|
uLong len = (uLong)strlen(hello)+1; |
|
|
@ -81,7 +81,7 @@ void test_compress(Byte *compr, uLong comprLen, Byte *uncompr, |
|
|
|
/* ===========================================================================
|
|
|
|
/* ===========================================================================
|
|
|
|
* Test read/write of .gz files |
|
|
|
* Test read/write of .gz files |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
void test_gzio(const char *fname, Byte *uncompr, uLong uncomprLen) { |
|
|
|
static void test_gzio(const char *fname, Byte *uncompr, uLong uncomprLen) { |
|
|
|
#ifdef NO_GZCOMPRESS |
|
|
|
#ifdef NO_GZCOMPRESS |
|
|
|
fprintf(stderr, "NO_GZCOMPRESS -- gz* functions cannot compress\n"); |
|
|
|
fprintf(stderr, "NO_GZCOMPRESS -- gz* functions cannot compress\n"); |
|
|
|
#else |
|
|
|
#else |
|
|
@ -163,7 +163,7 @@ void test_gzio(const char *fname, Byte *uncompr, uLong uncomprLen) { |
|
|
|
/* ===========================================================================
|
|
|
|
/* ===========================================================================
|
|
|
|
* Test deflate() with small buffers |
|
|
|
* Test deflate() with small buffers |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
void test_deflate(Byte *compr, uLong comprLen) { |
|
|
|
static void test_deflate(Byte *compr, uLong comprLen) { |
|
|
|
z_stream c_stream; /* compression stream */ |
|
|
|
z_stream c_stream; /* compression stream */ |
|
|
|
int err; |
|
|
|
int err; |
|
|
|
uLong len = (uLong)strlen(hello)+1; |
|
|
|
uLong len = (uLong)strlen(hello)+1; |
|
|
@ -198,7 +198,7 @@ void test_deflate(Byte *compr, uLong comprLen) { |
|
|
|
/* ===========================================================================
|
|
|
|
/* ===========================================================================
|
|
|
|
* Test inflate() with small buffers |
|
|
|
* Test inflate() with small buffers |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
void test_inflate(Byte *compr, uLong comprLen, Byte *uncompr, |
|
|
|
static void test_inflate(Byte *compr, uLong comprLen, Byte *uncompr, |
|
|
|
uLong uncomprLen) { |
|
|
|
uLong uncomprLen) { |
|
|
|
int err; |
|
|
|
int err; |
|
|
|
z_stream d_stream; /* decompression stream */ |
|
|
|
z_stream d_stream; /* decompression stream */ |
|
|
@ -237,7 +237,7 @@ void test_inflate(Byte *compr, uLong comprLen, Byte *uncompr, |
|
|
|
/* ===========================================================================
|
|
|
|
/* ===========================================================================
|
|
|
|
* Test deflate() with large buffers and dynamic change of compression level |
|
|
|
* Test deflate() with large buffers and dynamic change of compression level |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
void test_large_deflate(Byte *compr, uLong comprLen, Byte *uncompr, |
|
|
|
static void test_large_deflate(Byte *compr, uLong comprLen, Byte *uncompr, |
|
|
|
uLong uncomprLen) { |
|
|
|
uLong uncomprLen) { |
|
|
|
z_stream c_stream; /* compression stream */ |
|
|
|
z_stream c_stream; /* compression stream */ |
|
|
|
int err; |
|
|
|
int err; |
|
|
@ -290,7 +290,7 @@ void test_large_deflate(Byte *compr, uLong comprLen, Byte *uncompr, |
|
|
|
/* ===========================================================================
|
|
|
|
/* ===========================================================================
|
|
|
|
* Test inflate() with large buffers |
|
|
|
* Test inflate() with large buffers |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
void test_large_inflate(Byte *compr, uLong comprLen, Byte *uncompr, |
|
|
|
static void test_large_inflate(Byte *compr, uLong comprLen, Byte *uncompr, |
|
|
|
uLong uncomprLen) { |
|
|
|
uLong uncomprLen) { |
|
|
|
int err; |
|
|
|
int err; |
|
|
|
z_stream d_stream; /* decompression stream */ |
|
|
|
z_stream d_stream; /* decompression stream */ |
|
|
@ -329,7 +329,7 @@ void test_large_inflate(Byte *compr, uLong comprLen, Byte *uncompr, |
|
|
|
/* ===========================================================================
|
|
|
|
/* ===========================================================================
|
|
|
|
* Test deflate() with full flush |
|
|
|
* Test deflate() with full flush |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
void test_flush(Byte *compr, uLong *comprLen) { |
|
|
|
static void test_flush(Byte *compr, uLong *comprLen) { |
|
|
|
z_stream c_stream; /* compression stream */ |
|
|
|
z_stream c_stream; /* compression stream */ |
|
|
|
int err; |
|
|
|
int err; |
|
|
|
uInt len = (uInt)strlen(hello)+1; |
|
|
|
uInt len = (uInt)strlen(hello)+1; |
|
|
@ -364,7 +364,8 @@ void test_flush(Byte *compr, uLong *comprLen) { |
|
|
|
/* ===========================================================================
|
|
|
|
/* ===========================================================================
|
|
|
|
* Test inflateSync() |
|
|
|
* Test inflateSync() |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
void test_sync(Byte *compr, uLong comprLen, Byte *uncompr, uLong uncomprLen) { |
|
|
|
static void test_sync(Byte *compr, uLong comprLen, Byte *uncompr, |
|
|
|
|
|
|
|
uLong uncomprLen) { |
|
|
|
int err; |
|
|
|
int err; |
|
|
|
z_stream d_stream; /* decompression stream */ |
|
|
|
z_stream d_stream; /* decompression stream */ |
|
|
|
|
|
|
|
|
|
|
@ -404,7 +405,7 @@ void test_sync(Byte *compr, uLong comprLen, Byte *uncompr, uLong uncomprLen) { |
|
|
|
/* ===========================================================================
|
|
|
|
/* ===========================================================================
|
|
|
|
* Test deflate() with preset dictionary |
|
|
|
* Test deflate() with preset dictionary |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
void test_dict_deflate(Byte *compr, uLong comprLen) { |
|
|
|
static void test_dict_deflate(Byte *compr, uLong comprLen) { |
|
|
|
z_stream c_stream; /* compression stream */ |
|
|
|
z_stream c_stream; /* compression stream */ |
|
|
|
int err; |
|
|
|
int err; |
|
|
|
|
|
|
|
|
|
|
@ -438,7 +439,7 @@ void test_dict_deflate(Byte *compr, uLong comprLen) { |
|
|
|
/* ===========================================================================
|
|
|
|
/* ===========================================================================
|
|
|
|
* Test inflate() with a preset dictionary |
|
|
|
* Test inflate() with a preset dictionary |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
void test_dict_inflate(Byte *compr, uLong comprLen, Byte *uncompr, |
|
|
|
static void test_dict_inflate(Byte *compr, uLong comprLen, Byte *uncompr, |
|
|
|
uLong uncomprLen) { |
|
|
|
uLong uncomprLen) { |
|
|
|
int err; |
|
|
|
int err; |
|
|
|
z_stream d_stream; /* decompression stream */ |
|
|
|
z_stream d_stream; /* decompression stream */ |
|
|
|