13 (z_const
char *)
"need dictionary",
14 (z_const
char *)
"stream end",
16 (z_const
char *)
"file error",
17 (z_const
char *)
"stream error",
18 (z_const
char *)
"data error",
19 (z_const
char *)
"insufficient memory",
20 (z_const
char *)
"buffer error",
21 (z_const
char *)
"incompatible version",
36 switch ((
int)(
sizeof(uInt))) {
38 case 4: flags += 1;
break;
39 case 8: flags += 2;
break;
42 switch ((
int)(
sizeof(uLong))) {
44 case 4: flags += 1 << 2;
break;
45 case 8: flags += 2 << 2;
break;
46 default: flags += 3 << 2;
48 switch ((
int)(
sizeof(voidpf))) {
50 case 4: flags += 1 << 4;
break;
51 case 8: flags += 2 << 4;
break;
52 default: flags += 3 << 4;
54 switch ((
int)(
sizeof(z_off_t))) {
56 case 4: flags += 1 << 6;
break;
57 case 8: flags += 2 << 6;
break;
58 default: flags += 3 << 6;
63#if defined(ASMV) || defined(ASMINF)
72#ifdef DYNAMIC_CRC_TABLE
81#ifdef PKZIP_BUG_WORKAROUND
87#if defined(STDC) || defined(Z_HAVE_STDARG_H)
90# ifdef HAS_vsprintf_void
94# ifdef HAS_vsnprintf_void
102# ifdef HAS_sprintf_void
106# ifdef HAS_snprintf_void
124 fprintf(stderr,
"%s\n",
m);
138#if defined(_WIN32_WCE)
153 if (len == 0)
return;
156 }
while (--len != 0);
166 for (j = 0; j < len; j++) {
167 if (s1[j] != s2[j])
return 2*(s1[j] > s2[j])-1;
176 if (len == 0)
return;
179 }
while (--len != 0);
201local int next_ptr = 0;
203typedef struct ptr_table_s {
208local ptr_table table[MAX_PTR];
219 ulg bsize = (
ulg)items*size;
226 if (bsize < 65520L) {
227 buf = farmalloc(bsize);
228 if (*(
ush*)&buf != 0)
return buf;
230 buf = farmalloc(bsize + 16L);
232 if (buf == NULL || next_ptr >= MAX_PTR)
return NULL;
233 table[next_ptr].org_ptr = buf;
236 *((
ush*)&buf+1) += ((
ush)((
uch*)buf-0) + 15) >> 4;
238 table[next_ptr++].new_ptr = buf;
248 if (*(
ush*)&ptr != 0) {
253 for (
n = 0;
n < next_ptr;
n++) {
254 if (ptr != table[
n].new_ptr)
continue;
256 farfree(table[
n].org_ptr);
257 while (++
n < next_ptr) {
258 table[
n-1] = table[
n];
263 Assert(0,
"zcfree: ptr not found");
274#if (!defined(_MSC_VER) || (_MSC_VER <= 600))
275# define _halloc halloc
282 return _halloc((
long)items, size);
299extern voidp malloc
OF((uInt size));
300extern voidp calloc
OF((uInt items, uInt size));
310 return sizeof(uInt) > 2 ? (voidpf)malloc(items * size) :
311 (voidpf)calloc(items, size);
static constexpr double m
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)
voidp malloc OF((uInt size))
const char *ZEXPORT zError(int err)
int ZLIB_INTERNAL zmemcmp(Bytef *s1, const Bytef *s2, uInt len) const
#define Assert(cond, msg)