zlib 1.0-pre

This commit is contained in:
Mark Adler
2011-09-09 23:13:27 -07:00
parent 56bcb184fa
commit 8a2acbffc8
32 changed files with 588 additions and 1274 deletions

20
zutil.h
View File

@@ -1,5 +1,5 @@
/* zutil.h -- internal interface and configuration of the compression library
* Copyright (C) 1995-1996 Jean-loup Gailly.
* Copyright (C) 1995 Jean-loup Gailly.
* For conditions of distribution and use, see copyright notice in zlib.h
*/
@@ -15,7 +15,7 @@
#include "zlib.h"
#if defined(MSDOS) || defined(VMS) || defined(CRAY) || defined(WIN32)
#if defined(MSDOS) || defined(VMS) || defined(CRAY)
# include <stddef.h>
# include <errno.h>
#else
@@ -37,13 +37,9 @@ typedef unsigned short ush;
typedef ush FAR ushf;
typedef unsigned long ulg;
extern const char *z_errmsg[10]; /* indexed by 2-zlib_error */
/* (size given to avoid silly warnings with Visual C++) */
extern char *z_errmsg[]; /* indexed by 1-zlib_error */
#define ERR_MSG(err) (char*)z_errmsg[Z_NEED_DICT-(err)]
#define ERR_RETURN(strm,err) \
return (strm->msg = ERR_MSG(err), (err))
#define ERR_RETURN(strm,err) return (strm->msg = z_errmsg[1-(err)], (err))
/* To be used only when the state is known to be valid */
/* common constants */
@@ -69,8 +65,6 @@ extern const char *z_errmsg[10]; /* indexed by 2-zlib_error */
#define MAX_MATCH 258
/* The minimum and maximum match lengths */
#define PRESET_DICT 0x20 /* preset dictionary flag in zlib header */
/* target dependencies */
#ifdef MSDOS
@@ -148,13 +142,11 @@ extern const char *z_errmsg[10]; /* indexed by 2-zlib_error */
# define HAVE_MEMCPY
#endif
#ifdef HAVE_MEMCPY
# ifdef SMALL_MEDIUM /* MSDOS small or medium model */
# if defined(M_I86SM) || defined(M_I86MM) /* MSC small or medium model */
# define zmemcpy _fmemcpy
# define zmemcmp _fmemcmp
# define zmemzero(dest, len) _fmemset(dest, 0, len)
# else
# define zmemcpy memcpy
# define zmemcmp memcmp
# define zmemzero(dest, len) memset(dest, 0, len)
# endif
#else
@@ -184,7 +176,7 @@ extern const char *z_errmsg[10]; /* indexed by 2-zlib_error */
#endif
typedef uLong (*check_func) OF((uLong check, const Bytef *buf, uInt len));
typedef uLong (*check_func) OF((uLong check, Bytef *buf, uInt len));
extern void z_error OF((char *m));