blob: bdcd0b33c1cf183197e72dc7e3c0b8edb75a07e4 [file] [log] [blame]
J. Duke319a3b92007-12-01 00:00:00 +00001/*
2 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3 *
4 * This code is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 2 only, as
6 * published by the Free Software Foundation. Sun designates this
7 * particular file as subject to the "Classpath" exception as provided
8 * by Sun in the LICENSE file that accompanied this code.
9 *
10 * This code is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * version 2 for more details (a copy is included in the LICENSE file that
14 * accompanied this code).
15 *
16 * You should have received a copy of the GNU General Public License version
17 * 2 along with this work; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19 *
20 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
21 * CA 95054 USA or visit www.sun.com if you need additional information or
22 * have any questions.
23 *
24 * THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
25 */
26
27/*
28 * This file is available under and governed by the GNU General Public
29 * License version 2 only, as published by the Free Software Foundation.
30 * However, the following notice accompanied the original version of this
31 * file and, per its terms, should not be removed:
32 *
33 * zconf.h -- configuration of the zlib compression library
34 * Copyright (C) 1995-1998 Jean-loup Gailly.
35 * For conditions of distribution and use, see copyright notice in zlib.h
36 */
37
38#ifndef _ZCONF_H
39#define _ZCONF_H
40
41/* for _LP64 */
42#include <sys/types.h>
43
44/*
45 * If you *really* need a unique prefix for all types and library functions,
46 * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
47 */
48#ifdef Z_PREFIX
49# define deflateInit_ z_deflateInit_
50# define deflate z_deflate
51# define deflateEnd z_deflateEnd
52# define inflateInit_ z_inflateInit_
53# define inflate z_inflate
54# define inflateEnd z_inflateEnd
55# define deflateInit2_ z_deflateInit2_
56# define deflateSetDictionary z_deflateSetDictionary
57# define deflateCopy z_deflateCopy
58# define deflateReset z_deflateReset
59# define deflateParams z_deflateParams
60# define inflateInit2_ z_inflateInit2_
61# define inflateSetDictionary z_inflateSetDictionary
62# define inflateSync z_inflateSync
63# define inflateSyncPoint z_inflateSyncPoint
64# define inflateReset z_inflateReset
65# define compress z_compress
66# define compress2 z_compress2
67# define uncompress z_uncompress
68# define adler32 z_adler32
69# define crc32 z_crc32
70# define get_crc_table z_get_crc_table
71
72# define Byte z_Byte
73# define uInt z_uInt
74# define uLong z_uLong
75# define Bytef z_Bytef
76# define charf z_charf
77# define intf z_intf
78# define uIntf z_uIntf
79# define uLongf z_uLongf
80# define voidpf z_voidpf
81# define voidp z_voidp
82#endif
83
84#if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32)
85# define WIN32
86#endif
87#if defined(__GNUC__) || defined(WIN32) || defined(__386__) || defined(i386)
88# ifndef __32BIT__
89# define __32BIT__
90# endif
91#endif
92#if defined(__MSDOS__) && !defined(MSDOS)
93# define MSDOS
94#endif
95
96/*
97 * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
98 * than 64k bytes at a time (needed on systems with 16-bit int).
99 */
100#if defined(MSDOS) && !defined(__32BIT__)
101# define MAXSEG_64K
102#endif
103#ifdef MSDOS
104# define UNALIGNED_OK
105#endif
106
107#if (defined(MSDOS) || defined(_WINDOWS) || defined(WIN32)) && !defined(STDC)
108# define STDC
109#endif
110#if defined(__STDC__) || defined(__cplusplus) || defined(__OS2__)
111# ifndef STDC
112# define STDC
113# endif
114#endif
115
116#ifndef STDC
117# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
118# define const
119# endif
120#endif
121
122/* Some Mac compilers merge all .h files incorrectly: */
123#if defined(__MWERKS__) || defined(applec) ||defined(THINK_C) ||defined(__SC__)
124# define NO_DUMMY_DECL
125#endif
126
127/* Old Borland C incorrectly complains about missing returns: */
128#if defined(__BORLANDC__) && (__BORLANDC__ < 0x500)
129# define NEED_DUMMY_RETURN
130#endif
131
132
133/* Maximum value for memLevel in deflateInit2 */
134#ifndef MAX_MEM_LEVEL
135# ifdef MAXSEG_64K
136# define MAX_MEM_LEVEL 8
137# else
138# define MAX_MEM_LEVEL 9
139# endif
140#endif
141
142/* Maximum value for windowBits in deflateInit2 and inflateInit2.
143 * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
144 * created by gzip. (Files created by minigzip can still be extracted by
145 * gzip.)
146 */
147#ifndef MAX_WBITS
148# define MAX_WBITS 15 /* 32K LZ77 window */
149#endif
150
151/* The memory requirements for deflate are (in bytes):
152 (1 << (windowBits+2)) + (1 << (memLevel+9))
153 that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
154 plus a few kilobytes for small objects. For example, if you want to reduce
155 the default memory requirements from 256K to 128K, compile with
156 make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
157 Of course this will generally degrade compression (there's no free lunch).
158
159 The memory requirements for inflate are (in bytes) 1 << windowBits
160 that is, 32K for windowBits=15 (default value) plus a few kilobytes
161 for small objects.
162*/
163
164 /* Type declarations */
165
166#ifndef OF /* function prototypes */
167# ifdef STDC
168# define OF(args) args
169# else
170# define OF(args) ()
171# endif
172#endif
173
174/* The following definitions for FAR are needed only for MSDOS mixed
175 * model programming (small or medium model with some far allocations).
176 * This was tested only with MSC; for other MSDOS compilers you may have
177 * to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
178 * just define FAR to be empty.
179 */
180#if (defined(M_I86SM) || defined(M_I86MM)) && !defined(__32BIT__)
181 /* MSC small or medium model */
182# define SMALL_MEDIUM
183# ifdef _MSC_VER
184# define FAR _far
185# else
186# define FAR far
187# endif
188#endif
189#if defined(__BORLANDC__) && (defined(__SMALL__) || defined(__MEDIUM__))
190# ifndef __32BIT__
191# define SMALL_MEDIUM
192# define FAR _far
193# endif
194#endif
195
196/* Compile with -DZLIB_DLL for Windows DLL support */
197#if defined(ZLIB_DLL)
198# if defined(_WINDOWS) || defined(WINDOWS)
199# ifdef FAR
200# undef FAR
201# endif
202# include <windows.h>
203# define ZEXPORT WINAPI
204# ifdef WIN32
205# define ZEXPORTVA WINAPIV
206# else
207# define ZEXPORTVA FAR _cdecl _export
208# endif
209# endif
210# if defined (__BORLANDC__)
211# if (__BORLANDC__ >= 0x0500) && defined (WIN32)
212# include <windows.h>
213# define ZEXPORT __declspec(dllexport) WINAPI
214# define ZEXPORTRVA __declspec(dllexport) WINAPIV
215# else
216# if defined (_Windows) && defined (__DLL__)
217# define ZEXPORT _export
218# define ZEXPORTVA _export
219# endif
220# endif
221# endif
222#endif
223
224#if defined (__BEOS__)
225# if defined (ZLIB_DLL)
226# define ZEXTERN extern __declspec(dllexport)
227# else
228# define ZEXTERN extern __declspec(dllimport)
229# endif
230#endif
231
232#ifndef ZEXPORT
233# define ZEXPORT
234#endif
235#ifndef ZEXPORTVA
236# define ZEXPORTVA
237#endif
238#ifndef ZEXTERN
239# define ZEXTERN extern
240#endif
241
242#ifndef FAR
243# define FAR
244#endif
245
246#if !defined(MACOS) && !defined(TARGET_OS_MAC)
247typedef unsigned char Byte; /* 8 bits */
248#endif
249typedef unsigned int uInt; /* 16 bits or more */
250#ifdef _LP64
251typedef unsigned int uLong; /* 32 bits or more */
252#else
253typedef unsigned long uLong; /* 32 bits or more */
254#endif
255
256#ifdef SMALL_MEDIUM
257 /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
258# define Bytef Byte FAR
259#else
260 typedef Byte FAR Bytef;
261#endif
262typedef char FAR charf;
263typedef int FAR intf;
264typedef uInt FAR uIntf;
265typedef uLong FAR uLongf;
266
267#ifdef STDC
268 typedef void FAR *voidpf;
269 typedef void *voidp;
270#else
271 typedef Byte FAR *voidpf;
272 typedef Byte *voidp;
273#endif
274
275#ifdef HAVE_UNISTD_H
276# include <sys/types.h> /* for off_t */
277# include <unistd.h> /* for SEEK_* and off_t */
278# define z_off_t off_t
279#endif
280#ifndef SEEK_SET
281# define SEEK_SET 0 /* Seek from beginning of file. */
282# define SEEK_CUR 1 /* Seek from current position. */
283# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
284#endif
285#ifndef z_off_t
286# define z_off_t long
287#endif
288
289/* MVS linker does not support external names larger than 8 bytes */
290#if defined(__MVS__)
291# pragma map(deflateInit_,"DEIN")
292# pragma map(deflateInit2_,"DEIN2")
293# pragma map(deflateEnd,"DEEND")
294# pragma map(inflateInit_,"ININ")
295# pragma map(inflateInit2_,"ININ2")
296# pragma map(inflateEnd,"INEND")
297# pragma map(inflateSync,"INSY")
298# pragma map(inflateSetDictionary,"INSEDI")
299# pragma map(inflate_blocks,"INBL")
300# pragma map(inflate_blocks_new,"INBLNE")
301# pragma map(inflate_blocks_free,"INBLFR")
302# pragma map(inflate_blocks_reset,"INBLRE")
303# pragma map(inflate_codes_free,"INCOFR")
304# pragma map(inflate_codes,"INCO")
305# pragma map(inflate_fast,"INFA")
306# pragma map(inflate_flush,"INFLU")
307# pragma map(inflate_mask,"INMA")
308# pragma map(inflate_set_dictionary,"INSEDI2")
309# pragma map(inflate_copyright,"INCOPY")
310# pragma map(inflate_trees_bits,"INTRBI")
311# pragma map(inflate_trees_dynamic,"INTRDY")
312# pragma map(inflate_trees_fixed,"INTRFI")
313# pragma map(inflate_trees_free,"INTRFR")
314#endif
315
316#endif /* _ZCONF_H */