1/* zconf.h -- configuration of the zlib compression library
2 * Copyright (C) 1995-1996 Jean-loup Gailly.
3 * For conditions of distribution and use, see copyright notice in zlib.h
4 */
5
6/* $Id: zconf.h,v 1.1 1997/02/26 20:47:20 aku Exp $ */
7
8#ifndef _ZCONF_H
9#define _ZCONF_H
10
11/*
12 * Definitions to enable the generation of a DLL under Windows.
13 * Taken from 'ftp://ftp.sunlabs.com/pub/tcl/example.zip(example.c)'
14 */
15
16#if defined(__WIN32__)
17#   define WIN32_LEAN_AND_MEAN
18#   include <windows.h>
19#   undef WIN32_LEAN_AND_MEAN
20#endif
21
22/*
23 * If you *really* need a unique prefix for all types and library functions,
24 * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
25 */
26#ifdef Z_PREFIX
27#  define deflateInit_	z_deflateInit_
28#  define deflate	z_deflate
29#  define deflateEnd	z_deflateEnd
30#  define inflateInit_ 	z_inflateInit_
31#  define inflate	z_inflate
32#  define inflateEnd	z_inflateEnd
33#  define deflateInit2_	z_deflateInit2_
34#  define deflateSetDictionary z_deflateSetDictionary
35#  define deflateCopy	z_deflateCopy
36#  define deflateReset	z_deflateReset
37#  define deflateParams	z_deflateParams
38#  define inflateInit2_	z_inflateInit2_
39#  define inflateSetDictionary z_inflateSetDictionary
40#  define inflateSync	z_inflateSync
41#  define inflateReset	z_inflateReset
42#  define compress	z_compress
43#  define uncompress	z_uncompress
44#  define adler32	z_adler32
45#  define crc32		z_crc32
46#  define get_crc_table z_get_crc_table
47
48#  define Byte		z_Byte
49#  define uInt		z_uInt
50#  define uLong		z_uLong
51#  define Bytef	        z_Bytef
52#  define charf		z_charf
53#  define intf		z_intf
54#  define uIntf		z_uIntf
55#  define uLongf	z_uLongf
56#  define voidpf	z_voidpf
57#  define voidp		z_voidp
58#endif
59
60#if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32)
61#  define WIN32
62#endif
63#if defined(__GNUC__) || defined(WIN32) || defined(__386__) || defined(i386)
64#  ifndef __32BIT__
65#    define __32BIT__
66#  endif
67#endif
68#if defined(__MSDOS__) && !defined(MSDOS)
69#  define MSDOS
70#endif
71
72/*
73 * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
74 * than 64k bytes at a time (needed on systems with 16-bit int).
75 */
76#if defined(MSDOS) && !defined(__32BIT__)
77#  define MAXSEG_64K
78#endif
79#ifdef MSDOS
80#  define UNALIGNED_OK
81#endif
82
83#if (defined(MSDOS) || defined(_WINDOWS) || defined(WIN32))  && !defined(STDC)
84#  define STDC
85#endif
86#if (defined(__STDC__) || defined(__cplusplus)) && !defined(STDC)
87#  define STDC
88#endif
89
90#ifndef STDC
91#  ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
92#    define const
93#  endif
94#endif
95
96/* Some Mac compilers merge all .h files incorrectly: */
97#if defined(__MWERKS__) || defined(applec) ||defined(THINK_C) ||defined(__SC__)
98#  define NO_DUMMY_DECL
99#endif
100
101/* Maximum value for memLevel in deflateInit2 */
102#ifndef MAX_MEM_LEVEL
103#  ifdef MAXSEG_64K
104#    define MAX_MEM_LEVEL 8
105#  else
106#    define MAX_MEM_LEVEL 9
107#  endif
108#endif
109
110/* Maximum value for windowBits in deflateInit2 and inflateInit2 */
111#ifndef MAX_WBITS
112#  define MAX_WBITS   15 /* 32K LZ77 window */
113#endif
114
115/* The memory requirements for deflate are (in bytes):
116            1 << (windowBits+2)   +  1 << (memLevel+9)
117 that is: 128K for windowBits=15  +  128K for memLevel = 8  (default values)
118 plus a few kilobytes for small objects. For example, if you want to reduce
119 the default memory requirements from 256K to 128K, compile with
120     make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
121 Of course this will generally degrade compression (there's no free lunch).
122
123   The memory requirements for inflate are (in bytes) 1 << windowBits
124 that is, 32K for windowBits=15 (default value) plus a few kilobytes
125 for small objects.
126*/
127
128                        /* Type declarations */
129
130#ifndef OF /* function prototypes */
131#  ifdef STDC
132#    define OF(args)  args
133#  else
134#    define OF(args)  ()
135#  endif
136#endif
137
138/* The following definitions for FAR are needed only for MSDOS mixed
139 * model programming (small or medium model with some far allocations).
140 * This was tested only with MSC; for other MSDOS compilers you may have
141 * to define NO_MEMCPY in zutil.h.  If you don't need the mixed model,
142 * just define FAR to be empty.
143 */
144#if (defined(M_I86SM) || defined(M_I86MM)) && !defined(__32BIT__)
145   /* MSC small or medium model */
146#  define SMALL_MEDIUM
147#  ifdef _MSC_VER
148#    define FAR __far
149#  else
150#    define FAR far
151#  endif
152#endif
153
154#if defined(__BORLANDC__) && (defined(__SMALL__) || defined(__MEDIUM__))
155#  ifndef __32BIT__
156#    define SMALL_MEDIUM
157#    define FAR __far
158#  endif
159#endif
160
161#ifndef FAR
162#   define FAR
163#endif
164
165typedef unsigned char  Byte;  /* 8 bits */
166typedef unsigned int   uInt;  /* 16 bits or more */
167typedef unsigned long  uLong; /* 32 bits or more */
168
169#if defined(__BORLANDC__) && defined(SMALL_MEDIUM)
170   /* Borland C/C++ ignores FAR inside typedef */
171#  define Bytef Byte FAR
172#else
173   typedef Byte  FAR Bytef;
174#endif
175typedef char  FAR charf;
176typedef int   FAR intf;
177typedef uInt  FAR uIntf;
178typedef uLong FAR uLongf;
179
180#ifdef STDC
181   typedef void FAR *voidpf;
182   typedef void     *voidp;
183#else
184   typedef Byte FAR *voidpf;
185   typedef Byte     *voidp;
186#endif
187
188
189/* Compile with -DZLIB_DLL for Windows DLL support */
190/*#if (defined(_WINDOWS) || defined(WINDOWS)) && defined(ZLIB_DLL)*/
191
192/*
193 * Definitions to enable the generation of a DLL under Windows.
194 * Taken from 'ftp://ftp.sunlabs.com/pub/tcl/example.zip(example.c)'
195 */
196
197#if defined(__WIN32__)
198/*
199 * VC++ has an alternate entry point called DllMain, so we need to rename
200 * our entry point.
201 */
202#   if defined(_MSC_VER)
203#	define EXPORT(a,b) __declspec(dllexport) a b
204#	define DllEntryPoint DllMain
205#   else
206#	if defined(__BORLANDC__)
207#	    define EXPORT(a,b) a _export b
208#	else
209#	    define EXPORT(a,b) a b
210#	endif
211#   endif
212#else
213#   define EXPORT(a,b) a b
214#endif
215
216/*#  include <windows.h>*/
217/*#  define EXPORT  WINAPI*/
218/*#else*/
219/*#  define EXPORT*/
220/*#endif*/
221
222#endif /* _ZCONF_H */
223