zconf.h 15 KB

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