21 "insufficient memory",
23 "incompatible version",
37 switch (
sizeof(
uInt)) {
39 case 4: flags += 1;
break;
40 case 8: flags += 2;
break;
43 switch (
sizeof(
uLong)) {
45 case 4: flags += 1 << 2;
break;
46 case 8: flags += 2 << 2;
break;
47 default: flags += 3 << 2;
51 case 4: flags += 1 << 4;
break;
52 case 8: flags += 2 << 4;
break;
53 default: flags += 3 << 4;
57 case 4: flags += 1 << 6;
break;
58 case 8: flags += 2 << 6;
break;
59 default: flags += 3 << 6;
64 #if defined(ASMV) || defined(ASMINF) 73 #ifdef DYNAMIC_CRC_TABLE 82 #ifdef PKZIP_BUG_WORKAROUND 91 # ifdef HAS_vsprintf_void 95 # ifdef HAS_vsnprintf_void 103 # ifdef HAS_sprintf_void 107 # ifdef HAS_snprintf_void 125 fprintf(stderr,
"%s\n", m);
139 #if defined(_WIN32_WCE) 154 if (len == 0)
return;
157 }
while (--len != 0);
167 for (j = 0; j < len; j++) {
168 if (
s1[j] !=
s2[j])
return 2*(
s1[j] >
s2[j])-1;
177 if (len == 0)
return;
180 }
while (--len != 0);
201 local int next_ptr = 0;
203 typedef struct ptr_table_s {
208 local ptr_table table[MAX_PTR];
219 ulg bsize = (
ulg)items*size;
224 if (bsize < 65520L) {
225 buf = farmalloc(bsize);
226 if (*(
ush*)&buf != 0)
return buf;
228 buf = farmalloc(bsize + 16L);
230 if (buf == NULL || next_ptr >= MAX_PTR)
return NULL;
231 table[next_ptr].org_ptr =
buf;
234 *((
ush*)&buf+1) += ((
ush)((
uch*)buf-0) + 15) >> 4;
236 table[next_ptr++].new_ptr =
buf;
243 if (*(
ush*)&ptr != 0) {
248 for (n = 0; n < next_ptr; n++) {
249 if (ptr != table[n].new_ptr)
continue;
251 farfree(table[n].org_ptr);
252 while (++n < next_ptr) {
253 table[n-1] = table[
n];
259 Assert(0,
"zcfree: ptr not found");
270 #if (!defined(_MSC_VER) || (_MSC_VER <= 600)) 271 # define _halloc halloc 272 # define _hfree hfree 277 if (opaque) opaque = 0;
278 return _halloc((
long)items, size);
283 if (opaque) opaque = 0;
307 (
voidpf)calloc(items, size);
void zcfree(voidpf opaque, voidpf ptr)
void zmemcpy(Bytef *dest, const Bytef *source, uInt len)
#define Assert(cond, msg)
const char *const z_errmsg[10]
voidp malloc OF((uInt size))
const char *ZEXPORT zlibVersion()
int zmemcmp(Bytef *s1, const Bytef *s2, uInt len) const
voidpf zcalloc(voidpf opaque, unsigned items, unsigned size)
uLong ZEXPORT zlibCompileFlags()
const char *ZEXPORT zError(int err)
void zmemzero(Bytef *dest, uInt len)