20# define ZLIB_INTERNAL __attribute__((visibility ("hidden")))
27#if defined(STDC) && !defined(Z_SOLO)
28# if !(defined(_WIN32_WCE) && defined(_MSC_VER))
42typedef unsigned char uch;
44typedef unsigned short ush;
46typedef unsigned long ulg;
48#if !defined(Z_U8) && !defined(Z_SOLO) && defined(STDC)
50# if (ULONG_MAX == 0xffffffffffffffff)
51# define Z_U8 unsigned long
52# elif (ULLONG_MAX == 0xffffffffffffffff)
53# define Z_U8 unsigned long long
54# elif (UINT_MAX == 0xffffffffffffffff)
59extern const char *
const z_errmsg[10];
62#define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)]
64#define ERR_RETURN(strm,err) \
65 return (strm->msg = ERR_MSG(err), (err))
71# define DEF_WBITS MAX_WBITS
76# define DEF_MEM_LEVEL 8
78# define DEF_MEM_LEVEL MAX_MEM_LEVEL
91#define PRESET_DICT 0x20
95#if defined(MSDOS) || (defined(WINDOWS) && !defined(WIN32))
98# if defined(__TURBOC__) || defined(__BORLANDC__)
99# if (__STDC__ == 1) && (defined(__LARGE__) || defined(__COMPACT__))
101 void _Cdecl farfree(
void *block );
102 void *_Cdecl farmalloc(
unsigned long nbytes );
116#if defined(VAXC) || defined(VMS)
118# define F_OPEN(name, mode) \
119 fopen((name), (mode), "mbc=60", "ctx=stm", "rfm=fix", "mrs=512")
123# if __TARGET_LIB__ < 0x20000000
125# elif __TARGET_LIB__ < 0x40000000
132#if defined(ATARI) || defined(atarist)
138# if defined(M_I86) && !defined(Z_SOLO)
143#if defined(MACOS) || defined(TARGET_OS_MAC)
146# if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os
150# define fdopen(fd,mode) NULL
160#if defined(WIN32) && !defined(__CYGWIN__)
176#if defined(_BEOS_) || defined(RISCOS)
177# define fdopen(fd,mode) NULL
180#if (defined(_MSC_VER) && (_MSC_VER > 600)) && !defined __INTERIX
181# if defined(_WIN32_WCE)
182# define fdopen(fd,mode) NULL
184# define fdopen(fd,type) _fdopen(fd,type)
188#if defined(__BORLANDC__) && !defined(MSDOS)
195#if !defined(_WIN32) && \
196 (!defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0)
197 ZEXTERN uLong ZEXPORT adler32_combine64(uLong, uLong, z_off_t);
198 ZEXTERN uLong ZEXPORT crc32_combine64(uLong, uLong, z_off_t);
199 ZEXTERN uLong ZEXPORT crc32_combine_gen64(z_off_t);
209# define F_OPEN(name, mode) fopen((name), (mode))
214#if defined(pyr) || defined(Z_SOLO)
217#if defined(SMALL_MEDIUM) && !defined(_MSC_VER) && !defined(__SC__)
224#if defined(STDC) && !defined(HAVE_MEMCPY) && !defined(NO_MEMCPY)
229# define zmemcpy _fmemcpy
230# define zmemcmp _fmemcmp
231# define zmemzero(dest, len) _fmemset(dest, 0, len)
233# define zmemcpy memcpy
234# define zmemcmp memcmp
235# define zmemzero(dest, len) memset(dest, 0, len)
238 void ZLIB_INTERNAL zmemcpy(Bytef* dest,
const Bytef* source, uInt len);
239 int ZLIB_INTERNAL zmemcmp(
const Bytef* s1,
const Bytef* s2, uInt len);
240 void ZLIB_INTERNAL zmemzero(Bytef* dest, uInt len);
246 extern int ZLIB_INTERNAL z_verbose;
247 extern void ZLIB_INTERNAL z_error(
char *m);
248# define Assert(cond,msg) {if(!(cond)) z_error(msg);}
249# define Trace(x) {if (z_verbose>=0) fprintf x ;}
250# define Tracev(x) {if (z_verbose>0) fprintf x ;}
251# define Tracevv(x) {if (z_verbose>1) fprintf x ;}
252# define Tracec(c,x) {if (z_verbose>0 && (c)) fprintf x ;}
253# define Tracecv(c,x) {if (z_verbose>1 && (c)) fprintf x ;}
255# define Assert(cond,msg)
264 voidpf ZLIB_INTERNAL zcalloc(voidpf opaque,
unsigned items,
266 void ZLIB_INTERNAL zcfree(voidpf opaque, voidpf ptr);
269#define ZALLOC(strm, items, size) \
270 (*((strm)->zalloc))((strm)->opaque, (items), (size))
271#define ZFREE(strm, addr) (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
272#define TRY_FREE(s, p) {if (p) ZFREE(s, p);}
275#define ZSWAP32(q) ((((q) >> 24) & 0xff) + (((q) >> 8) & 0xff00) + \
276 (((q) & 0xff00) << 8) + (((q) & 0xff) << 24))