xref: /nrf52832-nimble/rt-thread/components/dfs/filesystems/jffs2/cyg/compress/include/zconf.h (revision 104654410c56c573564690304ae786df310c91fc)
1 /* zconf.h -- configuration of the zlib compression library
2  * Copyright (C) 1995-2005 Jean-loup Gailly.
3  * For conditions of distribution and use, see copyright notice in zlib.h
4  */
5 
6 /* @(#) $Id$ */
7 
8 #ifndef ZCONF_H
9 #define ZCONF_H
10 
11 // #ifdef __ECOS__
12 #undef __ECOS__
13 #define __ECOS__
14 #define Z_PREFIX
15 #include <pkgconf/compress_zlib.h>
16 #if CYGINT_COMPRESS_ZLIB_LOCAL_ALLOC != 0
17 #define MY_ZCALLOC
18 #endif
19 #ifdef CYGSEM_COMPRESS_ZLIB_DEFLATE_MAKES_GZIP
20 #undef  MAX_WBITS
21 #define MAX_WBITS   15+16 /* 32K LZ77 window */
22 #else
23 #define NO_GZIP
24 #define NO_GZCOMPRESS
25 #endif
26 // #endif
27 
28 /*
29  * If you *really* need a unique prefix for all types and library functions,
30  * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
31  */
32 #ifdef Z_PREFIX
33 #  define deflateInit_          z_deflateInit_
34 #  define deflate               z_deflate
35 #  define deflateEnd            z_deflateEnd
36 #  define inflateInit_          z_inflateInit_
37 #  define inflate               z_inflate
38 #  define inflateEnd            z_inflateEnd
39 #  define deflateInit2_         z_deflateInit2_
40 #  define deflateSetDictionary  z_deflateSetDictionary
41 #  define deflateCopy           z_deflateCopy
42 #  define deflateReset          z_deflateReset
43 #  define deflateParams         z_deflateParams
44 #  define deflateBound          z_deflateBound
45 #  define deflatePrime          z_deflatePrime
46 #  define inflateInit2_         z_inflateInit2_
47 #  define inflateSetDictionary  z_inflateSetDictionary
48 #  define inflateSync           z_inflateSync
49 #  define inflateSyncPoint      z_inflateSyncPoint
50 #  define inflateCopy           z_inflateCopy
51 #  define inflateReset          z_inflateReset
52 #  define inflateBack           z_inflateBack
53 #  define inflateBackEnd        z_inflateBackEnd
54 #  define compress              z_compress
55 #  define compress2             z_compress2
56 #  define compressBound         z_compressBound
57 #  define uncompress            z_uncompress
58 #  define adler32               z_adler32
59 #  define crc32                 z_crc32
60 #  define get_crc_table         z_get_crc_table
61 #  define zError                z_zError
62 
63 #  define alloc_func            z_alloc_func
64 #  define free_func             z_free_func
65 #  define in_func               z_in_func
66 #  define out_func              z_out_func
67 #  define Byte                  z_Byte
68 #  define uInt                  z_uInt
69 #  define uLong                 z_uLong
70 #  define Bytef                 z_Bytef
71 #  define charf                 z_charf
72 #  define intf                  z_intf
73 #  define uIntf                 z_uIntf
74 #  define uLongf                z_uLongf
75 #  define voidpf                z_voidpf
76 #  define voidp                 z_voidp
77 #endif
78 
79 #if defined(__MSDOS__) && !defined(MSDOS)
80 #  define MSDOS
81 #endif
82 #if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
83 #  define OS2
84 #endif
85 #if defined(_WINDOWS) && !defined(WINDOWS)
86 #  define WINDOWS
87 #endif
88 #if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
89 #  ifndef WIN32
90 #    define WIN32
91 #  endif
92 #endif
93 #if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
94 #  if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
95 #    ifndef SYS16BIT
96 #      define SYS16BIT
97 #    endif
98 #  endif
99 #endif
100 
101 /*
102  * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
103  * than 64k bytes at a time (needed on systems with 16-bit int).
104  */
105 #ifdef SYS16BIT
106 #  define MAXSEG_64K
107 #endif
108 #ifdef MSDOS
109 #  define UNALIGNED_OK
110 #endif
111 
112 #ifdef __STDC_VERSION__
113 #  ifndef STDC
114 #    define STDC
115 #  endif
116 #  if __STDC_VERSION__ >= 199901L
117 #    ifndef STDC99
118 #      define STDC99
119 #    endif
120 #  endif
121 #endif
122 #if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
123 #  define STDC
124 #endif
125 #if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
126 #  define STDC
127 #endif
128 #if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
129 #  define STDC
130 #endif
131 #if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
132 #  define STDC
133 #endif
134 
135 #if defined(__OS400__) && !defined(STDC)    /* iSeries (formerly AS/400). */
136 #  define STDC
137 #endif
138 
139 #ifndef STDC
140 #  ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
141 #    define const       /* note: need a more gentle solution here */
142 #  endif
143 #endif
144 
145 /* Some Mac compilers merge all .h files incorrectly: */
146 #if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
147 #  define NO_DUMMY_DECL
148 #endif
149 
150 /* Maximum value for memLevel in deflateInit2 */
151 #ifndef MAX_MEM_LEVEL
152 #  ifdef MAXSEG_64K
153 #    define MAX_MEM_LEVEL 8
154 #  else
155 #    define MAX_MEM_LEVEL 9
156 #  endif
157 #endif
158 
159 /* Maximum value for windowBits in deflateInit2 and inflateInit2.
160  * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
161  * created by gzip. (Files created by minigzip can still be extracted by
162  * gzip.)
163  */
164 #ifndef MAX_WBITS
165 #  define MAX_WBITS   15 /* 32K LZ77 window */
166 #endif
167 
168 /* The memory requirements for deflate are (in bytes):
169             (1 << (windowBits+2)) +  (1 << (memLevel+9))
170  that is: 128K for windowBits=15  +  128K for memLevel = 8  (default values)
171  plus a few kilobytes for small objects. For example, if you want to reduce
172  the default memory requirements from 256K to 128K, compile with
173      make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
174  Of course this will generally degrade compression (there's no free lunch).
175 
176    The memory requirements for inflate are (in bytes) 1 << windowBits
177  that is, 32K for windowBits=15 (default value) plus a few kilobytes
178  for small objects.
179 */
180 
181                         /* Type declarations */
182 
183 #ifndef OF /* function prototypes */
184 #  ifdef STDC
185 #    define OF(args)  args
186 #  else
187 #    define OF(args)  ()
188 #  endif
189 #endif
190 
191 /* The following definitions for FAR are needed only for MSDOS mixed
192  * model programming (small or medium model with some far allocations).
193  * This was tested only with MSC; for other MSDOS compilers you may have
194  * to define NO_MEMCPY in zutil.h.  If you don't need the mixed model,
195  * just define FAR to be empty.
196  */
197 #ifdef SYS16BIT
198 #  if defined(M_I86SM) || defined(M_I86MM)
199      /* MSC small or medium model */
200 #    define SMALL_MEDIUM
201 #    ifdef _MSC_VER
202 #      define FAR _far
203 #    else
204 #      define FAR far
205 #    endif
206 #  endif
207 #  if (defined(__SMALL__) || defined(__MEDIUM__))
208      /* Turbo C small or medium model */
209 #    define SMALL_MEDIUM
210 #    ifdef __BORLANDC__
211 #      define FAR _far
212 #    else
213 #      define FAR far
214 #    endif
215 #  endif
216 #endif
217 
218 #if defined(WINDOWS) || defined(WIN32)
219    /* If building or using zlib as a DLL, define ZLIB_DLL.
220     * This is not mandatory, but it offers a little performance increase.
221     */
222 #  ifdef ZLIB_DLL
223 #    if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
224 #      ifdef ZLIB_INTERNAL
225 #        define ZEXTERN extern __declspec(dllexport)
226 #      else
227 #        define ZEXTERN extern __declspec(dllimport)
228 #      endif
229 #    endif
230 #  endif  /* ZLIB_DLL */
231    /* If building or using zlib with the WINAPI/WINAPIV calling convention,
232     * define ZLIB_WINAPI.
233     * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
234     */
235 #  ifdef ZLIB_WINAPI
236 #    ifdef FAR
237 #      undef FAR
238 #    endif
239 #    include <windows.h>
240      /* No need for _export, use ZLIB.DEF instead. */
241      /* For complete Windows compatibility, use WINAPI, not __stdcall. */
242 #    define ZEXPORT WINAPI
243 #    ifdef WIN32
244 #      define ZEXPORTVA WINAPIV
245 #    else
246 #      define ZEXPORTVA FAR CDECL
247 #    endif
248 #  endif
249 #endif
250 
251 #if defined (__BEOS__)
252 #  ifdef ZLIB_DLL
253 #    ifdef ZLIB_INTERNAL
254 #      define ZEXPORT   __declspec(dllexport)
255 #      define ZEXPORTVA __declspec(dllexport)
256 #    else
257 #      define ZEXPORT   __declspec(dllimport)
258 #      define ZEXPORTVA __declspec(dllimport)
259 #    endif
260 #  endif
261 #endif
262 
263 #ifndef ZEXTERN
264 #  define ZEXTERN extern
265 #endif
266 #ifndef ZEXPORT
267 #  define ZEXPORT
268 #endif
269 #ifndef ZEXPORTVA
270 #  define ZEXPORTVA
271 #endif
272 
273 #ifndef FAR
274 #  define FAR
275 #endif
276 
277 #if !defined(__MACTYPES__)
278 typedef unsigned char  Byte;  /* 8 bits */
279 #endif
280 typedef unsigned int   uInt;  /* 16 bits or more */
281 typedef unsigned long  uLong; /* 32 bits or more */
282 
283 #ifdef SMALL_MEDIUM
284    /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
285 #  define Bytef Byte FAR
286 #else
287    typedef Byte  FAR Bytef;
288 #endif
289 typedef char  FAR charf;
290 typedef int   FAR intf;
291 typedef uInt  FAR uIntf;
292 typedef uLong FAR uLongf;
293 
294 #ifdef STDC
295    typedef void const *voidpc;
296    typedef void FAR   *voidpf;
297    typedef void       *voidp;
298 #else
299    typedef Byte const *voidpc;
300    typedef Byte FAR   *voidpf;
301    typedef Byte       *voidp;
302 #endif
303 
304 #if 0           /* HAVE_UNISTD_H -- this line is updated by ./configure */
305 #  include <sys/types.h> /* for off_t */
306 #  include <unistd.h>    /* for SEEK_* and off_t */
307 #  ifdef VMS
308 #    include <unixio.h>   /* for off_t */
309 #  endif
310 #  define z_off_t off_t
311 #endif
312 #ifndef SEEK_SET
313 #  define SEEK_SET        0       /* Seek from beginning of file.  */
314 #  define SEEK_CUR        1       /* Seek from current position.  */
315 #  define SEEK_END        2       /* Set file pointer to EOF plus "offset" */
316 #endif
317 #ifndef z_off_t
318 #  define z_off_t long
319 #endif
320 
321 #if defined(__OS400__)
322 #  define NO_vsnprintf
323 #endif
324 
325 #if defined(__MVS__)
326 #  define NO_vsnprintf
327 #  ifdef FAR
328 #    undef FAR
329 #  endif
330 #endif
331 
332 /* MVS linker does not support external names larger than 8 bytes */
333 #if defined(__MVS__)
334 #   pragma map(deflateInit_,"DEIN")
335 #   pragma map(deflateInit2_,"DEIN2")
336 #   pragma map(deflateEnd,"DEEND")
337 #   pragma map(deflateBound,"DEBND")
338 #   pragma map(inflateInit_,"ININ")
339 #   pragma map(inflateInit2_,"ININ2")
340 #   pragma map(inflateEnd,"INEND")
341 #   pragma map(inflateSync,"INSY")
342 #   pragma map(inflateSetDictionary,"INSEDI")
343 #   pragma map(compressBound,"CMBND")
344 #   pragma map(inflate_table,"INTABL")
345 #   pragma map(inflate_fast,"INFA")
346 #   pragma map(inflate_copyright,"INCOPY")
347 #endif
348 
349 #endif /* ZCONF_H */
350