1 --- linux/net/Makefile 3 Dec 2003 19:15:16 -0000 1.25
2 +++ linux/net/Makefile 20 Feb 2003 15:50:38 -0000 1.24
4 subdir-$(CONFIG_NETFILTER) += ipv4/netfilter
5 subdir-$(CONFIG_UNIX) += unix
6 subdir-$(CONFIG_IPV6) += ipv6
7 +subdir-$(CONFIG_IPSEC) += ipsec
9 ifneq ($(CONFIG_IPV6),n)
10 ifneq ($(CONFIG_IPV6),)
11 --- /dev/null 2004-02-02 20:32:13.000000000 +0000
12 +++ linux/include/zlib/zlib.h 2004-07-05 23:56:59.000000000 +0100
14 +/* zlib.h -- interface of the 'zlib' general purpose compression library
15 + version 1.1.4, March 11th, 2002
17 + Copyright (C) 1995-2002 Jean-loup Gailly and Mark Adler
19 + This software is provided 'as-is', without any express or implied
20 + warranty. In no event will the authors be held liable for any damages
21 + arising from the use of this software.
23 + Permission is granted to anyone to use this software for any purpose,
24 + including commercial applications, and to alter it and redistribute it
25 + freely, subject to the following restrictions:
27 + 1. The origin of this software must not be misrepresented; you must not
28 + claim that you wrote the original software. If you use this software
29 + in a product, an acknowledgment in the product documentation would be
30 + appreciated but is not required.
31 + 2. Altered source versions must be plainly marked as such, and must not be
32 + misrepresented as being the original software.
33 + 3. This notice may not be removed or altered from any source distribution.
35 + Jean-loup Gailly Mark Adler
36 + jloup@gzip.org madler@alumni.caltech.edu
39 + The data format used by the zlib library is described by RFCs (Request for
40 + Comments) 1950 to 1952 in the files ftp://ds.internic.net/rfc/rfc1950.txt
41 + (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format).
53 +#define ZLIB_VERSION "1.1.4"
56 + The 'zlib' compression library provides in-memory compression and
57 + decompression functions, including integrity checks of the uncompressed
58 + data. This version of the library supports only one compression method
59 + (deflation) but other algorithms will be added later and will have the same
62 + Compression can be done in a single step if the buffers are large
63 + enough (for example if an input file is mmap'ed), or can be done by
64 + repeated calls of the compression function. In the latter case, the
65 + application must provide more input and/or consume the output
66 + (providing more output space) before each call.
68 + The library also supports reading and writing files in gzip (.gz) format
69 + with an interface similar to that of stdio.
71 + The library does not install any signal handler. The decoder checks
72 + the consistency of the compressed data, so the library should never
73 + crash even in case of corrupted input.
76 +typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size));
77 +typedef void (*free_func) OF((voidpf opaque, voidpf address));
79 +struct internal_state;
81 +typedef struct z_stream_s {
82 + Bytef *next_in; /* next input byte */
83 + uInt avail_in; /* number of bytes available at next_in */
84 + uLong total_in; /* total nb of input bytes read so far */
86 + Bytef *next_out; /* next output byte should be put there */
87 + uInt avail_out; /* remaining free space at next_out */
88 + uLong total_out; /* total nb of bytes output so far */
90 + const char *msg; /* last error message, NULL if no error */
91 + struct internal_state FAR *state; /* not visible by applications */
93 + alloc_func zalloc; /* used to allocate the internal state */
94 + free_func zfree; /* used to free the internal state */
95 + voidpf opaque; /* private data object passed to zalloc and zfree */
97 + int data_type; /* best guess about the data type: ascii or binary */
98 + uLong adler; /* adler32 value of the uncompressed data */
99 + uLong reserved; /* reserved for future use */
102 +typedef z_stream FAR *z_streamp;
105 + The application must update next_in and avail_in when avail_in has
106 + dropped to zero. It must update next_out and avail_out when avail_out
107 + has dropped to zero. The application must initialize zalloc, zfree and
108 + opaque before calling the init function. All other fields are set by the
109 + compression library and must not be updated by the application.
111 + The opaque value provided by the application will be passed as the first
112 + parameter for calls of zalloc and zfree. This can be useful for custom
113 + memory management. The compression library attaches no meaning to the
116 + zalloc must return Z_NULL if there is not enough memory for the object.
117 + If zlib is used in a multi-threaded application, zalloc and zfree must be
120 + On 16-bit systems, the functions zalloc and zfree must be able to allocate
121 + exactly 65536 bytes, but will not be required to allocate more than this
122 + if the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS,
123 + pointers returned by zalloc for objects of exactly 65536 bytes *must*
124 + have their offset normalized to zero. The default allocation function
125 + provided by this library ensures this (see zutil.c). To reduce memory
126 + requirements and avoid any allocation of 64K objects, at the expense of
127 + compression ratio, compile the library with -DMAX_WBITS=14 (see zconf.h).
129 + The fields total_in and total_out can be used for statistics or
130 + progress reports. After compression, total_in holds the total size of
131 + the uncompressed data and may be saved for use in the decompressor
132 + (particularly if the decompressor wants to decompress everything in
138 +#define Z_NO_FLUSH 0
139 +#define Z_PARTIAL_FLUSH 1 /* will be removed, use Z_SYNC_FLUSH instead */
140 +#define Z_SYNC_FLUSH 2
141 +#define Z_FULL_FLUSH 3
143 +/* Allowed flush values; see deflate() below for details */
146 +#define Z_STREAM_END 1
147 +#define Z_NEED_DICT 2
148 +#define Z_ERRNO (-1)
149 +#define Z_STREAM_ERROR (-2)
150 +#define Z_DATA_ERROR (-3)
151 +#define Z_MEM_ERROR (-4)
152 +#define Z_BUF_ERROR (-5)
153 +#define Z_VERSION_ERROR (-6)
154 +/* Return codes for the compression/decompression functions. Negative
155 + * values are errors, positive values are used for special but normal events.
158 +#define Z_NO_COMPRESSION 0
159 +#define Z_BEST_SPEED 1
160 +#define Z_BEST_COMPRESSION 9
161 +#define Z_DEFAULT_COMPRESSION (-1)
162 +/* compression levels */
164 +#define Z_FILTERED 1
165 +#define Z_HUFFMAN_ONLY 2
166 +#define Z_DEFAULT_STRATEGY 0
167 +/* compression strategy; see deflateInit2() below for details */
172 +/* Possible values of the data_type field */
174 +#define Z_DEFLATED 8
175 +/* The deflate compression method (the only one supported in this version) */
177 +#define Z_NULL 0 /* for initializing zalloc, zfree, opaque */
179 +#define zlib_version zlibVersion()
180 +/* for compatibility with versions < 1.0.2 */
182 + /* basic functions */
184 +ZEXTERN const char * ZEXPORT zlibVersion OF((void));
185 +/* The application can compare zlibVersion and ZLIB_VERSION for consistency.
186 + If the first character differs, the library code actually used is
187 + not compatible with the zlib.h header file used by the application.
188 + This check is automatically made by deflateInit and inflateInit.
192 +ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level));
194 + Initializes the internal stream state for compression. The fields
195 + zalloc, zfree and opaque must be initialized before by the caller.
196 + If zalloc and zfree are set to Z_NULL, deflateInit updates them to
197 + use default allocation functions.
199 + The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9:
200 + 1 gives best speed, 9 gives best compression, 0 gives no compression at
201 + all (the input data is simply copied a block at a time).
202 + Z_DEFAULT_COMPRESSION requests a default compromise between speed and
203 + compression (currently equivalent to level 6).
205 + deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not
206 + enough memory, Z_STREAM_ERROR if level is not a valid compression level,
207 + Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatible
208 + with the version assumed by the caller (ZLIB_VERSION).
209 + msg is set to null if there is no error message. deflateInit does not
210 + perform any compression: this will be done by deflate().
214 +ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush));
216 + deflate compresses as much data as possible, and stops when the input
217 + buffer becomes empty or the output buffer becomes full. It may introduce some
218 + output latency (reading input without producing any output) except when
221 + The detailed semantics are as follows. deflate performs one or both of the
224 + - Compress more input starting at next_in and update next_in and avail_in
225 + accordingly. If not all input can be processed (because there is not
226 + enough room in the output buffer), next_in and avail_in are updated and
227 + processing will resume at this point for the next call of deflate().
229 + - Provide more output starting at next_out and update next_out and avail_out
230 + accordingly. This action is forced if the parameter flush is non zero.
231 + Forcing flush frequently degrades the compression ratio, so this parameter
232 + should be set only when necessary (in interactive applications).
233 + Some output may be provided even if flush is not set.
235 + Before the call of deflate(), the application should ensure that at least
236 + one of the actions is possible, by providing more input and/or consuming
237 + more output, and updating avail_in or avail_out accordingly; avail_out
238 + should never be zero before the call. The application can consume the
239 + compressed output when it wants, for example when the output buffer is full
240 + (avail_out == 0), or after each call of deflate(). If deflate returns Z_OK
241 + and with zero avail_out, it must be called again after making room in the
242 + output buffer because there might be more output pending.
244 + If the parameter flush is set to Z_SYNC_FLUSH, all pending output is
245 + flushed to the output buffer and the output is aligned on a byte boundary, so
246 + that the decompressor can get all input data available so far. (In particular
247 + avail_in is zero after the call if enough output space has been provided
248 + before the call.) Flushing may degrade compression for some compression
249 + algorithms and so it should be used only when necessary.
251 + If flush is set to Z_FULL_FLUSH, all output is flushed as with
252 + Z_SYNC_FLUSH, and the compression state is reset so that decompression can
253 + restart from this point if previous compressed data has been damaged or if
254 + random access is desired. Using Z_FULL_FLUSH too often can seriously degrade
257 + If deflate returns with avail_out == 0, this function must be called again
258 + with the same value of the flush parameter and more output space (updated
259 + avail_out), until the flush is complete (deflate returns with non-zero
262 + If the parameter flush is set to Z_FINISH, pending input is processed,
263 + pending output is flushed and deflate returns with Z_STREAM_END if there
264 + was enough output space; if deflate returns with Z_OK, this function must be
265 + called again with Z_FINISH and more output space (updated avail_out) but no
266 + more input data, until it returns with Z_STREAM_END or an error. After
267 + deflate has returned Z_STREAM_END, the only possible operations on the
268 + stream are deflateReset or deflateEnd.
270 + Z_FINISH can be used immediately after deflateInit if all the compression
271 + is to be done in a single step. In this case, avail_out must be at least
272 + 0.1% larger than avail_in plus 12 bytes. If deflate does not return
273 + Z_STREAM_END, then it must be called again as described above.
275 + deflate() sets strm->adler to the adler32 checksum of all input read
276 + so far (that is, total_in bytes).
278 + deflate() may update data_type if it can make a good guess about
279 + the input data type (Z_ASCII or Z_BINARY). In doubt, the data is considered
280 + binary. This field is only for information purposes and does not affect
281 + the compression algorithm in any manner.
283 + deflate() returns Z_OK if some progress has been made (more input
284 + processed or more output produced), Z_STREAM_END if all input has been
285 + consumed and all output has been produced (only when flush is set to
286 + Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for example
287 + if next_in or next_out was NULL), Z_BUF_ERROR if no progress is possible
288 + (for example avail_in or avail_out was zero).
292 +ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm));
294 + All dynamically allocated data structures for this stream are freed.
295 + This function discards any unprocessed input and does not flush any
298 + deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the
299 + stream state was inconsistent, Z_DATA_ERROR if the stream was freed
300 + prematurely (some input or output was discarded). In the error case,
301 + msg may be set but then points to a static string (which must not be
307 +ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm));
309 + Initializes the internal stream state for decompression. The fields
310 + next_in, avail_in, zalloc, zfree and opaque must be initialized before by
311 + the caller. If next_in is not Z_NULL and avail_in is large enough (the exact
312 + value depends on the compression method), inflateInit determines the
313 + compression method from the zlib header and allocates all data structures
314 + accordingly; otherwise the allocation will be deferred to the first call of
315 + inflate. If zalloc and zfree are set to Z_NULL, inflateInit updates them to
316 + use default allocation functions.
318 + inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enough
319 + memory, Z_VERSION_ERROR if the zlib library version is incompatible with the
320 + version assumed by the caller. msg is set to null if there is no error
321 + message. inflateInit does not perform any decompression apart from reading
322 + the zlib header if present: this will be done by inflate(). (So next_in and
323 + avail_in may be modified, but next_out and avail_out are unchanged.)
327 +ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush));
329 + inflate decompresses as much data as possible, and stops when the input
330 + buffer becomes empty or the output buffer becomes full. It may some
331 + introduce some output latency (reading input without producing any output)
332 + except when forced to flush.
334 + The detailed semantics are as follows. inflate performs one or both of the
337 + - Decompress more input starting at next_in and update next_in and avail_in
338 + accordingly. If not all input can be processed (because there is not
339 + enough room in the output buffer), next_in is updated and processing
340 + will resume at this point for the next call of inflate().
342 + - Provide more output starting at next_out and update next_out and avail_out
343 + accordingly. inflate() provides as much output as possible, until there
344 + is no more input data or no more space in the output buffer (see below
345 + about the flush parameter).
347 + Before the call of inflate(), the application should ensure that at least
348 + one of the actions is possible, by providing more input and/or consuming
349 + more output, and updating the next_* and avail_* values accordingly.
350 + The application can consume the uncompressed output when it wants, for
351 + example when the output buffer is full (avail_out == 0), or after each
352 + call of inflate(). If inflate returns Z_OK and with zero avail_out, it
353 + must be called again after making room in the output buffer because there
354 + might be more output pending.
356 + If the parameter flush is set to Z_SYNC_FLUSH, inflate flushes as much
357 + output as possible to the output buffer. The flushing behavior of inflate is
358 + not specified for values of the flush parameter other than Z_SYNC_FLUSH
359 + and Z_FINISH, but the current implementation actually flushes as much output
360 + as possible anyway.
362 + inflate() should normally be called until it returns Z_STREAM_END or an
363 + error. However if all decompression is to be performed in a single step
364 + (a single call of inflate), the parameter flush should be set to
365 + Z_FINISH. In this case all pending input is processed and all pending
366 + output is flushed; avail_out must be large enough to hold all the
367 + uncompressed data. (The size of the uncompressed data may have been saved
368 + by the compressor for this purpose.) The next operation on this stream must
369 + be inflateEnd to deallocate the decompression state. The use of Z_FINISH
370 + is never required, but can be used to inform inflate that a faster routine
371 + may be used for the single inflate() call.
373 + If a preset dictionary is needed at this point (see inflateSetDictionary
374 + below), inflate sets strm-adler to the adler32 checksum of the
375 + dictionary chosen by the compressor and returns Z_NEED_DICT; otherwise
376 + it sets strm->adler to the adler32 checksum of all output produced
377 + so far (that is, total_out bytes) and returns Z_OK, Z_STREAM_END or
378 + an error code as described below. At the end of the stream, inflate()
379 + checks that its computed adler32 checksum is equal to that saved by the
380 + compressor and returns Z_STREAM_END only if the checksum is correct.
382 + inflate() returns Z_OK if some progress has been made (more input processed
383 + or more output produced), Z_STREAM_END if the end of the compressed data has
384 + been reached and all uncompressed output has been produced, Z_NEED_DICT if a
385 + preset dictionary is needed at this point, Z_DATA_ERROR if the input data was
386 + corrupted (input stream not conforming to the zlib format or incorrect
387 + adler32 checksum), Z_STREAM_ERROR if the stream structure was inconsistent
388 + (for example if next_in or next_out was NULL), Z_MEM_ERROR if there was not
389 + enough memory, Z_BUF_ERROR if no progress is possible or if there was not
390 + enough room in the output buffer when Z_FINISH is used. In the Z_DATA_ERROR
391 + case, the application may then call inflateSync to look for a good
396 +ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm));
398 + All dynamically allocated data structures for this stream are freed.
399 + This function discards any unprocessed input and does not flush any
402 + inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state
403 + was inconsistent. In the error case, msg may be set but then points to a
404 + static string (which must not be deallocated).
407 + /* Advanced functions */
410 + The following functions are needed only in some special applications.
414 +ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm,
421 + This is another version of deflateInit with more compression options. The
422 + fields next_in, zalloc, zfree and opaque must be initialized before by
425 + The method parameter is the compression method. It must be Z_DEFLATED in
426 + this version of the library.
428 + The windowBits parameter is the base two logarithm of the window size
429 + (the size of the history buffer). It should be in the range 8..15 for this
430 + version of the library. Larger values of this parameter result in better
431 + compression at the expense of memory usage. The default value is 15 if
432 + deflateInit is used instead.
434 + The memLevel parameter specifies how much memory should be allocated
435 + for the internal compression state. memLevel=1 uses minimum memory but
436 + is slow and reduces compression ratio; memLevel=9 uses maximum memory
437 + for optimal speed. The default value is 8. See zconf.h for total memory
438 + usage as a function of windowBits and memLevel.
440 + The strategy parameter is used to tune the compression algorithm. Use the
441 + value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced by a
442 + filter (or predictor), or Z_HUFFMAN_ONLY to force Huffman encoding only (no
443 + string match). Filtered data consists mostly of small values with a
444 + somewhat random distribution. In this case, the compression algorithm is
445 + tuned to compress them better. The effect of Z_FILTERED is to force more
446 + Huffman coding and less string matching; it is somewhat intermediate
447 + between Z_DEFAULT and Z_HUFFMAN_ONLY. The strategy parameter only affects
448 + the compression ratio but not the correctness of the compressed output even
449 + if it is not set appropriately.
451 + deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
452 + memory, Z_STREAM_ERROR if a parameter is invalid (such as an invalid
453 + method). msg is set to null if there is no error message. deflateInit2 does
454 + not perform any compression: this will be done by deflate().
457 +ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm,
458 + const Bytef *dictionary,
461 + Initializes the compression dictionary from the given byte sequence
462 + without producing any compressed output. This function must be called
463 + immediately after deflateInit, deflateInit2 or deflateReset, before any
464 + call of deflate. The compressor and decompressor must use exactly the same
465 + dictionary (see inflateSetDictionary).
467 + The dictionary should consist of strings (byte sequences) that are likely
468 + to be encountered later in the data to be compressed, with the most commonly
469 + used strings preferably put towards the end of the dictionary. Using a
470 + dictionary is most useful when the data to be compressed is short and can be
471 + predicted with good accuracy; the data can then be compressed better than
472 + with the default empty dictionary.
474 + Depending on the size of the compression data structures selected by
475 + deflateInit or deflateInit2, a part of the dictionary may in effect be
476 + discarded, for example if the dictionary is larger than the window size in
477 + deflate or deflate2. Thus the strings most likely to be useful should be
478 + put at the end of the dictionary, not at the front.
480 + Upon return of this function, strm->adler is set to the Adler32 value
481 + of the dictionary; the decompressor may later use this value to determine
482 + which dictionary has been used by the compressor. (The Adler32 value
483 + applies to the whole dictionary even if only a subset of the dictionary is
484 + actually used by the compressor.)
486 + deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a
487 + parameter is invalid (such as NULL dictionary) or the stream state is
488 + inconsistent (for example if deflate has already been called for this stream
489 + or if the compression method is bsort). deflateSetDictionary does not
490 + perform any compression: this will be done by deflate().
493 +ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest,
494 + z_streamp source));
496 + Sets the destination stream as a complete copy of the source stream.
498 + This function can be useful when several compression strategies will be
499 + tried, for example when there are several ways of pre-processing the input
500 + data with a filter. The streams that will be discarded should then be freed
501 + by calling deflateEnd. Note that deflateCopy duplicates the internal
502 + compression state which can be quite large, so this strategy is slow and
503 + can consume lots of memory.
505 + deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not
506 + enough memory, Z_STREAM_ERROR if the source stream state was inconsistent
507 + (such as zalloc being NULL). msg is left unchanged in both source and
511 +ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm));
513 + This function is equivalent to deflateEnd followed by deflateInit,
514 + but does not free and reallocate all the internal compression state.
515 + The stream will keep the same compression level and any other attributes
516 + that may have been set by deflateInit2.
518 + deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
519 + stream state was inconsistent (such as zalloc or state being NULL).
522 +ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm,
526 + Dynamically update the compression level and compression strategy. The
527 + interpretation of level and strategy is as in deflateInit2. This can be
528 + used to switch between compression and straight copy of the input data, or
529 + to switch to a different kind of input data requiring a different
530 + strategy. If the compression level is changed, the input available so far
531 + is compressed with the old level (and may be flushed); the new level will
532 + take effect only at the next call of deflate().
534 + Before the call of deflateParams, the stream state must be set as for
535 + a call of deflate(), since the currently available input may have to
536 + be compressed and flushed. In particular, strm->avail_out must be non-zero.
538 + deflateParams returns Z_OK if success, Z_STREAM_ERROR if the source
539 + stream state was inconsistent or if a parameter was invalid, Z_BUF_ERROR
540 + if strm->avail_out was zero.
544 +ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm,
547 + This is another version of inflateInit with an extra parameter. The
548 + fields next_in, avail_in, zalloc, zfree and opaque must be initialized
549 + before by the caller.
551 + The windowBits parameter is the base two logarithm of the maximum window
552 + size (the size of the history buffer). It should be in the range 8..15 for
553 + this version of the library. The default value is 15 if inflateInit is used
554 + instead. If a compressed stream with a larger window size is given as
555 + input, inflate() will return with the error code Z_DATA_ERROR instead of
556 + trying to allocate a larger window.
558 + inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
559 + memory, Z_STREAM_ERROR if a parameter is invalid (such as a negative
560 + memLevel). msg is set to null if there is no error message. inflateInit2
561 + does not perform any decompression apart from reading the zlib header if
562 + present: this will be done by inflate(). (So next_in and avail_in may be
563 + modified, but next_out and avail_out are unchanged.)
566 +ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm,
567 + const Bytef *dictionary,
570 + Initializes the decompression dictionary from the given uncompressed byte
571 + sequence. This function must be called immediately after a call of inflate
572 + if this call returned Z_NEED_DICT. The dictionary chosen by the compressor
573 + can be determined from the Adler32 value returned by this call of
574 + inflate. The compressor and decompressor must use exactly the same
575 + dictionary (see deflateSetDictionary).
577 + inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a
578 + parameter is invalid (such as NULL dictionary) or the stream state is
579 + inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the
580 + expected one (incorrect Adler32 value). inflateSetDictionary does not
581 + perform any decompression: this will be done by subsequent calls of
585 +ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm));
587 + Skips invalid compressed data until a full flush point (see above the
588 + description of deflate with Z_FULL_FLUSH) can be found, or until all
589 + available input is skipped. No output is provided.
591 + inflateSync returns Z_OK if a full flush point has been found, Z_BUF_ERROR
592 + if no more input was provided, Z_DATA_ERROR if no flush point has been found,
593 + or Z_STREAM_ERROR if the stream structure was inconsistent. In the success
594 + case, the application may save the current current value of total_in which
595 + indicates where valid compressed data was found. In the error case, the
596 + application may repeatedly call inflateSync, providing more input each time,
597 + until success or end of the input data.
600 +ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm));
602 + This function is equivalent to inflateEnd followed by inflateInit,
603 + but does not free and reallocate all the internal decompression state.
604 + The stream will keep attributes that may have been set by inflateInit2.
606 + inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source
607 + stream state was inconsistent (such as zalloc or state being NULL).
611 + /* utility functions */
614 + The following utility functions are implemented on top of the
615 + basic stream-oriented functions. To simplify the interface, some
616 + default options are assumed (compression level and memory usage,
617 + standard memory allocation functions). The source code of these
618 + utility functions can easily be modified if you need special options.
621 +ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen,
622 + const Bytef *source, uLong sourceLen));
624 + Compresses the source buffer into the destination buffer. sourceLen is
625 + the byte length of the source buffer. Upon entry, destLen is the total
626 + size of the destination buffer, which must be at least 0.1% larger than
627 + sourceLen plus 12 bytes. Upon exit, destLen is the actual size of the
629 + This function can be used to compress a whole file at once if the
630 + input file is mmap'ed.
631 + compress returns Z_OK if success, Z_MEM_ERROR if there was not
632 + enough memory, Z_BUF_ERROR if there was not enough room in the output
636 +ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen,
637 + const Bytef *source, uLong sourceLen,
640 + Compresses the source buffer into the destination buffer. The level
641 + parameter has the same meaning as in deflateInit. sourceLen is the byte
642 + length of the source buffer. Upon entry, destLen is the total size of the
643 + destination buffer, which must be at least 0.1% larger than sourceLen plus
644 + 12 bytes. Upon exit, destLen is the actual size of the compressed buffer.
646 + compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
647 + memory, Z_BUF_ERROR if there was not enough room in the output buffer,
648 + Z_STREAM_ERROR if the level parameter is invalid.
651 +ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen,
652 + const Bytef *source, uLong sourceLen));
654 + Decompresses the source buffer into the destination buffer. sourceLen is
655 + the byte length of the source buffer. Upon entry, destLen is the total
656 + size of the destination buffer, which must be large enough to hold the
657 + entire uncompressed data. (The size of the uncompressed data must have
658 + been saved previously by the compressor and transmitted to the decompressor
659 + by some mechanism outside the scope of this compression library.)
660 + Upon exit, destLen is the actual size of the compressed buffer.
661 + This function can be used to decompress a whole file at once if the
662 + input file is mmap'ed.
664 + uncompress returns Z_OK if success, Z_MEM_ERROR if there was not
665 + enough memory, Z_BUF_ERROR if there was not enough room in the output
666 + buffer, or Z_DATA_ERROR if the input data was corrupted.
670 +typedef voidp gzFile;
672 +ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode));
674 + Opens a gzip (.gz) file for reading or writing. The mode parameter
675 + is as in fopen ("rb" or "wb") but can also include a compression level
676 + ("wb9") or a strategy: 'f' for filtered data as in "wb6f", 'h' for
677 + Huffman only compression as in "wb1h". (See the description
678 + of deflateInit2 for more information about the strategy parameter.)
680 + gzopen can be used to read a file which is not in gzip format; in this
681 + case gzread will directly read from the file without decompression.
683 + gzopen returns NULL if the file could not be opened or if there was
684 + insufficient memory to allocate the (de)compression state; errno
685 + can be checked to distinguish the two cases (if errno is zero, the
686 + zlib error is Z_MEM_ERROR). */
688 +ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode));
690 + gzdopen() associates a gzFile with the file descriptor fd. File
691 + descriptors are obtained from calls like open, dup, creat, pipe or
692 + fileno (in the file has been previously opened with fopen).
693 + The mode parameter is as in gzopen.
694 + The next call of gzclose on the returned gzFile will also close the
695 + file descriptor fd, just like fclose(fdopen(fd), mode) closes the file
696 + descriptor fd. If you want to keep fd open, use gzdopen(dup(fd), mode).
697 + gzdopen returns NULL if there was insufficient memory to allocate
698 + the (de)compression state.
701 +ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy));
703 + Dynamically update the compression level or strategy. See the description
704 + of deflateInit2 for the meaning of these parameters.
705 + gzsetparams returns Z_OK if success, or Z_STREAM_ERROR if the file was not
706 + opened for writing.
709 +ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len));
711 + Reads the given number of uncompressed bytes from the compressed file.
712 + If the input file was not in gzip format, gzread copies the given number
713 + of bytes into the buffer.
714 + gzread returns the number of uncompressed bytes actually read (0 for
715 + end of file, -1 for error). */
717 +ZEXTERN int ZEXPORT gzwrite OF((gzFile file,
718 + const voidp buf, unsigned len));
720 + Writes the given number of uncompressed bytes into the compressed file.
721 + gzwrite returns the number of uncompressed bytes actually written
722 + (0 in case of error).
725 +ZEXTERN int ZEXPORTVA gzprintf OF((gzFile file, const char *format, ...));
727 + Converts, formats, and writes the args to the compressed file under
728 + control of the format string, as in fprintf. gzprintf returns the number of
729 + uncompressed bytes actually written (0 in case of error).
732 +ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s));
734 + Writes the given null-terminated string to the compressed file, excluding
735 + the terminating null character.
736 + gzputs returns the number of characters written, or -1 in case of error.
739 +ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len));
741 + Reads bytes from the compressed file until len-1 characters are read, or
742 + a newline character is read and transferred to buf, or an end-of-file
743 + condition is encountered. The string is then terminated with a null
745 + gzgets returns buf, or Z_NULL in case of error.
748 +ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c));
750 + Writes c, converted to an unsigned char, into the compressed file.
751 + gzputc returns the value that was written, or -1 in case of error.
754 +ZEXTERN int ZEXPORT gzgetc OF((gzFile file));
756 + Reads one byte from the compressed file. gzgetc returns this byte
757 + or -1 in case of end of file or error.
760 +ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush));
762 + Flushes all pending output into the compressed file. The parameter
763 + flush is as in the deflate() function. The return value is the zlib
764 + error number (see function gzerror below). gzflush returns Z_OK if
765 + the flush parameter is Z_FINISH and all output could be flushed.
766 + gzflush should be called only when strictly necessary because it can
767 + degrade compression.
770 +ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file,
771 + z_off_t offset, int whence));
773 + Sets the starting position for the next gzread or gzwrite on the
774 + given compressed file. The offset represents a number of bytes in the
775 + uncompressed data stream. The whence parameter is defined as in lseek(2);
776 + the value SEEK_END is not supported.
777 + If the file is opened for reading, this function is emulated but can be
778 + extremely slow. If the file is opened for writing, only forward seeks are
779 + supported; gzseek then compresses a sequence of zeroes up to the new
782 + gzseek returns the resulting offset location as measured in bytes from
783 + the beginning of the uncompressed stream, or -1 in case of error, in
784 + particular if the file is opened for writing and the new starting position
785 + would be before the current position.
788 +ZEXTERN int ZEXPORT gzrewind OF((gzFile file));
790 + Rewinds the given file. This function is supported only for reading.
792 + gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET)
795 +ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file));
797 + Returns the starting position for the next gzread or gzwrite on the
798 + given compressed file. This position represents a number of bytes in the
799 + uncompressed data stream.
801 + gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR)
804 +ZEXTERN int ZEXPORT gzeof OF((gzFile file));
806 + Returns 1 when EOF has previously been detected reading the given
807 + input stream, otherwise zero.
810 +ZEXTERN int ZEXPORT gzclose OF((gzFile file));
812 + Flushes all pending output if necessary, closes the compressed file
813 + and deallocates all the (de)compression state. The return value is the zlib
814 + error number (see function gzerror below).
817 +ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum));
819 + Returns the error message for the last error which occurred on the
820 + given compressed file. errnum is set to zlib error number. If an
821 + error occurred in the file system and not in the compression library,
822 + errnum is set to Z_ERRNO and the application may consult errno
823 + to get the exact error code.
826 + /* checksum functions */
829 + These functions are not related to compression but are exported
830 + anyway because they might be useful in applications using the
831 + compression library.
834 +ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len));
837 + Update a running Adler-32 checksum with the bytes buf[0..len-1] and
838 + return the updated checksum. If buf is NULL, this function returns
839 + the required initial value for the checksum.
840 + An Adler-32 checksum is almost as reliable as a CRC32 but can be computed
841 + much faster. Usage example:
843 + uLong adler = adler32(0L, Z_NULL, 0);
845 + while (read_buffer(buffer, length) != EOF) {
846 + adler = adler32(adler, buffer, length);
848 + if (adler != original_adler) error();
851 +ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len));
853 + Update a running crc with the bytes buf[0..len-1] and return the updated
854 + crc. If buf is NULL, this function returns the required initial value
855 + for the crc. Pre- and post-conditioning (one's complement) is performed
856 + within this function so it shouldn't be done by the application.
859 + uLong crc = crc32(0L, Z_NULL, 0);
861 + while (read_buffer(buffer, length) != EOF) {
862 + crc = crc32(crc, buffer, length);
864 + if (crc != original_crc) error();
868 + /* various hacks, don't look :) */
870 +/* deflateInit and inflateInit are macros to allow checking the zlib version
871 + * and the compiler's view of z_stream:
873 +ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level,
874 + const char *version, int stream_size));
875 +ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm,
876 + const char *version, int stream_size));
877 +ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int level, int method,
878 + int windowBits, int memLevel,
879 + int strategy, const char *version,
881 +ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits,
882 + const char *version, int stream_size));
883 +#define deflateInit(strm, level) \
884 + deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream))
885 +#define inflateInit(strm) \
886 + inflateInit_((strm), ZLIB_VERSION, sizeof(z_stream))
887 +#define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \
888 + deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\
889 + (strategy), ZLIB_VERSION, sizeof(z_stream))
890 +#define inflateInit2(strm, windowBits) \
891 + inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream))
894 +#if !defined(_Z_UTIL_H) && !defined(NO_DUMMY_DECL)
895 + struct internal_state {int dummy;}; /* hack for buggy compilers */
898 +ZEXTERN const char * ZEXPORT zError OF((int err));
899 +ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp z));
900 +ZEXTERN const uLongf * ZEXPORT get_crc_table OF((void));
906 +#endif /* _ZLIB_H */
907 --- /dev/null 2004-02-02 20:32:13.000000000 +0000
908 +++ linux/include/zlib/zutil.h 2004-07-05 23:59:30.000000000 +0100
910 +/* zutil.h -- internal interface and configuration of the compression library
911 + * Copyright (C) 1995-2002 Jean-loup Gailly.
912 + * For conditions of distribution and use, see copyright notice in zlib.h
915 +/* WARNING: this file should *not* be used by applications. It is
916 + part of the implementation of the compression library and is
917 + subject to change. Applications should only use zlib.h.
920 +/* @(#) $Id: zutil.h,v 1.1 2004/07/05 22:59:30 pb Exp $ */
927 +#include <linux/string.h>
930 +#if 0 // #ifdef STDC
931 +# include <stddef.h>
932 +# include <string.h>
933 +# include <stdlib.h>
944 +# define local static
946 +/* compile with -Dlocal if your debugger can't find static symbols */
948 +typedef unsigned char uch;
949 +typedef uch FAR uchf;
950 +typedef unsigned short ush;
951 +typedef ush FAR ushf;
952 +typedef unsigned long ulg;
954 +extern const char *z_errmsg[10]; /* indexed by 2-zlib_error */
955 +/* (size given to avoid silly warnings with Visual C++) */
957 +#define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)]
959 +#define ERR_RETURN(strm,err) \
960 + return (strm->msg = ERR_MSG(err), (err))
961 +/* To be used only when the state is known to be valid */
963 + /* common constants */
966 +# define DEF_WBITS MAX_WBITS
968 +/* default windowBits for decompression. MAX_WBITS is for compression only */
970 +#if MAX_MEM_LEVEL >= 8
971 +# define DEF_MEM_LEVEL 8
973 +# define DEF_MEM_LEVEL MAX_MEM_LEVEL
975 +/* default memLevel */
977 +#define STORED_BLOCK 0
978 +#define STATIC_TREES 1
980 +/* The three kinds of block type */
983 +#define MAX_MATCH 258
984 +/* The minimum and maximum match lengths */
986 +#define PRESET_DICT 0x20 /* preset dictionary flag in zlib header */
988 + /* target dependencies */
991 +# define OS_CODE 0x00
992 +# if defined(__TURBOC__) || defined(__BORLANDC__)
993 +# if(__STDC__ == 1) && (defined(__LARGE__) || defined(__COMPACT__))
994 + /* Allow compilation with ANSI keywords only enabled */
995 + void _Cdecl farfree( void *block );
996 + void *_Cdecl farmalloc( unsigned long nbytes );
1000 +# else /* MSC or DJGPP */
1001 +# include <malloc.h>
1006 +# define OS_CODE 0x06
1009 +#ifdef WIN32 /* Window 95 & Windows NT */
1010 +# define OS_CODE 0x0b
1013 +#if defined(VAXC) || defined(VMS)
1014 +# define OS_CODE 0x02
1015 +# define F_OPEN(name, mode) \
1016 + fopen((name), (mode), "mbc=60", "ctx=stm", "rfm=fix", "mrs=512")
1020 +# define OS_CODE 0x01
1023 +#if defined(ATARI) || defined(atarist)
1024 +# define OS_CODE 0x05
1027 +#if defined(MACOS) || defined(TARGET_OS_MAC)
1028 +# define OS_CODE 0x07
1029 +# if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os
1030 +# include <unix.h> /* for fdopen */
1033 +# define fdopen(fd,mode) NULL /* No fdopen() */
1038 +#ifdef __50SERIES /* Prime/PRIMOS */
1039 +# define OS_CODE 0x0F
1043 +# define OS_CODE 0x0a
1046 +#if defined(_BEOS_) || defined(RISCOS)
1047 +# define fdopen(fd,mode) NULL /* No fdopen() */
1050 +#if (defined(_MSC_VER) && (_MSC_VER > 600))
1051 +# define fdopen(fd,type) _fdopen(fd,type)
1055 + /* Common defaults */
1058 +# define OS_CODE 0x03 /* assume Unix */
1062 +# define F_OPEN(name, mode) fopen((name), (mode))
1067 +#ifdef HAVE_STRERROR
1068 + extern char *strerror OF((int));
1069 +# define zstrerror(errnum) strerror(errnum)
1071 +# define zstrerror(errnum) ""
1077 +#if defined(SMALL_MEDIUM) && !defined(_MSC_VER) && !defined(__SC__)
1078 + /* Use our own functions for small and medium model with MSC <= 5.0.
1079 + * You may have to use the same strategy for Borland C (untested).
1080 + * The __SC__ check is for Symantec.
1084 +#if defined(STDC) && !defined(HAVE_MEMCPY) && !defined(NO_MEMCPY)
1085 +# define HAVE_MEMCPY
1088 +# ifdef SMALL_MEDIUM /* MSDOS small or medium model */
1089 +# define zmemcpy _fmemcpy
1090 +# define zmemcmp _fmemcmp
1091 +# define zmemzero(dest, len) _fmemset(dest, 0, len)
1093 +# define zmemcpy memcpy
1094 +# define zmemcmp memcmp
1095 +# define zmemzero(dest, len) memset(dest, 0, len)
1098 + extern void zmemcpy OF((Bytef* dest, const Bytef* source, uInt len));
1099 + extern int zmemcmp OF((const Bytef* s1, const Bytef* s2, uInt len));
1100 + extern void zmemzero OF((Bytef* dest, uInt len));
1103 +/* Diagnostic functions */
1105 +# include <stdio.h>
1106 + extern int z_verbose;
1107 + extern void z_error OF((char *m));
1108 +# define Assert(cond,msg) {if(!(cond)) z_error(msg);}
1109 +# define Trace(x) {if (z_verbose>=0) fprintf x ;}
1110 +# define Tracev(x) {if (z_verbose>0) fprintf x ;}
1111 +# define Tracevv(x) {if (z_verbose>1) fprintf x ;}
1112 +# define Tracec(c,x) {if (z_verbose>0 && (c)) fprintf x ;}
1113 +# define Tracecv(c,x) {if (z_verbose>1 && (c)) fprintf x ;}
1115 +# define Assert(cond,msg)
1118 +# define Tracevv(x)
1119 +# define Tracec(c,x)
1120 +# define Tracecv(c,x)
1124 +typedef uLong (ZEXPORT *check_func) OF((uLong check, const Bytef *buf,
1126 +voidpf zcalloc OF((voidpf opaque, unsigned items, unsigned size));
1127 +void zcfree OF((voidpf opaque, voidpf ptr));
1129 +#define ZALLOC(strm, items, size) \
1130 + (*((strm)->zalloc))((strm)->opaque, (items), (size))
1131 +#define ZFREE(strm, addr) (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
1132 +#define TRY_FREE(s, p) {if (p) ZFREE(s, p);}
1134 +#endif /* _Z_UTIL_H */
1135 --- /dev/null 2004-02-02 20:32:13.000000000 +0000
1136 +++ linux/include/zconf.h 2004-07-04 15:38:31.000000000 +0100
1138 +/* zconf.h -- configuration of the zlib compression library
1139 + * Copyright (C) 1995-2002 Jean-loup Gailly.
1140 + * For conditions of distribution and use, see copyright notice in zlib.h
1143 +/* @(#) $Id: zconf.h,v 1.2 2004/02/22 06:48:23 mcr Exp $ */
1149 + * If you *really* need a unique prefix for all types and library functions,
1150 + * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it.
1152 +#ifdef IPCOMP_PREFIX
1153 +# define deflateInit_ ipcomp_deflateInit_
1154 +# define deflate ipcomp_deflate
1155 +# define deflateEnd ipcomp_deflateEnd
1156 +# define inflateInit_ ipcomp_inflateInit_
1157 +# define inflate ipcomp_inflate
1158 +# define inflateEnd ipcomp_inflateEnd
1159 +# define deflateInit2_ ipcomp_deflateInit2_
1160 +# define deflateSetDictionary ipcomp_deflateSetDictionary
1161 +# define deflateCopy ipcomp_deflateCopy
1162 +# define deflateReset ipcomp_deflateReset
1163 +# define deflateParams ipcomp_deflateParams
1164 +# define inflateInit2_ ipcomp_inflateInit2_
1165 +# define inflateSetDictionary ipcomp_inflateSetDictionary
1166 +# define inflateSync ipcomp_inflateSync
1167 +# define inflateSyncPoint ipcomp_inflateSyncPoint
1168 +# define inflateReset ipcomp_inflateReset
1169 +# define compress ipcomp_compress
1170 +# define compress2 ipcomp_compress2
1171 +# define uncompress ipcomp_uncompress
1172 +# define adler32 ipcomp_adler32
1173 +# define crc32 ipcomp_crc32
1174 +# define get_crc_table ipcomp_get_crc_table
1175 +/* SSS: these also need to be prefixed to avoid clash with ppp_deflate and ext2compression */
1176 +# define inflate_blocks ipcomp_deflate_blocks
1177 +# define inflate_blocks_free ipcomp_deflate_blocks_free
1178 +# define inflate_blocks_new ipcomp_inflate_blocks_new
1179 +# define inflate_blocks_reset ipcomp_inflate_blocks_reset
1180 +# define inflate_blocks_sync_point ipcomp_inflate_blocks_sync_point
1181 +# define inflate_set_dictionary ipcomp_inflate_set_dictionary
1182 +# define inflate_codes ipcomp_inflate_codes
1183 +# define inflate_codes_free ipcomp_inflate_codes_free
1184 +# define inflate_codes_new ipcomp_inflate_codes_new
1185 +# define inflate_fast ipcomp_inflate_fast
1186 +# define inflate_trees_bits ipcomp_inflate_trees_bits
1187 +# define inflate_trees_dynamic ipcomp_inflate_trees_dynamic
1188 +# define inflate_trees_fixed ipcomp_inflate_trees_fixed
1189 +# define inflate_flush ipcomp_inflate_flush
1190 +# define inflate_mask ipcomp_inflate_mask
1191 +# define _dist_code _ipcomp_dist_code
1192 +# define _length_code _ipcomp_length_code
1193 +# define _tr_align _ipcomp_tr_align
1194 +# define _tr_flush_block _ipcomp_tr_flush_block
1195 +# define _tr_init _ipcomp_tr_init
1196 +# define _tr_stored_block _ipcomp_tr_stored_block
1197 +# define _tr_tally _ipcomp_tr_tally
1198 +# define zError ipcomp_zError
1199 +# define z_errmsg ipcomp_z_errmsg
1200 +# define zlibVersion ipcomp_zlibVersion
1201 +# define match_init ipcomp_match_init
1202 +# define longest_match ipcomp_longest_match
1206 +# define Byte z_Byte
1207 +# define uInt z_uInt
1208 +# define uLong z_uLong
1209 +# define Bytef z_Bytef
1210 +# define charf z_charf
1211 +# define intf z_intf
1212 +# define uIntf z_uIntf
1213 +# define uLongf z_uLongf
1214 +# define voidpf z_voidpf
1215 +# define voidp z_voidp
1218 +#if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32)
1221 +#if defined(__GNUC__) || defined(WIN32) || defined(__386__) || defined(i386)
1226 +#if defined(__MSDOS__) && !defined(MSDOS)
1231 + * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
1232 + * than 64k bytes at a time (needed on systems with 16-bit int).
1234 +#if defined(MSDOS) && !defined(__32BIT__)
1235 +# define MAXSEG_64K
1238 +# define UNALIGNED_OK
1241 +#if (defined(MSDOS) || defined(_WINDOWS) || defined(WIN32)) && !defined(STDC)
1244 +#if defined(__STDC__) || defined(__cplusplus) || defined(__OS2__)
1251 +# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
1256 +/* Some Mac compilers merge all .h files incorrectly: */
1257 +#if defined(__MWERKS__) || defined(applec) ||defined(THINK_C) ||defined(__SC__)
1258 +# define NO_DUMMY_DECL
1261 +/* Old Borland C incorrectly complains about missing returns: */
1262 +#if defined(__BORLANDC__) && (__BORLANDC__ < 0x500)
1263 +# define NEED_DUMMY_RETURN
1267 +/* Maximum value for memLevel in deflateInit2 */
1268 +#ifndef MAX_MEM_LEVEL
1270 +# define MAX_MEM_LEVEL 8
1272 +# define MAX_MEM_LEVEL 9
1276 +/* Maximum value for windowBits in deflateInit2 and inflateInit2.
1277 + * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
1278 + * created by gzip. (Files created by minigzip can still be extracted by
1282 +# define MAX_WBITS 15 /* 32K LZ77 window */
1285 +/* The memory requirements for deflate are (in bytes):
1286 + (1 << (windowBits+2)) + (1 << (memLevel+9))
1287 + that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
1288 + plus a few kilobytes for small objects. For example, if you want to reduce
1289 + the default memory requirements from 256K to 128K, compile with
1290 + make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
1291 + Of course this will generally degrade compression (there's no free lunch).
1293 + The memory requirements for inflate are (in bytes) 1 << windowBits
1294 + that is, 32K for windowBits=15 (default value) plus a few kilobytes
1295 + for small objects.
1298 + /* Type declarations */
1300 +#ifndef OF /* function prototypes */
1302 +# define OF(args) args
1304 +# define OF(args) ()
1308 +/* The following definitions for FAR are needed only for MSDOS mixed
1309 + * model programming (small or medium model with some far allocations).
1310 + * This was tested only with MSC; for other MSDOS compilers you may have
1311 + * to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
1312 + * just define FAR to be empty.
1314 +#if (defined(M_I86SM) || defined(M_I86MM)) && !defined(__32BIT__)
1315 + /* MSC small or medium model */
1316 +# define SMALL_MEDIUM
1323 +#if defined(__BORLANDC__) && (defined(__SMALL__) || defined(__MEDIUM__))
1325 +# define SMALL_MEDIUM
1330 +/* Compile with -DZLIB_DLL for Windows DLL support */
1331 +#if defined(ZLIB_DLL)
1332 +# if defined(_WINDOWS) || defined(WINDOWS)
1336 +# include <windows.h>
1337 +# define ZEXPORT WINAPI
1339 +# define ZEXPORTVA WINAPIV
1341 +# define ZEXPORTVA FAR _cdecl _export
1344 +# if defined (__BORLANDC__)
1345 +# if (__BORLANDC__ >= 0x0500) && defined (WIN32)
1346 +# include <windows.h>
1347 +# define ZEXPORT __declspec(dllexport) WINAPI
1348 +# define ZEXPORTRVA __declspec(dllexport) WINAPIV
1350 +# if defined (_Windows) && defined (__DLL__)
1351 +# define ZEXPORT _export
1352 +# define ZEXPORTVA _export
1358 +#if defined (__BEOS__)
1359 +# if defined (ZLIB_DLL)
1360 +# define ZEXTERN extern __declspec(dllexport)
1362 +# define ZEXTERN extern __declspec(dllimport)
1373 +# define ZEXTERN extern
1380 +#if !defined(MACOS) && !defined(TARGET_OS_MAC)
1381 +typedef unsigned char Byte; /* 8 bits */
1383 +typedef unsigned int uInt; /* 16 bits or more */
1384 +typedef unsigned long uLong; /* 32 bits or more */
1386 +#ifdef SMALL_MEDIUM
1387 + /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
1388 +# define Bytef Byte FAR
1390 + typedef Byte FAR Bytef;
1392 +typedef char FAR charf;
1393 +typedef int FAR intf;
1394 +typedef uInt FAR uIntf;
1395 +typedef uLong FAR uLongf;
1398 + typedef void FAR *voidpf;
1399 + typedef void *voidp;
1401 + typedef Byte FAR *voidpf;
1402 + typedef Byte *voidp;
1405 +#ifdef HAVE_UNISTD_H
1406 +# include <sys/types.h> /* for off_t */
1407 +# include <unistd.h> /* for SEEK_* and off_t */
1408 +# define z_off_t off_t
1411 +# define SEEK_SET 0 /* Seek from beginning of file. */
1412 +# define SEEK_CUR 1 /* Seek from current position. */
1413 +# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
1416 +# define z_off_t long
1419 +/* MVS linker does not support external names larger than 8 bytes */
1420 +#if defined(__MVS__)
1421 +# pragma map(deflateInit_,"DEIN")
1422 +# pragma map(deflateInit2_,"DEIN2")
1423 +# pragma map(deflateEnd,"DEEND")
1424 +# pragma map(inflateInit_,"ININ")
1425 +# pragma map(inflateInit2_,"ININ2")
1426 +# pragma map(inflateEnd,"INEND")
1427 +# pragma map(inflateSync,"INSY")
1428 +# pragma map(inflateSetDictionary,"INSEDI")
1429 +# pragma map(inflate_blocks,"INBL")
1430 +# pragma map(inflate_blocks_new,"INBLNE")
1431 +# pragma map(inflate_blocks_free,"INBLFR")
1432 +# pragma map(inflate_blocks_reset,"INBLRE")
1433 +# pragma map(inflate_codes_free,"INCOFR")
1434 +# pragma map(inflate_codes,"INCO")
1435 +# pragma map(inflate_fast,"INFA")
1436 +# pragma map(inflate_flush,"INFLU")
1437 +# pragma map(inflate_mask,"INMA")
1438 +# pragma map(inflate_set_dictionary,"INSEDI2")
1439 +# pragma map(ipcomp_inflate_copyright,"INCOPY")
1440 +# pragma map(inflate_trees_bits,"INTRBI")
1441 +# pragma map(inflate_trees_dynamic,"INTRDY")
1442 +# pragma map(inflate_trees_fixed,"INTRFI")
1443 +# pragma map(inflate_trees_free,"INTRFR")
1446 +#endif /* _ZCONF_H */