diff options
Diffstat (limited to 'zutil.h')
-rw-r--r-- | zutil.h | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -8,7 +8,7 @@ | |||
8 | subject to change. Applications should only use zlib.h. | 8 | subject to change. Applications should only use zlib.h. |
9 | */ | 9 | */ |
10 | 10 | ||
11 | /* $Id: zutil.h,v 1.4 1995/04/14 10:22:17 jloup Exp $ */ | 11 | /* $Id: zutil.h,v 1.5 1995/04/14 21:22:38 jloup Exp $ */ |
12 | 12 | ||
13 | #ifndef _Z_UTIL_H | 13 | #ifndef _Z_UTIL_H |
14 | #define _Z_UTIL_H | 14 | #define _Z_UTIL_H |
@@ -20,6 +20,10 @@ | |||
20 | #else | 20 | #else |
21 | extern int errno; | 21 | extern int errno; |
22 | #endif | 22 | #endif |
23 | #ifdef __STDC__ | ||
24 | # include <string.h> | ||
25 | # include <memory.h> | ||
26 | #endif | ||
23 | 27 | ||
24 | #ifndef local | 28 | #ifndef local |
25 | # define local static | 29 | # define local static |
@@ -154,13 +158,16 @@ extern char *z_errmsg[]; /* indexed by 1-zlib_error */ | |||
154 | #endif | 158 | #endif |
155 | 159 | ||
156 | 160 | ||
161 | typedef uLong (*check_func) __P((uLong check, Byte *buf, uInt len)); | ||
162 | |||
157 | extern void z_error __P((char *m)); | 163 | extern void z_error __P((char *m)); |
158 | 164 | ||
159 | voidp zcalloc __P((voidp opaque, unsigned items, unsigned size)); | 165 | voidp zcalloc __P((voidp opaque, unsigned items, unsigned size)); |
160 | void zcfree __P((voidp opaque, voidp ptr)); | 166 | void zcfree __P((voidp opaque, voidp ptr)); |
161 | 167 | ||
162 | #define ZALLOC(strm, items, size) (*strm->zalloc)(strm->opaque, items, size) | 168 | #define ZALLOC(strm, items, size) \ |
163 | #define ZFREE(strm, addr) (*strm->zfree) (strm->opaque, (voidp)addr) | 169 | (*((strm)->zalloc))((strm)->opaque, (items), (size)) |
170 | #define ZFREE(strm, addr) (*((strm)->zfree))((strm)->opaque, (voidp)(addr)) | ||
164 | #define TRY_FREE(s, p) {if (p) ZFREE(s, p);} | 171 | #define TRY_FREE(s, p) {if (p) ZFREE(s, p);} |
165 | 172 | ||
166 | #endif /* _Z_UTIL_H */ | 173 | #endif /* _Z_UTIL_H */ |