annotate lib/zlib/zconf.h @ 1904:1a1c4040bee4

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