jdk/src/share/native/java/util/zip/zlib-1.2.3/zconf.h
changeset 11303 5f48992867e6
parent 11302 a6305295d4d9
parent 11239 885050364691
child 11304 5d3d2bd1dfd1
equal deleted inserted replaced
11302:a6305295d4d9 11303:5f48992867e6
     1 /*
       
     2  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
       
     3  *
       
     4  * This code is free software; you can redistribute it and/or modify it
       
     5  * under the terms of the GNU General Public License version 2 only, as
       
     6  * published by the Free Software Foundation.  Oracle designates this
       
     7  * particular file as subject to the "Classpath" exception as provided
       
     8  * by Oracle in the LICENSE file that accompanied this code.
       
     9  *
       
    10  * This code is distributed in the hope that it will be useful, but WITHOUT
       
    11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
       
    12  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
       
    13  * version 2 for more details (a copy is included in the LICENSE file that
       
    14  * accompanied this code).
       
    15  *
       
    16  * You should have received a copy of the GNU General Public License version
       
    17  * 2 along with this work; if not, write to the Free Software Foundation,
       
    18  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
       
    19  *
       
    20  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
       
    21  * or visit www.oracle.com if you need additional information or have any
       
    22  * questions.
       
    23  */
       
    24 
       
    25 /* zconf.h -- configuration of the zlib compression library
       
    26  * Copyright (C) 1995-2005 Jean-loup Gailly.
       
    27  * For conditions of distribution and use, see copyright notice in zlib.h
       
    28  */
       
    29 
       
    30 /* @(#) $Id$ */
       
    31 
       
    32 #ifndef ZCONF_H
       
    33 #define ZCONF_H
       
    34 
       
    35 /* for _LP64 */
       
    36 #include <sys/types.h>
       
    37 
       
    38 /*
       
    39  * If you *really* need a unique prefix for all types and library functions,
       
    40  * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
       
    41  */
       
    42 #ifdef Z_PREFIX
       
    43 #  define deflateInit_          z_deflateInit_
       
    44 #  define deflate               z_deflate
       
    45 #  define deflateEnd            z_deflateEnd
       
    46 #  define inflateInit_          z_inflateInit_
       
    47 #  define inflate               z_inflate
       
    48 #  define inflateEnd            z_inflateEnd
       
    49 #  define deflateInit2_         z_deflateInit2_
       
    50 #  define deflateSetDictionary  z_deflateSetDictionary
       
    51 #  define deflateCopy           z_deflateCopy
       
    52 #  define deflateReset          z_deflateReset
       
    53 #  define deflateParams         z_deflateParams
       
    54 #  define deflateBound          z_deflateBound
       
    55 #  define deflatePrime          z_deflatePrime
       
    56 #  define inflateInit2_         z_inflateInit2_
       
    57 #  define inflateSetDictionary  z_inflateSetDictionary
       
    58 #  define inflateSync           z_inflateSync
       
    59 #  define inflateSyncPoint      z_inflateSyncPoint
       
    60 #  define inflateCopy           z_inflateCopy
       
    61 #  define inflateReset          z_inflateReset
       
    62 #  define inflateBack           z_inflateBack
       
    63 #  define inflateBackEnd        z_inflateBackEnd
       
    64 #  define compress              z_compress
       
    65 #  define compress2             z_compress2
       
    66 #  define compressBound         z_compressBound
       
    67 #  define uncompress            z_uncompress
       
    68 #  define adler32               z_adler32
       
    69 #  define crc32                 z_crc32
       
    70 #  define get_crc_table         z_get_crc_table
       
    71 #  define zError                z_zError
       
    72 
       
    73 #  define alloc_func            z_alloc_func
       
    74 #  define free_func             z_free_func
       
    75 #  define in_func               z_in_func
       
    76 #  define out_func              z_out_func
       
    77 #  define Byte                  z_Byte
       
    78 #  define uInt                  z_uInt
       
    79 #  define uLong                 z_uLong
       
    80 #  define Bytef                 z_Bytef
       
    81 #  define charf                 z_charf
       
    82 #  define intf                  z_intf
       
    83 #  define uIntf                 z_uIntf
       
    84 #  define uLongf                z_uLongf
       
    85 #  define voidpf                z_voidpf
       
    86 #  define voidp                 z_voidp
       
    87 #endif
       
    88 
       
    89 #if defined(__MSDOS__) && !defined(MSDOS)
       
    90 #  define MSDOS
       
    91 #endif
       
    92 #if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
       
    93 #  define OS2
       
    94 #endif
       
    95 #if defined(_WINDOWS) && !defined(WINDOWS)
       
    96 #  define WINDOWS
       
    97 #endif
       
    98 #if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
       
    99 #  ifndef WIN32
       
   100 #    define WIN32
       
   101 #  endif
       
   102 #endif
       
   103 #if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
       
   104 #  if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
       
   105 #    ifndef SYS16BIT
       
   106 #      define SYS16BIT
       
   107 #    endif
       
   108 #  endif
       
   109 #endif
       
   110 
       
   111 /*
       
   112  * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
       
   113  * than 64k bytes at a time (needed on systems with 16-bit int).
       
   114  */
       
   115 #ifdef SYS16BIT
       
   116 #  define MAXSEG_64K
       
   117 #endif
       
   118 #ifdef MSDOS
       
   119 #  define UNALIGNED_OK
       
   120 #endif
       
   121 
       
   122 #ifdef __STDC_VERSION__
       
   123 #  ifndef STDC
       
   124 #    define STDC
       
   125 #  endif
       
   126 #  if __STDC_VERSION__ >= 199901L
       
   127 #    ifndef STDC99
       
   128 #      define STDC99
       
   129 #    endif
       
   130 #  endif
       
   131 #endif
       
   132 #if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
       
   133 #  define STDC
       
   134 #endif
       
   135 #if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
       
   136 #  define STDC
       
   137 #endif
       
   138 #if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
       
   139 #  define STDC
       
   140 #endif
       
   141 #if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
       
   142 #  define STDC
       
   143 #endif
       
   144 
       
   145 #if defined(__OS400__) && !defined(STDC)    /* iSeries (formerly AS/400). */
       
   146 #  define STDC
       
   147 #endif
       
   148 
       
   149 #ifndef STDC
       
   150 #  ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
       
   151 #    define const       /* note: need a more gentle solution here */
       
   152 #  endif
       
   153 #endif
       
   154 
       
   155 /* Some Mac compilers merge all .h files incorrectly: */
       
   156 #if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
       
   157 #  define NO_DUMMY_DECL
       
   158 #endif
       
   159 
       
   160 /* Maximum value for memLevel in deflateInit2 */
       
   161 #ifndef MAX_MEM_LEVEL
       
   162 #  ifdef MAXSEG_64K
       
   163 #    define MAX_MEM_LEVEL 8
       
   164 #  else
       
   165 #    define MAX_MEM_LEVEL 9
       
   166 #  endif
       
   167 #endif
       
   168 
       
   169 /* Maximum value for windowBits in deflateInit2 and inflateInit2.
       
   170  * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
       
   171  * created by gzip. (Files created by minigzip can still be extracted by
       
   172  * gzip.)
       
   173  */
       
   174 #ifndef MAX_WBITS
       
   175 #  define MAX_WBITS   15 /* 32K LZ77 window */
       
   176 #endif
       
   177 
       
   178 /* The memory requirements for deflate are (in bytes):
       
   179             (1 << (windowBits+2)) +  (1 << (memLevel+9))
       
   180  that is: 128K for windowBits=15  +  128K for memLevel = 8  (default values)
       
   181  plus a few kilobytes for small objects. For example, if you want to reduce
       
   182  the default memory requirements from 256K to 128K, compile with
       
   183      make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
       
   184  Of course this will generally degrade compression (there's no free lunch).
       
   185 
       
   186    The memory requirements for inflate are (in bytes) 1 << windowBits
       
   187  that is, 32K for windowBits=15 (default value) plus a few kilobytes
       
   188  for small objects.
       
   189 */
       
   190 
       
   191                         /* Type declarations */
       
   192 
       
   193 #ifndef OF /* function prototypes */
       
   194 #  ifdef STDC
       
   195 #    define OF(args)  args
       
   196 #  else
       
   197 #    define OF(args)  ()
       
   198 #  endif
       
   199 #endif
       
   200 
       
   201 /* The following definitions for FAR are needed only for MSDOS mixed
       
   202  * model programming (small or medium model with some far allocations).
       
   203  * This was tested only with MSC; for other MSDOS compilers you may have
       
   204  * to define NO_MEMCPY in zutil.h.  If you don't need the mixed model,
       
   205  * just define FAR to be empty.
       
   206  */
       
   207 #ifdef SYS16BIT
       
   208 #  if defined(M_I86SM) || defined(M_I86MM)
       
   209      /* MSC small or medium model */
       
   210 #    define SMALL_MEDIUM
       
   211 #    ifdef _MSC_VER
       
   212 #      define FAR _far
       
   213 #    else
       
   214 #      define FAR far
       
   215 #    endif
       
   216 #  endif
       
   217 #  if (defined(__SMALL__) || defined(__MEDIUM__))
       
   218      /* Turbo C small or medium model */
       
   219 #    define SMALL_MEDIUM
       
   220 #    ifdef __BORLANDC__
       
   221 #      define FAR _far
       
   222 #    else
       
   223 #      define FAR far
       
   224 #    endif
       
   225 #  endif
       
   226 #endif
       
   227 
       
   228 #if defined(WINDOWS) || defined(WIN32)
       
   229    /* If building or using zlib as a DLL, define ZLIB_DLL.
       
   230     * This is not mandatory, but it offers a little performance increase.
       
   231     */
       
   232 #  ifdef ZLIB_DLL
       
   233 #    if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
       
   234 #      ifdef ZLIB_INTERNAL
       
   235 #        define ZEXTERN extern __declspec(dllexport)
       
   236 #      else
       
   237 #        define ZEXTERN extern __declspec(dllimport)
       
   238 #      endif
       
   239 #    endif
       
   240 #  endif  /* ZLIB_DLL */
       
   241    /* If building or using zlib with the WINAPI/WINAPIV calling convention,
       
   242     * define ZLIB_WINAPI.
       
   243     * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
       
   244     */
       
   245 #  ifdef ZLIB_WINAPI
       
   246 #    ifdef FAR
       
   247 #      undef FAR
       
   248 #    endif
       
   249 #    include <windows.h>
       
   250      /* No need for _export, use ZLIB.DEF instead. */
       
   251      /* For complete Windows compatibility, use WINAPI, not __stdcall. */
       
   252 #    define ZEXPORT WINAPI
       
   253 #    ifdef WIN32
       
   254 #      define ZEXPORTVA WINAPIV
       
   255 #    else
       
   256 #      define ZEXPORTVA FAR CDECL
       
   257 #    endif
       
   258 #  endif
       
   259 #endif
       
   260 
       
   261 #if defined (__BEOS__)
       
   262 #  ifdef ZLIB_DLL
       
   263 #    ifdef ZLIB_INTERNAL
       
   264 #      define ZEXPORT   __declspec(dllexport)
       
   265 #      define ZEXPORTVA __declspec(dllexport)
       
   266 #    else
       
   267 #      define ZEXPORT   __declspec(dllimport)
       
   268 #      define ZEXPORTVA __declspec(dllimport)
       
   269 #    endif
       
   270 #  endif
       
   271 #endif
       
   272 
       
   273 #ifndef ZEXTERN
       
   274 #  define ZEXTERN extern
       
   275 #endif
       
   276 #ifndef ZEXPORT
       
   277 #  define ZEXPORT
       
   278 #endif
       
   279 #ifndef ZEXPORTVA
       
   280 #  define ZEXPORTVA
       
   281 #endif
       
   282 
       
   283 #ifndef FAR
       
   284 #  define FAR
       
   285 #endif
       
   286 
       
   287 #if !defined(__MACTYPES__)
       
   288 typedef unsigned char  Byte;  /* 8 bits */
       
   289 #endif
       
   290 typedef unsigned int   uInt;  /* 16 bits or more */
       
   291 #ifdef _LP64
       
   292 typedef unsigned int  uLong;  /* 32 bits or more */
       
   293 #else
       
   294 typedef unsigned long  uLong; /* 32 bits or more */
       
   295 #endif
       
   296 
       
   297 #ifdef SMALL_MEDIUM
       
   298    /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
       
   299 #  define Bytef Byte FAR
       
   300 #else
       
   301    typedef Byte  FAR Bytef;
       
   302 #endif
       
   303 typedef char  FAR charf;
       
   304 typedef int   FAR intf;
       
   305 typedef uInt  FAR uIntf;
       
   306 typedef uLong FAR uLongf;
       
   307 
       
   308 #ifdef STDC
       
   309    typedef void const *voidpc;
       
   310    typedef void FAR   *voidpf;
       
   311    typedef void       *voidp;
       
   312 #else
       
   313    typedef Byte const *voidpc;
       
   314    typedef Byte FAR   *voidpf;
       
   315    typedef Byte       *voidp;
       
   316 #endif
       
   317 
       
   318 #if 0           /* HAVE_UNISTD_H -- this line is updated by ./configure */
       
   319 #  include <sys/types.h> /* for off_t */
       
   320 #  include <unistd.h>    /* for SEEK_* and off_t */
       
   321 #  ifdef VMS
       
   322 #    include <unixio.h>   /* for off_t */
       
   323 #  endif
       
   324 #  define z_off_t off_t
       
   325 #endif
       
   326 #ifndef SEEK_SET
       
   327 #  define SEEK_SET        0       /* Seek from beginning of file.  */
       
   328 #  define SEEK_CUR        1       /* Seek from current position.  */
       
   329 #  define SEEK_END        2       /* Set file pointer to EOF plus "offset" */
       
   330 #endif
       
   331 #ifndef z_off_t
       
   332 #  define z_off_t long
       
   333 #endif
       
   334 
       
   335 #if defined(__OS400__)
       
   336 #  define NO_vsnprintf
       
   337 #endif
       
   338 
       
   339 #if defined(__MVS__)
       
   340 #  define NO_vsnprintf
       
   341 #  ifdef FAR
       
   342 #    undef FAR
       
   343 #  endif
       
   344 #endif
       
   345 
       
   346 /* MVS linker does not support external names larger than 8 bytes */
       
   347 #if defined(__MVS__)
       
   348 #   pragma map(deflateInit_,"DEIN")
       
   349 #   pragma map(deflateInit2_,"DEIN2")
       
   350 #   pragma map(deflateEnd,"DEEND")
       
   351 #   pragma map(deflateBound,"DEBND")
       
   352 #   pragma map(inflateInit_,"ININ")
       
   353 #   pragma map(inflateInit2_,"ININ2")
       
   354 #   pragma map(inflateEnd,"INEND")
       
   355 #   pragma map(inflateSync,"INSY")
       
   356 #   pragma map(inflateSetDictionary,"INSEDI")
       
   357 #   pragma map(compressBound,"CMBND")
       
   358 #   pragma map(inflate_table,"INTABL")
       
   359 #   pragma map(inflate_fast,"INFA")
       
   360 #   pragma map(inflate_copyright,"INCOPY")
       
   361 #endif
       
   362 
       
   363 #endif /* ZCONF_H */