]> git.lizzy.rs Git - zlib.git/blob - zconf.h
69aa21b47d957c8c29a37ab6ae9b23408100ad15
[zlib.git] / zconf.h
1 /* zconf.h -- configuration of the zlib compression library
2  * Copyright (C) 1995-1996 Jean-loup Gailly.
3  * For conditions of distribution and use, see copyright notice in zlib.h 
4  */
5
6 /* $Id: zconf.h,v 1.18 1996/05/23 16:51:18 me Exp $ */
7
8 #ifndef _ZCONF_H
9 #define _ZCONF_H
10
11 /*
12  * If you *really* need a unique prefix for all types and library functions,
13  * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
14  */
15 #ifdef Z_PREFIX
16 #  define deflateInit_  z_deflateInit_
17 #  define deflate       z_deflate
18 #  define deflateEnd    z_deflateEnd
19 #  define inflateInit_  z_inflateInit_
20 #  define inflate       z_inflate
21 #  define inflateEnd    z_inflateEnd
22 #  define deflateInit2_ z_deflateInit2_
23 #  define deflateSetDictionary z_deflateSetDictionary
24 #  define deflateCopy   z_deflateCopy
25 #  define deflateReset  z_deflateReset
26 #  define deflateParams z_deflateParams
27 #  define inflateInit2_ z_inflateInit2_
28 #  define inflateSetDictionary z_inflateSetDictionary
29 #  define inflateSync   z_inflateSync
30 #  define inflateReset  z_inflateReset
31 #  define compress      z_compress
32 #  define uncompress    z_uncompress
33 #  define adler32       z_adler32
34 #  define crc32         z_crc32
35 #  define get_crc_table z_get_crc_table
36
37 #  define Byte          z_Byte
38 #  define uInt          z_uInt
39 #  define uLong         z_uLong
40 #  define Bytef         z_Bytef
41 #  define charf         z_charf
42 #  define intf          z_intf
43 #  define uIntf         z_uIntf
44 #  define uLongf        z_uLongf
45 #  define voidpf        z_voidpf
46 #  define voidp         z_voidp
47 #endif
48
49 #if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32)
50 #  define WIN32
51 #endif
52 #if (defined(__GNUC__) || defined(WIN32)) && !defined(__32BIT__)
53 #  define __32BIT__
54 #endif
55 #if defined(__MSDOS__) && !defined(MSDOS)
56 #  define MSDOS
57 #endif
58
59 /*
60  * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
61  * than 64k bytes at a time (needed on systems with 16-bit int).
62  */
63 #if defined(MSDOS) && !defined(__32BIT__)
64 #  define MAXSEG_64K
65 #endif
66 #ifdef MSDOS
67 #  define UNALIGNED_OK
68 #endif
69
70 #if (defined(MSDOS) || defined(_WINDOWS) || defined(WIN32))  && !defined(STDC)
71 #  define STDC
72 #endif
73 #if (defined(__STDC__) || defined(__cplusplus)) && !defined(STDC)
74 #  define STDC
75 #endif
76
77 #ifndef STDC
78 #  ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
79 #    define const
80 #  endif
81 #endif
82
83 #ifdef  __MWERKS__ /* Metrowerks CodeWarrior declares fileno() in unix.h */
84 #  include <unix.h>
85 #  define NO_DUMMY_DECL /* buggy compiler merges all .h files incorrectly */
86 #endif
87
88 /* Maximum value for memLevel in deflateInit2 */
89 #ifndef MAX_MEM_LEVEL
90 #  ifdef MAXSEG_64K
91 #    define MAX_MEM_LEVEL 8
92 #  else
93 #    define MAX_MEM_LEVEL 9
94 #  endif
95 #endif
96
97 /* Maximum value for windowBits in deflateInit2 and inflateInit2 */
98 #ifndef MAX_WBITS
99 #  define MAX_WBITS   15 /* 32K LZ77 window */
100 #endif
101
102 /* The memory requirements for deflate are (in bytes):
103             1 << (windowBits+2)   +  1 << (memLevel+9)
104  that is: 128K for windowBits=15  +  128K for memLevel = 8  (default values)
105  plus a few kilobytes for small objects. For example, if you want to reduce
106  the default memory requirements from 256K to 128K, compile with
107      make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
108  Of course this will generally degrade compression (there's no free lunch).
109
110    The memory requirements for inflate are (in bytes) 1 << windowBits
111  that is, 32K for windowBits=15 (default value) plus a few kilobytes
112  for small objects.
113 */
114
115                         /* Type declarations */
116
117 #ifndef OF /* function prototypes */
118 #  ifdef STDC
119 #    define OF(args)  args
120 #  else
121 #    define OF(args)  ()
122 #  endif
123 #endif
124
125 /* The following definitions for FAR are needed only for MSDOS mixed
126  * model programming (small or medium model with some far allocations).
127  * This was tested only with MSC; for other MSDOS compilers you may have
128  * to define NO_MEMCPY in zutil.h.  If you don't need the mixed model,
129  * just define FAR to be empty.
130  */
131 #if (defined(M_I86SM) || defined(M_I86MM)) && !defined(__32BIT__)
132    /* MSC small or medium model */
133 #  define SMALL_MEDIUM
134 #  ifdef _MSC_VER
135 #    define FAR __far
136 #  else
137 #    define FAR far
138 #  endif
139 #endif
140 #if defined(__BORLANDC__) && (defined(__SMALL__) || defined(__MEDIUM__))
141 #  ifndef __32BIT__
142 #    define SMALL_MEDIUM
143 #    define FAR __far
144 #  endif
145 #endif
146 #ifndef FAR
147 #   define FAR
148 #endif
149 /* The Watcom compiler defines M_I86SM and __SMALL__ even in 32 bit mode */
150 #if defined(__WATCOMC__) && defined(__386__) && defined(SMALL_MEDIUM)
151 #  undef FAR
152 #  define FAR
153 #  undef SMALL_MEDIUM
154 #endif
155
156 typedef unsigned char  Byte;  /* 8 bits */
157 typedef unsigned int   uInt;  /* 16 bits or more */
158 typedef unsigned long  uLong; /* 32 bits or more */
159
160 #if defined(__BORLANDC__) && defined(SMALL_MEDIUM)
161    /* Borland C/C++ ignores FAR inside typedef */
162 #  define Bytef Byte FAR
163 #else
164    typedef Byte  FAR Bytef;
165 #endif
166 typedef char  FAR charf;
167 typedef int   FAR intf;
168 typedef uInt  FAR uIntf;
169 typedef uLong FAR uLongf;
170
171 #ifdef STDC
172    typedef void FAR *voidpf;
173    typedef void     *voidp;
174 #else
175    typedef Byte FAR *voidpf;
176    typedef Byte     *voidp;
177 #endif
178
179
180 /* Compile with -DZLIB_DLL for Windows DLL support */
181 #if (defined(_WINDOWS) || defined(WINDOWS)) && defined(ZLIB_DLL)
182 #  include <windows.h>
183 #  define EXPORT  WINAPI
184 #else
185 #  define EXPORT
186 #endif
187
188 #endif /* _ZCONF_H */