Go to the documentation of this file.
17 #if defined( INC_ALL )
24 # if !(defined(_WIN32_WCE) && defined(_MSC_VER))
32 #if defined(UNDER_CE) && defined(NO_ERRNO_H)
33 # define zseterrno(ERR) SetLastError((DWORD)(ERR))
34 # define zerrno() ((int)GetLastError())
41 # define zseterrno(ERR) do { errno = (ERR); } while (0)
42 # define zerrno() errno
51 typedef unsigned char uch;
53 typedef unsigned short ush;
55 typedef unsigned long ulg;
57 extern const char *
const z_errmsg[10];
60 #define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)]
62 #define ERR_RETURN(strm,err) \
63 return (strm->msg = (char*)ERR_MSG(err), (err))
69 # define DEF_WBITS MAX_WBITS
73 #if MAX_MEM_LEVEL >= 8
74 # define DEF_MEM_LEVEL 8
76 # define DEF_MEM_LEVEL MAX_MEM_LEVEL
80 #define STORED_BLOCK 0
81 #define STATIC_TREES 1
89 #define PRESET_DICT 0x20
93 #if defined(MSDOS) || (defined(WINDOWS) && !defined(WIN32))
95 # if defined(__TURBOC__) || defined(__BORLANDC__)
96 # if (__STDC__ == 1) && (defined(__LARGE__) || defined(__COMPACT__))
98 void _Cdecl farfree(
void *block );
99 void *_Cdecl farmalloc(
unsigned long nbytes );
109 # define OS_CODE 0x01
112 #if defined(VAXC) || defined(VMS)
113 # define OS_CODE 0x02
114 # define F_OPEN(name, mode) \
115 fopen((name), (mode), "mbc=60", "ctx=stm", "rfm=fix", "mrs=512")
118 #if defined(ATARI) || defined(atarist)
119 # define OS_CODE 0x05
123 # define OS_CODE 0x06
129 #if defined(MACOS) || defined(TARGET_OS_MAC)
130 # define OS_CODE 0x07
131 # if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os
135 # define fdopen(fd,mode) NULL
141 # define OS_CODE 0x0a
146 # define OS_CODE 0x0b
151 # define OS_CODE 0x0f
154 #if defined(_BEOS_) || defined(RISCOS)
155 # define fdopen(fd,mode) NULL
158 #if (defined(_MSC_VER) && (_MSC_VER > 600)) && !defined __INTERIX
159 # if defined(_WIN32_WCE)
160 # define fdopen(fd,mode) NULL
161 # ifndef _PTRDIFF_T_DEFINED
162 typedef int ptrdiff_t;
163 # define _PTRDIFF_T_DEFINED
166 # define fdopen(fd,type) _fdopen(fd,type)
170 #if defined(__BORLANDC__)
177 #ifdef _LARGEFILE64_SOURCE
178 # define z_off64_t off64_t
180 # define z_off64_t z_off_t
183 #define z_off64_t z_off_t
188 # define OS_CODE 0x03
192 # define F_OPEN(name, mode) fopen((name), (mode))
195 #ifdef _LARGEFILE64_SOURCE
196 # define F_OPEN64(name, mode) fopen64((name), (mode))
198 # define F_OPEN64(name, mode) fopen((name), (mode))
203 #if defined(STDC99) || (defined(__TURBOC__) && __TURBOC__ >= 0x550)
204 # ifndef HAVE_VSNPRINTF
205 # define HAVE_VSNPRINTF
208 #if defined(__CYGWIN__)
209 # ifndef HAVE_VSNPRINTF
210 # define HAVE_VSNPRINTF
213 #ifndef HAVE_VSNPRINTF
217 # define NO_vsnprintf
220 # define NO_vsnprintf
224 # if !defined(vsnprintf) && !defined(NO_vsnprintf)
225 # if !defined(_MSC_VER) || ( defined(_MSC_VER) && _MSC_VER < 1500 )
226 # define vsnprintf _vsnprintf
231 # define NO_vsnprintf
235 # define NO_vsnprintf
241 #if defined(SMALL_MEDIUM) && !defined(_MSC_VER) && !defined(__SC__)
248 #if defined(STDC) && !defined(HAVE_MEMCPY) && !defined(NO_MEMCPY)
253 # define zmemcpy _fmemcpy
254 # define zmemcmp _fmemcmp
255 # define zmemzero(dest, len) _fmemset(dest, 0, len)
257 # define zmemcpy memcpy
258 # define zmemcmp memcmp
259 # define zmemzero(dest, len) memset(dest, 0, len)
270 extern int z_verbose;
271 extern void z_error
OF((
char *m));
272 # define Assert(cond,msg) {if(!(cond)) z_error(msg);}
273 # define Trace(x) {if (z_verbose>=0) fprintf x ;}
274 # define Tracev(x) {if (z_verbose>0) fprintf x ;}
275 # define Tracevv(x) {if (z_verbose>1) fprintf x ;}
276 # define Tracec(c,x) {if (z_verbose>0 && (c)) fprintf x ;}
277 # define Tracecv(c,x) {if (z_verbose>1 && (c)) fprintf x ;}
279 # define Assert(cond,msg)
284 # define Tracecv(c,x)
291 #define ZALLOC(strm, items, size) \
292 (*((strm)->zalloc))((strm)->opaque, (items), (size))
293 #define ZFREE(strm, addr) (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
294 #define TRY_FREE(s, p) {if (p) ZFREE(s, p);}