14 (
z_const char *)
"need dictionary",
20 (
z_const char *)
"insufficient memory",
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;
64 #if defined(ASMV) || defined(ASMINF) 73 #ifdef DYNAMIC_CRC_TABLE 82 #ifdef PKZIP_BUG_WORKAROUND 88 #if defined(STDC
) || defined(Z_HAVE_STDARG_H) 91 # ifdef HAS_vsprintf_void 95 # ifdef HAS_vsnprintf_void 103 # ifdef HAS_sprintf_void 107 # ifdef HAS_snprintf_void 120 int ZLIB_INTERNAL z_verbose = verbose;
122 void ZLIB_INTERNAL z_error (m)
125 fprintf(stderr,
"%s\n", m);
139 #if defined(_WIN32_WCE) 149 void ZLIB_INTERNAL zmemcpy(dest, source, len)
154 if (len == 0)
return;
157 }
while (--len != 0);
160 int ZLIB_INTERNAL zmemcmp(s1, s2, len)
167 for (j = 0; j < len; j++) {
168 if (s1[j] != s2[j])
return 2*(s1[j] > s2[j])-1;
173 void ZLIB_INTERNAL zmemzero(dest, len)
177 if (len == 0)
return;
180 }
while (--len != 0);
202 local
int next_ptr = 0;
204 typedef struct ptr_table_s {
209 local ptr_table table[MAX_PTR];
217 voidpf ZLIB_INTERNAL zcalloc (voidpf opaque,
unsigned items,
unsigned size)
220 ulg bsize = (ulg)items*size;
227 if (bsize < 65520L) {
228 buf = farmalloc(bsize);
229 if (*(ush*)&buf != 0)
return buf;
231 buf = farmalloc(bsize + 16L);
233 if (buf == NULL || next_ptr >= MAX_PTR)
return NULL;
234 table[next_ptr].org_ptr = buf;
237 *((ush*)&buf+1) += ((ush)((uch*)buf-0) + 15) >> 4;
239 table[next_ptr++].new_ptr = buf;
243 void ZLIB_INTERNAL zcfree (voidpf opaque, voidpf ptr)
249 if (*(ush*)&ptr != 0) {
254 for (n = 0; n < next_ptr; n++) {
255 if (ptr != table[n].new_ptr)
continue;
257 farfree(table[n].org_ptr);
258 while (++n < next_ptr) {
259 table[n-1] = table[n];
264 Assert(0,
"zcfree: ptr not found");
275 #if (!defined(_MSC_VER) || (_MSC_VER <= 600
)) 276 # define _halloc halloc 277 # define _hfree hfree 280 voidpf ZLIB_INTERNAL zcalloc (voidpf opaque, uInt items, uInt size)
283 return _halloc((
long)items, size);
286 void ZLIB_INTERNAL zcfree (voidpf opaque, voidpf ptr)
300 extern voidp malloc OF((uInt size));
301 extern voidp calloc OF((uInt items, uInt size));
302 extern void free OF((voidpf ptr));
311 return sizeof(uInt) > 2 ? (voidpf)malloc(items * size) :
312 (voidpf)calloc(items, size);
const char *ZEXPORT zlibVersion()
uLong ZEXPORT zlibCompileFlags()
z_const char *const z_errmsg[10]
const char *ZEXPORT zError(int err)
voidpf ZLIB_INTERNAL zcalloc(voidpf opaque, unsigned items, unsigned size)
void ZLIB_INTERNAL zcfree(voidpf opaque, voidpf ptr)