Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

279 lines
7.6 KiB

  1. /* zconf.h -- configuration of the zlib compression library
  2. * Copyright (C) 1995-2002 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 inflateInit2_ z_inflateInit2_
  25. # define inflateSetDictionary z_inflateSetDictionary
  26. # define inflateSync z_inflateSync
  27. # define inflateSyncPoint z_inflateSyncPoint
  28. # define inflateReset z_inflateReset
  29. # define compress z_compress
  30. # define compress2 z_compress2
  31. # define uncompress z_uncompress
  32. # define adler32 z_adler32
  33. # define crc32 z_crc32
  34. # define get_crc_table z_get_crc_table
  35. # define Byte z_Byte
  36. # define uInt z_uInt
  37. # define uLong z_uLong
  38. # define Bytef z_Bytef
  39. # define charf z_charf
  40. # define intf z_intf
  41. # define uIntf z_uIntf
  42. # define uLongf z_uLongf
  43. # define voidpf z_voidpf
  44. # define voidp z_voidp
  45. #endif
  46. #if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32)
  47. # define WIN32
  48. #endif
  49. #if defined(__GNUC__) || defined(WIN32) || defined(__386__) || defined(i386)
  50. # ifndef __32BIT__
  51. # define __32BIT__
  52. # endif
  53. #endif
  54. #if defined(__MSDOS__) && !defined(MSDOS)
  55. # define MSDOS
  56. #endif
  57. /*
  58. * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
  59. * than 64k bytes at a time (needed on systems with 16-bit int).
  60. */
  61. #if defined(MSDOS) && !defined(__32BIT__)
  62. # define MAXSEG_64K
  63. #endif
  64. #ifdef MSDOS
  65. # define UNALIGNED_OK
  66. #endif
  67. #if (defined(MSDOS) || defined(_WINDOWS) || defined(WIN32)) && !defined(STDC)
  68. # define STDC
  69. #endif
  70. #if defined(__STDC__) || defined(__cplusplus) || defined(__OS2__)
  71. # ifndef STDC
  72. # define STDC
  73. # endif
  74. #endif
  75. #ifndef STDC
  76. # ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
  77. # define const
  78. # endif
  79. #endif
  80. /* Some Mac compilers merge all .h files incorrectly: */
  81. #if defined(__MWERKS__) || defined(applec) ||defined(THINK_C) ||defined(__SC__)
  82. # define NO_DUMMY_DECL
  83. #endif
  84. /* Old Borland C incorrectly complains about missing returns: */
  85. #if defined(__BORLANDC__) && (__BORLANDC__ < 0x500)
  86. # define NEED_DUMMY_RETURN
  87. #endif
  88. /* Maximum value for memLevel in deflateInit2 */
  89. #ifndef MAX_MEM_LEVEL
  90. # ifdef MAXSEG_64K
  91. # define MAX_MEM_LEVEL 8
  92. # else
  93. # define MAX_MEM_LEVEL 9
  94. # endif
  95. #endif
  96. /* Maximum value for windowBits in deflateInit2 and inflateInit2.
  97. * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
  98. * created by gzip. (Files created by minigzip can still be extracted by
  99. * gzip.)
  100. */
  101. #ifndef MAX_WBITS
  102. # define MAX_WBITS 15 /* 32K LZ77 window */
  103. #endif
  104. /* The memory requirements for deflate are (in bytes):
  105. (1 << (windowBits+2)) + (1 << (memLevel+9))
  106. that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
  107. plus a few kilobytes for small objects. For example, if you want to reduce
  108. the default memory requirements from 256K to 128K, compile with
  109. make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
  110. Of course this will generally degrade compression (there's no free lunch).
  111. The memory requirements for inflate are (in bytes) 1 << windowBits
  112. that is, 32K for windowBits=15 (default value) plus a few kilobytes
  113. for small objects.
  114. */
  115. /* Type declarations */
  116. #ifndef OF /* function prototypes */
  117. # ifdef STDC
  118. # define OF(args) args
  119. # else
  120. # define OF(args) ()
  121. # endif
  122. #endif
  123. /* The following definitions for FAR are needed only for MSDOS mixed
  124. * model programming (small or medium model with some far allocations).
  125. * This was tested only with MSC; for other MSDOS compilers you may have
  126. * to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
  127. * just define FAR to be empty.
  128. */
  129. #if (defined(M_I86SM) || defined(M_I86MM)) && !defined(__32BIT__)
  130. /* MSC small or medium model */
  131. # define SMALL_MEDIUM
  132. # ifdef _MSC_VER
  133. # define FAR _far
  134. # else
  135. # define FAR far
  136. # endif
  137. #endif
  138. #if defined(__BORLANDC__) && (defined(__SMALL__) || defined(__MEDIUM__))
  139. # ifndef __32BIT__
  140. # define SMALL_MEDIUM
  141. # define FAR _far
  142. # endif
  143. #endif
  144. /* Compile with -DZLIB_DLL for Windows DLL support */
  145. #if defined(ZLIB_DLL)
  146. # if defined(_WINDOWS) || defined(WINDOWS)
  147. # ifdef FAR
  148. # undef FAR
  149. # endif
  150. # include <windows.h>
  151. # define ZEXPORT WINAPI
  152. # ifdef WIN32
  153. # define ZEXPORTVA WINAPIV
  154. # else
  155. # define ZEXPORTVA FAR _cdecl _export
  156. # endif
  157. # endif
  158. # if defined (__BORLANDC__)
  159. # if (__BORLANDC__ >= 0x0500) && defined (WIN32)
  160. # include <windows.h>
  161. # define ZEXPORT __declspec(dllexport) WINAPI
  162. # define ZEXPORTRVA __declspec(dllexport) WINAPIV
  163. # else
  164. # if defined (_Windows) && defined (__DLL__)
  165. # define ZEXPORT _export
  166. # define ZEXPORTVA _export
  167. # endif
  168. # endif
  169. # endif
  170. #endif
  171. #if defined (__BEOS__)
  172. # if defined (ZLIB_DLL)
  173. # define ZEXTERN extern __declspec(dllexport)
  174. # else
  175. # define ZEXTERN extern __declspec(dllimport)
  176. # endif
  177. #endif
  178. #ifndef ZEXPORT
  179. # define ZEXPORT
  180. #endif
  181. #ifndef ZEXPORTVA
  182. # define ZEXPORTVA
  183. #endif
  184. #ifndef ZEXTERN
  185. # define ZEXTERN extern
  186. #endif
  187. #ifndef FAR
  188. # define FAR
  189. #endif
  190. #if !defined(MACOS) && !defined(TARGET_OS_MAC)
  191. typedef unsigned char Byte; /* 8 bits */
  192. #endif
  193. typedef unsigned int uInt; /* 16 bits or more */
  194. typedef unsigned long uLong; /* 32 bits or more */
  195. #ifdef SMALL_MEDIUM
  196. /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
  197. # define Bytef Byte FAR
  198. #else
  199. typedef Byte FAR Bytef;
  200. #endif
  201. typedef char FAR charf;
  202. typedef int FAR intf;
  203. typedef uInt FAR uIntf;
  204. typedef uLong FAR uLongf;
  205. #ifdef STDC
  206. typedef void FAR *voidpf;
  207. typedef void *voidp;
  208. #else
  209. typedef Byte FAR *voidpf;
  210. typedef Byte *voidp;
  211. #endif
  212. #ifdef HAVE_UNISTD_H
  213. # include <sys/types.h> /* for off_t */
  214. # include <unistd.h> /* for SEEK_* and off_t */
  215. # define z_off_t off_t
  216. #endif
  217. #ifndef SEEK_SET
  218. # define SEEK_SET 0 /* Seek from beginning of file. */
  219. # define SEEK_CUR 1 /* Seek from current position. */
  220. # define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
  221. #endif
  222. #ifndef z_off_t
  223. # define z_off_t long
  224. #endif
  225. /* MVS linker does not support external names larger than 8 bytes */
  226. #if defined(__MVS__)
  227. # pragma map(deflateInit_,"DEIN")
  228. # pragma map(deflateInit2_,"DEIN2")
  229. # pragma map(deflateEnd,"DEEND")
  230. # pragma map(inflateInit_,"ININ")
  231. # pragma map(inflateInit2_,"ININ2")
  232. # pragma map(inflateEnd,"INEND")
  233. # pragma map(inflateSync,"INSY")
  234. # pragma map(inflateSetDictionary,"INSEDI")
  235. # pragma map(inflate_blocks,"INBL")
  236. # pragma map(inflate_blocks_new,"INBLNE")
  237. # pragma map(inflate_blocks_free,"INBLFR")
  238. # pragma map(inflate_blocks_reset,"INBLRE")
  239. # pragma map(inflate_codes_free,"INCOFR")
  240. # pragma map(inflate_codes,"INCO")
  241. # pragma map(inflate_fast,"INFA")
  242. # pragma map(inflate_flush,"INFLU")
  243. # pragma map(inflate_mask,"INMA")
  244. # pragma map(inflate_set_dictionary,"INSEDI2")
  245. # pragma map(inflate_copyright,"INCOPY")
  246. # pragma map(inflate_trees_bits,"INTRBI")
  247. # pragma map(inflate_trees_dynamic,"INTRDY")
  248. # pragma map(inflate_trees_fixed,"INTRFI")
  249. # pragma map(inflate_trees_free,"INTRFR")
  250. #endif
  251. #endif /* _ZCONF_H */