aboutsummaryrefslogtreecommitdiff
path: root/dep/src/zlib/zutil.h
diff options
context:
space:
mode:
authormaximius <none@none>2009-10-17 15:51:44 -0700
committermaximius <none@none>2009-10-17 15:51:44 -0700
commite585187b248f48b3c6e9247b49fa07c6565d65e5 (patch)
tree637c5b7ddacf41040bef4ea4f75a97da64c6a9bc /dep/src/zlib/zutil.h
parent26b5e033ffde3d161382fc9addbfa99738379641 (diff)
*Backed out changeset 3be01fb200a5
--HG-- branch : trunk
Diffstat (limited to 'dep/src/zlib/zutil.h')
-rw-r--r--dep/src/zlib/zutil.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/dep/src/zlib/zutil.h b/dep/src/zlib/zutil.h
index f55a94803cd..b8a722d904d 100644
--- a/dep/src/zlib/zutil.h
+++ b/dep/src/zlib/zutil.h
@@ -2,15 +2,20 @@
* Copyright (C) 1995-2005 Jean-loup Gailly.
* For conditions of distribution and use, see copyright notice in zlib.h
*/
+
/* WARNING: this file should *not* be used by applications. It is
part of the implementation of the compression library and is
subject to change. Applications should only use zlib.h.
*/
+
/* @(#) $Id$ */
+
#ifndef ZUTIL_H
#define ZUTIL_H
+
#define ZLIB_INTERNAL
#include "zlib.h"
+
#ifdef STDC
# ifndef _WIN32_WCE
# include <stddef.h>
@@ -33,41 +38,54 @@
# include <errno.h>
# endif
#endif
+
#ifndef local
# define local static
#endif
/* compile with -Dlocal if your debugger can't find static symbols */
+
typedef unsigned char uch;
typedef uch FAR uchf;
typedef unsigned short ush;
typedef ush FAR ushf;
typedef unsigned long ulg;
+
extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
/* (size given to avoid silly warnings with Visual C++) */
+
#define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)]
+
#define ERR_RETURN(strm,err) \
return (strm->msg = (char*)ERR_MSG(err), (err))
/* To be used only when the state is known to be valid */
+
/* common constants */
+
#ifndef DEF_WBITS
# define DEF_WBITS MAX_WBITS
#endif
/* default windowBits for decompression. MAX_WBITS is for compression only */
+
#if MAX_MEM_LEVEL >= 8
# define DEF_MEM_LEVEL 8
#else
# define DEF_MEM_LEVEL MAX_MEM_LEVEL
#endif
/* default memLevel */
+
#define STORED_BLOCK 0
#define STATIC_TREES 1
#define DYN_TREES 2
/* The three kinds of block type */
+
#define MIN_MATCH 3
#define MAX_MATCH 258
/* The minimum and maximum match lengths */
+
#define PRESET_DICT 0x20 /* preset dictionary flag in zlib header */
+
/* target dependencies */
+
#if defined(MSDOS) || (defined(WINDOWS) && !defined(WIN32))
# define OS_CODE 0x00
# if defined(__TURBOC__) || defined(__BORLANDC__)
@@ -82,23 +100,28 @@ extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
# include <malloc.h>
# endif
#endif
+
#ifdef AMIGA
# define OS_CODE 0x01
#endif
+
#if defined(VAXC) || defined(VMS)
# define OS_CODE 0x02
# define F_OPEN(name, mode) \
fopen((name), (mode), "mbc=60", "ctx=stm", "rfm=fix", "mrs=512")
#endif
+
#if defined(ATARI) || defined(atarist)
# define OS_CODE 0x05
#endif
+
#ifdef OS2
# define OS_CODE 0x06
# ifdef M_I86
#include <malloc.h>
# endif
#endif
+
#if defined(MACOS) || defined(TARGET_OS_MAC)
# define OS_CODE 0x07
# if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os
@@ -109,20 +132,25 @@ extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
# endif
# endif
#endif
+
#ifdef TOPS20
# define OS_CODE 0x0a
#endif
+
#ifdef WIN32
# ifndef __CYGWIN__ /* Cygwin is Unix, not Win32 */
# define OS_CODE 0x0b
# endif
#endif
+
#ifdef __50SERIES /* Prime/PRIMOS */
# define OS_CODE 0x0f
#endif
+
#if defined(_BEOS_) || defined(RISCOS)
# define fdopen(fd,mode) NULL /* No fdopen() */
#endif
+
#if (defined(_MSC_VER) && (_MSC_VER > 600))
# if defined(_WIN32_WCE)
# define fdopen(fd,mode) NULL /* No fdopen() */
@@ -134,14 +162,19 @@ extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
# define fdopen(fd,type) _fdopen(fd,type)
# endif
#endif
+
/* common defaults */
+
#ifndef OS_CODE
# define OS_CODE 0x03 /* assume Unix */
#endif
+
#ifndef F_OPEN
# define F_OPEN(name, mode) fopen((name), (mode))
#endif
+
/* functions */
+
#if defined(STDC99) || (defined(__TURBOC__) && __TURBOC__ >= 0x550)
# ifndef HAVE_VSNPRINTF
# define HAVE_VSNPRINTF
@@ -174,6 +207,7 @@ extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
#ifdef VMS
# define NO_vsnprintf
#endif
+
#if defined(pyr)
# define NO_MEMCPY
#endif
@@ -202,6 +236,7 @@ extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
extern int zmemcmp OF((const Bytef* s1, const Bytef* s2, uInt len));
extern void zmemzero OF((Bytef* dest, uInt len));
#endif
+
/* Diagnostic functions */
#ifdef DEBUG
# include <stdio.h>
@@ -222,11 +257,14 @@ extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
# define Tracecv(c,x)
#endif
+
voidpf zcalloc OF((voidpf opaque, unsigned items, unsigned size));
void zcfree OF((voidpf opaque, voidpf ptr));
+
#define ZALLOC(strm, items, size) \
(*((strm)->zalloc))((strm)->opaque, (items), (size))
#define ZFREE(strm, addr) (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
#define TRY_FREE(s, p) {if (p) ZFREE(s, p);}
+
#endif /* ZUTIL_H */