zconf.h 15 KB

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