| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
#ifndef ZUTIL_H |
| 6 |
#define ZUTIL_H |
| 7 |
|
| 8 |
#include "inflate64_config.h" |
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
extern z_const char * const z_errmsg[10]; |
| 13 |
|
| 14 |
|
| 15 |
#define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)] |
| 16 |
|
| 17 |
#define ERR_RETURN(strm,err) \ |
| 18 |
return (strm->msg = ERR_MSG(err), (err)) |
| 19 |
|
| 20 |
|
| 21 |
#if defined(pyr) || defined(Z_SOLO) |
| 22 |
# define NO_MEMCPY |
| 23 |
#endif |
| 24 |
#if defined(STDC) && !defined(HAVE_MEMCPY) && !defined(NO_MEMCPY) |
| 25 |
# define HAVE_MEMCPY |
| 26 |
#endif |
| 27 |
|
| 28 |
#ifdef HAVE_MEMCPY |
| 29 |
# define zmemcpy memcpy |
| 30 |
# define zmemcmp memcmp |
| 31 |
# define zmemzero(dest, len) memset(dest, 0, len) |
| 32 |
#else |
| 33 |
void ZLIB_INTERNAL zmemcpy OF((Byte FAR* dest, const Byte FAR* source, uInt len)); |
| 34 |
int ZLIB_INTERNAL zmemcmp OF((const Byte FAR* s1, const Byte FAR* s2, uInt len)); |
| 35 |
void ZLIB_INTERNAL zmemzero OF((Byte FAR* dest, uInt len)); |
| 36 |
#endif |
| 37 |
|
| 38 |
|
| 39 |
#ifdef ZLIB_DEBUG |
| 40 |
# include <stdio.h> |
| 41 |
extern int ZLIB_INTERNAL z_verbose; |
| 42 |
extern void ZLIB_INTERNAL z_error OF((char *m)); |
| 43 |
# define Assert(cond,msg) {if(!(cond)) z_error(msg);} |
| 44 |
# define Tracev(x) {if (z_verbose>0) fprintf x ;} |
| 45 |
# define Tracevv(x) {if (z_verbose>1) fprintf x ;} |
| 46 |
# define Tracecv(c,x) {if (z_verbose>1 && (c)) fprintf x ;} |
| 47 |
#else |
| 48 |
# define Assert(cond,msg) |
| 49 |
# define Tracev(x) |
| 50 |
# define Tracevv(x) |
| 51 |
# define Tracecv(c,x) |
| 52 |
#endif |
| 53 |
|
| 54 |
#define ZALLOC(strm, items, size) \ |
| 55 |
(*((strm)->zalloc))((strm)->opaque, (items), (size)) |
| 56 |
#define ZFREE(strm, addr) (*((strm)->zfree))((strm)->opaque, (voidpf)(addr)) |
| 57 |
#define TRY_FREE(s, p) {if (p) ZFREE(s, p);} |
| 58 |
|
| 59 |
#endif |