zconf.h 9.4 KB

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