]> pilppa.org Git - familiar-h63xx-build.git/blob - org.handhelds.familiar/packages/linux/handhelds-sa-2.4.19-rmk6-pxa1-hh36.12/ipsec.patch
OE tree imported from monotone branch org.openembedded.oz354fam083 at revision 8b12e3...
[familiar-h63xx-build.git] / org.handhelds.familiar / packages / linux / handhelds-sa-2.4.19-rmk6-pxa1-hh36.12 / ipsec.patch
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
3 @@ -19,6 +19,7 @@
4  subdir-$(CONFIG_NETFILTER)     += ipv4/netfilter
5  subdir-$(CONFIG_UNIX)          += unix
6  subdir-$(CONFIG_IPV6)          += ipv6
7 +subdir-$(CONFIG_IPSEC)         += ipsec
8  
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
13 @@ -0,0 +1,893 @@
14 +/* zlib.h -- interface of the 'zlib' general purpose compression library
15 +  version 1.1.4, March 11th, 2002
16 +
17 +  Copyright (C) 1995-2002 Jean-loup Gailly and Mark Adler
18 +
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.
22 +
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:
26 +
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.
34 +
35 +  Jean-loup Gailly        Mark Adler
36 +  jloup@gzip.org          madler@alumni.caltech.edu
37 +
38 +
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).
42 +*/
43 +
44 +#ifndef _ZLIB_H
45 +#define _ZLIB_H
46 +
47 +#include "zconf.h"
48 +
49 +#ifdef __cplusplus
50 +extern "C" {
51 +#endif
52 +
53 +#define ZLIB_VERSION "1.1.4"
54 +
55 +/* 
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
60 +  stream interface.
61 +
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.
67 +
68 +     The library also supports reading and writing files in gzip (.gz) format
69 +  with an interface similar to that of stdio.
70 +
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.
74 +*/
75 +
76 +typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size));
77 +typedef void   (*free_func)  OF((voidpf opaque, voidpf address));
78 +
79 +struct internal_state;
80 +
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 */
85 +
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 */
89 +
90 +    const char     *msg;      /* last error message, NULL if no error */
91 +    struct internal_state FAR *state; /* not visible by applications */
92 +
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 */
96 +
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 */
100 +} z_stream;
101 +
102 +typedef z_stream FAR *z_streamp;
103 +
104 +/*
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.
110 +
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
114 +   opaque value.
115 +
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
118 +   thread safe.
119 +
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).
128 +
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
133 +   a single step).
134 +*/
135 +
136 +                        /* constants */
137 +
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
142 +#define Z_FINISH        4
143 +/* Allowed flush values; see deflate() below for details */
144 +
145 +#define Z_OK            0
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.
156 + */
157 +
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 */
163 +
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 */
168 +
169 +#define Z_BINARY   0
170 +#define Z_ASCII    1
171 +#define Z_UNKNOWN  2
172 +/* Possible values of the data_type field */
173 +
174 +#define Z_DEFLATED   8
175 +/* The deflate compression method (the only one supported in this version) */
176 +
177 +#define Z_NULL  0  /* for initializing zalloc, zfree, opaque */
178 +
179 +#define zlib_version zlibVersion()
180 +/* for compatibility with versions < 1.0.2 */
181 +
182 +                        /* basic functions */
183 +
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.
189 + */
190 +
191 +/* 
192 +ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level));
193 +
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.
198 +
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).
204 +
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().
211 +*/
212 +
213 +
214 +ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush));
215 +/*
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
219 +  forced to flush.
220 +
221 +    The detailed semantics are as follows. deflate performs one or both of the
222 +  following actions:
223 +
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().
228 +
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.
234 +
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.
243 +
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.
250 +
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
255 +  the compression.
256 +
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
260 +  avail_out).
261 +
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.
269 +  
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.
274 +
275 +    deflate() sets strm->adler to the adler32 checksum of all input read
276 +  so far (that is, total_in bytes).
277 +
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.
282 +
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).
289 +*/
290 +
291 +
292 +ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm));
293 +/*
294 +     All dynamically allocated data structures for this stream are freed.
295 +   This function discards any unprocessed input and does not flush any
296 +   pending output.
297 +
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
302 +   deallocated).
303 +*/
304 +
305 +
306 +/* 
307 +ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm));
308 +
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.
317 +
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.)
324 +*/
325 +
326 +
327 +ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush));
328 +/*
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.
333 +
334 +  The detailed semantics are as follows. inflate performs one or both of the
335 +  following actions:
336 +
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().
341 +
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).
346 +
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.
355 +
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.
361 +
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.
372 +
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.
381 +
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
392 +  compression block.
393 +*/
394 +
395 +
396 +ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm));
397 +/*
398 +     All dynamically allocated data structures for this stream are freed.
399 +   This function discards any unprocessed input and does not flush any
400 +   pending output.
401 +
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).
405 +*/
406 +
407 +                        /* Advanced functions */
408 +
409 +/*
410 +    The following functions are needed only in some special applications.
411 +*/
412 +
413 +/*   
414 +ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm,
415 +                                     int  level,
416 +                                     int  method,
417 +                                     int  windowBits,
418 +                                     int  memLevel,
419 +                                     int  strategy));
420 +
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
423 +   the caller.
424 +
425 +     The method parameter is the compression method. It must be Z_DEFLATED in
426 +   this version of the library.
427 +
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.
433 +
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.
439 +
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.
450 +
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().
455 +*/
456 +                            
457 +ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm,
458 +                                             const Bytef *dictionary,
459 +                                             uInt  dictLength));
460 +/*
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).
466 +
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.
473 +
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.
479 +
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.)
485 +
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().
491 +*/
492 +
493 +ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest,
494 +                                    z_streamp source));
495 +/*
496 +     Sets the destination stream as a complete copy of the source stream.
497 +
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.
504 +
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
508 +   destination.
509 +*/
510 +
511 +ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm));
512 +/*
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.
517 +
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).
520 +*/
521 +
522 +ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm,
523 +                                     int level,
524 +                                     int strategy));
525 +/*
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().
533 +
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.
537 +
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.
541 +*/
542 +
543 +/*   
544 +ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm,
545 +                                     int  windowBits));
546 +
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.
550 +
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.
557 +
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.)
564 +*/
565 +
566 +ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm,
567 +                                             const Bytef *dictionary,
568 +                                             uInt  dictLength));
569 +/*
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).
576 +
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
582 +   inflate().
583 +*/
584 +
585 +ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm));
586 +/* 
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.
590 +
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.
598 +*/
599 +
600 +ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm));
601 +/*
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.
605 +
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).
608 +*/
609 +
610 +
611 +                        /* utility functions */
612 +
613 +/*
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.
619 +*/
620 +
621 +ZEXTERN int ZEXPORT compress OF((Bytef *dest,   uLongf *destLen,
622 +                                 const Bytef *source, uLong sourceLen));
623 +/*
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
628 +   compressed buffer.
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
633 +   buffer.
634 +*/
635 +
636 +ZEXTERN int ZEXPORT compress2 OF((Bytef *dest,   uLongf *destLen,
637 +                                  const Bytef *source, uLong sourceLen,
638 +                                  int level));
639 +/*
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.
645 +
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.
649 +*/
650 +
651 +ZEXTERN int ZEXPORT uncompress OF((Bytef *dest,   uLongf *destLen,
652 +                                   const Bytef *source, uLong sourceLen));
653 +/*
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.
663 +
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.
667 +*/
668 +
669 +
670 +typedef voidp gzFile;
671 +
672 +ZEXTERN gzFile ZEXPORT gzopen  OF((const char *path, const char *mode));
673 +/*
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.)
679 +
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.
682 +
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).  */
687 +
688 +ZEXTERN gzFile ZEXPORT gzdopen  OF((int fd, const char *mode));
689 +/*
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.
699 +*/
700 +
701 +ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy));
702 +/*
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.
707 +*/
708 +
709 +ZEXTERN int ZEXPORT    gzread  OF((gzFile file, voidp buf, unsigned len));
710 +/*
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). */
716 +
717 +ZEXTERN int ZEXPORT    gzwrite OF((gzFile file, 
718 +                                  const voidp buf, unsigned len));
719 +/*
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).
723 +*/
724 +
725 +ZEXTERN int ZEXPORTVA   gzprintf OF((gzFile file, const char *format, ...));
726 +/*
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).
730 +*/
731 +
732 +ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s));
733 +/*
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.
737 +*/
738 +
739 +ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len));
740 +/*
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
744 +   character.
745 +      gzgets returns buf, or Z_NULL in case of error.
746 +*/
747 +
748 +ZEXTERN int ZEXPORT    gzputc OF((gzFile file, int c));
749 +/*
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.
752 +*/
753 +
754 +ZEXTERN int ZEXPORT    gzgetc OF((gzFile file));
755 +/*
756 +      Reads one byte from the compressed file. gzgetc returns this byte
757 +   or -1 in case of end of file or error.
758 +*/
759 +
760 +ZEXTERN int ZEXPORT    gzflush OF((gzFile file, int flush));
761 +/*
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.
768 +*/
769 +
770 +ZEXTERN z_off_t ZEXPORT    gzseek OF((gzFile file,
771 +                                     z_off_t offset, int whence));
772 +/* 
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
780 +   starting position.
781 +
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.
786 +*/
787 +
788 +ZEXTERN int ZEXPORT    gzrewind OF((gzFile file));
789 +/*
790 +     Rewinds the given file. This function is supported only for reading.
791 +
792 +   gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET)
793 +*/
794 +
795 +ZEXTERN z_off_t ZEXPORT    gztell OF((gzFile file));
796 +/*
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.
800 +
801 +   gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR)
802 +*/
803 +
804 +ZEXTERN int ZEXPORT gzeof OF((gzFile file));
805 +/*
806 +     Returns 1 when EOF has previously been detected reading the given
807 +   input stream, otherwise zero.
808 +*/
809 +
810 +ZEXTERN int ZEXPORT    gzclose OF((gzFile file));
811 +/*
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).
815 +*/
816 +
817 +ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum));
818 +/*
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.
824 +*/
825 +
826 +                        /* checksum functions */
827 +
828 +/*
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.
832 +*/
833 +
834 +ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len));
835 +
836 +/*
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:
842 +
843 +     uLong adler = adler32(0L, Z_NULL, 0);
844 +
845 +     while (read_buffer(buffer, length) != EOF) {
846 +       adler = adler32(adler, buffer, length);
847 +     }
848 +     if (adler != original_adler) error();
849 +*/
850 +
851 +ZEXTERN uLong ZEXPORT crc32   OF((uLong crc, const Bytef *buf, uInt len));
852 +/*
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.
857 +   Usage example:
858 +
859 +     uLong crc = crc32(0L, Z_NULL, 0);
860 +
861 +     while (read_buffer(buffer, length) != EOF) {
862 +       crc = crc32(crc, buffer, length);
863 +     }
864 +     if (crc != original_crc) error();
865 +*/
866 +
867 +
868 +                        /* various hacks, don't look :) */
869 +
870 +/* deflateInit and inflateInit are macros to allow checking the zlib version
871 + * and the compiler's view of z_stream:
872 + */
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,
880 +                                      int stream_size));
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))
892 +
893 +
894 +#if !defined(_Z_UTIL_H) && !defined(NO_DUMMY_DECL)
895 +    struct internal_state {int dummy;}; /* hack for buggy compilers */
896 +#endif
897 +
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));
901 +
902 +#ifdef __cplusplus
903 +}
904 +#endif
905 +
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
909 @@ -0,0 +1,225 @@
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
913 + */
914 +
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.
918 + */
919 +
920 +/* @(#) $Id: zutil.h,v 1.1 2004/07/05 22:59:30 pb Exp $ */
921 +
922 +#ifndef _Z_UTIL_H
923 +#define _Z_UTIL_H
924 +
925 +#include "zlib.h"
926 +
927 +#include <linux/string.h>
928 +#define HAVE_MEMCPY
929 +
930 +#if 0 // #ifdef STDC
931 +#  include <stddef.h>
932 +#  include <string.h>
933 +#  include <stdlib.h>
934 +#endif
935 +#ifndef __KERNEL__
936 +#ifdef NO_ERRNO_H
937 +    extern int errno;
938 +#else
939 +#   include <errno.h>
940 +#endif
941 +#endif
942 +
943 +#ifndef local
944 +#  define local static
945 +#endif
946 +/* compile with -Dlocal if your debugger can't find static symbols */
947 +
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;
953 +
954 +extern const char *z_errmsg[10]; /* indexed by 2-zlib_error */
955 +/* (size given to avoid silly warnings with Visual C++) */
956 +
957 +#define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)]
958 +
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 */
962 +
963 +        /* common constants */
964 +
965 +#ifndef DEF_WBITS
966 +#  define DEF_WBITS MAX_WBITS
967 +#endif
968 +/* default windowBits for decompression. MAX_WBITS is for compression only */
969 +
970 +#if MAX_MEM_LEVEL >= 8
971 +#  define DEF_MEM_LEVEL 8
972 +#else
973 +#  define DEF_MEM_LEVEL  MAX_MEM_LEVEL
974 +#endif
975 +/* default memLevel */
976 +
977 +#define STORED_BLOCK 0
978 +#define STATIC_TREES 1
979 +#define DYN_TREES    2
980 +/* The three kinds of block type */
981 +
982 +#define MIN_MATCH  3
983 +#define MAX_MATCH  258
984 +/* The minimum and maximum match lengths */
985 +
986 +#define PRESET_DICT 0x20 /* preset dictionary flag in zlib header */
987 +
988 +        /* target dependencies */
989 +
990 +#ifdef MSDOS
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 );
997 +#    else
998 +#     include <alloc.h>
999 +#    endif
1000 +#  else /* MSC or DJGPP */
1001 +#    include <malloc.h>
1002 +#  endif
1003 +#endif
1004 +
1005 +#ifdef OS2
1006 +#  define OS_CODE  0x06
1007 +#endif
1008 +
1009 +#ifdef WIN32 /* Window 95 & Windows NT */
1010 +#  define OS_CODE  0x0b
1011 +#endif
1012 +
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")
1017 +#endif
1018 +
1019 +#ifdef AMIGA
1020 +#  define OS_CODE  0x01
1021 +#endif
1022 +
1023 +#if defined(ATARI) || defined(atarist)
1024 +#  define OS_CODE  0x05
1025 +#endif
1026 +
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 */
1031 +#  else
1032 +#    ifndef fdopen
1033 +#      define fdopen(fd,mode) NULL /* No fdopen() */
1034 +#    endif
1035 +#  endif
1036 +#endif
1037 +
1038 +#ifdef __50SERIES /* Prime/PRIMOS */
1039 +#  define OS_CODE  0x0F
1040 +#endif
1041 +
1042 +#ifdef TOPS20
1043 +#  define OS_CODE  0x0a
1044 +#endif
1045 +
1046 +#if defined(_BEOS_) || defined(RISCOS)
1047 +#  define fdopen(fd,mode) NULL /* No fdopen() */
1048 +#endif
1049 +
1050 +#if (defined(_MSC_VER) && (_MSC_VER > 600))
1051 +#  define fdopen(fd,type)  _fdopen(fd,type)
1052 +#endif
1053 +
1054 +
1055 +        /* Common defaults */
1056 +
1057 +#ifndef OS_CODE
1058 +#  define OS_CODE  0x03  /* assume Unix */
1059 +#endif
1060 +
1061 +#ifndef F_OPEN
1062 +#  define F_OPEN(name, mode) fopen((name), (mode))
1063 +#endif
1064 +
1065 +         /* functions */
1066 +
1067 +#ifdef HAVE_STRERROR
1068 +   extern char *strerror OF((int));
1069 +#  define zstrerror(errnum) strerror(errnum)
1070 +#else
1071 +#  define zstrerror(errnum) ""
1072 +#endif
1073 +
1074 +#if defined(pyr)
1075 +#  define NO_MEMCPY
1076 +#endif
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.
1081 +  */
1082 +#  define NO_MEMCPY
1083 +#endif
1084 +#if defined(STDC) && !defined(HAVE_MEMCPY) && !defined(NO_MEMCPY)
1085 +#  define HAVE_MEMCPY
1086 +#endif
1087 +#ifdef 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)
1092 +#  else
1093 +#    define zmemcpy memcpy
1094 +#    define zmemcmp memcmp
1095 +#    define zmemzero(dest, len) memset(dest, 0, len)
1096 +#  endif
1097 +#else
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));
1101 +#endif
1102 +
1103 +/* Diagnostic functions */
1104 +#ifdef DEBUG
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 ;}
1114 +#else
1115 +#  define Assert(cond,msg)
1116 +#  define Trace(x)
1117 +#  define Tracev(x)
1118 +#  define Tracevv(x)
1119 +#  define Tracec(c,x)
1120 +#  define Tracecv(c,x)
1121 +#endif
1122 +
1123 +
1124 +typedef uLong (ZEXPORT *check_func) OF((uLong check, const Bytef *buf,
1125 +                                      uInt len));
1126 +voidpf zcalloc OF((voidpf opaque, unsigned items, unsigned size));
1127 +void   zcfree  OF((voidpf opaque, voidpf ptr));
1128 +
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);}
1133 +
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
1137 @@ -0,0 +1,309 @@
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 
1141 + */
1142 +
1143 +/* @(#) $Id: zconf.h,v 1.2 2004/02/22 06:48:23 mcr Exp $ */
1144 +
1145 +#ifndef _ZCONF_H
1146 +#define _ZCONF_H
1147 +
1148 +/*
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.
1151 + */
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
1203 +#endif
1204 +
1205 +#ifdef Z_PREFIX
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
1216 +#endif
1217 +
1218 +#if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32)
1219 +#  define WIN32
1220 +#endif
1221 +#if defined(__GNUC__) || defined(WIN32) || defined(__386__) || defined(i386)
1222 +#  ifndef __32BIT__
1223 +#    define __32BIT__
1224 +#  endif
1225 +#endif
1226 +#if defined(__MSDOS__) && !defined(MSDOS)
1227 +#  define MSDOS
1228 +#endif
1229 +
1230 +/*
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).
1233 + */
1234 +#if defined(MSDOS) && !defined(__32BIT__)
1235 +#  define MAXSEG_64K
1236 +#endif
1237 +#ifdef MSDOS
1238 +#  define UNALIGNED_OK
1239 +#endif
1240 +
1241 +#if (defined(MSDOS) || defined(_WINDOWS) || defined(WIN32))  && !defined(STDC)
1242 +#  define STDC
1243 +#endif
1244 +#if defined(__STDC__) || defined(__cplusplus) || defined(__OS2__)
1245 +#  ifndef STDC
1246 +#    define STDC
1247 +#  endif
1248 +#endif
1249 +
1250 +#ifndef STDC
1251 +#  ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
1252 +#    define const
1253 +#  endif
1254 +#endif
1255 +
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
1259 +#endif
1260 +
1261 +/* Old Borland C incorrectly complains about missing returns: */
1262 +#if defined(__BORLANDC__) && (__BORLANDC__ < 0x500)
1263 +#  define NEED_DUMMY_RETURN
1264 +#endif
1265 +
1266 +
1267 +/* Maximum value for memLevel in deflateInit2 */
1268 +#ifndef MAX_MEM_LEVEL
1269 +#  ifdef MAXSEG_64K
1270 +#    define MAX_MEM_LEVEL 8
1271 +#  else
1272 +#    define MAX_MEM_LEVEL 9
1273 +#  endif
1274 +#endif
1275 +
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
1279 + * gzip.)
1280 + */
1281 +#ifndef MAX_WBITS
1282 +#  define MAX_WBITS   15 /* 32K LZ77 window */
1283 +#endif
1284 +
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).
1292 +
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.
1296 +*/
1297 +
1298 +                        /* Type declarations */
1299 +
1300 +#ifndef OF /* function prototypes */
1301 +#  ifdef STDC
1302 +#    define OF(args)  args
1303 +#  else
1304 +#    define OF(args)  ()
1305 +#  endif
1306 +#endif
1307 +
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.
1313 + */
1314 +#if (defined(M_I86SM) || defined(M_I86MM)) && !defined(__32BIT__)
1315 +   /* MSC small or medium model */
1316 +#  define SMALL_MEDIUM
1317 +#  ifdef _MSC_VER
1318 +#    define FAR _far
1319 +#  else
1320 +#    define FAR far
1321 +#  endif
1322 +#endif
1323 +#if defined(__BORLANDC__) && (defined(__SMALL__) || defined(__MEDIUM__))
1324 +#  ifndef __32BIT__
1325 +#    define SMALL_MEDIUM
1326 +#    define FAR _far
1327 +#  endif
1328 +#endif
1329 +
1330 +/* Compile with -DZLIB_DLL for Windows DLL support */
1331 +#if defined(ZLIB_DLL)
1332 +#  if defined(_WINDOWS) || defined(WINDOWS)
1333 +#    ifdef FAR
1334 +#      undef FAR
1335 +#    endif
1336 +#    include <windows.h>
1337 +#    define ZEXPORT  WINAPI
1338 +#    ifdef WIN32
1339 +#      define ZEXPORTVA  WINAPIV
1340 +#    else
1341 +#      define ZEXPORTVA  FAR _cdecl _export
1342 +#    endif
1343 +#  endif
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
1349 +#    else
1350 +#      if defined (_Windows) && defined (__DLL__)
1351 +#        define ZEXPORT _export
1352 +#        define ZEXPORTVA _export
1353 +#      endif
1354 +#    endif
1355 +#  endif
1356 +#endif
1357 +
1358 +#if defined (__BEOS__)
1359 +#  if defined (ZLIB_DLL)
1360 +#    define ZEXTERN extern __declspec(dllexport)
1361 +#  else
1362 +#    define ZEXTERN extern __declspec(dllimport)
1363 +#  endif
1364 +#endif
1365 +
1366 +#ifndef ZEXPORT
1367 +#  define ZEXPORT
1368 +#endif
1369 +#ifndef ZEXPORTVA
1370 +#  define ZEXPORTVA
1371 +#endif
1372 +#ifndef ZEXTERN
1373 +#  define ZEXTERN extern
1374 +#endif
1375 +
1376 +#ifndef FAR
1377 +#   define FAR
1378 +#endif
1379 +
1380 +#if !defined(MACOS) && !defined(TARGET_OS_MAC)
1381 +typedef unsigned char  Byte;  /* 8 bits */
1382 +#endif
1383 +typedef unsigned int   uInt;  /* 16 bits or more */
1384 +typedef unsigned long  uLong; /* 32 bits or more */
1385 +
1386 +#ifdef SMALL_MEDIUM
1387 +   /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
1388 +#  define Bytef Byte FAR
1389 +#else
1390 +   typedef Byte  FAR Bytef;
1391 +#endif
1392 +typedef char  FAR charf;
1393 +typedef int   FAR intf;
1394 +typedef uInt  FAR uIntf;
1395 +typedef uLong FAR uLongf;
1396 +
1397 +#ifdef STDC
1398 +   typedef void FAR *voidpf;
1399 +   typedef void     *voidp;
1400 +#else
1401 +   typedef Byte FAR *voidpf;
1402 +   typedef Byte     *voidp;
1403 +#endif
1404 +
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
1409 +#endif
1410 +#ifndef SEEK_SET
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" */
1414 +#endif
1415 +#ifndef z_off_t
1416 +#  define  z_off_t long
1417 +#endif
1418 +
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")
1444 +#endif
1445 +
1446 +#endif /* _ZCONF_H */