zconf.h 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. /* zconf.h -- configuration of the zlib compression library
  2. * Copyright (C) 1995-1996 Jean-loup Gailly.
  3. * For conditions of distribution and use, see copyright notice in zlib.h
  4. */
  5. /* $Id: zconf.h,v 1.20 1996/07/02 15:09:28 me 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 deflateParams z_deflateParams
  24. # define inflateInit2_ z_inflateInit2_
  25. # define inflateSetDictionary z_inflateSetDictionary
  26. # define inflateSync z_inflateSync
  27. # define inflateReset z_inflateReset
  28. # define compress z_compress
  29. # define uncompress z_uncompress
  30. # define adler32 z_adler32
  31. # define crc32 z_crc32
  32. # define get_crc_table z_get_crc_table
  33. # define Byte z_Byte
  34. # define uInt z_uInt
  35. # define uLong z_uLong
  36. # define Bytef z_Bytef
  37. # define charf z_charf
  38. # define intf z_intf
  39. # define uIntf z_uIntf
  40. # define uLongf z_uLongf
  41. # define voidpf z_voidpf
  42. # define voidp z_voidp
  43. #endif
  44. #if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32)
  45. # define WIN32
  46. #endif
  47. #if defined(__GNUC__) || defined(WIN32) || defined(__386__) || defined(i386)
  48. # ifndef __32BIT__
  49. # define __32BIT__
  50. # endif
  51. #endif
  52. #if defined(__MSDOS__) && !defined(MSDOS)
  53. # define MSDOS
  54. #endif
  55. /*
  56. * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
  57. * than 64k bytes at a time (needed on systems with 16-bit int).
  58. */
  59. #if defined(MSDOS) && !defined(__32BIT__)
  60. # define MAXSEG_64K
  61. #endif
  62. #ifdef MSDOS
  63. # define UNALIGNED_OK
  64. #endif
  65. #if (defined(MSDOS) || defined(_WINDOWS) || defined(WIN32)) && !defined(STDC)
  66. # define STDC
  67. #endif
  68. #if (defined(__STDC__) || defined(__cplusplus)) && !defined(STDC)
  69. # define STDC
  70. #endif
  71. #ifndef STDC
  72. # ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
  73. # define const
  74. # endif
  75. #endif
  76. /* Some Mac compilers merge all .h files incorrectly: */
  77. #if defined(__MWERKS__) || defined(applec) ||defined(THINK_C) ||defined(__SC__)
  78. # define NO_DUMMY_DECL
  79. #endif
  80. /* Maximum value for memLevel in deflateInit2 */
  81. #ifndef MAX_MEM_LEVEL
  82. # ifdef MAXSEG_64K
  83. # define MAX_MEM_LEVEL 8
  84. # else
  85. # define MAX_MEM_LEVEL 9
  86. # endif
  87. #endif
  88. /* Maximum value for windowBits in deflateInit2 and inflateInit2 */
  89. #ifndef MAX_WBITS
  90. # define MAX_WBITS 15 /* 32K LZ77 window */
  91. #endif
  92. /* The memory requirements for deflate are (in bytes):
  93. 1 << (windowBits+2) + 1 << (memLevel+9)
  94. that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
  95. plus a few kilobytes for small objects. For example, if you want to reduce
  96. the default memory requirements from 256K to 128K, compile with
  97. make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
  98. Of course this will generally degrade compression (there's no free lunch).
  99. The memory requirements for inflate are (in bytes) 1 << windowBits
  100. that is, 32K for windowBits=15 (default value) plus a few kilobytes
  101. for small objects.
  102. */
  103. /* Type declarations */
  104. #ifndef OF /* function prototypes */
  105. # ifdef STDC
  106. # define OF(args) args
  107. # else
  108. # define OF(args) ()
  109. # endif
  110. #endif
  111. /* The following definitions for FAR are needed only for MSDOS mixed
  112. * model programming (small or medium model with some far allocations).
  113. * This was tested only with MSC; for other MSDOS compilers you may have
  114. * to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
  115. * just define FAR to be empty.
  116. */
  117. #if (defined(M_I86SM) || defined(M_I86MM)) && !defined(__32BIT__)
  118. /* MSC small or medium model */
  119. # define SMALL_MEDIUM
  120. # ifdef _MSC_VER
  121. # define FAR __far
  122. # else
  123. # define FAR far
  124. # endif
  125. #endif
  126. #if defined(__BORLANDC__) && (defined(__SMALL__) || defined(__MEDIUM__))
  127. # ifndef __32BIT__
  128. # define SMALL_MEDIUM
  129. # define FAR __far
  130. # endif
  131. #endif
  132. #ifndef FAR
  133. # define FAR
  134. #endif
  135. typedef unsigned char Byte; /* 8 bits */
  136. typedef unsigned int uInt; /* 16 bits or more */
  137. typedef unsigned long uLong; /* 32 bits or more */
  138. #if defined(__BORLANDC__) && defined(SMALL_MEDIUM)
  139. /* Borland C/C++ ignores FAR inside typedef */
  140. # define Bytef Byte FAR
  141. #else
  142. typedef Byte FAR Bytef;
  143. #endif
  144. typedef char FAR charf;
  145. typedef int FAR intf;
  146. typedef uInt FAR uIntf;
  147. typedef uLong FAR uLongf;
  148. #ifdef STDC
  149. typedef void FAR *voidpf;
  150. typedef void *voidp;
  151. #else
  152. typedef Byte FAR *voidpf;
  153. typedef Byte *voidp;
  154. #endif
  155. /* Compile with -DZLIB_DLL for Windows DLL support */
  156. #if (defined(_WINDOWS) || defined(WINDOWS)) && defined(ZLIB_DLL)
  157. # include <windows.h>
  158. # define EXPORT WINAPI
  159. #else
  160. # define EXPORT
  161. #endif
  162. #endif /* _ZCONF_H */