comparison zlib/zconf.h @ 10:1040ca591f2e

First entry of Paradise Server 2.9 patch 10 Beta
author darius
date Sat, 06 Dec 1997 04:37:18 +0000
parents
children
comparison
equal deleted inserted replaced
9:331055a97a9d 10:1040ca591f2e
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
4 */
5
6 /* $Id: zconf.h,v 1.1.1.1 1997/12/06 04:37:18 darius Exp $ */
7
8 #ifndef _ZCONF_H
9 #define _ZCONF_H
10
11 /*
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.
16 */
17
18 /*
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).
21 */
22 #if defined(_GNUC__) && !defined(__32BIT__)
23 # define __32BIT__
24 #endif
25 #if defined(__MSDOS__) && !defined(MSDOS)
26 # define MSDOS
27 #endif
28 #if defined(MSDOS) && !defined(__32BIT__)
29 # define MAXSEG_64K
30 #endif
31 #ifdef MSDOS
32 # define UNALIGNED_OK
33 #endif
34
35 #ifndef STDC
36 # if defined(MSDOS) || defined(__STDC__) || defined(__cplusplus)
37 # define STDC
38 # endif
39 #endif
40
41 #ifndef STDC
42 # ifndef const
43 # define const
44 # endif
45 #endif
46
47 #ifdef __MWERKS__ /* Metrowerks CodeWarrior declares fileno() in unix.h */
48 # include <unix.h>
49 #endif
50
51 /* Maximum value for memLevel in deflateInit2 */
52 #ifndef MAX_MEM_LEVEL
53 # ifdef MAXSEG_64K
54 # define MAX_MEM_LEVEL 8
55 # else
56 # define MAX_MEM_LEVEL 9
57 # endif
58 #endif
59
60 /* Maximum value for windowBits in deflateInit2 and inflateInit2 */
61 #ifndef MAX_WBITS
62 # define MAX_WBITS 15 /* 32K LZ77 window */
63 #endif
64
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).
72
73 The memory requirements for inflate are (in bytes) 1 << windowBits
74 that is, 32K for windowBits=15 (default value) plus a few kilobytes
75 for small objects.
76 */
77
78 /* Type declarations */
79
80 #ifndef OF /* function prototypes */
81 # ifdef STDC
82 # define OF(args) args
83 # else
84 # define OF(args) ()
85 # endif
86 #endif
87
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.
93 */
94 #if defined(M_I86SM) || defined(M_I86MM) /* MSC small or medium model */
95 # ifdef _MSC_VER
96 # define FAR __far
97 # else
98 # define FAR far
99 # endif
100 #endif
101 #if defined(__BORLANDC__) && (defined(__SMALL__) || defined(__MEDIUM__))
102 # define FAR __far /* completely untested, just a best guess */
103 #endif
104 #ifndef FAR
105 # define FAR
106 #endif
107
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 */
111
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;
117
118 #ifdef STDC
119 typedef void FAR *voidpf;
120 typedef void *voidp;
121 #else
122 typedef Byte FAR *voidpf;
123 typedef Byte *voidp;
124 #endif
125
126 #endif /* _ZCONF_H */