zconf.h 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345
  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: zconf.h,v 1.2 2003/12/22 18:19:09 bhook 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. */
  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(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */
  122. # define STDC
  123. #endif
  124. #ifndef STDC
  125. # ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
  126. # define const /* note: need a more gentle solution here */
  127. # endif
  128. #endif
  129. /* Some Mac compilers merge all .h files incorrectly: */
  130. #if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
  131. # define NO_DUMMY_DECL
  132. #endif
  133. /* Maximum value for memLevel in deflateInit2 */
  134. #ifndef MAX_MEM_LEVEL
  135. # ifdef MAXSEG_64K
  136. # define MAX_MEM_LEVEL 8
  137. # else
  138. # define MAX_MEM_LEVEL 9
  139. # endif
  140. #endif
  141. /* Maximum value for windowBits in deflateInit2 and inflateInit2.
  142. * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
  143. * created by gzip. (Files created by minigzip can still be extracted by
  144. * gzip.)
  145. */
  146. #ifndef MAX_WBITS
  147. # define MAX_WBITS 15 /* 32K LZ77 window */
  148. #endif
  149. /* The memory requirements for deflate are (in bytes):
  150. (1 << (windowBits+2)) + (1 << (memLevel+9))
  151. that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
  152. plus a few kilobytes for small objects. For example, if you want to reduce
  153. the default memory requirements from 256K to 128K, compile with
  154. make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
  155. Of course this will generally degrade compression (there's no free lunch).
  156. The memory requirements for inflate are (in bytes) 1 << windowBits
  157. that is, 32K for windowBits=15 (default value) plus a few kilobytes
  158. for small objects.
  159. */
  160. /* Type declarations */
  161. #ifndef OF /* function prototypes */
  162. # ifdef STDC
  163. # define OF(args) args
  164. # else
  165. # define OF(args) ()
  166. # endif
  167. #endif
  168. /* The following definitions for FAR are needed only for MSDOS mixed
  169. * model programming (small or medium model with some far allocations).
  170. * This was tested only with MSC; for other MSDOS compilers you may have
  171. * to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
  172. * just define FAR to be empty.
  173. */
  174. #ifdef SYS16BIT
  175. # if defined(M_I86SM) || defined(M_I86MM)
  176. /* MSC small or medium model */
  177. # define SMALL_MEDIUM
  178. # ifdef _MSC_VER
  179. # define FAR _far
  180. # else
  181. # define FAR far
  182. # endif
  183. # endif
  184. # if (defined(__SMALL__) || defined(__MEDIUM__))
  185. /* Turbo C small or medium model */
  186. # define SMALL_MEDIUM
  187. # ifdef __BORLANDC__
  188. # define FAR _far
  189. # else
  190. # define FAR far
  191. # endif
  192. # endif
  193. #endif
  194. #if defined(WINDOWS) || defined(WIN32)
  195. /* If building or using zlib as a DLL, define ZLIB_DLL.
  196. * This is not mandatory, but it offers a little performance increase.
  197. */
  198. # ifdef ZLIB_DLL
  199. # if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
  200. # ifdef ZLIB_INTERNAL
  201. # define ZEXTERN extern __declspec(dllexport)
  202. # else
  203. # define ZEXTERN extern __declspec(dllimport)
  204. # endif
  205. # endif
  206. # endif /* ZLIB_DLL */
  207. /* If building or using zlib with the WINAPI/WINAPIV calling convention,
  208. * define ZLIB_WINAPI.
  209. * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
  210. */
  211. # ifdef ZLIB_WINAPI
  212. # ifdef FAR
  213. # undef FAR
  214. # endif
  215. # include <windows.h>
  216. /* No need for _export, use ZLIB.DEF instead. */
  217. /* For complete Windows compatibility, use WINAPI, not __stdcall. */
  218. # define ZEXPORT WINAPI
  219. # ifdef WIN32
  220. # define ZEXPORTVA WINAPIV
  221. # else
  222. # define ZEXPORTVA FAR CDECL
  223. # endif
  224. # endif
  225. #endif
  226. #if defined (__BEOS__)
  227. # ifdef ZLIB_DLL
  228. # ifdef ZLIB_INTERNAL
  229. # define ZEXPORT __declspec(dllexport)
  230. # define ZEXPORTVA __declspec(dllexport)
  231. # else
  232. # define ZEXPORT __declspec(dllimport)
  233. # define ZEXPORTVA __declspec(dllimport)
  234. # endif
  235. # endif
  236. #endif
  237. #ifndef ZEXTERN
  238. # define ZEXTERN extern
  239. #endif
  240. #ifndef ZEXPORT
  241. # define ZEXPORT
  242. #endif
  243. #ifndef ZEXPORTVA
  244. # define ZEXPORTVA
  245. #endif
  246. #ifndef FAR
  247. # define FAR
  248. #endif
  249. #if !defined(__MACTYPES__)
  250. typedef unsigned char Byte; /* 8 bits */
  251. #endif
  252. typedef unsigned int uInt; /* 16 bits or more */
  253. typedef unsigned long uLong; /* 32 bits or more */
  254. #ifdef SMALL_MEDIUM
  255. /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
  256. # define Bytef Byte FAR
  257. #else
  258. typedef Byte FAR Bytef;
  259. #endif
  260. typedef char FAR charf;
  261. typedef int FAR intf;
  262. typedef uInt FAR uIntf;
  263. typedef uLong FAR uLongf;
  264. #ifdef STDC
  265. typedef void const *voidpc;
  266. typedef void FAR *voidpf;
  267. typedef void *voidp;
  268. #else
  269. typedef Byte const *voidpc;
  270. typedef Byte FAR *voidpf;
  271. typedef Byte *voidp;
  272. #endif
  273. #if 0 /* HAVE_UNISTD_H -- this line is updated by ./configure */
  274. # include <sys/types.h> /* for off_t */
  275. # include <unistd.h> /* for SEEK_* and off_t */
  276. # ifdef VMS
  277. # include <unixio.h> /* for off_t */
  278. # endif
  279. # define z_off_t off_t
  280. #endif
  281. #ifndef SEEK_SET
  282. # define SEEK_SET 0 /* Seek from beginning of file. */
  283. # define SEEK_CUR 1 /* Seek from current position. */
  284. # define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
  285. #endif
  286. #ifndef z_off_t
  287. # define z_off_t long
  288. #endif
  289. #if defined(__OS400__)
  290. #define NO_vsnprintf
  291. #endif
  292. #if defined(__MVS__)
  293. # define NO_vsnprintf
  294. # ifdef FAR
  295. # undef FAR
  296. # endif
  297. #endif
  298. /* MVS linker does not support external names larger than 8 bytes */
  299. #if defined(__MVS__)
  300. # pragma map(deflateInit_,"DEIN")
  301. # pragma map(deflateInit2_,"DEIN2")
  302. # pragma map(deflateEnd,"DEEND")
  303. # pragma map(deflateBound,"DEBND")
  304. # pragma map(inflateInit_,"ININ")
  305. # pragma map(inflateInit2_,"ININ2")
  306. # pragma map(inflateEnd,"INEND")
  307. # pragma map(inflateSync,"INSY")
  308. # pragma map(inflateSetDictionary,"INSEDI")
  309. # pragma map(compressBound,"CMBND")
  310. # pragma map(inflate_table,"INTABL")
  311. # pragma map(inflate_fast,"INFA")
  312. # pragma map(inflate_copyright,"INCOPY")
  313. #endif
  314. #endif /* ZCONF_H */