14 (z_const
char *)
"need dictionary",
15 (z_const
char *)
"stream end",
17 (z_const
char *)
"file error",
18 (z_const
char *)
"stream error",
19 (z_const
char *)
"data error",
20 (z_const
char *)
"insufficient memory",
21 (z_const
char *)
"buffer error",
22 (z_const
char *)
"incompatible version",
35 switch ((
int)(
sizeof(uInt))) {
37 case 4: flags += 1;
break;
38 case 8: flags += 2;
break;
41 switch ((
int)(
sizeof(uLong))) {
43 case 4: flags += 1 << 2;
break;
44 case 8: flags += 2 << 2;
break;
45 default: flags += 3 << 2;
47 switch ((
int)(
sizeof(voidpf))) {
49 case 4: flags += 1 << 4;
break;
50 case 8: flags += 2 << 4;
break;
51 default: flags += 3 << 4;
53 switch ((
int)(
sizeof(z_off_t))) {
55 case 4: flags += 1 << 6;
break;
56 case 8: flags += 2 << 6;
break;
57 default: flags += 3 << 6;
73#ifdef DYNAMIC_CRC_TABLE
82#ifdef PKZIP_BUG_WORKAROUND
88#if defined(STDC) || defined(Z_HAVE_STDARG_H)
91# ifdef HAS_vsprintf_void
95# ifdef HAS_vsnprintf_void
103# ifdef HAS_sprintf_void
107# ifdef HAS_snprintf_void
123 fprintf(stderr,
"%s\n", m);
135#if defined(_WIN32_WCE) && _WIN32_WCE < 0x800
146 if (len == 0)
return;
149 }
while (--len != 0);
155 for (j = 0; j < len; j++) {
156 if (s1[j] != s2[j])
return 2*(s1[j] > s2[j])-1;
162 if (len == 0)
return;
165 }
while (--len != 0);
187local int next_ptr = 0;
189typedef struct ptr_table_s {
204 ulg bsize = (
ulg)items*size;
211 if (bsize < 65520L) {
212 buf = farmalloc(bsize);
213 if (*(
ush*)&buf != 0)
return buf;
215 buf = farmalloc(bsize + 16L);
217 if (buf == NULL || next_ptr >= MAX_PTR)
return NULL;
218 table[next_ptr].org_ptr = buf;
221 *((
ush*)&buf+1) += ((
ush)((
uch*)buf-0) + 15) >> 4;
223 table[next_ptr++].new_ptr = buf;
232 if (*(
ush*)&ptr != 0) {
237 for (n = 0;
n < next_ptr;
n++) {
238 if (ptr != table[n].new_ptr)
continue;
240 farfree(table[n].org_ptr);
241 while (++n < next_ptr) {
247 Assert(0,
"zcfree: ptr not found");
258#if (!defined(_MSC_VER) || (_MSC_VER <= 600))
259# define _halloc halloc
265 return _halloc((
long)items, size);
282extern voidp
calloc(uInt items, uInt size);
288 return sizeof(uInt) > 2 ? (voidpf)
malloc(items * size) :
289 (voidpf)
calloc(items, size);
void ZLIB_INTERNAL zcfree(voidpf opaque, voidpf ptr)
voidp calloc(uInt items, uInt size)
const char *ZEXPORT zlibVersion(void)
voidpf ZLIB_INTERNAL zcalloc(voidpf opaque, unsigned items, unsigned size)
void ZLIB_INTERNAL zmemzero(Bytef *dest, uInt len)
int ZLIB_INTERNAL zmemcmp(const Bytef *s1, const Bytef *s2, uInt len)
void ZLIB_INTERNAL zmemcpy(Bytef *dest, const Bytef *source, uInt len)
uLong ZEXPORT zlibCompileFlags(void)
const char *ZEXPORT zError(int err)
#define Assert(cond, msg)
z_const char *const z_errmsg[10]