zconf.h 15 KB

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