| 1 | /* zutil.h -- internal interface and configuration of the compression library
|
|---|
| 2 | * Copyright (C) 1995-2002 Jean-loup Gailly.
|
|---|
| 3 | * For conditions of distribution and use, see copyright notice in zlib.h
|
|---|
| 4 | */
|
|---|
| 5 |
|
|---|
| 6 | /* WARNING: this file should *not* be used by applications. It is
|
|---|
| 7 | part of the implementation of the compression library and is
|
|---|
| 8 | subject to change. Applications should only use zlib.h.
|
|---|
| 9 | */
|
|---|
| 10 |
|
|---|
| 11 | /* @(#) $Id: zutil.h,v 1.1.26.1 2002/03/11 22:18:20 tromey Exp $ */
|
|---|
| 12 |
|
|---|
| 13 | #ifndef _Z_UTIL_H
|
|---|
| 14 | #define _Z_UTIL_H
|
|---|
| 15 |
|
|---|
| 16 | #include "zlib.h"
|
|---|
| 17 |
|
|---|
| 18 | #ifdef STDC
|
|---|
| 19 | # include <stddef.h>
|
|---|
| 20 | # include <string.h>
|
|---|
| 21 | # include <stdlib.h>
|
|---|
| 22 | #endif
|
|---|
| 23 | #ifdef NO_ERRNO_H
|
|---|
| 24 | extern int errno;
|
|---|
| 25 | #else
|
|---|
| 26 | # include <errno.h>
|
|---|
| 27 | #endif
|
|---|
| 28 |
|
|---|
| 29 | #ifndef local
|
|---|
| 30 | # define local static
|
|---|
| 31 | #endif
|
|---|
| 32 | /* compile with -Dlocal if your debugger can't find static symbols */
|
|---|
| 33 |
|
|---|
| 34 | typedef unsigned char uch;
|
|---|
| 35 | typedef uch FAR uchf;
|
|---|
| 36 | typedef unsigned short ush;
|
|---|
| 37 | typedef ush FAR ushf;
|
|---|
| 38 | typedef unsigned long ulg;
|
|---|
| 39 |
|
|---|
| 40 | extern const char *z_errmsg[10]; /* indexed by 2-zlib_error */
|
|---|
| 41 | /* (size given to avoid silly warnings with Visual C++) */
|
|---|
| 42 |
|
|---|
| 43 | #define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)]
|
|---|
| 44 |
|
|---|
| 45 | #define ERR_RETURN(strm,err) \
|
|---|
| 46 | return (strm->msg = (char*)ERR_MSG(err), (err))
|
|---|
| 47 | /* To be used only when the state is known to be valid */
|
|---|
| 48 |
|
|---|
| 49 | /* common constants */
|
|---|
| 50 |
|
|---|
| 51 | #ifndef DEF_WBITS
|
|---|
| 52 | # define DEF_WBITS MAX_WBITS
|
|---|
| 53 | #endif
|
|---|
| 54 | /* default windowBits for decompression. MAX_WBITS is for compression only */
|
|---|
| 55 |
|
|---|
| 56 | #if MAX_MEM_LEVEL >= 8
|
|---|
| 57 | # define DEF_MEM_LEVEL 8
|
|---|
| 58 | #else
|
|---|
| 59 | # define DEF_MEM_LEVEL MAX_MEM_LEVEL
|
|---|
| 60 | #endif
|
|---|
|
|---|