zconf.h 8.7 KB

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