Home | History | Annotate | Download | only in include
      1 /* zconf.h -- configuration of the zlib compression library
      2  * Copyright (C) 1995-2006 Jean-loup Gailly.
      3  * For conditions of distribution and use, see copyright notice in zlib.h
      4  */
      5 
      6 /* @(#) $Id$ */
      7 
      8 #ifndef ZCONF_H
      9 #define ZCONF_H
     10 
     11 /*
     12  * If you *really* need a unique prefix for all types and library functions,
     13  * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
     14  * Even better than compiling with -DZ_PREFIX would be to use configure to set
     15  * this permanently in zconf.h using "./configure --zprefix".
     16  */
     17 #ifdef Z_PREFIX     /* may be set to #if 1 by ./configure */
     18 
     19 /* all linked symbols */
     20 #  define _dist_code            z__dist_code
     21 #  define _length_code          z__length_code
     22 #  define _tr_align             z__tr_align
     23 #  define _tr_flush_block       z__tr_flush_block
     24 #  define _tr_init              z__tr_init
     25 #  define _tr_stored_block      z__tr_stored_block
     26 #  define _tr_tally             z__tr_tally
     27 #  define adler32               z_adler32
     28 #  define adler32_combine       z_adler32_combine
     29 #  define compress              z_compress
     30 #  define compress2             z_compress2
     31 #  define compressBound         z_compressBound
     32 #  define crc32                 z_crc32
     33 #  define crc32_combine         z_crc32_combine
     34 #  define deflate               z_deflate
     35 #  define deflateBound          z_deflateBound
     36 #  define deflateCopy           z_deflateCopy
     37 #  define deflateEnd            z_deflateEnd
     38 #  define deflateInit2_         z_deflateInit2_
     39 #  define deflateInit_          z_deflateInit_
     40 #  define deflateParams         z_deflateParams
     41 #  define deflatePrime          z_deflatePrime
     42 #  define deflateReset          z_deflateReset
     43 #  define deflateSetDictionary  z_deflateSetDictionary
     44 #  define deflateSetHeader      z_deflateSetHeader
     45 #  define deflateTune           z_deflateTune
     46 #  define deflate_copyright     z_deflate_copyright
     47 #  define get_crc_table         z_get_crc_table
     48 #  define gzclearerr            z_gzclearerr
     49 #  define gzclose               z_gzclose
     50 #  define gzdirect              z_gzdirect
     51 #  define gzdopen               z_gzdopen
     52 #  define gzeof                 z_gzeof
     53 #  define gzerror               z_gzerror
     54 #  define gzflush               z_gzflush
     55 #  define gzgetc                z_gzgetc
     56 #  define gzgets                z_gzgets
     57 #  define gzopen                z_gzopen
     58 #  define gzprintf              z_gzprintf
     59 #  define gzputc                z_gzputc
     60 #  define gzputs                z_gzputs
     61 #  define gzread                z_gzread
     62 #  define gzrewind              z_gzrewind
     63 #  define gzseek                z_gzseek
     64 #  define gzsetparams           z_gzsetparams
     65 #  define gztell                z_gztell
     66 #  define gzungetc              z_gzungetc
     67 #  define gzwrite               z_gzwrite
     68 #  define inflate               z_inflate
     69 #  define inflateBack           z_inflateBack
     70 #  define inflateBackEnd        z_inflateBackEnd
     71 #  define inflateBackInit_      z_inflateBackInit_
     72 #  define inflateCopy           z_inflateCopy
     73 #  define inflateEnd            z_inflateEnd
     74 #  define inflateGetHeader      z_inflateGetHeader
     75 #  define inflateInit2_         z_inflateInit2_
     76 #  define inflateInit_          z_inflateInit_
     77 #  define inflatePrime          z_inflatePrime
     78 #  define inflateReset          z_inflateReset
     79 #  define inflateSetDictionary  z_inflateSetDictionary
     80 #  define inflateSync           z_inflateSync
     81 #  define inflateSyncPoint      z_inflateSyncPoint
     82 #  define inflate_copyright     z_inflate_copyright
     83 #  define inflate_fast          z_inflate_fast
     84 #  define inflate_table         z_inflate_table
     85 #  define uncompress            z_uncompress
     86 #  define zError                z_zError
     87 #  define z_errmsg              z_z_errmsg
     88 #  define zcalloc               z_zcalloc
     89 #  define zcfree                z_zcfree
     90 #  define zlibCompileFlags      z_zlibCompileFlags
     91 #  define zlibVersion           z_zlibVersion
     92 
     93 /* all zlib typedefs in zlib.h and zconf.h */
     94 #  define Byte                  z_Byte
     95 #  define Bytef                 z_Bytef
     96 #  define alloc_func            z_alloc_func
     97 #  define charf                 z_charf
     98 #  define free_func             z_free_func
     99 #  define gzFile                z_gzFile
    100 #  define gz_header             z_gz_header
    101 #  define gz_headerp            z_gz_headerp
    102 #  define in_func               z_in_func
    103 #  define intf                  z_intf
    104 #  define out_func              z_out_func
    105 #  define uInt                  z_uInt
    106 #  define uIntf                 z_uIntf
    107 #  define uLong                 z_uLong
    108 #  define uLongf                z_uLongf
    109 #  define voidp                 z_voidp
    110 #  define voidp                 z_voidp
    111 #  define voidpc                z_voidpc
    112 #  define voidpc                z_voidpc
    113 #  define voidpf                z_voidpf
    114 #  define voidpf                z_voidpf
    115 #  define z_stream              z_z_stream
    116 #  define z_streamp             z_z_streamp
    117 
    118 /* all zlib structs in zlib.h and zconf.h */
    119 #  define gz_header_s           z_gz_header_s
    120 #  define internal_state        z_internal_state
    121 #  define z_stream_s            z_z_stream_s
    122 
    123 #endif
    124 
    125 #if defined(__MSDOS__) && !defined(MSDOS)
    126 #  define MSDOS
    127 #endif
    128 #if (defined(OS_2) || defined(__OS2__)) && !defined(OS2)
    129 #  define OS2
    130 #endif
    131 #if defined(_WINDOWS) && !defined(WINDOWS)
    132 #  define WINDOWS
    133 #endif
    134 #if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__)
    135 #  ifndef WIN32
    136 #    define WIN32
    137 #  endif
    138 #endif
    139 #if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32)
    140 #  if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__)
    141 #    ifndef SYS16BIT
    142 #      define SYS16BIT
    143 #    endif
    144 #  endif
    145 #endif
    146 
    147 /*
    148  * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
    149  * than 64k bytes at a time (needed on systems with 16-bit int).
    150  */
    151 #ifdef SYS16BIT
    152 #  define MAXSEG_64K
    153 #endif
    154 #ifdef MSDOS
    155 #  define UNALIGNED_OK
    156 #endif
    157 
    158 #ifdef __STDC_VERSION__
    159 #  ifndef STDC
    160 #    define STDC
    161 #  endif
    162 #  if __STDC_VERSION__ >= 199901L
    163 #    ifndef STDC99
    164 #      define STDC99
    165 #    endif
    166 #  endif
    167 #endif
    168 #if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
    169 #  define STDC
    170 #endif
    171 #if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
    172 #  define STDC
    173 #endif
    174 #if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
    175 #  define STDC
    176 #endif
    177 #if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
    178 #  define STDC
    179 #endif
    180 
    181 #if defined(__OS400__) && !defined(STDC)    /* iSeries (formerly AS/400). */
    182 #  define STDC
    183 #endif
    184 
    185 #ifndef STDC
    186 #  ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
    187 #    define const       /* note: need a more gentle solution here */
    188 #  endif
    189 #endif
    190 
    191 /* Some Mac compilers merge all .h files incorrectly: */
    192 #if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
    193 #  define NO_DUMMY_DECL
    194 #endif
    195 
    196 /* Maximum value for memLevel in deflateInit2 */
    197 #ifndef MAX_MEM_LEVEL
    198 #  ifdef MAXSEG_64K
    199 #    define MAX_MEM_LEVEL 8
    200 #  else
    201 #    define MAX_MEM_LEVEL 9
    202 #  endif
    203 #endif
    204 
    205 /* Maximum value for windowBits in deflateInit2 and inflateInit2.
    206  * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
    207  * created by gzip. (Files created by minigzip can still be extracted by
    208  * gzip.)
    209  */
    210 #ifndef MAX_WBITS
    211 #  define MAX_WBITS   15 /* 32K LZ77 window */
    212 #endif
    213 
    214 /* The memory requirements for deflate are (in bytes):
    215             (1 << (windowBits+2)) +  (1 << (memLevel+9))
    216  that is: 128K for windowBits=15  +  128K for memLevel = 8  (default values)
    217  plus a few kilobytes for small objects. For example, if you want to reduce
    218  the default memory requirements from 256K to 128K, compile with
    219      make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
    220  Of course this will generally degrade compression (there's no free lunch).
    221 
    222    The memory requirements for inflate are (in bytes) 1 << windowBits
    223  that is, 32K for windowBits=15 (default value) plus a few kilobytes
    224  for small objects.
    225 */
    226 
    227                         /* Type declarations */
    228 
    229 #ifndef OF /* function prototypes */
    230 #  ifdef STDC
    231 #    define OF(args)  args
    232 #  else
    233 #    define OF(args)  ()
    234 #  endif
    235 #endif
    236 
    237 /* The following definitions for FAR are needed only for MSDOS mixed
    238  * model programming (small or medium model with some far allocations).
    239  * This was tested only with MSC; for other MSDOS compilers you may have
    240  * to define NO_MEMCPY in zutil.h.  If you don't need the mixed model,
    241  * just define FAR to be empty.
    242  */
    243 #ifdef SYS16BIT
    244 #  if defined(M_I86SM) || defined(M_I86MM)
    245      /* MSC small or medium model */
    246 #    define SMALL_MEDIUM
    247 #    ifdef _MSC_VER
    248 #      define FAR _far
    249 #    else
    250 #      define FAR far
    251 #    endif
    252 #  endif
    253 #  if (defined(__SMALL__) || defined(__MEDIUM__))
    254      /* Turbo C small or medium model */
    255 #    define SMALL_MEDIUM
    256 #    ifdef __BORLANDC__
    257 #      define FAR _far
    258 #    else
    259 #      define FAR far
    260 #    endif
    261 #  endif
    262 #endif
    263 
    264 #if defined(WINDOWS) || defined(WIN32)
    265    /* If building or using zlib as a DLL, define ZLIB_DLL.
    266     * This is not mandatory, but it offers a little performance increase.
    267     */
    268 #  ifdef ZLIB_DLL
    269 #    if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
    270 #      ifdef ZLIB_INTERNAL
    271 #        define ZEXTERN extern __declspec(dllexport)
    272 #      else
    273 #        define ZEXTERN extern __declspec(dllimport)
    274 #      endif
    275 #    endif
    276 #  endif  /* ZLIB_DLL */
    277    /* If building or using zlib with the WINAPI/WINAPIV calling convention,
    278     * define ZLIB_WINAPI.
    279     * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
    280     */
    281 #  ifdef ZLIB_WINAPI
    282 #    ifdef FAR
    283 #      undef FAR
    284 #    endif
    285 #    include <windows.h>
    286      /* No need for _export, use ZLIB.DEF instead. */
    287      /* For complete Windows compatibility, use WINAPI, not __stdcall. */
    288 #    define ZEXPORT WINAPI
    289 #    ifdef WIN32
    290 #      define ZEXPORTVA WINAPIV
    291 #    else
    292 #      define ZEXPORTVA FAR CDECL
    293 #    endif
    294 #  endif
    295 #endif
    296 
    297 #if defined (__BEOS__)
    298 #  ifdef ZLIB_DLL
    299 #    ifdef ZLIB_INTERNAL
    300 #      define ZEXPORT   __declspec(dllexport)
    301 #      define ZEXPORTVA __declspec(dllexport)
    302 #    else
    303 #      define ZEXPORT   __declspec(dllimport)
    304 #      define ZEXPORTVA __declspec(dllimport)
    305 #    endif
    306 #  endif
    307 #endif
    308 
    309 #ifdef HAVE_VISIBILITY_PRAGMA
    310 #  define ZEXTERN __attribute__((visibility ("default"))) extern
    311 #endif
    312 
    313 #ifndef ZEXTERN
    314 #  define ZEXTERN extern
    315 #endif
    316 #ifndef ZEXPORT
    317 #  define ZEXPORT
    318 #endif
    319 #ifndef ZEXPORTVA
    320 #  define ZEXPORTVA
    321 #endif
    322 
    323 #ifndef FAR
    324 #  define FAR
    325 #endif
    326 
    327 #if !defined(__MACTYPES__)
    328 typedef unsigned char  Byte;  /* 8 bits */
    329 #endif
    330 typedef unsigned int   uInt;  /* 16 bits or more */
    331 typedef unsigned long  uLong; /* 32 bits or more */
    332 
    333 #ifdef SMALL_MEDIUM
    334    /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
    335 #  define Bytef Byte FAR
    336 #else
    337    typedef Byte  FAR Bytef;
    338 #endif
    339 typedef char  FAR charf;
    340 typedef int   FAR intf;
    341 typedef uInt  FAR uIntf;
    342 typedef uLong FAR uLongf;
    343 
    344 #ifdef STDC
    345    typedef void const *voidpc;
    346    typedef void FAR   *voidpf;
    347    typedef void       *voidp;
    348 #else
    349    typedef Byte const *voidpc;
    350    typedef Byte FAR   *voidpf;
    351    typedef Byte       *voidp;
    352 #endif
    353 
    354 #include "zlibdefs.h"       /* created by configure */
    355 
    356 #ifdef _LARGEFILE64_SOURCE
    357 #include <sys/types.h>
    358 #endif
    359 
    360 #ifndef SEEK_SET
    361 #  define SEEK_SET        0       /* Seek from beginning of file.  */
    362 #  define SEEK_CUR        1       /* Seek from current position.  */
    363 #  define SEEK_END        2       /* Set file pointer to EOF plus "offset" */
    364 #endif
    365 #ifndef z_off_t
    366 #  define z_off_t long
    367 #endif
    368 
    369 #if defined(__OS400__)
    370 #  define NO_vsnprintf
    371 #endif
    372 
    373 #if defined(__MVS__)
    374 #  define NO_vsnprintf
    375 #endif
    376 
    377 /* MVS linker does not support external names larger than 8 bytes */
    378 #if defined(__MVS__)
    379 #   pragma map(deflateInit_,"DEIN")
    380 #   pragma map(deflateInit2_,"DEIN2")
    381 #   pragma map(deflateEnd,"DEEND")
    382 #   pragma map(deflateBound,"DEBND")
    383 #   pragma map(inflateInit_,"ININ")
    384 #   pragma map(inflateInit2_,"ININ2")
    385 #   pragma map(inflateEnd,"INEND")
    386 #   pragma map(inflateSync,"INSY")
    387 #   pragma map(inflateSetDictionary,"INSEDI")
    388 #   pragma map(compressBound,"CMBND")
    389 #   pragma map(inflate_table,"INTABL")
    390 #   pragma map(inflate_fast,"INFA")
    391 #   pragma map(inflate_copyright,"INCOPY")
    392 #endif
    393 
    394 #endif /* ZCONF_H */
    395