zconf.h 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428
  1. /* zconf.h -- configuration of the zlib compression library
  2. * Copyright (C) 1995-2010 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. * Even better than compiling with -DZ_PREFIX would be to use configure to set
  12. * this permanently in zconf.h using "./configure --zprefix".
  13. */
  14. #ifdef Z_PREFIX /* may be set to #if 1 by ./configure */
  15. /* all linked symbols */
  16. # define _dist_code z__dist_code
  17. # define _length_code z__length_code
  18. # define _tr_align z__tr_align
  19. # define _tr_flush_block z__tr_flush_block
  20. # define _tr_init z__tr_init
  21. # define _tr_stored_block z__tr_stored_block
  22. # define _tr_tally z__tr_tally
  23. # define adler32 z_adler32
  24. # define adler32_combine z_adler32_combine
  25. # define adler32_combine64 z_adler32_combine64
  26. # define compress z_compress
  27. # define compress2 z_compress2
  28. # define compressBound z_compressBound
  29. # define crc32 z_crc32
  30. # define crc32_combine z_crc32_combine
  31. # define crc32_combine64 z_crc32_combine64
  32. # define deflate z_deflate
  33. # define deflateBound z_deflateBound
  34. # define deflateCopy z_deflateCopy
  35. # define deflateEnd z_deflateEnd
  36. # define deflateInit2_ z_deflateInit2_
  37. # define deflateInit_ z_deflateInit_
  38. # define deflateParams z_deflateParams
  39. # define deflatePrime z_deflatePrime
  40. # define deflateReset z_deflateReset
  41. # define deflateSetDictionary z_deflateSetDictionary
  42. # define deflateSetHeader z_deflateSetHeader
  43. # define deflateTune z_deflateTune
  44. # define deflate_copyright z_deflate_copyright
  45. # define get_crc_table z_get_crc_table
  46. # define gz_error z_gz_error
  47. # define gz_intmax z_gz_intmax
  48. # define gz_strwinerror z_gz_strwinerror
  49. # define gzbuffer z_gzbuffer
  50. # define gzclearerr z_gzclearerr
  51. # define gzclose z_gzclose
  52. # define gzclose_r z_gzclose_r
  53. # define gzclose_w z_gzclose_w
  54. # define gzdirect z_gzdirect
  55. # define gzdopen z_gzdopen
  56. # define gzeof z_gzeof
  57. # define gzerror z_gzerror
  58. # define gzflush z_gzflush
  59. # define gzgetc z_gzgetc
  60. # define gzgets z_gzgets
  61. # define gzoffset z_gzoffset
  62. # define gzoffset64 z_gzoffset64
  63. # define gzopen z_gzopen
  64. # define gzopen64 z_gzopen64
  65. # define gzprintf z_gzprintf
  66. # define gzputc z_gzputc
  67. # define gzputs z_gzputs
  68. # define gzread z_gzread
  69. # define gzrewind z_gzrewind
  70. # define gzseek z_gzseek
  71. # define gzseek64 z_gzseek64
  72. # define gzsetparams z_gzsetparams
  73. # define gztell z_gztell
  74. # define gztell64 z_gztell64
  75. # define gzungetc z_gzungetc
  76. # define gzwrite z_gzwrite
  77. # define inflate z_inflate
  78. # define inflateBack z_inflateBack
  79. # define inflateBackEnd z_inflateBackEnd
  80. # define inflateBackInit_ z_inflateBackInit_
  81. # define inflateCopy z_inflateCopy
  82. # define inflateEnd z_inflateEnd
  83. # define inflateGetHeader z_inflateGetHeader
  84. # define inflateInit2_ z_inflateInit2_
  85. # define inflateInit_ z_inflateInit_
  86. # define inflateMark z_inflateMark
  87. # define inflatePrime z_inflatePrime
  88. # define inflateReset z_inflateReset
  89. # define inflateReset2 z_inflateReset2
  90. # define inflateSetDictionary z_inflateSetDictionary
  91. # define inflateSync z_inflateSync
  92. # define inflateSyncPoint z_inflateSyncPoint
  93. # define inflateUndermine z_inflateUndermine
  94. # define inflate_copyright z_inflate_copyright
  95. # define inflate_fast z_inflate_fast
  96. # define inflate_table z_inflate_table
  97. # define uncompress z_uncompress
  98. # define zError z_zError
  99. # define zcalloc z_zcalloc
  100. # define zcfree z_zcfree
  101. # define zlibCompileFlags z_zlibCompileFlags
  102. # define zlibVersion z_zlibVersion
  103. /* all zlib typedefs in zlib.h and zconf.h */
  104. # define Byte z_Byte
  105. # define Bytef z_Bytef
  106. # define alloc_func z_alloc_func
  107. # define charf z_charf
  108. # define free_func z_free_func
  109. # define gzFile z_gzFile
  110. # define gz_header z_gz_header
  111. # define gz_headerp z_gz_headerp
  112. # define in_func z_in_func
  113. # define intf z_intf
  114. # define out_func z_out_func
  115. # define uInt z_uInt
  116. # define uIntf z_uIntf
  117. # define uLong z_uLong
  118. # define uLongf z_uLongf
  119. # define voidp z_voidp
  120. # define voidpc z_voidpc
  121. # define voidpf z_voidpf
  122. /* all zlib structs in zlib.h and zconf.h */
  123. # define gz_header_s z_gz_header_s
  124. # define internal_state z_internal_state
  125. #endif
  126. #if defined(__MSDOS__) && !defined(MSDOS)
  127. # define MSDOS
  128. #endif
  129. #if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
  130. # define OS2
  131. #endif
  132. #if defined(_WINDOWS) && !defined(WINDOWS)
  133. # define WINDOWS
  134. #endif
  135. #if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
  136. # ifndef WIN32
  137. # define WIN32
  138. # endif
  139. #endif
  140. #if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
  141. # if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
  142. # ifndef SYS16BIT
  143. # define SYS16BIT
  144. # endif
  145. # endif
  146. #endif
  147. /*
  148. * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
  149. * than 64k bytes at a time (needed on systems with 16-bit int).
  150. */
  151. #ifdef SYS16BIT
  152. # define MAXSEG_64K
  153. #endif
  154. #ifdef MSDOS
  155. # define UNALIGNED_OK
  156. #endif
  157. #ifdef __STDC_VERSION__
  158. # ifndef STDC
  159. # define STDC
  160. # endif
  161. # if __STDC_VERSION__ >= 199901L
  162. # ifndef STDC99
  163. # define STDC99
  164. # endif
  165. # endif
  166. #endif
  167. #if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
  168. # define STDC
  169. #endif
  170. #if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
  171. # define STDC
  172. #endif
  173. #if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
  174. # define STDC
  175. #endif
  176. #if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
  177. # define STDC
  178. #endif
  179. #if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */
  180. # define STDC
  181. #endif
  182. #ifndef STDC
  183. # ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
  184. # define const /* note: need a more gentle solution here */
  185. # endif
  186. #endif
  187. /* Some Mac compilers merge all .h files incorrectly: */
  188. #if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
  189. # define NO_DUMMY_DECL
  190. #endif
  191. /* Maximum value for memLevel in deflateInit2 */
  192. #ifndef MAX_MEM_LEVEL
  193. # ifdef MAXSEG_64K
  194. # define MAX_MEM_LEVEL 8
  195. # else
  196. # define MAX_MEM_LEVEL 9
  197. # endif
  198. #endif
  199. /* Maximum value for windowBits in deflateInit2 and inflateInit2.
  200. * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
  201. * created by gzip. (Files created by minigzip can still be extracted by
  202. * gzip.)
  203. */
  204. #ifndef MAX_WBITS
  205. # define MAX_WBITS 15 /* 32K LZ77 window */
  206. #endif
  207. /* The memory requirements for deflate are (in bytes):
  208. (1 << (windowBits+2)) + (1 << (memLevel+9))
  209. that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
  210. plus a few kilobytes for small objects. For example, if you want to reduce
  211. the default memory requirements from 256K to 128K, compile with
  212. make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
  213. Of course this will generally degrade compression (there's no free lunch).
  214. The memory requirements for inflate are (in bytes) 1 << windowBits
  215. that is, 32K for windowBits=15 (default value) plus a few kilobytes
  216. for small objects.
  217. */
  218. /* Type declarations */
  219. #ifndef OF /* function prototypes */
  220. # ifdef STDC
  221. # define OF(args) args
  222. # else
  223. # define OF(args) ()
  224. # endif
  225. #endif
  226. /* The following definitions for FAR are needed only for MSDOS mixed
  227. * model programming (small or medium model with some far allocations).
  228. * This was tested only with MSC; for other MSDOS compilers you may have
  229. * to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
  230. * just define FAR to be empty.
  231. */
  232. #ifdef SYS16BIT
  233. # if defined(M_I86SM) || defined(M_I86MM)
  234. /* MSC small or medium model */
  235. # define SMALL_MEDIUM
  236. # ifdef _MSC_VER
  237. # define FAR _far
  238. # else
  239. # define FAR far
  240. # endif
  241. # endif
  242. # if (defined(__SMALL__) || defined(__MEDIUM__))
  243. /* Turbo C small or medium model */
  244. # define SMALL_MEDIUM
  245. # ifdef __BORLANDC__
  246. # define FAR _far
  247. # else
  248. # define FAR far
  249. # endif
  250. # endif
  251. #endif
  252. #if defined(WINDOWS) || defined(WIN32)
  253. /* If building or using zlib as a DLL, define ZLIB_DLL.
  254. * This is not mandatory, but it offers a little performance increase.
  255. */
  256. # ifdef ZLIB_DLL
  257. # if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
  258. # ifdef ZLIB_INTERNAL
  259. # define ZEXTERN extern __declspec(dllexport)
  260. # else
  261. # define ZEXTERN extern __declspec(dllimport)
  262. # endif
  263. # endif
  264. # endif /* ZLIB_DLL */
  265. /* If building or using zlib with the WINAPI/WINAPIV calling convention,
  266. * define ZLIB_WINAPI.
  267. * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
  268. */
  269. # ifdef ZLIB_WINAPI
  270. # ifdef FAR
  271. # undef FAR
  272. # endif
  273. # include <windows.h>
  274. /* No need for _export, use ZLIB.DEF instead. */
  275. /* For complete Windows compatibility, use WINAPI, not __stdcall. */
  276. # define ZEXPORT WINAPI
  277. # ifdef WIN32
  278. # define ZEXPORTVA WINAPIV
  279. # else
  280. # define ZEXPORTVA FAR CDECL
  281. # endif
  282. # endif
  283. #endif
  284. #if defined (__BEOS__)
  285. # ifdef ZLIB_DLL
  286. # ifdef ZLIB_INTERNAL
  287. # define ZEXPORT __declspec(dllexport)
  288. # define ZEXPORTVA __declspec(dllexport)
  289. # else
  290. # define ZEXPORT __declspec(dllimport)
  291. # define ZEXPORTVA __declspec(dllimport)
  292. # endif
  293. # endif
  294. #endif
  295. #ifndef ZEXTERN
  296. # define ZEXTERN extern
  297. #endif
  298. #ifndef ZEXPORT
  299. # define ZEXPORT
  300. #endif
  301. #ifndef ZEXPORTVA
  302. # define ZEXPORTVA
  303. #endif
  304. #ifndef FAR
  305. # define FAR
  306. #endif
  307. #if !defined(__MACTYPES__)
  308. typedef unsigned char Byte; /* 8 bits */
  309. #endif
  310. typedef unsigned int uInt; /* 16 bits or more */
  311. typedef unsigned long uLong; /* 32 bits or more */
  312. #ifdef SMALL_MEDIUM
  313. /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
  314. # define Bytef Byte FAR
  315. #else
  316. typedef Byte FAR Bytef;
  317. #endif
  318. typedef char FAR charf;
  319. typedef int FAR intf;
  320. typedef uInt FAR uIntf;
  321. typedef uLong FAR uLongf;
  322. #ifdef STDC
  323. typedef void const *voidpc;
  324. typedef void FAR *voidpf;
  325. typedef void *voidp;
  326. #else
  327. typedef Byte const *voidpc;
  328. typedef Byte FAR *voidpf;
  329. typedef Byte *voidp;
  330. #endif
  331. #ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */
  332. # define Z_HAVE_UNISTD_H
  333. #endif
  334. #ifdef STDC
  335. # include <sys/types.h> /* for off_t */
  336. #endif
  337. /* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and
  338. * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even
  339. * though the former does not conform to the LFS document), but considering
  340. * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as
  341. * equivalently requesting no 64-bit operations
  342. */
  343. #if -_LARGEFILE64_SOURCE - -1 == 1
  344. # undef _LARGEFILE64_SOURCE
  345. #endif
  346. #if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE)
  347. # include <unistd.h> /* for SEEK_* and off_t */
  348. # ifdef VMS
  349. # include <unixio.h> /* for off_t */
  350. # endif
  351. # ifndef z_off_t
  352. # define z_off_t off_t
  353. # endif
  354. #endif
  355. #ifndef SEEK_SET
  356. # define SEEK_SET 0 /* Seek from beginning of file. */
  357. # define SEEK_CUR 1 /* Seek from current position. */
  358. # define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
  359. #endif
  360. #ifndef z_off_t
  361. # define z_off_t long
  362. #endif
  363. #if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0
  364. # define z_off64_t off64_t
  365. #else
  366. # define z_off64_t z_off_t
  367. #endif
  368. #if defined(__OS400__)
  369. # define NO_vsnprintf
  370. #endif
  371. #if defined(__MVS__)
  372. # define NO_vsnprintf
  373. #endif
  374. /* MVS linker does not support external names larger than 8 bytes */
  375. #if defined(__MVS__)
  376. #pragma map(deflateInit_,"DEIN")
  377. #pragma map(deflateInit2_,"DEIN2")
  378. #pragma map(deflateEnd,"DEEND")
  379. #pragma map(deflateBound,"DEBND")
  380. #pragma map(inflateInit_,"ININ")
  381. #pragma map(inflateInit2_,"ININ2")
  382. #pragma map(inflateEnd,"INEND")
  383. #pragma map(inflateSync,"INSY")
  384. #pragma map(inflateSetDictionary,"INSEDI")
  385. #pragma map(compressBound,"CMBND")
  386. #pragma map(inflate_table,"INTABL")
  387. #pragma map(inflate_fast,"INFA")
  388. #pragma map(inflate_copyright,"INCOPY")
  389. #endif
  390. #endif /* ZCONF_H */