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