diff options
Diffstat (limited to 'zutil.h')
-rw-r--r-- | zutil.h | 20 |
1 files changed, 6 insertions, 14 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* zutil.h -- internal interface and configuration of the compression library | 1 | /* zutil.h -- internal interface and configuration of the compression library |
2 | * Copyright (C) 1995-1996 Jean-loup Gailly. | 2 | * Copyright (C) 1995 Jean-loup Gailly. |
3 | * For conditions of distribution and use, see copyright notice in zlib.h | 3 | * For conditions of distribution and use, see copyright notice in zlib.h |
4 | */ | 4 | */ |
5 | 5 | ||
@@ -15,7 +15,7 @@ | |||
15 | 15 | ||
16 | #include "zlib.h" | 16 | #include "zlib.h" |
17 | 17 | ||
18 | #if defined(MSDOS) || defined(VMS) || defined(CRAY) || defined(WIN32) | 18 | #if defined(MSDOS) || defined(VMS) || defined(CRAY) |
19 | # include <stddef.h> | 19 | # include <stddef.h> |
20 | # include <errno.h> | 20 | # include <errno.h> |
21 | #else | 21 | #else |
@@ -37,13 +37,9 @@ typedef unsigned short ush; | |||
37 | typedef ush FAR ushf; | 37 | typedef ush FAR ushf; |
38 | typedef unsigned long ulg; | 38 | typedef unsigned long ulg; |
39 | 39 | ||
40 | extern const char *z_errmsg[10]; /* indexed by 2-zlib_error */ | 40 | extern char *z_errmsg[]; /* indexed by 1-zlib_error */ |
41 | /* (size given to avoid silly warnings with Visual C++) */ | ||
42 | 41 | ||
43 | #define ERR_MSG(err) (char*)z_errmsg[Z_NEED_DICT-(err)] | 42 | #define ERR_RETURN(strm,err) return (strm->msg = z_errmsg[1-(err)], (err)) |
44 | |||
45 | #define ERR_RETURN(strm,err) \ | ||
46 | return (strm->msg = ERR_MSG(err), (err)) | ||
47 | /* To be used only when the state is known to be valid */ | 43 | /* To be used only when the state is known to be valid */ |
48 | 44 | ||
49 | /* common constants */ | 45 | /* common constants */ |
@@ -69,8 +65,6 @@ extern const char *z_errmsg[10]; /* indexed by 2-zlib_error */ | |||
69 | #define MAX_MATCH 258 | 65 | #define MAX_MATCH 258 |
70 | /* The minimum and maximum match lengths */ | 66 | /* The minimum and maximum match lengths */ |
71 | 67 | ||
72 | #define PRESET_DICT 0x20 /* preset dictionary flag in zlib header */ | ||
73 | |||
74 | /* target dependencies */ | 68 | /* target dependencies */ |
75 | 69 | ||
76 | #ifdef MSDOS | 70 | #ifdef MSDOS |
@@ -148,13 +142,11 @@ extern const char *z_errmsg[10]; /* indexed by 2-zlib_error */ | |||
148 | # define HAVE_MEMCPY | 142 | # define HAVE_MEMCPY |
149 | #endif | 143 | #endif |
150 | #ifdef HAVE_MEMCPY | 144 | #ifdef HAVE_MEMCPY |
151 | # ifdef SMALL_MEDIUM /* MSDOS small or medium model */ | 145 | # if defined(M_I86SM) || defined(M_I86MM) /* MSC small or medium model */ |
152 | # define zmemcpy _fmemcpy | 146 | # define zmemcpy _fmemcpy |
153 | # define zmemcmp _fmemcmp | ||
154 | # define zmemzero(dest, len) _fmemset(dest, 0, len) | 147 | # define zmemzero(dest, len) _fmemset(dest, 0, len) |
155 | # else | 148 | # else |
156 | # define zmemcpy memcpy | 149 | # define zmemcpy memcpy |
157 | # define zmemcmp memcmp | ||
158 | # define zmemzero(dest, len) memset(dest, 0, len) | 150 | # define zmemzero(dest, len) memset(dest, 0, len) |
159 | # endif | 151 | # endif |
160 | #else | 152 | #else |
@@ -184,7 +176,7 @@ extern const char *z_errmsg[10]; /* indexed by 2-zlib_error */ | |||
184 | #endif | 176 | #endif |
185 | 177 | ||
186 | 178 | ||
187 | typedef uLong (*check_func) OF((uLong check, const Bytef *buf, uInt len)); | 179 | typedef uLong (*check_func) OF((uLong check, Bytef *buf, uInt len)); |
188 | 180 | ||
189 | extern void z_error OF((char *m)); | 181 | extern void z_error OF((char *m)); |
190 | 182 | ||