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",
37 switch ((
int)(
sizeof(uInt))) {
39 case 4: flags += 1;
break;
40 case 8: flags += 2;
break;
43 switch ((
int)(
sizeof(uLong))) {
45 case 4: flags += 1 << 2;
break;
46 case 8: flags += 2 << 2;
break;
47 default: flags += 3 << 2;
49 switch ((
int)(
sizeof(voidpf))) {
51 case 4: flags += 1 << 4;
break;
52 case 8: flags += 2 << 4;
break;
53 default: flags += 3 << 4;
55 switch ((
int)(
sizeof(z_off_t))) {
57 case 4: flags += 1 << 6;
break;
58 case 8: flags += 2 << 6;
break;
59 default: flags += 3 << 6;
75#ifdef DYNAMIC_CRC_TABLE
84#ifdef PKZIP_BUG_WORKAROUND
90#if defined(STDC) || defined(Z_HAVE_STDARG_H)
93# ifdef HAS_vsprintf_void
97# ifdef HAS_vsnprintf_void
105# ifdef HAS_sprintf_void
109# ifdef HAS_snprintf_void
127 fprintf(stderr,
"%s\n", m);
141#if defined(_WIN32_WCE) && _WIN32_WCE < 0x800
156 if (len == 0)
return;
159 }
while (--len != 0);
169 for (j = 0; j < len; j++) {
170 if (s1[j] != s2[j])
return 2*(s1[j] > s2[j])-1;
179 if (len == 0)
return;
182 }
while (--len != 0);
204local int next_ptr = 0;
206typedef struct ptr_table_s {
211local ptr_table table[MAX_PTR];
222 ulg bsize = (
ulg)items*size;
229 if (bsize < 65520L) {
230 buf = farmalloc(bsize);
231 if (*(
ush*)&buf != 0)
return buf;
233 buf = farmalloc(bsize + 16L);
235 if (buf == NULL || next_ptr >= MAX_PTR)
return NULL;
236 table[next_ptr].org_ptr = buf;
239 *((
ush*)&buf+1) += ((
ush)((
uch*)buf-0) + 15) >> 4;
241 table[next_ptr++].new_ptr = buf;
251 if (*(
ush*)&ptr != 0) {
256 for (n = 0;
n < next_ptr;
n++) {
257 if (ptr != table[n].new_ptr)
continue;
259 farfree(table[n].org_ptr);
260 while (++n < next_ptr) {
261 table[
n-1] = table[
n];
266 Assert(0,
"zcfree: ptr not found");
277#if (!defined(_MSC_VER) || (_MSC_VER <= 600))
278# define _halloc halloc
285 return _halloc((
long)items, size);
302extern voidp malloc
OF((uInt size));
303extern voidp calloc
OF((uInt items, uInt size));
313 return sizeof(uInt) > 2 ? (voidpf)malloc(items * size) :
314 (voidpf)calloc(items, size);
voidpf alloc_func OF((voidpf opaque, uInt items, uInt size))
void ZLIB_INTERNAL zcfree(voidpf opaque, voidpf ptr)
voidpf ZLIB_INTERNAL zcalloc(voidpf opaque, unsigned items, unsigned size)
const char *ZEXPORT zlibVersion()
z_const char *const z_errmsg[10]
uLong ZEXPORT zlibCompileFlags()
void ZLIB_INTERNAL zmemzero(Bytef *dest, uInt len)
void ZLIB_INTERNAL zmemcpy(Bytef *dest, const Bytef *source, uInt len)
const char *ZEXPORT zError(int err)
int ZLIB_INTERNAL zmemcmp(Bytef *s1, const Bytef *s2, uInt len) const
#define Assert(cond, msg)