zconf.h 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348
  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. # define inflate_table z_inflate_table
  50. # define inflate_copyright z_inflate_copyright
  51. # define inflate_fast z_inflate_fast
  52. # define inflateBackInit_ z_inflateBackInit_
  53. # define inflateBack z_inflateBack
  54. # define inflateBackEnd z_inflateBackEnd
  55. # define deflate_copyright z_deflate_copyright
  56. # define zlibVersion z_zlibVersion
  57. # define zlibCompileFlags z_zlibCompileFlags
  58. # define zError z_zError
  59. # define zcalloc z_zcalloc
  60. # define zcfree z_zcfree
  61. # define z_errmsg z_z_errmsg
  62. # define _tr_init z_tr_init
  63. # define _tr_stored_block z_tr_stored_block
  64. # define _tr_flush_block z_tr_flush_block
  65. # define _tr_tally z_tr_tally
  66. # define _length_code z_length_code
  67. # define _dist_code z_dist_code
  68. # define _tr_align z_tr_align
  69. #endif
  70. #if defined(__MSDOS__) && !defined(MSDOS)
  71. # define MSDOS
  72. #endif
  73. #if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
  74. # define OS2
  75. #endif
  76. #if defined(_WINDOWS) && !defined(WINDOWS)
  77. # define WINDOWS
  78. #endif
  79. #if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32)
  80. # define WIN32
  81. #endif
  82. #if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
  83. # if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
  84. # ifndef SYS16BIT
  85. # define SYS16BIT
  86. # endif
  87. # endif
  88. #endif
  89. /*
  90. * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
  91. * than 64k bytes at a time (needed on systems with 16-bit int).
  92. */
  93. #ifdef SYS16BIT
  94. # define MAXSEG_64K
  95. #endif
  96. #ifdef MSDOS
  97. # define UNALIGNED_OK
  98. #endif
  99. #ifdef __STDC_VERSION__
  100. # ifndef STDC
  101. # define STDC
  102. # endif
  103. # if __STDC_VERSION__ >= 199901L
  104. # ifndef STDC99
  105. # define STDC99
  106. # endif
  107. # endif
  108. #endif
  109. #if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
  110. # define STDC
  111. #endif
  112. #if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
  113. # define STDC
  114. #endif
  115. #if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
  116. # define STDC
  117. #endif
  118. #if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
  119. # define STDC
  120. #endif
  121. #if !defined(STDC) && defined(macintosh)
  122. # define STDC
  123. #endif
  124. #if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */
  125. # define STDC
  126. #endif
  127. #ifndef STDC
  128. # ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
  129. # define const /* note: need a more gentle solution here */
  130. # endif
  131. #endif
  132. /* Some Mac compilers merge all .h files incorrectly: */
  133. #if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)||defined(__MRC__)
  134. # define NO_DUMMY_DECL
  135. #endif
  136. /* Maximum value for memLevel in deflateInit2 */
  137. #ifndef MAX_MEM_LEVEL
  138. # ifdef MAXSEG_64K
  139. # define MAX_MEM_LEVEL 8
  140. # else
  141. # define MAX_MEM_LEVEL 9
  142. # endif
  143. #endif
  144. /* Maximum value for windowBits in deflateInit2 and inflateInit2.
  145. * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
  146. * created by gzip. (Files created by minigzip can still be extracted by
  147. * gzip.)
  148. */
  149. #ifndef MAX_WBITS
  150. # define MAX_WBITS 15 /* 32K LZ77 window */
  151. #endif
  152. /* The memory requirements for deflate are (in bytes):
  153. (1 << (windowBits+2)) + (1 << (memLevel+9))
  154. that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
  155. plus a few kilobytes for small objects. For example, if you want to reduce
  156. the default memory requirements from 256K to 128K, compile with
  157. make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
  158. Of course this will generally degrade compression (there's no free lunch).
  159. The memory requirements for inflate are (in bytes) 1 << windowBits
  160. that is, 32K for windowBits=15 (default value) plus a few kilobytes
  161. for small objects.
  162. */
  163. /* Type declarations */
  164. #ifndef OF /* function prototypes */
  165. # ifdef STDC
  166. # define OF(args) args
  167. # else
  168. # define OF(args) ()
  169. # endif
  170. #endif
  171. /* The following definitions for FAR are needed only for MSDOS mixed
  172. * model programming (small or medium model with some far allocations).
  173. * This was tested only with MSC; for other MSDOS compilers you may have
  174. * to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
  175. * just define FAR to be empty.
  176. */
  177. #ifdef SYS16BIT
  178. # if defined(M_I86SM) || defined(M_I86MM)
  179. /* MSC small or medium model */
  180. # define SMALL_MEDIUM
  181. # ifdef _MSC_VER
  182. # define FAR _far
  183. # else
  184. # define FAR far
  185. # endif
  186. # endif
  187. # if (defined(__SMALL__) || defined(__MEDIUM__))
  188. /* Turbo C small or medium model */
  189. # define SMALL_MEDIUM
  190. # ifdef __BORLANDC__
  191. # define FAR _far
  192. # else
  193. # define FAR far
  194. # endif
  195. # endif
  196. #endif
  197. #if defined(WINDOWS) || defined(WIN32)
  198. /* If building or using zlib as a DLL, define ZLIB_DLL.
  199. * This is not mandatory, but it offers a little performance increase.
  200. */
  201. # ifdef ZLIB_DLL
  202. # if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
  203. # ifdef ZLIB_INTERNAL
  204. # define ZEXTERN extern __declspec(dllexport)
  205. # else
  206. # define ZEXTERN extern __declspec(dllimport)
  207. # endif
  208. # endif
  209. # endif /* ZLIB_DLL */
  210. /* If building or using zlib with the WINAPI/WINAPIV calling convention,
  211. * define ZLIB_WINAPI.
  212. * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
  213. */
  214. # ifdef ZLIB_WINAPI
  215. # ifdef FAR
  216. # undef FAR
  217. # endif
  218. # include <windows.h>
  219. /* No need for _export, use ZLIB.DEF instead. */
  220. /* For complete Windows compatibility, use WINAPI, not __stdcall. */
  221. # define ZEXPORT WINAPI
  222. # ifdef WIN32
  223. # define ZEXPORTVA WINAPIV
  224. # else
  225. # define ZEXPORTVA FAR CDECL
  226. # endif
  227. # endif
  228. #endif
  229. #if defined (__BEOS__)
  230. # ifdef ZLIB_DLL
  231. # ifdef ZLIB_INTERNAL
  232. # define ZEXPORT __declspec(dllexport)
  233. # define ZEXPORTVA __declspec(dllexport)
  234. # else
  235. # define ZEXPORT __declspec(dllimport)
  236. # define ZEXPORTVA __declspec(dllimport)
  237. # endif
  238. # endif
  239. #endif
  240. #ifndef ZEXTERN
  241. # define ZEXTERN extern
  242. #endif
  243. #ifndef ZEXPORT
  244. # define ZEXPORT
  245. #endif
  246. #ifndef ZEXPORTVA
  247. # define ZEXPORTVA
  248. #endif
  249. #ifndef FAR
  250. # define FAR
  251. #endif
  252. #if !defined(__MACTYPES__)
  253. typedef unsigned char Byte; /* 8 bits */
  254. #endif
  255. typedef unsigned int uInt; /* 16 bits or more */
  256. typedef unsigned long uLong; /* 32 bits or more */
  257. #ifdef SMALL_MEDIUM
  258. /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
  259. # define Bytef Byte FAR
  260. #else
  261. typedef Byte FAR Bytef;
  262. #endif
  263. typedef char FAR charf;
  264. typedef int FAR intf;
  265. typedef uInt FAR uIntf;
  266. typedef uLong FAR uLongf;
  267. #ifdef STDC
  268. typedef void const *voidpc;
  269. typedef void FAR *voidpf;
  270. typedef void *voidp;
  271. #else
  272. typedef Byte const *voidpc;
  273. typedef Byte FAR *voidpf;
  274. typedef Byte *voidp;
  275. #endif
  276. #if 0 /* HAVE_UNISTD_H -- this line is updated by ./configure */
  277. # include <sys/types.h> /* for off_t */
  278. # include <unistd.h> /* for SEEK_* and off_t */
  279. # ifdef VMS
  280. # include <unixio.h> /* for off_t */
  281. # endif
  282. # define z_off_t off_t
  283. #endif
  284. #ifndef SEEK_SET
  285. # define SEEK_SET 0 /* Seek from beginning of file. */
  286. # define SEEK_CUR 1 /* Seek from current position. */
  287. # define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
  288. #endif
  289. #ifndef z_off_t
  290. # define z_off_t long
  291. #endif
  292. #if defined(__OS400__)
  293. #define NO_vsnprintf
  294. #endif
  295. #if defined(__MVS__)
  296. # define NO_vsnprintf
  297. # ifdef FAR
  298. # undef FAR
  299. # endif
  300. #endif
  301. /* MVS linker does not support external names larger than 8 bytes */
  302. #if defined(__MVS__)
  303. # pragma map(deflateInit_,"DEIN")
  304. # pragma map(deflateInit2_,"DEIN2")
  305. # pragma map(deflateEnd,"DEEND")
  306. # pragma map(deflateBound,"DEBND")
  307. # pragma map(inflateInit_,"ININ")
  308. # pragma map(inflateInit2_,"ININ2")
  309. # pragma map(inflateEnd,"INEND")
  310. # pragma map(inflateSync,"INSY")
  311. # pragma map(inflateSetDictionary,"INSEDI")
  312. # pragma map(compressBound,"CMBND")
  313. # pragma map(inflate_table,"INTABL")
  314. # pragma map(inflate_fast,"INFA")
  315. # pragma map(inflate_copyright,"INCOPY")
  316. #endif
  317. #endif /* ZCONF_H */