Update of /cvsroot/solidircd/solidircd-stable/zlib In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv7252/zlib Modified Files: ChangeLog FAQ INDEX adler32.c configure crc32.c deflate.c deflate.h gzio.c infback.c inffast.c inflate.c inflate.h inftrees.c minigzip.c zconf.h zconf.in.h zlib.h zutil.c zutil.h Log Message: Bahamut 1.8.4 latest changes part 4 Index: inflate.c =================================================================== RCS file: /cvsroot/solidircd/solidircd-stable/zlib/inflate.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** inflate.c 27 Jun 2005 03:02:40 -0000 1.1.1.1 --- inflate.c 10 Apr 2007 20:13:08 -0000 1.2 *************** *** 1,4 **** /* inflate.c -- zlib decompression ! * Copyright (C) 1995-2003 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ --- 1,4 ---- /* inflate.c -- zlib decompression ! * Copyright (C) 1995-2005 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ *************** *** 110,118 **** --- 110,122 ---- strm->total_in = strm->total_out = state->total = 0; strm->msg = Z_NULL; + strm->adler = 1; /* to support ill-conceived Java test suite */ state->mode = HEAD; state->last = 0; state->havedict = 0; + state->dmax = 32768U; + state->head = Z_NULL; state->wsize = 0; state->whave = 0; + state->write = 0; state->hold = 0; state->bits = 0; *************** *** 122,125 **** --- 126,145 ---- } + int ZEXPORT inflatePrime(strm, bits, value) + z_streamp strm; + int bits; + int value; + { + struct inflate_state FAR *state; + + if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + state = (struct inflate_state FAR *)strm->state; + if (bits > 16 || state->bits + bits > 32) return Z_STREAM_ERROR; + value &= (1L << bits) - 1; + state->hold += value << state->bits; + state->bits += bits; + return Z_OK; + } + int ZEXPORT inflateInit2_(strm, windowBits, version, stream_size) z_streamp strm; *************** *** 144,148 **** if (state == Z_NULL) return Z_MEM_ERROR; Tracev((stderr, "inflate: allocated\n")); ! strm->state = (voidpf)state; if (windowBits < 0) { state->wrap = 0; --- 164,168 ---- if (state == Z_NULL) return Z_MEM_ERROR; Tracev((stderr, "inflate: allocated\n")); ! strm->state = (struct internal_state FAR *)state; if (windowBits < 0) { state->wrap = 0; *************** *** 582,585 **** --- 602,607 ---- } state->flags = 0; /* expect zlib header */ + if (state->head != Z_NULL) + state->head->done = -1; if (!(state->wrap & 1) || /* check if zlib header allowed */ #else *************** *** 597,605 **** } DROPBITS(4); ! if (BITS(4) + 8 > state->wbits) { strm->msg = (char *)"invalid window size"; state->mode = BAD; break; } Tracev((stderr, "inflate: zlib header ok\n")); strm->adler = state->check = adler32(0L, Z_NULL, 0); --- 619,629 ---- } DROPBITS(4); ! len = BITS(4) + 8; ! if (len > state->wbits) { strm->msg = (char *)"invalid window size"; state->mode = BAD; break; } + state->dmax = 1U << len; Tracev((stderr, "inflate: zlib header ok\n")); strm->adler = state->check = adler32(0L, Z_NULL, 0); *************** *** 621,624 **** --- 645,650 ---- break; } + if (state->head != Z_NULL) + state->head->text = (int)((hold >> 8) & 1); if (state->flags & 0x0200) CRC2(state->check, hold); INITBITS(); *************** *** 626,629 **** --- 652,657 ---- case TIME: NEEDBITS(32); + if (state->head != Z_NULL) + state->head->time = hold; if (state->flags & 0x0200) CRC4(state->check, hold); INITBITS(); *************** *** 631,634 **** --- 659,666 ---- case OS: NEEDBITS(16); + if (state->head != Z_NULL) { + state->head->xflags = (int)(hold & 0xff); + state->head->os = (int)(hold >> 8); + } if (state->flags & 0x0200) CRC2(state->check, hold); INITBITS(); *************** *** 638,644 **** --- 670,680 ---- NEEDBITS(16); state->length = (unsigned)(hold); + if (state->head != Z_NULL) + state->head->extra_len = (unsigned)hold; if (state->flags & 0x0200) CRC2(state->check, hold); INITBITS(); } + else if (state->head != Z_NULL) + state->head->extra = Z_NULL; state->mode = EXTRA; case EXTRA: *************** *** 647,650 **** --- 683,693 ---- if (copy > have) copy = have; if (copy) { + if (state->head != Z_NULL && + state->head->extra != Z_NULL) { + len = state->head->extra_len - state->length; + zmemcpy(state->head->extra + len, next, + len + copy > state->head->extra_max ? + state->head->extra_max - len : copy); + } if (state->flags & 0x0200) state->check = crc32(state->check, next, copy); *************** *** 655,658 **** --- 698,702 ---- if (state->length) goto inf_leave; } + state->length = 0; state->mode = NAME; case NAME: *************** *** 662,667 **** do { len = (unsigned)(next[copy++]); } while (len && copy < have); ! if (state->flags & 0x02000) state->check = crc32(state->check, next, copy); have -= copy; --- 706,715 ---- do { len = (unsigned)(next[copy++]); + if (state->head != Z_NULL && + state->head->name != Z_NULL && + state->length < state->head->name_max) + state->head->name[state->length++] = len; } while (len && copy < have); ! if (state->flags & 0x0200) state->check = crc32(state->check, next, copy); have -= copy; *************** *** 669,672 **** --- 717,723 ---- if (len) goto inf_leave; } + else if (state->head != Z_NULL) + state->head->name = Z_NULL; + state->length = 0; state->mode = COMMENT; case COMMENT: *************** *** 676,681 **** do { len = (unsigned)(next[copy++]); } while (len && copy < have); ! if (state->flags & 0x02000) state->check = crc32(state->check, next, copy); have -= copy; --- 727,736 ---- do { len = (unsigned)(next[copy++]); + if (state->head != Z_NULL && + state->head->comment != Z_NULL && + state->length < state->head->comm_max) + state->head->comment[state->length++] = len; } while (len && copy < have); ! if (state->flags & 0x0200) state->check = crc32(state->check, next, copy); have -= copy; *************** *** 683,686 **** --- 738,743 ---- if (len) goto inf_leave; } + else if (state->head != Z_NULL) + state->head->comment = Z_NULL; state->mode = HCRC; case HCRC: *************** *** 694,697 **** --- 751,758 ---- INITBITS(); } + if (state->head != Z_NULL) { + state->head->hcrc = (int)((state->flags >> 9) & 1); + state->head->done = 1; + } strm->adler = state->check = crc32(0L, Z_NULL, 0); state->mode = TYPE; *************** *** 862,865 **** --- 923,929 ---- } + /* handle error breaks in while */ + if (state->mode == BAD) break; + /* build code tables */ state->next = state->codes; *************** *** 966,969 **** --- 1030,1040 ---- DROPBITS(state->extra); } + #ifdef INFLATE_STRICT + if (state->offset > state->dmax) { + strm->msg = (char *)"invalid distance too far back"; + state->mode = BAD; + break; + } + #endif if (state->offset > state->whave + out - left) { strm->msg = (char *)"invalid distance too far back"; *************** *** 1107,1116 **** if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; state = (struct inflate_state FAR *)strm->state; ! if (state->mode != DICT) return Z_STREAM_ERROR; /* check for correct dictionary id */ ! id = adler32(0L, Z_NULL, 0); ! id = adler32(id, dictionary, dictLength); ! if (id != state->check) return Z_DATA_ERROR; /* copy dictionary to window */ --- 1178,1191 ---- if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; state = (struct inflate_state FAR *)strm->state; ! if (state->wrap != 0 && state->mode != DICT) ! return Z_STREAM_ERROR; /* check for correct dictionary id */ ! if (state->mode == DICT) { ! id = adler32(0L, Z_NULL, 0); ! id = adler32(id, dictionary, dictLength); ! if (id != state->check) ! return Z_DATA_ERROR; ! } /* copy dictionary to window */ *************** *** 1134,1137 **** --- 1209,1229 ---- } + int ZEXPORT inflateGetHeader(strm, head) + z_streamp strm; + gz_headerp head; + { + struct inflate_state FAR *state; + + /* check state */ + if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + state = (struct inflate_state FAR *)strm->state; + if ((state->wrap & 2) == 0) return Z_STREAM_ERROR; + + /* save header structure */ + state->head = head; + head->done = 0; + return Z_OK; + } + /* Search buf[0..len-1] for the pattern: 0, 0, 0xff, 0xff. Return when found *************** *** 1236,1239 **** --- 1328,1332 ---- struct inflate_state FAR *copy; unsigned char FAR *window; + unsigned wsize; /* check input */ *************** *** 1258,1270 **** /* copy state */ ! *dest = *source; ! *copy = *state; ! copy->lencode = copy->codes + (state->lencode - state->codes); ! copy->distcode = copy->codes + (state->distcode - state->codes); copy->next = copy->codes + (state->next - state->codes); ! if (window != Z_NULL) ! zmemcpy(window, state->window, 1U << state->wbits); copy->window = window; ! dest->state = (voidpf)copy; return Z_OK; } --- 1351,1368 ---- /* copy state */ ! zmemcpy(dest, source, sizeof(z_stream)); ! zmemcpy(copy, state, sizeof(struct inflate_state)); ! if (state->lencode >= state->codes && ! state->lencode <= state->codes + ENOUGH - 1) { ! copy->lencode = copy->codes + (state->lencode - state->codes); ! copy->distcode = copy->codes + (state->distcode - state->codes); ! } copy->next = copy->codes + (state->next - state->codes); ! if (window != Z_NULL) { ! wsize = 1U << state->wbits; ! zmemcpy(window, state->window, wsize); ! } copy->window = window; ! dest->state = (struct internal_state FAR *)copy; return Z_OK; } Index: minigzip.c =================================================================== RCS file: /cvsroot/solidircd/solidircd-stable/zlib/minigzip.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** minigzip.c 27 Jun 2005 03:02:43 -0000 1.1.1.1 --- minigzip.c 10 Apr 2007 20:13:08 -0000 1.2 *************** *** 1,4 **** /* minigzip.c -- simulate gzip using the zlib compression library ! * Copyright (C) 1995-2002 Jean-loup Gailly. * For conditions of distribution and use, see copyright notice in zlib.h */ --- 1,4 ---- /* minigzip.c -- simulate gzip using the zlib compression library ! * Copyright (C) 1995-2005 Jean-loup Gailly. * For conditions of distribution and use, see copyright notice in zlib.h */ *************** *** 22,27 **** # include <string.h> # include <stdlib.h> - #else - extern void exit OF((int)); #endif --- 22,25 ---- *************** *** 298,301 **** --- 296,301 ---- argc--, argv++; } + if (outmode[3] == ' ') + outmode[3] = 0; if (argc == 0) { SET_BINARY_MODE(stdin); Index: FAQ =================================================================== RCS file: /cvsroot/solidircd/solidircd-stable/zlib/FAQ,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** FAQ 27 Jun 2005 03:02:41 -0000 1.1.1.1 --- FAQ 10 Apr 2007 20:13:08 -0000 1.2 *************** *** 314,315 **** --- 314,334 ---- No. Go away. Shoo. + 1, most notably Microsoft. So even though the + "deflate" transfer encoding using the zlib format would be the more + efficient approach (and in fact exactly what the zlib format was designed + for), using the "gzip" transfer encoding is probably more reliable due to + an unfortunate choice of name on the part of the HTTP 1.1 authors. + + Bottom line: use the gzip format for HTTP 1.1 encoding. + + 40. Does zlib support the new "Deflate64" format introduced by PKWare? + + No. PKWare has apparently decided to keep that format proprietary, since + they have not documented it as they have previous compression formats. + In any case, the compression improvements are so modest compared to other + more modern approaches, that it's not worth the effort to implement. + + 41. Can you please sign these lengthy legal documents and fax them back to us + so that we can use your software in our product? + + No. Go away. Shoo. Index: configure =================================================================== RCS file: /cvsroot/solidircd/solidircd-stable/zlib/configure,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** configure 27 Jun 2005 03:02:49 -0000 1.1.1.1 --- configure 10 Apr 2007 20:13:08 -0000 1.2 *************** *** 444,445 **** --- 444,463 ---- /^LDFLAGS *=/s#=.*#=$LDFLAGS# " > Makefile + C *=/s#=.*#=$CC# + /^CFLAGS *=/s#=.*#=$CFLAGS# + /^CPP *=/s#=.*#=$CPP# + /^LDSHARED *=/s#=.*#=$LDSHARED# + /^LIBS *=/s#=.*#=$LIBS# + /^SHAREDLIB *=/s#=.*#=$SHAREDLIB# + /^SHAREDLIBV *=/s#=.*#=$SHAREDLIBV# + /^SHAREDLIBM *=/s#=.*#=$SHAREDLIBM# + /^AR *=/s#=.*#=$AR# + /^RANLIB *=/s#=.*#=$RANLIB# + /^EXE *=/s#=.*#=$EXE# + /^prefix *=/s#=.*#=$prefix# + /^exec_prefix *=/s#=.*#=$exec_prefix# + /^libdir *=/s#=.*#=$libdir# + /^includedir *=/s#=.*#=$includedir# + /^mandir *=/s#=.*#=$mandir# + /^LDFLAGS *=/s#=.*#=$LDFLAGS# + " > Makefile Index: zlib.h =================================================================== RCS file: /cvsroot/solidircd/solidircd-stable/zlib/zlib.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** zlib.h 27 Jun 2005 03:02:42 -0000 1.1.1.1 --- zlib.h 10 Apr 2007 20:13:08 -0000 1.2 *************** *** 1,6 **** /* zlib.h -- interface of the 'zlib' general purpose compression library ! version 1.2.1, November 17th, 2003 ! Copyright (C) 1995-2003 Jean-loup Gailly and Mark Adler This software is provided 'as-is', without any express or implied --- 1,6 ---- /* zlib.h -- interface of the 'zlib' general purpose compression library ! version 1.2.3, July 18th, 2005 ! Copyright (C) 1995-2005 Jean-loup Gailly and Mark Adler This software is provided 'as-is', without any express or implied *************** *** 38,43 **** #endif ! #define ZLIB_VERSION "1.2.1" ! #define ZLIB_VERNUM 0x1210 /* --- 38,43 ---- #endif ! #define ZLIB_VERSION "1.2.3" ! #define ZLIB_VERNUM 0x1230 /* *************** *** 54,60 **** (providing more output space) before each call. ! The compressed data format used by the in-memory functions is the zlib ! format, which is a zlib wrapper documented in RFC 1950, wrapped around a ! deflate stream, which is itself documented in RFC 1951. The library also supports reading and writing files in gzip (.gz) format --- 54,60 ---- (providing more output space) before each call. ! The compressed data format used by default by the in-memory functions is ! the zlib format, which is a zlib wrapper documented in RFC 1950, wrapped ! around a deflate stream, which is itself documented in RFC 1951. The library also supports reading and writing files in gzip (.gz) format *************** *** 63,66 **** --- 63,68 ---- gzip wrapper, documented in RFC 1952, wrapped around a deflate stream. + This library can optionally read and write gzip streams in memory as well. + The zlib format was designed to be compact and fast for use in memory and on communications channels. The gzip format was designed for single- *************** *** 68,75 **** directory information, and uses a different, slower check method than zlib. - This library does not provide any functions to write gzip files in memory. - However such functions could be easily written using zlib's deflate function, - the documentation in the gzip RFC, and the examples in gzio.c. - The library does not install any signal handler. The decoder checks the consistency of the compressed data, so the library should never --- 70,73 ---- *************** *** 98,102 **** voidpf opaque; /* private data object passed to zalloc and zfree */ ! int data_type; /* best guess about the data type: ascii or binary */ uLong adler; /* adler32 value of the uncompressed data */ uLong reserved; /* reserved for future use */ --- 96,100 ---- voidpf opaque; /* private data object passed to zalloc and zfree */ ! int data_type; /* best guess about the data type: binary or text */ uLong adler; /* adler32 value of the uncompressed data */ uLong reserved; /* reserved for future use */ *************** *** 106,109 **** --- 104,130 ---- /* + gzip header information passed to and from zlib routines. See RFC 1952 + for more details on the meanings of these fields. + */ + typedef struct gz_header_s { + int text; /* true if compressed data believed to be text */ + uLong time; /* modification time */ + int xflags; /* extra flags (not used when writing a gzip file) */ + int os; /* operating system */ + Bytef *extra; /* pointer to extra field or Z_NULL if none */ + uInt extra_len; /* extra field length (valid if extra != Z_NULL) */ + uInt extra_max; /* space at extra (only when reading header) */ + Bytef *name; /* pointer to zero-terminated file name or Z_NULL */ + uInt name_max; /* space at name (only when reading header) */ + Bytef *comment; /* pointer to zero-terminated comment or Z_NULL */ + uInt comm_max; /* space at comment (only when reading header) */ + int hcrc; /* true if there was or will be a header crc */ + int done; /* true when done reading gzip header (not used + when writing a gzip file) */ + } gz_header; + + typedef gz_header FAR *gz_headerp; + + /* The application must update next_in and avail_in when avail_in has dropped to zero. It must update next_out and avail_out when avail_out *************** *** 169,177 **** #define Z_HUFFMAN_ONLY 2 #define Z_RLE 3 #define Z_DEFAULT_STRATEGY 0 /* compression strategy; see deflateInit2() below for details */ #define Z_BINARY 0 ! #define Z_ASCII 1 #define Z_UNKNOWN 2 /* Possible values of the data_type field (though see inflate()) */ --- 190,200 ---- #define Z_HUFFMAN_ONLY 2 #define Z_RLE 3 + #define Z_FIXED 4 #define Z_DEFAULT_STRATEGY 0 /* compression strategy; see deflateInit2() below for details */ #define Z_BINARY 0 ! #define Z_TEXT 1 ! #define Z_ASCII Z_TEXT /* for compatibility with 1.2.2 and earlier */ #define Z_UNKNOWN 2 /* Possible values of the data_type field (though see inflate()) */ *************** *** 247,250 **** --- 270,277 ---- output buffer because there might be more output pending. + Normally the parameter flush is set to Z_NO_FLUSH, which allows deflate to + decide how much data to accumualte before producing output, in order to + maximize compression. + If the parameter flush is set to Z_SYNC_FLUSH, all pending output is flushed to the output buffer and the output is aligned on a byte boundary, so *************** *** 258,262 **** restart from this point if previous compressed data has been damaged or if random access is desired. Using Z_FULL_FLUSH too often can seriously degrade ! the compression. If deflate returns with avail_out == 0, this function must be called again --- 285,289 ---- restart from this point if previous compressed data has been damaged or if random access is desired. Using Z_FULL_FLUSH too often can seriously degrade ! compression. If deflate returns with avail_out == 0, this function must be called again *************** *** 283,288 **** so far (that is, total_in bytes). ! deflate() may update data_type if it can make a good guess about ! the input data type (Z_ASCII or Z_BINARY). In doubt, the data is considered binary. This field is only for information purposes and does not affect the compression algorithm in any manner. --- 310,315 ---- so far (that is, total_in bytes). ! deflate() may update strm->data_type if it can make a good guess about ! the input data type (Z_BINARY or Z_TEXT). In doubt, the data is considered binary. This field is only for information purposes and does not affect the compression algorithm in any manner. *************** *** 366,374 **** Z_FINISH, or Z_BLOCK. Z_SYNC_FLUSH requests that inflate() flush as much output as possible to the output buffer. Z_BLOCK requests that inflate() stop ! if and when it get to the next deflate block boundary. When decoding the zlib ! or gzip format, this will cause inflate() to return immediately after the ! header and before the first block. When doing a raw inflate, inflate() will ! go ahead and process the first block, and will return when it gets to the end ! of that block, or when it runs out of data. The Z_BLOCK option assists in appending to or combining deflate streams. --- 393,401 ---- Z_FINISH, or Z_BLOCK. Z_SYNC_FLUSH requests that inflate() flush as much output as possible to the output buffer. Z_BLOCK requests that inflate() stop ! if and when it gets to the next deflate block boundary. When decoding the ! zlib or gzip format, this will cause inflate() to return immediately after ! the header and before the first block. When doing a raw inflate, inflate() ! will go ahead and process the first block, and will return when it gets to ! the end of that block, or when it runs out of data. The Z_BLOCK option assists in appending to or combining deflate streams. *************** *** 402,406 **** If a preset dictionary is needed after this call (see inflateSetDictionary ! below), inflate sets strm-adler to the adler32 checksum of the dictionary chosen by the compressor and returns Z_NEED_DICT; otherwise it sets strm->adler to the adler32 checksum of all output produced so far (that is, --- 429,433 ---- If a preset dictionary is needed after this call (see inflateSetDictionary ! below), inflate sets strm->adler to the adler32 checksum of the dictionary chosen by the compressor and returns Z_NEED_DICT; otherwise it sets strm->adler to the adler32 checksum of all output produced so far (that is, *************** *** 479,483 **** compressed data instead of a zlib wrapper. The gzip header will have no file name, no extra data, no comment, no modification time (set to zero), ! no header crc, and the operating system will be set to 255 (unknown). The memLevel parameter specifies how much memory should be allocated --- 506,511 ---- compressed data instead of a zlib wrapper. The gzip header will have no file name, no extra data, no comment, no modification time (set to zero), ! no header crc, and the operating system will be set to 255 (unknown). If a ! gzip stream is being written, strm->adler is a crc32 instead of an adler32. The memLevel parameter specifies how much memory should be allocated *************** *** 498,502 **** Z_HUFFMAN_ONLY, but give better compression for PNG image data. The strategy parameter only affects the compression ratio but not the correctness of the ! compressed output even if it is not set appropriately. deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough --- 526,532 ---- Z_HUFFMAN_ONLY, but give better compression for PNG image data. The strategy parameter only affects the compression ratio but not the correctness of the ! compressed output even if it is not set appropriately. Z_FIXED prevents the ! use of dynamic Huffman codes, allowing for a simpler decoder for special ! applications. deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough *************** *** 527,531 **** discarded, for example if the dictionary is larger than the window size in deflate or deflate2. Thus the strings most likely to be useful should be ! put at the end of the dictionary, not at the front. Upon return of this function, strm->adler is set to the adler32 value --- 557,563 ---- discarded, for example if the dictionary is larger than the window size in deflate or deflate2. Thus the strings most likely to be useful should be ! put at the end of the dictionary, not at the front. In addition, the ! current implementation of deflate will use at most the window size minus ! 262 bytes of the provided dictionary. Upon return of this function, strm->adler is set to the adler32 value *************** *** 593,596 **** --- 625,645 ---- */ + ZEXTERN int ZEXPORT deflateTune OF((z_streamp strm, + int good_length, + int max_lazy, + int nice_length, + int max_chain)); + /* + Fine tune deflate's internal compression parameters. This should only be + used by someone who understands the algorithm used by zlib's deflate for + searching for the best matching string, and even then only by the most + fanatic optimizer trying to squeeze out the last compressed bit for their + specific input data. Read the deflate.c source code for the meaning of the + max_lazy, good_length, nice_length, and max_chain parameters. + + deflateTune() can be called after deflateInit() or deflateInit2(), and + returns Z_OK on success, or Z_STREAM_ERROR for an invalid deflate stream. + */ + ZEXTERN uLong ZEXPORT deflateBound OF((z_streamp strm, uLong sourceLen)); *************** *** 618,621 **** --- 667,694 ---- */ + ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm, + gz_headerp head)); + /* + deflateSetHeader() provides gzip header information for when a gzip + stream is requested by deflateInit2(). deflateSetHeader() may be called + after deflateInit2() or deflateReset() and before the first call of + deflate(). The text, time, os, extra field, name, and comment information + in the provided gz_header structure are written to the gzip header (xflag is + ignored -- the extra flags are set according to the compression level). The + caller must assure that, if not Z_NULL, name and comment are terminated with + a zero byte, and that if extra is not Z_NULL, that extra_len bytes are + available there. If hcrc is true, a gzip header crc is included. Note that + the current versions of the command-line version of gzip (up through version + 1.3.x) do not support header crc's, and will report that it is a "multi-part + gzip file" and give up. + + If deflateSetHeader is not used, the default gzip header has text false, + the time set to zero, and os set to 255, with no extra, name, or comment + fields. The gzip header is returned to the default state by deflateReset(). + + deflateSetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source + stream state was inconsistent. + */ + /* ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm, *************** *** 650,661 **** 32 to windowBits to enable zlib and gzip decoding with automatic header detection, or add 16 to decode only the gzip format (the zlib format will ! return a Z_DATA_ERROR). inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough ! memory, Z_STREAM_ERROR if a parameter is invalid (such as a negative ! memLevel). msg is set to null if there is no error message. inflateInit2 ! does not perform any decompression apart from reading the zlib header if ! present: this will be done by inflate(). (So next_in and avail_in may be ! modified, but next_out and avail_out are unchanged.) */ --- 723,735 ---- 32 to windowBits to enable zlib and gzip decoding with automatic header detection, or add 16 to decode only the gzip format (the zlib format will ! return a Z_DATA_ERROR). If a gzip stream is being decoded, strm->adler is ! a crc32 instead of an adler32. inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not enough ! memory, Z_STREAM_ERROR if a parameter is invalid (such as a null strm). msg ! is set to null if there is no error message. inflateInit2 does not perform ! any decompression apart from reading the zlib header if present: this will ! be done by inflate(). (So next_in and avail_in may be modified, but next_out ! and avail_out are unchanged.) */ *************** *** 665,673 **** /* Initializes the decompression dictionary from the given uncompressed byte ! sequence. This function must be called immediately after a call of inflate ! if this call returned Z_NEED_DICT. The dictionary chosen by the compressor ! can be determined from the adler32 value returned by this call of ! inflate. The compressor and decompressor must use exactly the same ! dictionary (see deflateSetDictionary). inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a --- 739,750 ---- /* Initializes the decompression dictionary from the given uncompressed byte ! sequence. This function must be called immediately after a call of inflate, ! if that call returned Z_NEED_DICT. The dictionary chosen by the compressor ! can be determined from the adler32 value returned by that call of inflate. ! The compressor and decompressor must use exactly the same dictionary (see ! deflateSetDictionary). For raw inflate, this function can be called ! immediately after inflateInit2() or inflateReset() and before any call of ! inflate() to set the dictionary. The application must insure that the ! dictionary that was used for compression is provided. inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a *************** *** 720,725 **** */ /* ! ZEXTERN int ZEXPORT inflateBackInit OF((z_stream FAR *strm, int windowBits, unsigned char FAR *window)); --- 797,858 ---- */ + ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm, + int bits, + int value)); /* ! This function inserts bits in the inflate input stream. The intent is ! that this function is used to start inflating at a bit position in the ! middle of a byte. The provided bits will be used before any bytes are used ! from next_in. This function should only be used with raw inflate, and ! should be used before the first inflate() call after inflateInit2() or ! inflateReset(). bits must be less than or equal to 16, and that many of the ! least significant bits of value will be inserted in the input. ! ! inflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source ! stream state was inconsistent. ! */ ! ! ZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm, ! gz_headerp head)); ! /* ! inflateGetHeader() requests that gzip header information be stored in the ! provided gz_header structure. inflateGetHeader() may be called after ! inflateInit2() or inflateReset(), and before the first call of inflate(). ! As inflate() processes the gzip stream, head->done is zero until the header ! is completed, at which time head->done is set to one. If a zlib stream is ! being decoded, then head->done is set to -1 to indicate that there will be ! no gzip header information forthcoming. Note that Z_BLOCK can be used to ! force inflate() to return immediately after header processing is complete ! and before any actual data is decompressed. ! ! The text, time, xflags, and os fields are filled in with the gzip header ! contents. hcrc is set to true if there is a header CRC. (The header CRC ! was valid if done is set to one.) If extra is not Z_NULL, then extra_max ! contains the maximum number of bytes to write to extra. Once done is true, ! extra_len contains the actual extra field length, and extra contains the ! extra field, or that field truncated if extra_max is less than extra_len. ! If name is not Z_NULL, then up to name_max characters are written there, ! terminated with a zero unless the length is greater than name_max. If ! comment is not Z_NULL, then up to comm_max characters are written there, ! terminated with a zero unless the length is greater than comm_max. When ! any of extra, name, or comment are not Z_NULL and the respective field is ! not present in the header, then that field is set to Z_NULL to signal its ! absence. This allows the use of deflateSetHeader() with the returned ! structure to duplicate the header. However if those fields are set to ! allocated memory, then the application will need to save those pointers ! elsewhere so that they can be eventually freed. ! ! If inflateGetHeader is not used, then the header information is simply ! discarded. The header is always checked for validity, including the header ! CRC if present. inflateReset() will reset the process to discard the header ! information. The application would need to call inflateGetHeader() again to ! retrieve the header from the next gzip stream. ! ! inflateGetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source ! stream state was inconsistent. ! */ ! ! /* ! ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits, unsigned char FAR *window)); *************** *** 745,749 **** typedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned)); ! ZEXTERN int ZEXPORT inflateBack OF((z_stream FAR *strm, in_func in, void FAR *in_desc, out_func out, void FAR *out_desc)); --- 878,882 ---- typedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned)); ! ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm, in_func in, void FAR *in_desc, out_func out, void FAR *out_desc)); *************** *** 814,818 **** */ ! ZEXTERN int ZEXPORT inflateBackEnd OF((z_stream FAR *strm)); /* All memory allocated by inflateBackInit() is freed. --- 947,951 ---- */ ! ZEXTERN int ZEXPORT inflateBackEnd OF((z_streamp strm)); /* All memory allocated by inflateBackInit() is freed. *************** *** 1088,1091 **** --- 1221,1230 ---- */ + ZEXTERN int ZEXPORT gzdirect OF((gzFile file)); + /* + Returns 1 if file is being read directly without decompression, otherwise + zero. + */ + ZEXTERN int ZEXPORT gzclose OF((gzFile file)); /* *************** *** 1120,1124 **** ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len)); - /* Update a running Adler-32 checksum with the bytes buf[0..len-1] and --- 1259,1262 ---- *************** *** 1136,1145 **** */ ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len)); /* ! Update a running crc with the bytes buf[0..len-1] and return the updated ! crc. If buf is NULL, this function returns the required initial value ! for the crc. Pre- and post-conditioning (one's complement) is performed ! within this function so it shouldn't be done by the application. Usage example: --- 1274,1292 ---- */ + ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2, + z_off_t len2)); + /* + Combine two Adler-32 checksums into one. For two sequences of bytes, seq1 + and seq2 with lengths len1 and len2, Adler-32 checksums were calculated for + each, adler1 and adler2. adler32_combine() returns the Adler-32 checksum of + seq1 and seq2 concatenated, requiring only adler1, adler2, and len2. + */ + ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len)); /* ! Update a running CRC-32 with the bytes buf[0..len-1] and return the ! updated CRC-32. If buf is NULL, this function returns the required initial ! value for the for the crc. Pre- and post-conditioning (one's complement) is ! performed within this function so it shouldn't be done by the application. Usage example: *************** *** 1152,1155 **** --- 1299,1312 ---- */ + ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len2)); + + /* + Combine two CRC-32 check values into one. For two sequences of bytes, + seq1 and seq2 with lengths len1 and len2, CRC-32 check values were + calculated for each, crc1 and crc2. crc32_combine() returns the CRC-32 + check value of seq1 and seq2 concatenated, requiring only crc1, crc2, and + len2. + */ + /* various hacks, don't look :) */ *************** *** 1168,1172 **** ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits, const char *version, int stream_size)); ! ZEXTERN int ZEXPORT inflateBackInit_ OF((z_stream FAR *strm, int windowBits, unsigned char FAR *window, const char *version, --- 1325,1329 ---- ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits, const char *version, int stream_size)); ! ZEXTERN int ZEXPORT inflateBackInit_ OF((z_streamp strm, int windowBits, unsigned char FAR *window, const char *version, *************** *** 1190,1194 **** #endif ! ZEXTERN const char * ZEXPORT zError OF((int err)); ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp z)); ZEXTERN const uLongf * ZEXPORT get_crc_table OF((void)); --- 1347,1351 ---- #endif ! ZEXTERN const char * ZEXPORT zError OF((int)); ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp z)); ZEXTERN const uLongf * ZEXPORT get_crc_table OF((void)); Index: INDEX =================================================================== RCS file: /cvsroot/solidircd/solidircd-stable/zlib/INDEX,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** INDEX 27 Jun 2005 03:02:45 -0000 1.1.1.1 --- INDEX 10 Apr 2007 20:13:08 -0000 1.2 *************** *** 47,48 **** --- 47,54 ---- unsupported contribution by third parties See contrib/README.contrib + source files for sample programs: + example.c + minigzip.c + + unsupported contribution by third parties + See contrib/README.contrib Index: inflate.h =================================================================== RCS file: /cvsroot/solidircd/solidircd-stable/zlib/inflate.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** inflate.h 27 Jun 2005 03:02:40 -0000 1.1.1.1 --- inflate.h 10 Apr 2007 20:13:08 -0000 1.2 *************** *** 1,4 **** /* inflate.h -- internal inflate state definition ! * Copyright (C) 1995-2003 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ --- 1,4 ---- /* inflate.h -- internal inflate state definition ! * Copyright (C) 1995-2004 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ *************** *** 20,24 **** typedef enum { HEAD, /* i: waiting for magic header */ - #ifdef GUNZIP FLAGS, /* i: waiting for method and flags (gzip) */ TIME, /* i: waiting for modification time (gzip) */ --- 20,23 ---- *************** *** 29,33 **** COMMENT, /* i: waiting for end of comment (gzip) */ HCRC, /* i: waiting for header crc (gzip) */ - #endif DICTID, /* i: waiting for dictionary check value */ DICT, /* waiting for inflateSetDictionary() call */ --- 28,31 ---- *************** *** 46,52 **** LIT, /* o: waiting for output space to write literal */ CHECK, /* i: waiting for 32-bit check value */ - #ifdef GUNZIP LENGTH, /* i: waiting for 32-bit length (gzip) */ - #endif DONE, /* finished check, done -- remain here until reset */ BAD, /* got a data error -- remain here until reset */ --- 44,48 ---- *************** *** 85,90 **** --- 81,88 ---- int havedict; /* true if dictionary provided */ int flags; /* gzip header method and flags (0 if zlib) */ + unsigned dmax; /* zlib header max distance (INFLATE_STRICT) */ unsigned long check; /* protected copy of check value */ unsigned long total; /* protected copy of output count */ + gz_headerp head; /* where to save gzip header information */ /* sliding window */ unsigned wbits; /* log base 2 of requested window size */ Index: inffast.c =================================================================== RCS file: /cvsroot/solidircd/solidircd-stable/zlib/inffast.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** inffast.c 27 Jun 2005 03:02:48 -0000 1.1.1.1 --- inffast.c 10 Apr 2007 20:13:08 -0000 1.2 *************** *** 1,4 **** /* inffast.c -- fast decoding ! * Copyright (C) 1995-2003 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ --- 1,4 ---- /* inffast.c -- fast decoding ! * Copyright (C) 1995-2004 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ *************** *** 20,24 **** No measurable difference: - Pentium III (Anderson) ! - 68060 (Nikl) */ #ifdef POSTINC --- 20,24 ---- No measurable difference: - Pentium III (Anderson) ! - M68060 (Nikl) */ #ifdef POSTINC *************** *** 75,78 **** --- 75,81 ---- unsigned char FAR *beg; /* inflate()'s initial strm->next_out */ unsigned char FAR *end; /* while out < end, enough space available */ + #ifdef INFLATE_STRICT + unsigned dmax; /* maximum distance from zlib header */ + #endif unsigned wsize; /* window size or zero if not using window */ unsigned whave; /* valid bytes in the window */ *************** *** 99,102 **** --- 102,108 ---- beg = out - (start - strm->avail_out); end = out + (strm->avail_out - 257); + #ifdef INFLATE_STRICT + dmax = state->dmax; + #endif wsize = state->wsize; whave = state->whave; *************** *** 168,171 **** --- 174,184 ---- } dist += (unsigned)hold & ((1U << op) - 1); + #ifdef INFLATE_STRICT + if (dist > dmax) { + strm->msg = (char *)"invalid distance too far back"; + state->mode = BAD; + break; + } + #endif hold >>= op; bits -= op; Index: inftrees.c =================================================================== RCS file: /cvsroot/solidircd/solidircd-stable/zlib/inftrees.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** inftrees.c 27 Jun 2005 03:02:39 -0000 1.1.1.1 --- inftrees.c 10 Apr 2007 20:13:08 -0000 1.2 *************** *** 1,4 **** /* inftrees.c -- generate Huffman trees for efficient decoding ! * Copyright (C) 1995-2003 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ --- 1,4 ---- /* inftrees.c -- generate Huffman trees for efficient decoding ! * Copyright (C) 1995-2005 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ *************** *** 10,14 **** const char inflate_copyright[] = ! " inflate 1.2.1 Copyright 1995-2003 Mark Adler "; /* If you use the zlib library in a product, an acknowledgment is welcome --- 10,14 ---- const char inflate_copyright[] = ! " inflate 1.2.3 Copyright 1995-2005 Mark Adler "; /* If you use the zlib library in a product, an acknowledgment is welcome *************** *** 63,67 **** static const unsigned short lext[31] = { /* Length codes 257..285 extra */ 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, ! 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 76, 66}; static const unsigned short dbase[32] = { /* Distance codes 0..29 base */ 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, --- 63,67 ---- static const unsigned short lext[31] = { /* Length codes 257..285 extra */ 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, ! 19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 201, 196}; static const unsigned short dbase[32] = { /* Distance codes 0..29 base */ 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, *************** *** 115,119 **** if (count[max] != 0) break; if (root > max) root = max; ! if (max == 0) return -1; /* no codes! */ for (min = 1; min <= MAXBITS; min++) if (count[min] != 0) break; --- 115,127 ---- if (count[max] != 0) break; if (root > max) root = max; ! if (max == 0) { /* no symbols to code at all */ ! this.op = (unsigned char)64; /* invalid code marker */ ! this.bits = (unsigned char)1; ! this.val = (unsigned short)0; ! *(*table)++ = this; /* make a table to force an error */ ! *(*table)++ = this; ! *bits = 1; ! return 0; /* no symbols, but wait for decoding to report error */ ! } for (min = 1; min <= MAXBITS; min++) if (count[min] != 0) break; *************** *** 127,131 **** if (left < 0) return -1; /* over-subscribed */ } ! if (left > 0 && (type == CODES || (codes - count[0] != 1))) return -1; /* incomplete set */ --- 135,139 ---- if (left < 0) return -1; /* over-subscribed */ } ! if (left > 0 && (type == CODES || max != 1)) return -1; /* incomplete set */ *************** *** 225,228 **** --- 233,237 ---- incr = 1U << (len - drop); fill = 1U << curr; + min = fill; /* save offset to next table */ do { fill -= incr; *************** *** 255,259 **** /* increment past last table */ ! next += 1U << curr; /* determine length of next table */ --- 264,268 ---- /* increment past last table */ ! next += min; /* here min is 1 << curr */ /* determine length of next table */ *************** *** 296,300 **** len = root; next = *table; - curr = root; this.bits = (unsigned char)len; } --- 305,308 ---- Index: gzio.c =================================================================== RCS file: /cvsroot/solidircd/solidircd-stable/zlib/gzio.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** gzio.c 27 Jun 2005 03:02:43 -0000 1.1.1.1 --- gzio.c 10 Apr 2007 20:13:08 -0000 1.2 *************** *** 1,4 **** /* gzio.c -- IO on .gz files ! * Copyright (C) 1995-2003 Jean-loup Gailly. * For conditions of distribution and use, see copyright notice in zlib.h * --- 1,4 ---- /* gzio.c -- IO on .gz files ! * Copyright (C) 1995-2005 Jean-loup Gailly. * For conditions of distribution and use, see copyright notice in zlib.h * *************** *** 12,16 **** #include "zutil.h" ! #ifdef NO_DEFLATE /* for compatiblity with old definition */ # define NO_GZCOMPRESS #endif --- 12,16 ---- #include "zutil.h" ! #ifdef NO_DEFLATE /* for compatibility with old definition */ # define NO_GZCOMPRESS #endif *************** *** 221,225 **** const char *mode; { ! char name[20]; if (fd < 0) return (gzFile)Z_NULL; --- 221,225 ---- const char *mode; { ! char name[46]; /* allow for up to 128-bit integers */ if (fd < 0) return (gzFile)Z_NULL; *************** *** 265,269 **** if (s->stream.avail_in == 0) { errno = 0; ! s->stream.avail_in = fread(s->inbuf, 1, Z_BUFSIZE, s->file); if (s->stream.avail_in == 0) { s->z_eof = 1; --- 265,269 ---- if (s->stream.avail_in == 0) { errno = 0; ! s->stream.avail_in = (uInt)fread(s->inbuf, 1, Z_BUFSIZE, s->file); if (s->stream.avail_in == 0) { s->z_eof = 1; *************** *** 301,305 **** if (len) s->inbuf[0] = s->stream.next_in[0]; errno = 0; ! len = fread(s->inbuf + len, 1, Z_BUFSIZE >> len, s->file); if (len == 0 && ferror(s->file)) s->z_err = Z_ERRNO; s->stream.avail_in += len; --- 301,305 ---- if (len) s->inbuf[0] = s->stream.next_in[0]; errno = 0; ! len = (uInt)fread(s->inbuf + len, 1, Z_BUFSIZE >> len, s->file); if (len == 0 && ferror(s->file)) s->z_err = Z_ERRNO; s->stream.avail_in += len; *************** *** 416,419 **** --- 416,420 ---- s->back = EOF; s->out++; + start++; if (s->last) { s->z_err = Z_STREAM_END; *************** *** 437,442 **** } if (s->stream.avail_out > 0) { ! s->stream.avail_out -= fread(next_out, 1, s->stream.avail_out, ! s->file); } len -= s->stream.avail_out; --- 438,443 ---- } if (s->stream.avail_out > 0) { ! s->stream.avail_out -= ! (uInt)fread(next_out, 1, s->stream.avail_out, s->file); } len -= s->stream.avail_out; *************** *** 449,453 **** errno = 0; ! s->stream.avail_in = fread(s->inbuf, 1, Z_BUFSIZE, s->file); if (s->stream.avail_in == 0) { s->z_eof = 1; --- 450,454 ---- errno = 0; ! s->stream.avail_in = (uInt)fread(s->inbuf, 1, Z_BUFSIZE, s->file); if (s->stream.avail_in == 0) { s->z_eof = 1; *************** *** 489,492 **** --- 490,496 ---- s->crc = crc32(s->crc, start, (uInt)(s->stream.next_out - start)); + if (len == s->stream.avail_out && + (s->z_err == Z_DATA_ERROR || s->z_err == Z_ERRNO)) + return -1; return (int)(len - s->stream.avail_out); } *************** *** 900,903 **** --- 904,919 ---- /* =========================================================================== + Returns 1 if reading and doing so transparently, otherwise zero. + */ + int ZEXPORT gzdirect (file) + gzFile file; + { + gz_stream *s = (gz_stream*)file; + + if (s == NULL || s->mode != 'r') return 0; + return s->transparent; + } + + /* =========================================================================== Outputs a long in LSB order to the given file */ *************** *** 938,942 **** gzFile file; { - int err; gz_stream *s = (gz_stream*)file; --- 954,957 ---- *************** *** 947,952 **** return Z_STREAM_ERROR; #else ! err = do_flush (file, Z_FINISH); ! if (err != Z_OK) return destroy((gz_stream*)file); putLong (s->file, s->crc); --- 962,967 ---- return Z_STREAM_ERROR; #else ! if (do_flush (file, Z_FINISH) != Z_OK) ! return destroy((gz_stream*)file); putLong (s->file, s->crc); *************** *** 957,964 **** } /* =========================================================================== ! Returns the error message for the last error which occured on the given compressed file. errnum is set to zlib error number. If an ! error occured in the file system and not in the compression library, errnum is set to Z_ERRNO and the application may consult errno to get the exact error code. --- 972,985 ---- } + #ifdef STDC + # define zstrerror(errnum) strerror(errnum) + #else + # define zstrerror(errnum) "" + #endif + /* =========================================================================== ! Returns the error message for the last error which occurred on the given compressed file. errnum is set to zlib error number. If an ! error occurred in the file system and not in the compression library, errnum is set to Z_ERRNO and the application may consult errno to get the exact error code. Index: zutil.h =================================================================== RCS file: /cvsroot/solidircd/solidircd-stable/zlib/zutil.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** zutil.h 27 Jun 2005 03:02:46 -0000 1.1.1.1 --- zutil.h 10 Apr 2007 20:13:08 -0000 1.2 *************** *** 1,4 **** /* zutil.h -- internal interface and configuration of the compression library ! * Copyright (C) 1995-2003 Jean-loup Gailly. * For conditions of distribution and use, see copyright notice in zlib.h */ --- 1,4 ---- /* zutil.h -- internal interface and configuration of the compression library ! * Copyright (C) 1995-2005 Jean-loup Gailly. * For conditions of distribution and use, see copyright notice in zlib.h */ *************** *** 18,29 **** #ifdef STDC ! # include <stddef.h> # include <string.h> # include <stdlib.h> #endif #ifdef NO_ERRNO_H extern int errno; #else ! # include <errno.h> #endif --- 18,41 ---- #ifdef STDC ! # ifndef _WIN32_WCE ! # include <stddef.h> ! # endif # include <string.h> # include <stdlib.h> #endif #ifdef NO_ERRNO_H + # ifdef _WIN32_WCE + /* The Microsoft C Run-Time Library for Windows CE doesn't have + * errno. We define it as a global variable to simplify porting. + * Its value is always 0 and should not be used. We rename it to + * avoid conflict with other libraries that use the same workaround. + */ + # define errno z_errno + # endif extern int errno; #else ! # ifndef _WIN32_WCE ! # include <errno.h> ! # endif #endif *************** *** 106,109 **** --- 118,124 ---- #ifdef OS2 # define OS_CODE 0x06 + # ifdef M_I86 + #include <malloc.h> + # endif #endif *************** *** 190,199 **** # endif #endif ! ! #ifdef HAVE_STRERROR ! extern char *strerror OF((int)); ! # define zstrerror(errnum) strerror(errnum) ! #else ! # define zstrerror(errnum) "" #endif --- 205,210 ---- # endif #endif ! #ifdef VMS ! # define NO_vsnprintf #endif Index: infback.c =================================================================== RCS file: /cvsroot/solidircd/solidircd-stable/zlib/infback.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** infback.c 27 Jun 2005 03:02:45 -0000 1.1.1.1 --- infback.c 10 Apr 2007 20:13:08 -0000 1.2 *************** *** 1,4 **** /* infback.c -- inflate using a call-back interface ! * Copyright (C) 1995-2003 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ --- 1,4 ---- /* infback.c -- inflate using a call-back interface ! * Copyright (C) 1995-2005 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ *************** *** 27,31 **** */ int ZEXPORT inflateBackInit_(strm, windowBits, window, version, stream_size) ! z_stream FAR *strm; int windowBits; unsigned char FAR *window; --- 27,31 ---- */ int ZEXPORT inflateBackInit_(strm, windowBits, window, version, stream_size) ! z_streamp strm; int windowBits; unsigned char FAR *window; *************** *** 51,55 **** if (state == Z_NULL) return Z_MEM_ERROR; Tracev((stderr, "inflate: allocated\n")); ! strm->state = (voidpf)state; state->wbits = windowBits; state->wsize = 1U << windowBits; --- 51,56 ---- if (state == Z_NULL) return Z_MEM_ERROR; Tracev((stderr, "inflate: allocated\n")); ! strm->state = (struct internal_state FAR *)state; ! state->dmax = 32768U; state->wbits = windowBits; state->wsize = 1U << windowBits; *************** *** 239,243 **** */ int ZEXPORT inflateBack(strm, in, in_desc, out, out_desc) ! z_stream FAR *strm; in_func in; void FAR *in_desc; --- 240,244 ---- */ int ZEXPORT inflateBack(strm, in, in_desc, out, out_desc) ! z_streamp strm; in_func in; void FAR *in_desc; *************** *** 435,438 **** --- 436,442 ---- } + /* handle error breaks in while */ + if (state->mode == BAD) break; + /* build code tables */ state->next = state->codes; *************** *** 609,613 **** int ZEXPORT inflateBackEnd(strm) ! z_stream FAR *strm; { if (strm == Z_NULL || strm->state == Z_NULL || strm->zfree == (free_func)0) --- 613,617 ---- int ZEXPORT inflateBackEnd(strm) ! z_streamp strm; { if (strm == Z_NULL || strm->state == Z_NULL || strm->zfree == (free_func)0) Index: deflate.c =================================================================== RCS file: /cvsroot/solidircd/solidircd-stable/zlib/deflate.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** deflate.c 27 Jun 2005 03:02:47 -0000 1.1.1.1 --- deflate.c 10 Apr 2007 20:13:08 -0000 1.2 *************** *** 1,4 **** /* deflate.c -- compress data using the deflation algorithm ! * Copyright (C) 1995-2003 Jean-loup Gailly. * For conditions of distribution and use, see copyright notice in zlib.h */ --- 1,4 ---- /* deflate.c -- compress data using the deflation algorithm ! * Copyright (C) 1995-2005... [truncated message content] |