uLong
uLong ZEXPORT adler32(uLong adler, const Bytef *buf, uInt len) {
local uLong adler32_combine_(uLong adler1, uLong adler2, z_off64_t len2) {
uLong ZEXPORT adler32_combine(uLong adler1, uLong adler2, z_off_t len2) {
uLong ZEXPORT adler32_combine64(uLong adler1, uLong adler2, z_off64_t len2) {
uLong ZEXPORT adler32_z(uLong adler, const Bytef *buf, z_size_t len) {
return (uLong)bound != bound ? (uLong)-1 : (uLong)bound;
uLong sourceLen, int level) {
*destLen = (uLong)got;
uLong sourceLen) {
uLong ZEXPORT compressBound(uLong sourceLen) {
local uLong multmodp(uLong a, uLong b) {
uLong m, p;
m = (uLong)1 << 31;
local uLong x2nmodp(z_off64_t n, unsigned k) {
uLong p;
p = (uLong)1 << 31; /* x^0 == 1 */
uLong ZEXPORT crc32_z(uLong crc, const unsigned char FAR *buf, z_size_t len) {
uLong val;
uLong ZEXPORT crc32_z(uLong crc, const unsigned char FAR *buf, z_size_t len) {
uLong ZEXPORT crc32(uLong crc, const unsigned char FAR *buf, uInt len) {
uLong ZEXPORT crc32_combine_gen64(z_off64_t len2) {
uLong ZEXPORT crc32_combine_gen(z_off_t len2) {
uLong ZEXPORT crc32_combine_op(uLong crc1, uLong crc2, uLong op) {
uLong ZEXPORT crc32_combine64(uLong crc1, uLong crc2, z_off64_t len2) {
uLong ZEXPORT crc32_combine(uLong crc1, uLong crc2, z_off_t len2) {
uLong ZEXPORT deflateBound(z_streamp strm, uLong sourceLen) {
return (uLong)bound != bound ? (uLong)-1 : (uLong)bound;
static void test_deflate(Byte *compr, uLong comprLen) {
uLong len = (uLong)strlen(hello)+1;
static void test_inflate(Byte *compr, uLong comprLen, Byte *uncompr,
uLong uncomprLen) {
static void test_large_deflate(Byte *compr, uLong comprLen, Byte *uncompr,
uLong uncomprLen) {
static void test_large_inflate(Byte *compr, uLong comprLen, Byte *uncompr,
uLong uncomprLen) {
static void test_flush(Byte *compr, uLong *comprLen) {
static void test_sync(Byte *compr, uLong comprLen, Byte *uncompr,
uLong uncomprLen) {
static uLong dictId; /* Adler32 value of the dictionary */
static void test_dict_deflate(Byte *compr, uLong comprLen) {
static void test_dict_inflate(Byte *compr, uLong comprLen, Byte *uncompr,
uLong uncomprLen) {
uLong uncomprLen = 20000;
uLong comprLen = 3 * uncomprLen;
static void test_compress(Byte *compr, uLong comprLen, Byte *uncompr,
uLong uncomprLen) {
uLong len = (uLong)strlen(hello)+1;
static void test_gzio(const char *fname, Byte *uncompr, uLong uncomprLen) {
uLong sourceLen) {
uLong used = sourceLen;
uLong *sourceLen) {
*sourceLen = (uLong)used;
*destLen = (uLong)got;
typedef uLong FAR uLongf;
uLong adler; /* Adler-32 or CRC-32 value of the uncompressed data */
uLong reserved; /* reserved for future use */
ZEXTERN uLong ZEXPORT zlibCompileFlags(void);
uLong time; /* modification time */
const Bytef *source, uLong sourceLen);
const Bytef *source, uLong sourceLen,
ZEXTERN uLong ZEXPORT compressBound(uLong sourceLen);
const Bytef *source, uLong sourceLen);
const Bytef *source, uLong *sourceLen);
ZEXTERN uLong ZEXPORT adler32(uLong adler, const Bytef *buf, uInt len);
ZEXTERN uLong ZEXPORT adler32_z(uLong adler, const Bytef *buf,
ZEXTERN uLong ZEXPORT crc32(uLong crc, const Bytef *buf, uInt len);
ZEXTERN uLong ZEXPORT crc32_z(uLong crc, const Bytef *buf,
ZEXTERN uLong ZEXPORT crc32_combine_op(uLong crc1, uLong crc2, uLong op);
ZEXTERN uLong ZEXPORT adler32_combine64(uLong, uLong, z_off64_t);
ZEXTERN uLong ZEXPORT crc32_combine64(uLong, uLong, z_off64_t);
ZEXTERN uLong ZEXPORT crc32_combine_gen64(z_off64_t);
ZEXTERN uLong ZEXPORT adler32_combine64(uLong, uLong, z_off64_t);
ZEXTERN uLong ZEXPORT crc32_combine64(uLong, uLong, z_off64_t);
ZEXTERN uLong ZEXPORT crc32_combine_gen64(z_off64_t);
ZEXTERN uLong ZEXPORT adler32_combine(uLong, uLong, z_off_t);
ZEXTERN uLong ZEXPORT crc32_combine(uLong, uLong, z_off_t);
ZEXTERN uLong ZEXPORT crc32_combine_gen(z_off_t);
ZEXTERN uLong ZEXPORT adler32_combine(uLong, uLong, z_off_t);
ZEXTERN uLong ZEXPORT crc32_combine(uLong, uLong, z_off_t);
ZEXTERN uLong ZEXPORT crc32_combine_gen(z_off_t);
ZEXTERN uLong ZEXPORT deflateBound(z_streamp strm, uLong sourceLen);
uLong total_in; /* total number of input bytes read so far */
uLong total_out; /* total number of bytes output so far */
uLong ZEXPORT zlibCompileFlags(void) {
uLong flags;
switch ((int)(sizeof(uLong))) {
ZEXTERN uLong ZEXPORT adler32_combine64(uLong, uLong, z_off64_t);
ZEXTERN uLong ZEXPORT crc32_combine64(uLong, uLong, z_off64_t);
ZEXTERN uLong ZEXPORT crc32_combine_gen64(z_off64_t);
uLong crc32(uLong crc, const Bytef *buf, uInt len);
typedef uLong (ZEXPORT *check_func)(uLong check, const Bytef *buf,
uLong was; /* computed check value */
uLong need; /* stream check value */
z->state->sub.check.need = (uLong)NEXTBYTE << 24;
z->state->sub.check.need += (uLong)NEXTBYTE << 16;
z->state->sub.check.need += (uLong)NEXTBYTE << 8;
z->state->sub.check.need += (uLong)NEXTBYTE;
z->state->sub.check.need = (uLong)NEXTBYTE << 24;
z->state->sub.check.need += (uLong)NEXTBYTE << 16;
z->state->sub.check.need += (uLong)NEXTBYTE << 8;
z->state->sub.check.need += (uLong)NEXTBYTE;
uLong r, w; /* temporaries to save total_in and total_out */
uLong bitb; /* bit buffer */
uLong check; /* check on output */
#define NEEDBITS(j) {while(k<(j)){NEEDBYTE;b|=((uLong)NEXTBYTE)<<k;k+=8;}}
uLong b; /* bit buffer */
uLong b; /* bit buffer */ /* NOT USED HERE */
uLong b; /* bit buffer */
#define GRABBITS(j) {while(k<(j)){b|=((uLong)NEXTBYTE)<<k;k+=8;}}
uLong b; /* bit buffer */
uLong ZEXPORT adler32(uLong adler, const Bytef *buf, uInt len)
ZEXTERN uLong ZEXPORT adler32(uLong, const Bytef *, uInt);
ZEXTERN uLong ZEXPORT crc32(uLong, const Bytef *, uInt);
typedef uLong FAR uLongf;
uLong total_in; /* total nb of input bytes read so far */
uLong total_out; /* total nb of bytes output so far */
uLong adler; /* adler32 value of the uncompressed data */
uLong reserved; /* reserved for future use */
ZEXTERN int ZEXPORT compress(Bytef *, uLongf *, const Bytef *, uLong);
uLong, int);
ZEXTERN int ZEXPORT uncompress(Bytef *, uLongf *, const Bytef *, uLong);
uLong origcrc;
uLong origlen;
uLong crc;
uLong crc = 0;