Merge from vendor branch OPENSSL:
[dragonfly.git] / lib / libz / zconf.h
1 /* zconf.h -- configuration of the zlib 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 /* @(#) $FreeBSD: src/lib/libz/zconf.h,v 1.6.2.1 2003/02/01 13:33:12 sobomax Exp $ */
7 /* @(#) $DragonFly: src/lib/libz/Attic/zconf.h,v 1.2 2003/06/17 04:26:52 dillon Exp $ */
8
9 #ifndef _ZCONF_H
10 #define _ZCONF_H
11
12 /*
13  * If you *really* need a unique prefix for all types and library functions,
14  * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
15  */
16 #ifdef Z_PREFIX
17 #  define deflateInit_  z_deflateInit_
18 #  define deflate       z_deflate
19 #  define deflateEnd    z_deflateEnd
20 #  define inflateInit_  z_inflateInit_
21 #  define inflate       z_inflate
22 #  define inflateEnd    z_inflateEnd
23 #  define deflateInit2_ z_deflateInit2_
24 #  define deflateSetDictionary z_deflateSetDictionary
25 #  define deflateCopy   z_deflateCopy
26 #  define deflateReset  z_deflateReset
27 #  define deflateParams z_deflateParams
28 #  define inflateInit2_ z_inflateInit2_
29 #  define inflateSetDictionary z_inflateSetDictionary
30 #  define inflateSync   z_inflateSync
31 #  define inflateSyncPoint z_inflateSyncPoint
32 #  define inflateReset  z_inflateReset
33 #  define compress      z_compress
34 #  define compress2     z_compress2
35 #  define uncompress    z_uncompress
36 #  define adler32       z_adler32
37 #  define crc32         z_crc32
38 #  define get_crc_table z_get_crc_table
39
40 #  define Byte          z_Byte
41 #  define uInt          z_uInt
42 #  define uLong         z_uLong
43 #  define Bytef         z_Bytef
44 #  define charf         z_charf
45 #  define intf          z_intf
46 #  define uIntf         z_uIntf
47 #  define uLongf        z_uLongf
48 #  define voidpf        z_voidpf
49 #  define voidp         z_voidp
50 #endif
51
52 #if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32)
53 #  define WIN32
54 #endif
55 #if defined(__GNUC__) || defined(WIN32) || defined(__386__) || defined(i386)
56 #  ifndef __32BIT__
57 #    define __32BIT__
58 #  endif
59 #endif
60 #if defined(__MSDOS__) && !defined(MSDOS)
61 #  define MSDOS
62 #endif
63
64 /*
65  * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
66  * than 64k bytes at a time (needed on systems with 16-bit int).
67  */
68 #if defined(MSDOS) && !defined(__32BIT__)
69 #  define MAXSEG_64K
70 #endif
71 #ifdef MSDOS
72 #  define UNALIGNED_OK
73 #endif
74
75 #if (defined(MSDOS) || defined(_WINDOWS) || defined(WIN32))  && !defined(STDC)
76 #  define STDC
77 #endif
78 #if defined(__STDC__) || defined(__cplusplus) || defined(__OS2__)
79 #  ifndef STDC
80 #    define STDC
81 #  endif
82 #endif
83
84 #ifndef STDC
85 #  ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
86 #    define const
87 #  endif
88 #endif
89
90 /* Some Mac compilers merge all .h files incorrectly: */
91 #if defined(__MWERKS__) || defined(applec) ||defined(THINK_C) ||defined(__SC__)
92 #  define NO_DUMMY_DECL
93 #endif
94
95 /* Old Borland C incorrectly complains about missing returns: */
96 #if defined(__BORLANDC__) && (__BORLANDC__ < 0x500)
97 #  define NEED_DUMMY_RETURN
98 #endif
99
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  * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
112  * created by gzip. (Files created by minigzip can still be extracted by
113  * gzip.)
114  */
115 #ifndef MAX_WBITS
116 #  define MAX_WBITS   15 /* 32K LZ77 window */
117 #endif
118
119 /* The memory requirements for deflate are (in bytes):
120             (1 << (windowBits+2)) +  (1 << (memLevel+9))
121  that is: 128K for windowBits=15  +  128K for memLevel = 8  (default values)
122  plus a few kilobytes for small objects. For example, if you want to reduce
123  the default memory requirements from 256K to 128K, compile with
124      make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
125  Of course this will generally degrade compression (there's no free lunch).
126
127    The memory requirements for inflate are (in bytes) 1 << windowBits
128  that is, 32K for windowBits=15 (default value) plus a few kilobytes
129  for small objects.
130 */
131
132                         /* Type declarations */
133
134 #ifndef OF /* function prototypes */
135 #  ifdef STDC
136 #    define OF(args)  args
137 #  else
138 #    define OF(args)  ()
139 #  endif
140 #endif
141
142 /* The following definitions for FAR are needed only for MSDOS mixed
143  * model programming (small or medium model with some far allocations).
144  * This was tested only with MSC; for other MSDOS compilers you may have
145  * to define NO_MEMCPY in zutil.h.  If you don't need the mixed model,
146  * just define FAR to be empty.
147  */
148 #if (defined(M_I86SM) || defined(M_I86MM)) && !defined(__32BIT__)
149    /* MSC small or medium model */
150 #  define SMALL_MEDIUM
151 #  ifdef _MSC_VER
152 #    define FAR _far
153 #  else
154 #    define FAR far
155 #  endif
156 #endif
157 #if defined(__BORLANDC__) && (defined(__SMALL__) || defined(__MEDIUM__))
158 #  ifndef __32BIT__
159 #    define SMALL_MEDIUM
160 #    define FAR _far
161 #  endif
162 #endif
163
164 /* Compile with -DZLIB_DLL for Windows DLL support */
165 #if defined(ZLIB_DLL)
166 #  if defined(_WINDOWS) || defined(WINDOWS)
167 #    ifdef FAR
168 #      undef FAR
169 #    endif
170 #    include <windows.h>
171 #    define ZEXPORT  WINAPI
172 #    ifdef WIN32
173 #      define ZEXPORTVA  WINAPIV
174 #    else
175 #      define ZEXPORTVA  FAR _cdecl _export
176 #    endif
177 #  endif
178 #  if defined (__BORLANDC__)
179 #    if (__BORLANDC__ >= 0x0500) && defined (WIN32)
180 #      include <windows.h>
181 #      define ZEXPORT __declspec(dllexport) WINAPI
182 #      define ZEXPORTRVA __declspec(dllexport) WINAPIV
183 #    else
184 #      if defined (_Windows) && defined (__DLL__)
185 #        define ZEXPORT _export
186 #        define ZEXPORTVA _export
187 #      endif
188 #    endif
189 #  endif
190 #endif
191
192 #if defined (__BEOS__)
193 #  if defined (ZLIB_DLL)
194 #    define ZEXTERN extern __declspec(dllexport)
195 #  else
196 #    define ZEXTERN extern __declspec(dllimport)
197 #  endif
198 #endif
199
200 #ifndef ZEXPORT
201 #  define ZEXPORT
202 #endif
203 #ifndef ZEXPORTVA
204 #  define ZEXPORTVA
205 #endif
206 #ifndef ZEXTERN
207 #  define ZEXTERN extern
208 #endif
209
210 #ifndef FAR
211 #   define FAR
212 #endif
213
214 #if !defined(MACOS) && !defined(TARGET_OS_MAC)
215 typedef unsigned char  Byte;  /* 8 bits */
216 #endif
217 typedef unsigned int   uInt;  /* 16 bits or more */
218 typedef unsigned long  uLong; /* 32 bits or more */
219
220 #ifdef SMALL_MEDIUM
221    /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
222 #  define Bytef Byte FAR
223 #else
224    typedef Byte  FAR Bytef;
225 #endif
226 typedef char  FAR charf;
227 typedef int   FAR intf;
228 typedef uInt  FAR uIntf;
229 typedef uLong FAR uLongf;
230
231 #ifdef STDC
232    typedef void FAR *voidpf;
233    typedef void     *voidp;
234 #else
235    typedef Byte FAR *voidpf;
236    typedef Byte     *voidp;
237 #endif
238
239 #ifdef HAVE_UNISTD_H
240 #  include <sys/types.h> /* for off_t */
241 #  include <unistd.h>    /* for SEEK_* and off_t */
242 #endif
243 #ifndef SEEK_SET
244 #  define SEEK_SET        0       /* Seek from beginning of file.  */
245 #  define SEEK_CUR        1       /* Seek from current position.  */
246 #  define SEEK_END        2       /* Set file pointer to EOF plus "offset" */
247 #endif
248
249 /*
250  * This is hard-configured for FreeBSD, since zlib doesn't actually support
251  * using the system off_t for offsets unless off_t is no longer than long.
252  */
253 #define z_off_t long
254
255 /* MVS linker does not support external names larger than 8 bytes */
256 #if defined(__MVS__)
257 #   pragma map(deflateInit_,"DEIN")
258 #   pragma map(deflateInit2_,"DEIN2")
259 #   pragma map(deflateEnd,"DEEND")
260 #   pragma map(inflateInit_,"ININ")
261 #   pragma map(inflateInit2_,"ININ2")
262 #   pragma map(inflateEnd,"INEND")
263 #   pragma map(inflateSync,"INSY")
264 #   pragma map(inflateSetDictionary,"INSEDI")
265 #   pragma map(inflate_blocks,"INBL")
266 #   pragma map(inflate_blocks_new,"INBLNE")
267 #   pragma map(inflate_blocks_free,"INBLFR")
268 #   pragma map(inflate_blocks_reset,"INBLRE")
269 #   pragma map(inflate_codes_free,"INCOFR")
270 #   pragma map(inflate_codes,"INCO")
271 #   pragma map(inflate_fast,"INFA")
272 #   pragma map(inflate_flush,"INFLU")
273 #   pragma map(inflate_mask,"INMA")
274 #   pragma map(inflate_set_dictionary,"INSEDI2")
275 #   pragma map(inflate_copyright,"INCOPY")
276 #   pragma map(inflate_trees_bits,"INTRBI")
277 #   pragma map(inflate_trees_dynamic,"INTRDY")
278 #   pragma map(inflate_trees_fixed,"INTRFI")
279 #   pragma map(inflate_trees_free,"INTRFR")
280 #endif
281
282 #endif /* _ZCONF_H */