24 "insufficient memory",
26 "incompatible version",
40 switch ((
int)(
sizeof(uInt))) {
42 case 4: flags += 1;
break;
43 case 8: flags += 2;
break;
46 switch ((
int)(
sizeof(uLong))) {
48 case 4: flags += 1 << 2;
break;
49 case 8: flags += 2 << 2;
break;
50 default: flags += 3 << 2;
52 switch ((
int)(
sizeof(voidpf))) {
54 case 4: flags += 1 << 4;
break;
55 case 8: flags += 2 << 4;
break;
56 default: flags += 3 << 4;
58 switch ((
int)(
sizeof(z_off_t))) {
60 case 4: flags += 1 << 6;
break;
61 case 8: flags += 2 << 6;
break;
62 default: flags += 3 << 6;
67 #if defined(ASMV) || defined(ASMINF)
76 #ifdef DYNAMIC_CRC_TABLE
85 #ifdef PKZIP_BUG_WORKAROUND
91 #if defined(STDC) || defined(Z_HAVE_STDARG_H)
94 # ifdef HAS_vsprintf_void
98 # ifdef HAS_vsnprintf_void
106 # ifdef HAS_sprintf_void
110 # ifdef HAS_snprintf_void
127 fprintf(stderr,
"%s\n", m);
140 #if defined(_WIN32_WCE)
152 if (len == 0)
return;
155 }
while (--len != 0);
162 for (j = 0; j <
len; j++) {
163 if (s1[j] != s2[j])
return 2*(s1[j] > s2[j])-1;
170 if (len == 0)
return;
173 }
while (--len != 0);
195 local int next_ptr = 0;
197 typedef struct ptr_table_s {
202 local ptr_table table[MAX_PTR];
213 ulg bsize = (
ulg)items*size;
218 if (bsize < 65520L) {
219 buf = farmalloc(bsize);
220 if (*(
ush*)&buf != 0)
return buf;
222 buf = farmalloc(bsize + 16L);
224 if (buf == NULL || next_ptr >= MAX_PTR)
return NULL;
225 table[next_ptr].org_ptr = buf;
228 *((
ush*)&buf+1) += ((
ush)((
uch*)buf-0) + 15) >> 4;
230 table[next_ptr++].new_ptr = buf;
237 if (*(
ush*)&ptr != 0) {
242 for (n = 0; n < next_ptr; n++) {
243 if (ptr != table[n].new_ptr)
continue;
245 farfree(table[n].org_ptr);
246 while (++n < next_ptr) {
247 table[n-1] = table[
n];
253 Assert(0,
"zcfree: ptr not found");
264 #if (!defined(_MSC_VER) || (_MSC_VER <= 600))
265 # define _halloc halloc
266 # define _hfree hfree
271 if (opaque) opaque = 0;
272 return _halloc((
long)items, size);
277 if (opaque) opaque = 0;
289 extern voidp
malloc OF((uInt size));
290 extern voidp
calloc OF((uInt items, uInt size));
291 extern void free OF((voidpf ptr));
296 if (opaque) items += size - size;
297 return sizeof(uInt) > 2 ? (voidpf)
malloc(items * size) :
298 (voidpf)
calloc(items, size);
const char *ZEXPORT zError(int err)
voidpf ZLIB_INTERNAL zcalloc(voidpf opaque, unsigned items, unsigned size)
void * calloc(size_t __nmemb, size_t __size)
#define Assert(cond, msg)
void ZLIB_INTERNAL zmemcpy(Bytef *dest, const Bytef *source, uInt len)
void ZLIB_INTERNAL zmemzero(Bytef *dest, uInt len)
void ZLIB_INTERNAL zcfree(voidpf opaque, voidpf ptr)
const char *ZEXPORT zlibVersion()
int ZLIB_INTERNAL zmemcmp(const Bytef *s1, const Bytef *s2, uInt len)
const char *const z_errmsg[10]
void * malloc(size_t __size)
uLong ZEXPORT zlibCompileFlags()
voidpf alloc_func OF((voidpf opaque, uInt items, uInt size))