15 extern void exit
OF((
int));
25 "insufficient memory",
27 "incompatible version",
41 switch (
sizeof(
uInt)) {
43 case 4: flags += 1;
break;
44 case 8: flags += 2;
break;
47 switch (
sizeof(
uLong)) {
49 case 4: flags += 1 << 2;
break;
50 case 8: flags += 2 << 2;
break;
51 default: flags += 3 << 2;
55 case 4: flags += 1 << 4;
break;
56 case 8: flags += 2 << 4;
break;
57 default: flags += 3 << 4;
61 case 4: flags += 1 << 6;
break;
62 case 8: flags += 2 << 6;
break;
63 default: flags += 3 << 6;
68 #if defined(ASMV) || defined(ASMINF)
77 #ifdef DYNAMIC_CRC_TABLE
86 #ifdef PKZIP_BUG_WORKAROUND
95 # ifdef HAS_vsprintf_void
99 # ifdef HAS_vsnprintf_void
107 # ifdef HAS_sprintf_void
111 # ifdef HAS_snprintf_void
124 int z_verbose = verbose;
126 void z_error (
char *
m)
128 fprintf(stderr,
"%s\n", m);
141 #if defined(_WIN32_WCE)
150 if (len == 0)
return;
153 }
while (--len != 0);
160 for (j = 0; j <
len; j++) {
161 if (s1[j] != s2[j])
return 2*(s1[j] > s2[j])-1;
168 if (len == 0)
return;
171 }
while (--len != 0);
192 local int next_ptr = 0;
194 typedef struct ptr_table_s {
199 local ptr_table table[MAX_PTR];
210 ulg bsize = (
ulg)items*size;
215 if (bsize < 65520L) {
216 buf = farmalloc(bsize);
217 if (*(
ush*)&buf != 0)
return buf;
219 buf = farmalloc(bsize + 16L);
221 if (buf == NULL || next_ptr >= MAX_PTR)
return NULL;
222 table[next_ptr].org_ptr = buf;
225 *((
ush*)&buf+1) += ((
ush)((
uch*)buf-0) + 15) >> 4;
227 table[next_ptr++].new_ptr = buf;
234 if (*(
ush*)&ptr != 0) {
239 for (n = 0; n < next_ptr; n++) {
240 if (ptr != table[n].new_ptr)
continue;
242 farfree(table[n].org_ptr);
243 while (++n < next_ptr) {
244 table[n-1] = table[
n];
250 Assert(0,
"zcfree: ptr not found");
261 #if (!defined(_MSC_VER) || (_MSC_VER <= 600))
262 # define _halloc halloc
263 # define _hfree hfree
268 if (opaque) opaque = 0;
269 return _halloc((
long)items, size);
274 if (opaque) opaque = 0;
293 if (opaque) items += size - size;
294 return sizeof(
uInt) > 2 ? (
voidpf)malloc(items * size) :
295 (
voidpf)calloc(items, size);