15extern void exit
OF((
int));
27"incompatible version",
41 switch (
sizeof(
uInt)) {
43 case 4: flags += 1;
break;
44 case 8: flags += 2;
break;
47 switch (
sizeof(
uLong)) {
49 case 4: flags += 1 << 2;
break;
50 case 8: flags += 2 << 2;
break;
51 default: flags += 3 << 2;
55 case 4: flags += 1 << 4;
break;
56 case 8: flags += 2 << 4;
break;
57 default: flags += 3 << 4;
61 case 4: flags += 1 << 6;
break;
62 case 8: flags += 2 << 6;
break;
63 default: flags += 3 << 6;
68#if defined(ASMV) || defined(ASMINF)
77#ifdef DYNAMIC_CRC_TABLE
86#ifdef PKZIP_BUG_WORKAROUND
95# ifdef HAS_vsprintf_void
99# ifdef HAS_vsnprintf_void
107# ifdef HAS_sprintf_void
111# ifdef HAS_snprintf_void
124int z_verbose = verbose;
126void z_error (
char *m)
128 fprintf(stderr,
"%s\n", m);
141#if defined(_WIN32_WCE)
150 if (len == 0)
return;
153 }
while (--len != 0);
160 for (j = 0; j < len; j++) {
161 if (s1[j] != s2[j])
return 2*(s1[j] > s2[j])-1;
168 if (len == 0)
return;
171 }
while (--len != 0);
192local int next_ptr = 0;
194typedef struct ptr_table_s {
199local ptr_table table[MAX_PTR];
210 ulg bsize = (
ulg)items*size;
215 if (bsize < 65520L) {
216 buf = farmalloc(bsize);
217 if (*(
ush*)&buf != 0)
return buf;
219 buf = farmalloc(bsize + 16L);
221 if (buf == NULL || next_ptr >= MAX_PTR)
return NULL;
222 table[next_ptr].org_ptr = buf;
225 *((
ush*)&buf+1) += ((
ush)((
uch*)buf-0) + 15) >> 4;
227 table[next_ptr++].new_ptr = buf;
234 if (*(
ush*)&ptr != 0) {
239 for (n = 0;
n < next_ptr;
n++) {
240 if (ptr != table[n].new_ptr)
continue;
242 farfree(table[n].org_ptr);
243 while (++n < next_ptr) {
244 table[
n-1] = table[
n];
250 Assert(0,
"zcfree: ptr not found");
261#if (!defined(_MSC_VER) || (_MSC_VER <= 600))
262# define _halloc halloc
268 if (opaque) opaque = 0;
269 return _halloc((
long)items, size);
274 if (opaque) opaque = 0;
293 if (opaque) items += size - size;
294 return sizeof(
uInt) > 2 ? (
voidpf)malloc(items * size) :
295 (
voidpf)calloc(items, size);
const char *ZEXPORT zlibVersion()
uLong ZEXPORT zlibCompileFlags()
int zmemcmp(const Bytef *s1, const Bytef *s2, uInt len)
void zmemcpy(Bytef *dest, const Bytef *source, uInt len)
void zcfree(voidpf opaque, voidpf ptr)
voidpf zcalloc(voidpf opaque, unsigned items, unsigned size)
const char *const z_errmsg[10]
const char *ZEXPORT zError(int err)
void zmemzero(Bytef *dest, uInt len)
#define Assert(cond, msg)