Update of /cvsroot/opengtoolkit/lvzip/c_source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7024/c_source Modified Files: ChangeLog ChangeLogUnzip FAQ README adler32.c compress.c crc32.c crypt.h deflate.c deflate.h example.c gvmat32.asm gvmat32.obj gvmat32c.c gzio.c infback.c inffas32.asm inffas32.obj inffast.c inflate.c inflate.h inftrees.c inftrees.h ioapi.c ioapi.h iowin32.c iowin32.h minigzip.c miniunz.c minizip.c mztools.c trees.c unzip.c unzip.h zconf.h zconf.in.h zip.c zip.h zlib.3 zlib.h zlib.rc zutil.c zutil.h Log Message: Upgraded zlib and zip sources to version 1.2.3 of zlib. Index: inftrees.h =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/c_source/inftrees.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** inftrees.h 7 Dec 2004 22:52:50 -0000 1.2 --- inftrees.h 7 Jan 2006 20:06:23 -0000 1.3 *************** *** 1,4 **** /* inftrees.h -- header to use inftrees.c ! * Copyright (C) 1995-2003 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ --- 1,4 ---- /* inftrees.h -- header to use inftrees.c ! * Copyright (C) 1995-2005 Mark Adler * For conditions of distribution and use, see copyright notice in zlib.h */ *************** *** 37,46 **** /* Maximum size of dynamic tree. The maximum found in a long but non- ! exhaustive search was 1004 code structures (850 for length/literals ! and 154 for distances, the latter actually the result of an exhaustive search). The true maximum is not known, but the value below is more than safe. */ ! #define ENOUGH 1440 ! #define MAXD 154 /* Type of code to build for inftable() */ --- 37,46 ---- /* Maximum size of dynamic tree. The maximum found in a long but non- ! exhaustive search was 1444 code structures (852 for length/literals ! and 592 for distances, the latter actually the result of an exhaustive search). The true maximum is not known, but the value below is more than safe. */ ! #define ENOUGH 2048 ! #define MAXD 592 /* Type of code to build for inftable() */ Index: trees.c =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/c_source/trees.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** trees.c 8 Dec 2004 20:29:15 -0000 1.3 --- trees.c 7 Jan 2006 20:06:23 -0000 1.4 *************** *** 1,4 **** /* trees.c -- output deflated data using Huffman coding ! * Copyright (C) 1995-2003 Jean-loup Gailly * For conditions of distribution and use, see copyright notice in zlib.h */ --- 1,4 ---- /* trees.c -- output deflated data using Huffman coding ! * Copyright (C) 1995-2005 Jean-loup Gailly * For conditions of distribution and use, see copyright notice in zlib.h */ *************** *** 556,560 **** m = s->heap[--h]; if (m > max_code) continue; ! if (tree[m].Len != (unsigned) bits) { Trace((stderr,"code %d bits %d->%d\n", m, tree[m].Len, bits)); s->opt_len += ((long)bits - (long)tree[m].Len) --- 556,560 ---- m = s->heap[--h]; if (m > max_code) continue; ! if ((unsigned) tree[m].Len != (unsigned) bits) { Trace((stderr,"code %d bits %d->%d\n", m, tree[m].Len, bits)); s->opt_len += ((long)bits - (long)tree[m].Len) *************** *** 931,936 **** if (s->level > 0) { ! /* Check if the file is ascii or binary */ ! if (s->strm->data_type == Z_UNKNOWN) set_data_type(s); /* Construct the literal and distance trees */ --- 931,937 ---- if (s->level > 0) { ! /* Check if the file is binary or text */ ! if (stored_len > 0 && s->strm->data_type == Z_UNKNOWN) ! set_data_type(s); /* Construct the literal and distance trees */ *************** *** 983,987 **** } else if (static_lenb >= 0) { /* force static trees */ #else ! } else if (static_lenb == opt_lenb) { #endif send_bits(s, (STATIC_TREES<<1)+eof, 3); --- 984,988 ---- } else if (static_lenb >= 0) { /* force static trees */ #else ! } else if (s->strategy == Z_FIXED || static_lenb == opt_lenb) { #endif send_bits(s, (STATIC_TREES<<1)+eof, 3); *************** *** 1118,1136 **** /* =========================================================================== ! * Set the data type to ASCII or BINARY, using a crude approximation: ! * binary if more than 20% of the bytes are <= 6 or >= 128, ascii otherwise. ! * IN assertion: the fields freq of dyn_ltree are set and the total of all ! * frequencies does not exceed 64K (to fit in an int on 16 bit machines). */ local void set_data_type(s) deflate_state *s; { ! int n = 0; ! unsigned ascii_freq = 0; ! unsigned bin_freq = 0; ! while (n < 7) bin_freq += s->dyn_ltree[n++].Freq; ! while (n < 128) ascii_freq += s->dyn_ltree[n++].Freq; ! while (n < LITERALS) bin_freq += s->dyn_ltree[n++].Freq; ! s->strm->data_type = bin_freq > (ascii_freq >> 2) ? Z_BINARY : Z_ASCII; } --- 1119,1140 ---- /* =========================================================================== ! * Set the data type to BINARY or TEXT, using a crude approximation: ! * set it to Z_TEXT if all symbols are either printable characters (33 to 255) ! * or white spaces (9 to 13, or 32); or set it to Z_BINARY otherwise. ! * IN assertion: the fields Freq of dyn_ltree are set. */ local void set_data_type(s) deflate_state *s; { ! int n; ! ! for (n = 0; n < 9; n++) ! if (s->dyn_ltree[n].Freq != 0) ! break; ! if (n == 9) ! for (n = 14; n < 32; n++) ! if (s->dyn_ltree[n].Freq != 0) ! break; ! s->strm->data_type = (n == 32) ? Z_TEXT : Z_BINARY; } Index: inffast.c =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/c_source/inffast.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** inffast.c 8 Dec 2004 20:23:39 -0000 1.3 --- inffast.c 7 Jan 2006 20:06:23 -0000 1.4 *************** *** 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/opengtoolkit/lvzip/c_source/inftrees.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** inftrees.c 8 Dec 2004 20:23:39 -0000 1.3 --- inftrees.c 7 Jan 2006 20:06:23 -0000 1.4 *************** *** 1,4 **** /* inftrees.c -- generate Huffman trees for efficient decoding ! * Copyright (C) 1995-2004 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.2 Copyright 1995-2004 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, 199, 198}; 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, *************** *** 135,139 **** 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 */ *************** *** 233,236 **** --- 233,237 ---- incr = 1U << (len - drop); fill = 1U << curr; + min = fill; /* save offset to next table */ do { fill -= incr; *************** *** 263,267 **** /* 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 */ Index: unzip.c =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/c_source/unzip.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** unzip.c 8 Dec 2004 20:29:15 -0000 1.4 --- unzip.c 7 Jan 2006 20:06:23 -0000 1.5 *************** *** 1,6 **** /* unzip.c -- IO for uncompress .zip files using zlib ! Version 1.01d, September 22th, 2004 ! Copyright (C) 1998-2004 Gilles Vollant Read unzip.h for more info --- 1,6 ---- /* unzip.c -- IO for uncompress .zip files using zlib ! Version 1.01e, February 12th, 2005 ! Copyright (C) 1998-2005 Gilles Vollant Read unzip.h for more info *************** *** 1138,1142 **** --- 1138,1145 ---- pfile_in_zip_read_info->stream_initialised=1; else + { + TRYFREE(pfile_in_zip_read_info); return err; + } /* windowBits is passed < 0 to tell that there is no zlib header. * Note that in this case inflate *requires* an extra "dummy" byte Index: crypt.h =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/c_source/crypt.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** crypt.h 8 Dec 2004 20:23:39 -0000 1.2 --- crypt.h 7 Jan 2006 20:06:22 -0000 1.3 *************** *** 2,8 **** ! Version 1.01, May 8th, 2004 ! Copyright (C) 1998-2004 Gilles Vollant This code is a modified version of crypting code in Infozip distribution --- 2,8 ---- ! Version 1.01e, February 12th, 2005 ! Copyright (C) 1998-2005 Gilles Vollant This code is a modified version of crypting code in Infozip distribution Index: mztools.c =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/c_source/mztools.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** mztools.c 25 Dec 2004 16:29:44 -0000 1.1 --- mztools.c 7 Jan 2006 20:06:23 -0000 1.2 *************** *** 249,253 **** int nRead; char buffer[8192]; ! while ( (nRead = fread(buffer, 1, sizeof(buffer), fpOutCD)) > 0) { if ((int)fwrite(buffer, 1, nRead, fpOut) != nRead) { err = Z_ERRNO; --- 249,253 ---- int nRead; char buffer[8192]; ! while ( (nRead = (int)fread(buffer, 1, sizeof(buffer), fpOutCD)) > 0) { if ((int)fwrite(buffer, 1, nRead, fpOut) != nRead) { err = Z_ERRNO; Index: zutil.h =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/c_source/zutil.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** zutil.h 8 Dec 2004 20:29:15 -0000 1.3 --- zutil.h 7 Jan 2006 20:06:23 -0000 1.4 *************** *** 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 *************** *** 194,206 **** #endif - #ifdef HAVE_STRERROR - # ifndef VMS - extern char *strerror OF((int)); - # endif - # define zstrerror(errnum) strerror(errnum) - #else - # define zstrerror(errnum) "" - #endif - #if defined(pyr) # define NO_MEMCPY --- 209,212 ---- Index: infback.c =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/c_source/infback.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** infback.c 8 Dec 2004 20:23:39 -0000 1.2 --- infback.c 7 Jan 2006 20:06:22 -0000 1.3 *************** *** 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; *************** *** 612,616 **** 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: zconf.in.h =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/c_source/zconf.in.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** zconf.in.h 8 Dec 2004 20:29:15 -0000 1.2 --- zconf.in.h 7 Jan 2006 20:06:23 -0000 1.3 *************** *** 1,4 **** /* zconf.h -- configuration of the zlib compression library ! * Copyright (C) 1995-2004 Jean-loup Gailly. * For conditions of distribution and use, see copyright notice in zlib.h */ --- 1,4 ---- /* zconf.h -- configuration of the zlib compression library ! * Copyright (C) 1995-2005 Jean-loup Gailly. * For conditions of distribution and use, see copyright notice in zlib.h */ *************** *** 44,47 **** --- 44,51 ---- # define zError z_zError + # define alloc_func z_alloc_func + # define free_func z_free_func + # define in_func z_in_func + # define out_func z_out_func # define Byte z_Byte # define uInt z_uInt *************** *** 65,70 **** # define WINDOWS #endif ! #if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32) ! # define WIN32 #endif #if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32) --- 69,76 ---- # define WINDOWS #endif ! #if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__) ! # ifndef WIN32 ! # define WIN32 ! # endif #endif #if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32) Index: zutil.c =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/c_source/zutil.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** zutil.c 8 Dec 2004 20:29:15 -0000 1.3 --- zutil.c 7 Jan 2006 20:06:23 -0000 1.4 *************** *** 1,4 **** /* zutil.c -- target dependent utility functions for 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.c -- target dependent utility functions for the compression library ! * Copyright (C) 1995-2005 Jean-loup Gailly. * For conditions of distribution and use, see copyright notice in zlib.h */ *************** *** 12,19 **** #endif - #ifndef STDC - extern void exit OF((int)); - #endif - const char * const z_errmsg[10] = { "need dictionary", /* Z_NEED_DICT 2 */ --- 12,15 ---- *************** *** 79,114 **** #endif #ifdef NO_GZCOMPRESS ! flags += 1 << 16; #endif #ifdef NO_GZIP ! flags += 1 << 17; #endif #ifdef PKZIP_BUG_WORKAROUND ! flags += 1 << 20; #endif #ifdef FASTEST ! flags += 1 << 21; #endif #ifdef STDC # ifdef NO_vsnprintf ! flags += 1 << 25; # ifdef HAS_vsprintf_void ! flags += 1 << 26; # endif # else # ifdef HAS_vsnprintf_void ! flags += 1 << 26; # endif # endif #else ! flags += 1 << 24; # ifdef NO_snprintf ! flags += 1 << 25; # ifdef HAS_sprintf_void ! flags += 1 << 26; # endif # else # ifdef HAS_snprintf_void ! flags += 1 << 26; # endif # endif --- 75,110 ---- #endif #ifdef NO_GZCOMPRESS ! flags += 1L << 16; #endif #ifdef NO_GZIP ! flags += 1L << 17; #endif #ifdef PKZIP_BUG_WORKAROUND ! flags += 1L << 20; #endif #ifdef FASTEST ! flags += 1L << 21; #endif #ifdef STDC # ifdef NO_vsnprintf ! flags += 1L << 25; # ifdef HAS_vsprintf_void ! flags += 1L << 26; # endif # else # ifdef HAS_vsnprintf_void ! flags += 1L << 26; # endif # endif #else ! flags += 1L << 24; # ifdef NO_snprintf ! flags += 1L << 25; # ifdef HAS_sprintf_void ! flags += 1L << 26; # endif # else # ifdef HAS_snprintf_void ! flags += 1L << 26; # endif # endif *************** *** 142,146 **** #if defined(_WIN32_WCE) ! /* does not exist on WCE */ int errno = 0; #endif --- 138,145 ---- #if defined(_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. ! */ int errno = 0; #endif Index: unzip.h =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/c_source/unzip.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** unzip.h 8 Dec 2004 20:29:15 -0000 1.4 --- unzip.h 7 Jan 2006 20:06:23 -0000 1.5 *************** *** 1,10 **** /* unzip.h -- IO for uncompress .zip files using zlib ! Version 1.01, May 8th, 2004 ! Copyright (C) 1998-2004 Gilles Vollant This unzip package allow extract file from .ZIP file, compatible with PKZip 2.04g WinZip, InfoZip tools and compatible. ! Encryption and multi volume ZipFile (span) are not supported. Old compressions used by old PKZip 1.x are not supported --- 1,12 ---- /* unzip.h -- IO for uncompress .zip files using zlib ! Version 1.01e, February 12th, 2005 ! Copyright (C) 1998-2005 Gilles Vollant This unzip package allow extract file from .ZIP file, compatible with PKZip 2.04g WinZip, InfoZip tools and compatible. ! ! Multi volume ZipFile (span) are not supported. ! Encryption compatible with pkzip 2.04g only supported Old compressions used by old PKZip 1.x are not supported Index: zlib.3 =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/c_source/zlib.3,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** zlib.3 8 Dec 2004 20:29:15 -0000 1.3 --- zlib.3 7 Jan 2006 20:06:23 -0000 1.4 *************** *** 1,3 **** ! .TH ZLIB 3 "3 October 2004" .SH NAME zlib \- compression/decompression library --- 1,3 ---- ! .TH ZLIB 3 "18 July 2005" .SH NAME zlib \- compression/decompression library *************** *** 134,139 **** or (for the Windows DLL version) to Gilles Vollant (in...@wi...). .SH AUTHORS ! Version 1.2.2 ! Copyright (C) 1995-2004 Jean-loup Gailly (jl...@gz...) and Mark Adler (ma...@al...). .LP --- 134,139 ---- or (for the Windows DLL version) to Gilles Vollant (in...@wi...). .SH AUTHORS ! Version 1.2.3 ! Copyright (C) 1995-2005 Jean-loup Gailly (jl...@gz...) and Mark Adler (ma...@al...). .LP Index: inflate.c =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/c_source/inflate.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** inflate.c 8 Dec 2004 20:23:39 -0000 1.3 --- inflate.c 7 Jan 2006 20:06:23 -0000 1.4 *************** *** 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 */ *************** *** 114,119 **** --- 114,122 ---- 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; *************** *** 123,126 **** --- 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; *************** *** 145,149 **** 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; *************** *** 583,586 **** --- 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 *************** *** 598,606 **** } 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); *************** *** 622,625 **** --- 645,650 ---- break; } + if (state->head != Z_NULL) + state->head->text = (int)((hold >> 8) & 1); if (state->flags & 0x0200) CRC2(state->check, hold); INITBITS(); *************** *** 627,630 **** --- 652,657 ---- case TIME: NEEDBITS(32); + if (state->head != Z_NULL) + state->head->time = hold; if (state->flags & 0x0200) CRC4(state->check, hold); INITBITS(); *************** *** 632,635 **** --- 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(); *************** *** 639,645 **** --- 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: *************** *** 648,651 **** --- 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); *************** *** 656,659 **** --- 698,702 ---- if (state->length) goto inf_leave; } + state->length = 0; state->mode = NAME; case NAME: *************** *** 663,668 **** 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; *************** *** 670,673 **** --- 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: *************** *** 677,682 **** 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; *************** *** 684,687 **** --- 738,743 ---- if (len) goto inf_leave; } + else if (state->head != Z_NULL) + state->head->comment = Z_NULL; state->mode = HCRC; case HCRC: *************** *** 695,698 **** --- 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; *************** *** 970,973 **** --- 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"; *************** *** 1111,1120 **** 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 */ *************** *** 1138,1141 **** --- 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 *************** *** 1240,1243 **** --- 1328,1332 ---- struct inflate_state FAR *copy; unsigned char FAR *window; + unsigned wsize; /* check input */ *************** *** 1262,1274 **** /* 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: zip.c =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/c_source/zip.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** zip.c 29 Dec 2004 01:52:40 -0000 1.6 --- zip.c 7 Jan 2006 20:06:23 -0000 1.7 *************** *** 1,9 **** /* zip.c -- IO on .zip files using zlib ! Version 1.01, May 8th, 2004 27 Dec 2004 Rolf Kalbermatter Modification to zipOpen2 to support globalComment retrieval. ! Copyright (C) 1998-2004 Gilles Vollant Read zip.h for more info --- 1,9 ---- /* zip.c -- IO on .zip files using zlib ! Version 1.01e, February 12th, 2005 27 Dec 2004 Rolf Kalbermatter Modification to zipOpen2 to support globalComment retrieval. ! Copyright (C) 1998-2005 Gilles Vollant Read zip.h for more info Index: iowin32.h =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/c_source/iowin32.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** iowin32.h 28 Dec 2004 17:31:52 -0000 1.4 --- iowin32.h 7 Jan 2006 20:06:23 -0000 1.5 *************** *** 3,9 **** This IO API version uses the Win32 API (for Microsoft Windows) ! Version 1.01, May 8th, 2004 ! Copyright (C) 1998-2004 Gilles Vollant */ --- 3,9 ---- This IO API version uses the Win32 API (for Microsoft Windows) ! Version 1.01e, February 12th, 2005 ! Copyright (C) 1998-2005 Gilles Vollant */ Index: inffas32.asm =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/c_source/inffas32.asm,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** inffas32.asm 29 Dec 2004 01:52:40 -0000 1.1 --- inffas32.asm 7 Jan 2006 20:06:22 -0000 1.2 *************** *** 1,2 **** --- 1,56 ---- + ;/* inffas32.asm is a hand tuned assembler version of inffast.c -- fast decoding + ; * + ; * inffas32.asm is derivated from inffas86.c, with translation of assembly code + ; * + ; * Copyright (C) 1995-2003 Mark Adler + ; * For conditions of distribution and use, see copyright notice in zlib.h + ; * + ; * Copyright (C) 2003 Chris Anderson <chr...@ch...> + ; * Please use the copyright conditions above. + ; * + ; * Mar-13-2003 -- Most of this is derived from inffast.S which is derived from + ; * the gcc -S output of zlib-1.2.0/inffast.c. Zlib-1.2.0 is in beta release at + ; * the moment. I have successfully compiled and tested this code with gcc2.96, + ; * gcc3.2, icc5.0, msvc6.0. It is very close to the speed of inffast.S + ; * compiled with gcc -DNO_MMX, but inffast.S is still faster on the P3 with MMX + ; * enabled. I will attempt to merge the MMX code into this version. Newer + ; * versions of this and inffast.S can be found at + ; * http://www.eetbeetee.com/zlib/ and http://www.charm.net/~christop/zlib/ + ; * + ; * 2005 : modification by Gilles Vollant + ; */ + ; For Visual C++ 4.x and higher and ML 6.x and higher + ; ml.exe is in directory \MASM611C of Win95 DDK + ; ml.exe is also distributed in http://www.masm32.com/masmdl.htm + ; and in VC++2003 toolkit at http://msdn.microsoft.com/visualc/vctoolkit2003/ + ; + ; + ; compile with command line option + ; ml /coff /Zi /c /Flinffas32.lst inffas32.asm + + ; if you define NO_GZIP (see inflate.h), compile with + ; ml /coff /Zi /c /Flinffas32.lst /DNO_GUNZIP inffas32.asm + + + ; zlib122sup is 0 fort zlib 1.2.2.1 and lower + ; zlib122sup is 8 fort zlib 1.2.2.2 and more (with addition of dmax and head + ; in inflate_state in inflate.h) + zlib1222sup equ 8 + + + IFDEF GUNZIP + INFLATE_MODE_TYPE equ 11 + INFLATE_MODE_BAD equ 26 + ELSE + IFNDEF NO_GUNZIP + INFLATE_MODE_TYPE equ 11 + INFLATE_MODE_BAD equ 26 + ELSE + INFLATE_MODE_TYPE equ 3 + INFLATE_MODE_BAD equ 17 + ENDIF + ENDIF + + ; 75 "inffast.S" ;FILE "inffast.S" *************** *** 85,99 **** - mode_state equ 0 ;/* state->mode */ ! wsize_state equ 32 ;/* state->wsize */ ! write_state equ (36+4) ;/* state->write */ ! window_state equ (40+4) ;/* state->window */ ! hold_state equ (44+4) ;/* state->hold */ ! bits_state equ (48+4) ;/* state->bits */ ! lencode_state equ (64+4) ;/* state->lencode */ ! distcode_state equ (68+4) ;/* state->distcode */ ! lenbits_state equ (72+4) ;/* state->lenbits */ ! distbits_state equ (76+4) ;/* state->distbits */ --- 139,152 ---- mode_state equ 0 ;/* state->mode */ ! wsize_state equ (32+zlib1222sup) ;/* state->wsize */ ! write_state equ (36+4+zlib1222sup) ;/* state->write */ ! window_state equ (40+4+zlib1222sup) ;/* state->window */ ! hold_state equ (44+4+zlib1222sup) ;/* state->hold */ ! bits_state equ (48+4+zlib1222sup) ;/* state->bits */ ! lencode_state equ (64+4+zlib1222sup) ;/* state->lencode */ ! distcode_state equ (68+4+zlib1222sup) ;/* state->distcode */ ! lenbits_state equ (72+4+zlib1222sup) ;/* state->lenbits */ ! distbits_state equ (76+4+zlib1222sup) ;/* state->distbits */ *************** *** 869,873 **** mov ecx, invalid_distance_code_msg ! mov edx,26 jmp L_update_stream_state --- 922,926 ---- mov ecx, invalid_distance_code_msg ! mov edx,INFLATE_MODE_BAD jmp L_update_stream_state *************** *** 882,886 **** mov ecx,0 ! mov edx,11 jmp L_update_stream_state --- 935,939 ---- mov ecx,0 ! mov edx,INFLATE_MODE_TYPE jmp L_update_stream_state *************** *** 892,896 **** mov ecx, invalid_literal_length_code_msg ! mov edx,26 jmp L_update_stream_state --- 945,949 ---- mov ecx, invalid_literal_length_code_msg ! mov edx,INFLATE_MODE_BAD jmp L_update_stream_state *************** *** 901,905 **** mov esi, [esp+44] mov ecx, invalid_distance_too_far_msg ! mov edx,26 jmp L_update_stream_state --- 954,958 ---- mov esi, [esp+44] mov ecx, invalid_distance_too_far_msg ! mov edx,INFLATE_MODE_BAD jmp L_update_stream_state *************** *** 1027,1033 **** ret - - - _TEXT ends end --- 1080,1083 ---- Index: inflate.h =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/c_source/inflate.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** inflate.h 7 Dec 2004 22:52:50 -0000 1.1 --- inflate.h 7 Jan 2006 20:06:23 -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: FAQ =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/c_source/FAQ,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** FAQ 8 Dec 2004 20:23:39 -0000 1.3 --- FAQ 7 Jan 2006 20:06:22 -0000 1.4 *************** *** 149,159 **** the gzip format using inflateInit2(). Read zlib.h for more details. - Note that you cannot specify special gzip header contents (e.g. a file - name or modification date), nor will inflate tell you what was in the - gzip header. If you need to customize the header or see what's in it, - you can use the raw deflate and inflate operations and the crc32() - function and roll your own gzip encoding and decoding. Read the gzip - RFC 1952 for details of the header and trailer format. - 21. Is zlib thread-safe? --- 149,152 ---- *************** *** 296,300 **** works. ! 36. Will zlib read the (insert any ancient or arcane format here) compressed data format? --- 289,302 ---- works. ! 36. Valgrind (or some similar memory access checker) says that deflate is ! performing a conditional jump that depends on an uninitialized value. ! Isn't that a bug? ! ! No. That is intentional for performance reasons, and the output of ! deflate is not affected. This only started showing up recently since ! zlib 1.2.x uses malloc() by default for allocations, whereas earlier ! versions used calloc(), which zeros out the allocated memory. ! ! 37. Will zlib read the (insert any ancient or arcane format here) compressed data format? *************** *** 302,306 **** formats and associated software. ! 37. How can I encrypt/decrypt zip files with zlib? zlib doesn't support encryption. The original PKZIP encryption is very weak --- 304,308 ---- formats and associated software. ! 38. How can I encrypt/decrypt zip files with zlib? zlib doesn't support encryption. The original PKZIP encryption is very weak *************** *** 309,313 **** For PKZIP compatible "encryption", look at http://www.info-zip.org/ ! 38. What's the difference between the "gzip" and "deflate" HTTP 1.1 encodings? "gzip" is the gzip format, and "deflate" is the zlib format. They should --- 311,315 ---- For PKZIP compatible "encryption", look at http://www.info-zip.org/ ! 39. What's the difference between the "gzip" and "deflate" HTTP 1.1 encodings? "gzip" is the gzip format, and "deflate" is the zlib format. They should *************** *** 325,329 **** Bottom line: use the gzip format for HTTP 1.1 encoding. ! 39. Does zlib support the new "Deflate64" format introduced by PKWare? No. PKWare has apparently decided to keep that format proprietary, since --- 327,331 ---- 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 *************** *** 332,336 **** more modern approaches, that it's not worth the effort to implement. ! 40. Can you please sign these lengthy legal documents and fax them back to us so that we can use your software in our product? --- 334,338 ---- 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? Index: iowin32.c =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/c_source/iowin32.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** iowin32.c 28 Dec 2004 17:31:52 -0000 1.4 --- iowin32.c 7 Jan 2006 20:06:23 -0000 1.5 *************** *** 3,9 **** This IO API version uses the Win32 API (for Microsoft Windows) ! Version 1.01, May 8th, 2004 ! Copyright (C) 1998-2004 Gilles Vollant */ --- 3,9 ---- This IO API version uses the Win32 API (for Microsoft Windows) ! Version 1.01e, February 12th, 2005 ! Copyright (C) 1998-2005 Gilles Vollant */ Index: zip.h =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/c_source/zip.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** zip.h 8 Dec 2004 20:29:15 -0000 1.4 --- zip.h 7 Jan 2006 20:06:23 -0000 1.5 *************** *** 1,10 **** /* zip.h -- IO for compress .zip files using zlib ! Version 1.01, May 8th, 2004 - Copyright (C) 1998-2004 Gilles Vollant This unzip package allow creates .ZIP file, compatible with PKZip 2.04g WinZip, InfoZip tools and compatible. ! Encryption and multi volume ZipFile (span) are not supported. Old compressions used by old PKZip 1.x are not supported --- 1,13 ---- /* zip.h -- IO for compress .zip files using zlib ! Version 1.01e, February 12th, 2005 ! ! Copyright (C) 1998-2005 Gilles Vollant This unzip package allow creates .ZIP file, compatible with PKZip 2.04g WinZip, InfoZip tools and compatible. ! Multi volume ZipFile (span) are not supported. ! Encryption compatible with pkzip 2.04g only supported ! Old compressions used by old PKZip 1.x are not supported Index: inffas32.obj =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/c_source/inffas32.obj,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsZEIROe and /tmp/cvsqWplGb differ Index: zlib.rc =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/c_source/zlib.rc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** zlib.rc 8 Dec 2004 20:29:15 -0000 1.3 --- zlib.rc 7 Jan 2006 20:06:23 -0000 1.4 *************** *** 3,8 **** #define IDR_VERSION1 1 IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE ! FILEVERSION 1,2,2,0 ! PRODUCTVERSION 1,2,2,0 FILEFLAGSMASK VS_FFI_FILEFLAGSMASK FILEFLAGS 0 --- 3,8 ---- #define IDR_VERSION1 1 IDR_VERSION1 VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE ! FILEVERSION 1,2,3,0 ! PRODUCTVERSION 1,2,3,0 FILEFLAGSMASK VS_FFI_FILEFLAGSMASK FILEFLAGS 0 *************** *** 17,27 **** BEGIN ! VALUE "FileDescription", "LabVIEW zlib data compression library\0" ! VALUE "FileVersion", "1.2.2.0.LV6\0" ! VALUE "InternalName", "lvzlib\0" ! VALUE "OriginalFilename", "lvzlib.dll\0" ! VALUE "ProductName", "LVZLib.DLL\0" ! VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant, LabVIEW support by Rolf Kalbermatter\0" ! VALUE "LegalCopyright", "(C) 1995-2003 Jean-loup Gailly & Mark Adler\0" END END --- 17,27 ---- BEGIN ! VALUE "FileDescription", "LabVIEW zlib data compression library\0" ! VALUE "FileVersion", "1.2.3.0.LV6\0" ! VALUE "InternalName", "lvzlib\0" ! VALUE "OriginalFilename", "lvzlib.dll\0" ! VALUE "ProductName", "LVZLib.DLL\0" ! VALUE "Comments","DLL support by Alessandro Iacopetti & Gilles Vollant, ZIP support by Gilles Vollant, LabVIEW support by Rolf Kalbermatter\0" ! VALUE "LegalCopyright", "(C) 1995-2005 Jean-loup Gailly & Mark Adler\0" END END Index: zconf.h =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/c_source/zconf.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** zconf.h 8 Dec 2004 20:29:15 -0000 1.5 --- zconf.h 7 Jan 2006 20:06:23 -0000 1.6 *************** *** 1,4 **** /* zconf.h -- configuration of the zlib compression library ! * Copyright (C) 1995-2004 Jean-loup Gailly. * For conditions of distribution and use, see copyright notice in zlib.h */ --- 1,4 ---- /* zconf.h -- configuration of the zlib compression library ! * Copyright (C) 1995-2005 Jean-loup Gailly. * For conditions of distribution and use, see copyright notice in zlib.h */ *************** *** 44,47 **** --- 44,51 ---- # define zError z_zError + # define alloc_func z_alloc_func + # define free_func z_free_func + # define in_func z_in_func + # define out_func z_out_func # define Byte z_Byte # define uInt z_uInt *************** *** 65,70 **** # define WINDOWS #endif ! #if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32) ! # define WIN32 #endif #if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32) --- 69,76 ---- # define WINDOWS #endif ! #if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__) ! # ifndef WIN32 ! # define WIN32 ! # endif #endif #if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32) Index: README =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/c_source/README,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** README 8 Dec 2004 20:29:15 -0000 1.3 --- README 7 Jan 2006 20:06:22 -0000 1.4 *************** *** 1,5 **** ZLIB DATA COMPRESSION LIBRARY ! zlib 1.2.2 is a general purpose data compression library. All the code is thread safe. The data format used by the zlib library is described by RFCs (Request for Comments) 1950 to 1952 in the files --- 1,5 ---- ZLIB DATA COMPRESSION LIBRARY ! zlib 1.2.3 is a general purpose data compression library. All the code is thread safe. The data format used by the zlib library is described by RFCs (Request for Comments) 1950 to 1952 in the files *************** *** 17,23 **** To compile all files and run the test program, follow the instructions given at the top of Makefile. In short "make test; make install" should work for most ! machines. For Unix: "./configure; make test; make install" For MSDOS, use one ! of the special makefiles such as Makefile.msc. For VMS, use Make_vms.com or ! descrip.mms. Questions about zlib should be sent to <zl...@gz...>, or to Gilles Vollant --- 17,22 ---- To compile all files and run the test program, follow the instructions given at the top of Makefile. In short "make test; make install" should work for most ! machines. For Unix: "./configure; make test; make install". For MSDOS, use one ! of the special makefiles such as Makefile.msc. For VMS, use make_vms.com. Questions about zlib should be sent to <zl...@gz...>, or to Gilles Vollant *************** *** 35,39 **** http://dogma.net/markn/articles/zlibtool/zlibtool.htm ! The changes made in version 1.2.2 are documented in the file ChangeLog. Unsupported third party contributions are provided in directory "contrib". --- 34,38 ---- http://dogma.net/markn/articles/zlibtool/zlibtool.htm ! The changes made in version 1.2.3 are documented in the file ChangeLog. Unsupported third party contributions are provided in directory "contrib". Index: deflate.h =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/c_source/deflate.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** deflate.h 8 Dec 2004 20:23:39 -0000 1.3 --- deflate.h 7 Jan 2006 20:06:22 -0000 1.4 *************** *** 1,4 **** /* deflate.h -- internal compression state ! * Copyright (C) 1995-2002 Jean-loup Gailly * For conditions of distribution and use, see copyright notice in zlib.h */ --- 1,4 ---- /* deflate.h -- internal compression state ! * Copyright (C) 1995-2004 Jean-loup Gailly * For conditions of distribution and use, see copyright notice in zlib.h */ *************** *** 50,53 **** --- 50,57 ---- #define INIT_STATE 42 + #define EXTRA_STATE 69 + #define NAME_STATE 73 + #define COMMENT_STATE 91 + #define HCRC_STATE 103 #define BUSY_STATE 113 #define FINISH_STATE 666 *************** *** 94,99 **** ulg pending_buf_size; /* size of pending_buf */ Bytef *pending_out; /* next pending byte to output to the stream */ ! int pending; /* nb of bytes in the pending buffer */ int wrap; /* bit 0 true for zlib, bit 1 true for gzip */ Byte method; /* STORED (for zip only) or DEFLATED */ int last_flush; /* value of flush param for previous deflate call */ --- 98,105 ---- ulg pending_buf_size; /* size of pending_buf */ Bytef *pending_out; /* next pending byte to output to the stream */ ! uInt pending; /* nb of bytes in the pending buffer */ int wrap; /* bit 0 true for zlib, bit 1 true for gzip */ + gz_headerp gzhead; /* gzip header information to write */ + uInt gzindex; /* where in extra, name, or comment */ Byte method; /* STORED (for zip only) or DEFLATED */ int last_flush; /* value of flush param for previous deflate call */ Index: deflate.c =================================================================== RCS file: /cvsroot/opengtoolkit/lvzip/c_source/deflate.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** deflate.c 8 Dec 2004 20:23:39 -0000 1.3 --- deflate.c 7 Jan 2006 20:06:22 -0000 1.4 *************** *** 1,4 **** /* deflate.c -- compress data using the deflation algorithm ! * Copyright (C) 1995-2004 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 Jean-loup Gailly. * For conditions of distribution and use, see copyright notice in zlib.h */ *************** *** 53,57 **** const char deflate_copyright[] = ! " deflate 1.2.2 Copyright 1995-2004 Jean-loup Gailly "; /* If you use the zlib library in a product, an acknowledgment is welcome --- 53,57 ---- const char deflate_copyright[] = ! " deflate 1.2.3 Copyright 1995-2005 Jean-loup Gailly "; /* If you use the zlib library in a product, an acknowledgment is welcome *************** *** 265,269 **** if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method != Z_DEFLATED || windowBits < 8 || windowBits > 15 || level < 0 || level > 9 || ! strategy < 0 || strategy > Z_RLE) { return Z_STREAM_ERROR; } --- 265,269 ---- if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method != Z_DEFLATED || windowBits < 8 || windowBits > 15 || level < 0 || level > 9 || ! strategy < 0 || strategy > Z_FIXED) { return Z_STREAM_ERROR; } *************** *** 275,278 **** --- 275,279 ---- s->wrap = wrap; + s->gzhead = Z_NULL; s->w_bits = windowBits; s->w_size = 1 << s->w_bits; *************** *** 334,340 **** if (length > MAX_DIST(s)) { length = MAX_DIST(s); - #ifndef USE_DICT_HEAD dictionary += dictLength - length; /* use the tail of the dictionary */ - #endif } zmemcpy(s->window, dictionary, length); --- 335,339 ---- *************** *** 392,395 **** --- 391,405 ---- /* ========================================================================= */ + int ZEXPORT deflateSetHeader (strm, head) + z_streamp strm; + gz_headerp head; + { + if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + if (strm->state->wrap != 2) return Z_STREAM_ERROR; + strm->state->gzhead = head; + return Z_OK; + } + + /* ========================================================================= */ int ZEXPORT deflatePrime (strm, bits, value) z_streamp strm; *************** *** 421,425 **** if (level == Z_DEFAULT_COMPRESSION) level = 6; #endif ! if (level < 0 || level > 9 || strategy < 0 || strategy > Z_RLE) { return Z_STREAM_ERROR; } --- 431,435 ---- if (level == Z_DEFAULT_COMPRESSION) level = 6; #endif ! if (level < 0 || level > 9 || strategy < 0 || strategy > Z_FIXED) { return Z_STREAM_ERROR; } *************** *** 441,444 **** --- 451,473 ---- } + /* ========================================================================= */ + int ZEXPORT deflateTune(strm, good_length, max_lazy, nice_length, max_chain) + z_streamp strm; + int good_length; + int max_lazy; + int nice_length; + int max_chain; + { + deflate_state *s; + + if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; + s = strm->state; + s->good_match = good_length; + s->max_lazy_match = max_lazy; + s->nice_match = nice_length; + s->max_chain_length = max_chain; + return Z_OK; + } + /* ========================================================================= * For the default windowBits of 15 and memLevel of 8, this function returns *************** *** 549,566 **** #ifdef GZIP if (s->wrap == 2) { put_byt... [truncated message content] |