1 /* zconf.h -- configuration of the zlib compression library
2 * Copyright (C) 1995 Jean-loup Gailly.
3 * For conditions of distribution and use, see copyright notice in zlib.h
6 /* $Id: zconf.h,v 1.1 1996/01/18 03:26:47 paulus Exp $ */
12 The library does not install any signal handler. It is recommended to
13 add at least a handler for SIGSEGV when decompressing; the library checks
14 the consistency of the input data whenever possible but may go nuts
15 for some forms of corrupted input.
19 * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
20 * than 64k bytes at a time (needed on systems with 16-bit int).
22 #if defined(_GNUC__) && !defined(__32BIT__)
25 #if defined(__MSDOS__) && !defined(MSDOS)
28 #if defined(MSDOS) && !defined(__32BIT__)
36 # if defined(MSDOS) || defined(__STDC__) || defined(__cplusplus)
47 #ifdef __MWERKS__ /* Metrowerks CodeWarrior declares fileno() in unix.h */
51 /* Maximum value for memLevel in deflateInit2 */
54 # define MAX_MEM_LEVEL 8
56 # define MAX_MEM_LEVEL 9
60 /* Maximum value for windowBits in deflateInit2 and inflateInit2 */
62 # define MAX_WBITS 15 /* 32K LZ77 window */
65 /* The memory requirements for deflate are (in bytes):
66 1 << (windowBits+2) + 1 << (memLevel+9)
67 that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
68 plus a few kilobytes for small objects. For example, if you want to reduce
69 the default memory requirements from 256K to 128K, compile with
70 make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
71 Of course this will generally degrade compression (there's no free lunch).
73 The memory requirements for inflate are (in bytes) 1 << windowBits
74 that is, 32K for windowBits=15 (default value) plus a few kilobytes
78 /* Type declarations */
80 #ifndef OF /* function prototypes */
82 # define OF(args) args
88 /* The following definitions for FAR are needed only for MSDOS mixed
89 * model programming (small or medium model with some far allocations).
90 * This was tested only with MSC; for other MSDOS compilers you may have
91 * to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
92 * just define FAR to be empty.
94 #if defined(M_I86SM) || defined(M_I86MM) /* MSC small or medium model */
101 #if defined(__BORLANDC__) && (defined(__SMALL__) || defined(__MEDIUM__))
102 # define FAR __far /* completely untested, just a best guess */
108 typedef unsigned char Byte; /* 8 bits */
109 typedef unsigned int uInt; /* 16 bits or more */
110 typedef unsigned long uLong; /* 32 bits or more */
112 typedef Byte FAR Bytef;
113 typedef char FAR charf;
114 typedef int FAR intf;
115 typedef uInt FAR uIntf;
116 typedef uLong FAR uLongf;
119 typedef void FAR *voidpf;
122 typedef Byte FAR *voidpf;
126 #endif /* _ZCONF_H */