17# define ZLIB_INTERNAL __attribute__((visibility ("hidden")))
24#if defined(STDC) && !defined(Z_SOLO)
25# if !(defined(_WIN32_WCE) && defined(_MSC_VER))
39typedef unsigned char uch;
41typedef unsigned short ush;
43typedef unsigned long ulg;
46#if !defined(Z_U8) && !defined(Z_SOLO) && defined(STDC)
48# if (ULONG_MAX == 0xffffffffffffffff)
49# define Z_U8 unsigned long
50# elif (ULLONG_MAX == 0xffffffffffffffff)
51# define Z_U8 unsigned long long
52# elif (UINT_MAX == 0xffffffffffffffff)
60extern z_const
char *
const z_errmsg[10];
63#define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)]
65#define ERR_RETURN(strm,err) \
66 return (strm->msg = ERR_MSG(err), (err))
72# define DEF_WBITS MAX_WBITS
77# define DEF_MEM_LEVEL 8
79# define DEF_MEM_LEVEL MAX_MEM_LEVEL
92#define PRESET_DICT 0x20
96#if defined(MSDOS) || (defined(WINDOWS) && !defined(WIN32))
99# if defined(__TURBOC__) || defined(__BORLANDC__)
100# if (__STDC__ == 1) && (defined(__LARGE__) || defined(__COMPACT__))
102 void _Cdecl farfree(
void *block );
103 void *_Cdecl farmalloc(
unsigned long nbytes );
117#if defined(VAXC) || defined(VMS)
119# define F_OPEN(name, mode) \
120 fopen((name), (mode), "mbc=60", "ctx=stm", "rfm=fix", "mrs=512")
124# if __TARGET_LIB__ < 0x20000000
126# elif __TARGET_LIB__ < 0x40000000
133#if defined(ATARI) || defined(atarist)
139# if defined(M_I86) && !defined(Z_SOLO)
144#if defined(MACOS) || defined(TARGET_OS_MAC)
147# if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os
151# define fdopen(fd,mode) NULL
161#if defined(WIN32) && !defined(__CYGWIN__)
177#if defined(_BEOS_) || defined(RISCOS)
178# define fdopen(fd,mode) NULL
181#if (defined(_MSC_VER) && (_MSC_VER > 600)) && !defined __INTERIX
182# if defined(_WIN32_WCE)
183# define fdopen(fd,mode) NULL
185# define fdopen(fd,type) _fdopen(fd,type)
189#if defined(__BORLANDC__) && !defined(MSDOS)
196#if !defined(_WIN32) && \
197 (!defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0)
198 ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t));
199 ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t));
200 ZEXTERN uLong ZEXPORT crc32_combine_gen64 OF((z_off_t));
210# define F_OPEN(name, mode) fopen((name), (mode))
215#if defined(pyr) || defined(Z_SOLO)
218#if defined(SMALL_MEDIUM) && !defined(_MSC_VER) && !defined(__SC__)
225#if defined(STDC) && !defined(HAVE_MEMCPY) && !defined(NO_MEMCPY)
230# define zmemcpy _fmemcpy
231# define zmemcmp _fmemcmp
232# define zmemzero(dest, len) _fmemset(dest, 0, len)
234# define zmemcpy memcpy
235# define zmemcmp memcmp
236# define zmemzero(dest, len) memset(dest, 0, len)
239 void ZLIB_INTERNAL zmemcpy OF((Bytef* dest,
const Bytef* source, uInt len));
240 int ZLIB_INTERNAL zmemcmp OF((
const Bytef* s1,
const Bytef* s2, uInt len));
241 void ZLIB_INTERNAL zmemzero OF((Bytef* dest, uInt len));
247 extern int ZLIB_INTERNAL z_verbose;
248 extern void ZLIB_INTERNAL z_error OF((
char *m));
249# define Assert(cond,msg) {if(!(cond)) z_error(msg);}
250# define Trace(x) {if (z_verbose>=0) fprintf x ;}
251# define Tracev(x) {if (z_verbose>0) fprintf x ;}
252# define Tracevv(x) {if (z_verbose>1) fprintf x ;}
253# define Tracec(c,x) {if (z_verbose>0 && (c)) fprintf x ;}
254# define Tracecv(c,x) {if (z_verbose>1 && (c)) fprintf x ;}
256# define Assert(cond,msg)
265 voidpf ZLIB_INTERNAL zcalloc OF((voidpf
opaque,
unsigned items,
267 void ZLIB_INTERNAL zcfree OF((voidpf
opaque, voidpf ptr));
270#define ZALLOC(strm, items, size) \
271 (*((strm)->zalloc))((strm)->opaque, (items), (size))
272#define ZFREE(strm, addr) (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
273#define TRY_FREE(s, p) {if (p) ZFREE(s, p);}
276#define ZSWAP32(q) ((((q) >> 24) & 0xff) + (((q) >> 8) & 0xff00) + \
277 (((q) & 0xff00) << 8) + (((q) & 0xff) << 24))