annotate zlib/zconf.h @ 3:5a977ccbc7a9 default tip

Empty changelog
author darius
date Sat, 06 Dec 1997 05:41:29 +0000
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
1 /* zconf.h -- configuration of the zlib compression library
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
2 * Copyright (C) 1995 Jean-loup Gailly.
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
3 * For conditions of distribution and use, see copyright notice in zlib.h
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
4 */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
5
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
6 /* $Id: zconf.h,v 1.1.1.1 1997/12/06 05:41:38 darius Exp $ */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
7
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
8 #ifndef _ZCONF_H
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
9 #define _ZCONF_H
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
10
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
11 /*
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
12 The library does not install any signal handler. It is recommended to
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
13 add at least a handler for SIGSEGV when decompressing; the library checks
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
14 the consistency of the input data whenever possible but may go nuts
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
15 for some forms of corrupted input.
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
16 */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
17
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
18 /*
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
19 * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
20 * than 64k bytes at a time (needed on systems with 16-bit int).
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
21 */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
22 #if defined(_GNUC__) && !defined(__32BIT__)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
23 # define __32BIT__
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
24 #endif
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
25 #if defined(__MSDOS__) && !defined(MSDOS)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
26 # define MSDOS
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
27 #endif
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
28 #if defined(MSDOS) && !defined(__32BIT__)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
29 # define MAXSEG_64K
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
30 #endif
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
31 #if !defined(STDC) && (defined(MSDOS) || defined(__STDC__))
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
32 # define STDC
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
33 #endif
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
34
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
35 /* Maximum value for memLevel in deflateInit2 */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
36 #ifndef MAX_MEM_LEVEL
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
37 # ifdef MAXSEG_64K
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
38 # define MAX_MEM_LEVEL 8
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
39 # else
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
40 # define MAX_MEM_LEVEL 9
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
41 # endif
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
42 #endif
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
43
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
44 /* Maximum value for windowBits in deflateInit2 and inflateInit2 */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
45 #ifndef MAX_WBITS
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
46 # define MAX_WBITS 15 /* 32K LZ77 window */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
47 #endif
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
48
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
49 /* The memory requirements for deflate are (in bytes):
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
50 1 << (windowBits+2) + 1 << (memLevel+9)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
51 that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
52 plus a few kilobytes for small objects. For example, if you want to reduce
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
53 the default memory requirements from 256K to 128K, compile with
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
54 make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
55 Of course this will generally degrade compression (there's no free lunch).
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
56
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
57 The memory requirements for inflate are (in bytes) 1 << windowBits
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
58 that is, 32K for windowBits=15 (default value) plus a few kilobytes
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
59 for small objects.
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
60 */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
61
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
62 /* Type declarations */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
63
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
64 #ifndef __P /* function prototypes */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
65 # ifdef STDC
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
66 # define __P(args) args
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
67 # else
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
68 # define __P(args) ()
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
69 # endif
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
70 #endif
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
71
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
72 #ifndef Byte
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
73 typedef unsigned char Byte; /* 8 bits */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
74 #endif
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
75 #ifndef uInt
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
76 typedef unsigned int uInt; /* 16 bits or more */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
77 #endif
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
78 #ifndef uLong
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
79 typedef unsigned long uLong; /* 32 bits or more */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
80 #endif
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
81 #ifndef voidp
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
82 # ifdef STDC
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
83 typedef void *voidp;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
84 # else
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
85 typedef Byte *voidp;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
86 # endif
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
87 #endif
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
88
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
89 #endif /* _ZCONF_H */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
90