This is the Info-ZIP file COPYING.OLD (for UnZip)
Last content update: 17 Jul 2000
- Last edit: 28 Jan 2013
+ Last edit: 09 Jan 2015
__________________________________________________________________________
FIRST NOTE:
filename-mapping, text translation, ...; etc. As far as we can
tell, only the core code of the Reduce method remained substantially
similar to Mr. Smith's original source. As of UnZip 5.42, the complete
- core code is now covered by the Info-ZIP Licence. Therefore, support
+ core code is now covered by the Info-ZIP License. Therefore, support
for the Reduce method has been removed.
The drop of the Reduce method should only affect some test archives.
Reduce was never used in any publicly distributed Zip program.
crypt.h Header file for crypt.c
ebcdic.h Static lookup table for ASCII <-> EBCDIC translation
envargs.c Read options from environment variables
+expand.c Reduce compression (methods 2-5), Peter Backes (public domain)
explode.c Implode compression (method 6)
extract.c High-level extraction and decryption code
fileio.c File I/O, password, various utilities
ttyio.c Terminal I/O: echo, size; password, pager
ttyio.h Header file for ttyio.c
ubz2err.c Callback handler for fatal bzip2 errors (bzip2 support)
-unreduce.c Reduce compression (methods 2-5), stub only
+unreduce.c Reduce compression (methods 2-5), wrapper
unshrink.c Shrink compression (method 1)
unzip.c UnZip main(), usage and options code
unzip.h Public part of main UnZip header file
6.10c13 (17 Dec 2014):
- No news.
+6.10c14 (03 Jan 2015):
+ - No news.
+
+6.10c15 (12 Jan 2015):
+ - Included public-domain code from Peter Backes for the (obsolete)
+ Reduce compression method. (Some minor changes were made to clear
+ some diagnostics from modern compilers, and to accommodate inclusion
+ by unreduce.c.) To enable Unreduce support using the public-domain
+ code, define the C macro USE_UNREDUCE_PUBLIC. To enable Unreduce
+ support using the copyrighted Unreduce code, define the C macro
+ USE_UNREDUCE_SMITH (or, for compatibility with old code and
+ documentation, USE_SMITH_CODE), and supply the source file
+ unreduce_full.c. See INSTALL for details. The C macro
+ COPYRIGHT_CLEAN has been removed from the code and from the "UnZip
+ special compilation options" ("-v") report. The new USE_UNREDUCE_xxx
+ macros appear instead.
+ http://sourceforge.net/p/infozip/patches/18/
+ (api.c, COPYING.OLD, expand.c (new), extract.c, INSTALL,
+ unix/Makefile, unreduce.c, unzip.c, unzpriv.h, vms/descrip_deps.mms,
+ vms/descrip_mkdeps.mms) [Peter Backes, SMS]
+
Bugs fixed:
_ Added more details to documentation on build customization.
(INSTALL) [SMS]
- Advanced copyright dates in messages to 2015. (unzip.c) [SMS]
+
+6.10c15 (10 Jan 2015)
+ - Spelling changes. (COPYING.OLD, tandem/README) [SMS]
+ - Removed some dead code. (unzip.c) [SMS]
INSTALL -- Info-ZIP UnZip Installation Instructions
===================================================
- UnZip version 6.10. Revised: 2015-01-03
+ UnZip version 6.10. Revised: 2015-01-09
------------------------------------------------------------------------
with the "-d <extract_dir>" command line option, therefore
CHEAP_SFX_AUTORUN implicitly sets the NO_SFX_EXDIR option (below).
-COPYRIGHT_CLEAN (now default)
-USE_SMITH_CODE
- The last chunk of code in UnZip that was blatantly derived from Sam
- Smith's unzip 2.0 (as in, "substantially similar") is in unreduce.c.
- Because the Reduce compression method was only used by very early
- PKZIP beta versions (0.9x), support for it is now omitted by default
- (COPYRIGHT_CLEAN). To include support for Reduce compression, define
- the C macro USE_SMITH_CODE, and replace the stub unreduce.c source
- module with the separately distributed full source code module. Note
- that this subjects your UnZip to any and all restrictions in Smith's
- copyright. See the UnZip COPYING.OLD file for details. The source
- code module unreduce.c is supplied in:
- ftp://ftp.info-zip.org/pub/infozip/src/unreduce_full.zip
-
IZ_CRYPT_AES_WG (requires additional external code distribution)
Enable WinZip/Gladman AES (strong) encryption support. Currently,
this support is integrated in the Make procedures of MSDOS 32-bit
On target ports where UNIXBACKUP is enabled by default, the negated
option, NO_UNIXBACKUP, may be used to disable this feature.
+USE_UNREDUCE_PUBLIC
+USE_UNREDUCE_SMITH
+ The Reduce compression method is now obsolete. It was used by very
+ early PKZIP beta versions (0.9x). By default, support for it is not
+ included in UnZip. If desired, Unreduce support can be provided
+ using either the original, copyrighted code from Samuel H. Smith, or
+ some newer, public-domain code from Peter Backes.
+ USE_UNREDUCE_PUBLIC enables Unreduce support using the public-domain
+ code. USE_UNREDUCE_SMITH enables Unreduce support using the
+ copyrighted code. The public-domain Unreduce source module
+ (expand.c) is included in the UnZip source kit. The copyrighted
+ source module (unreduce_full.c) is available separately in:
+ ftp://ftp.info-zip.org/pub/infozip/src/unreduce_full.zip
+ Note that using the copyrighted code subjects your UnZip to any and
+ all restrictions in Smith's copyright. See the UnZip COPYING.OLD
+ file for details.
+
VMS_TEXT_CONV (default everywhere except VMS)
NO_VMS_TEXT_CONV
VMS_TEXT_CONV enables conversion of some VMS-specific text file
# ifdef PPMD_SUPPORT
strcat( featurelist, ",ppmd");
# endif
- strcat( featurelist, ";");
-
-# ifdef COPYRIGHT_CLEAN
- strcat( featurelist, "copyright_clean;");
+# if defined( USE_UNREDUCE_PUBLIC) || defined( USE_UNREDUCE_SMITH)
+ strcat( featurelist, ",unreduce;");
# endif
+ strcat( featurelist, ";");
# ifdef IZ_CRYPT_ANY
strcat( featurelist, "use_ef_ut_time;");
# endif
+# ifdef USE_UNREDUCE_PUBLIC
+ strcat( featurelist, "use_unreduce_public;");
+# endif
+# ifdef USE_UNREDUCE_SMITH
+ strcat( featurelist, "use_unreduce_smith;");
+# endif
+
# ifdef USE_VFAT
strcat( featurelist, "use_vfat;");
# endif
--- /dev/null
+/* Info-ZIP version 1.0 */
+
+/*
+ * expand (unreduce)
+ *
+ * Written by Peter Backes, 2012
+ * Public Domain
+ *
+ * This is a free replacement for "[t]he last chunk of code in UnZip
+ * that was blatantly derived from Sam Smith's unzip 2.0." The reduce
+ * algorithm was used only by PKZIP 0.90 and 0.92. To enable unreducing
+ * capability, define USE_UNREDUCE_PUBLIC (for example, by specifying
+ * LOCAL_UNZIP=-DUSE_UNREDUCE_PUBLIC to the Makefile).
+ *
+ * reduce was rarely ever used, and, in fact, the PKZIP 0.90 and 0.92
+ * self-extracting distributions themselves (PKZ090.EXE and PKZ092.EXE)
+ * are the only easy to find files that actually make use of it. So
+ * this file might be handy only if you are into computer archeology and
+ * old software archives.
+ *
+ *
+ * "The Reducing algorithm is actually a combination of two
+ * distinct algorithms. The first algorithm compresses repeated
+ * byte sequences, and the second algorithm takes the compressed
+ * stream from the first algorithm and applies a probabilistic
+ * compression method." --APPNOTE.TXT
+ *
+ *
+ *
+ * NOTE: unreduce may or may not infinge or have been covered or
+ * be covered anytime in the future by patent restoration, by
+ * US patent 4,612,532, "Data compression apparatus and method,"
+ * inventor Bacon, assignee Telebyte Corportion, filed Jun. 19,
+ * 1984, granted Sep. 16, 1986 (see compression-faq, section 7).
+ *
+ * ALL LIABILITY FOR USE OF THIS CODE IN VIOLATION OF APPLICABLE
+ * PATENT LAW IS HEREBY DISCLAIMED.
+ *
+ */
+
+
+#define __UNREDUCE_C
+#define UNZIP_INTERNAL
+#include "unzip.h"
+
+/* extend most significant bit to the right, at most one char, set
+ * least significant extended bit to 1
+ */
+#define M_EXTR1C(j) (((j) | (j) >> 1) | ((j) | (j) >> 1) >> 2 \
+ | (((j) | (j) >> 1) | ((j) |127) >> 2) >> 4)
+
+/* compute log2(n) for n=1,2,...,128. Stolen from ghostscript gxarith.h */
+#define M_L2C(n) ((unsigned int)(05637042010L >> ((((n) % 11) - 1) * 3)) & 7)
+
+#define LMASK 0x0f1f3f7f
+/* function L(X): masks out the lower (8-CF) bits of X, where
+ * CF = compression factor
+ */
+#define M_L(cf,x) (LMASK >> ((cf-1)<<3) & (x))
+/* function F(X): 2 if all masked bits in L(X) are set, 3 otherwise */
+#define M_F(cf,x) (3 - (M_L(cf,0xff) == (x)))
+/* function D(X,Y): upper CF bits of X concatenated with the bits of y+1 */
+#define M_D(cf,x,y) ((((x) << (cf)) & 0xf00) + (y) + 1)
+/* B(N(j)) = bits needed to encode N(j)-1 */
+#define M_B(i) (M_L2C((M_EXTR1C((i)-1)&127)+1)+((unsigned)((i)-1)>127))
+
+#define DLE 144
+
+#define XREADBITS(nbits,zdest,stmt) READBITS(nbits,zdest) if (G.zipeof) stmt;
+
+#define SWSIZE M_D(cf, 255, 255)
+
+int unreduce(__G)
+ __GDEF
+{
+ int lc = 0; /* Last-Character */
+ int state = 0;
+ int len, v;
+ int cf = G.lrec.compression_method - 1;
+ ulg rest = G.lrec.ucsize;
+ int outpos = 0, backptr;
+ int error;
+ int i;
+ /* number of followers N(j) */
+ uch (*f_n)[256] = (uch (*)[256])(slide + SWSIZE);
+ /* follower set S(j)[0..N(j)-1] */
+ uch (*f_s)[256][32] = (uch (*)[256][32])(slide + SWSIZE + sizeof *f_n);
+
+ memzero(slide,SWSIZE);
+
+ Trace((stderr, "unreduce()\ncompression factor %d\n", cf));
+ Trace((stderr, "size1 %d size2 %d setlen %d\n", sizeof **f_s,
+ sizeof ***f_s, M_L2C(sizeof **f_s / sizeof ***f_s)));
+ /* get follower sets */
+ for (i = 0; i < sizeof *f_n / sizeof **f_n; i++) {
+ int m, j = 255 - i;
+ XREADBITS(M_L2C(sizeof **f_s / sizeof ***f_s) + 1,
+ (*f_n)[j],return PK_OK)
+ Trace((stderr, "N(%d) = %d, S(%d) = {", j, (*f_n)[j], j));
+ if ((*f_n)[j] > 32)
+ return PK_OK;
+ for (m = 0; m < (*f_n)[j]; m++) {
+ XREADBITS(8,(*f_s)[j][m], return PK_OK)
+ Trace((stderr, "%d, ", (*f_s)[j][m]));
+ }
+ Trace((stderr, "}\n"));
+ }
+
+ /* expand file */
+ while (rest) {
+ Trace((stderr, "N(%d) = %d ", lc, (*f_n)[lc]));
+ if (!(*f_n)[lc]) {
+ XREADBITS(8, lc, break)
+ Trace((stderr, "=> %d ", lc));
+ } else {
+ shrint code;
+ XREADBITS(1, code, break)
+ if (code) {
+ XREADBITS(8, lc, break)
+ Trace((stderr, "1 => %d", lc));
+ } else {
+ XREADBITS(M_B((*f_n)[lc]), code, break)
+ Trace((stderr, "0 %d %d ",
+ M_B((*f_n)[lc]), code));
+ if (code >= (*f_n)[lc])
+ break;
+ lc = (*f_s)[lc][code];
+ Trace((stderr, "=> %d", lc));
+ }
+ }
+
+ Trace((stderr, "\t[%d] ", state));
+
+ switch (state) {
+ case 0:
+ if (lc != DLE) {
+ slide[outpos++] = lc;
+ rest--;
+ Trace((stderr, "%d/%d", outpos, SWSIZE));
+ if (outpos == SWSIZE) {
+ if ((error = flush(__G__ slide,
+ (ulg)SWSIZE, 0)))
+ return error;
+ outpos = 0;
+ }
+ } else
+ state = 1;
+ Trace((stderr, "\n"));
+ break;
+ case 1:
+ if (lc) {
+ v = lc;
+ len = M_L(cf,v);
+ state = M_F(cf,len);
+ Trace((stderr, "len=%d", len));
+ } else {
+ Trace((stderr, "%d/%d", outpos, SWSIZE));
+ slide[outpos++] = DLE;
+ rest--;
+ if (outpos == SWSIZE) {
+ if ((error = flush(__G__ slide,
+ (ulg)SWSIZE, 0)))
+ return error;
+
+ outpos = 0;
+ }
+ state = 0;
+ }
+ Trace((stderr, "\n"));
+ break;
+ case 2:
+ len += lc;
+ Trace((stderr, "+len=%d\n", len));
+ state = 3;
+ break;
+ case 3:
+ backptr = outpos - M_D(cf,v,lc);
+ len += 3;
+ rest -= len > rest ? rest : len;
+ Trace((stderr, "%d <-%d[%d]-- %d/%d\n", backptr,
+ outpos - backptr,len, outpos, SWSIZE));
+ if (backptr < 0)
+ backptr += SWSIZE;
+
+ if (backptr + len > SWSIZE) {
+ len -= SWSIZE - backptr;
+ if (outpos >= backptr) {
+ while (outpos < SWSIZE)
+ slide[outpos++]
+ = slide[backptr++];
+ if ((error = flush(__G__ slide,
+ (ulg)SWSIZE, 0)))
+ return error;
+ outpos = 0;
+ }
+ memmove(slide+outpos,slide+backptr,
+ SWSIZE - backptr);
+ outpos += SWSIZE - backptr;
+ backptr = 0;
+ }
+ if (outpos + len >= SWSIZE) {
+ len -= SWSIZE - outpos;
+ while (outpos < SWSIZE)
+ slide[outpos++]
+ = slide[backptr++];
+ if ((error = flush(__G__ slide,
+ (ulg)SWSIZE, 0)))
+ return error;
+ outpos = 0;
+ }
+ while (len-- > 0)
+ slide[outpos++]
+ = slide[backptr++];
+
+ state = 0;
+ break;
+ }
+ }
+ if (outpos && (error = flush(__G__ slide, (ulg)outpos, 0)))
+ return error;
+
+ return PK_OK;
+}
+
/*
- Copyright (c) 1990-2014 Info-ZIP. All rights reserved.
+ Copyright (c) 1990-2015 Info-ZIP. All rights reserved.
See the accompanying file LICENSE, version 2009-Jan-02 or later
(the contents of which are also included in unzip.h) for terms of use.
# define UNKN_SHR FALSE /* Shrink (1) allowed. */
#endif
-#ifdef COPYRIGHT_CLEAN /* Reduce (2-5) not allowed. */
+#if !defined( USE_UNREDUCE_PUBLIC) && !defined( USE_UNREDUCE_SMITH)
+ /* Reduce (2-5) not allowed. */
# define UNKN_RED (G.crec.compression_method >= REDUCED1 && \
G.crec.compression_method <= REDUCED4)
#else
continue; /* go on */
}
}
+
+#ifdef USE_EF_STREAM
+
+ /* Process any EF_STREAM extra block.
+ * Proof of concept. Currently not actually used for anything.
+ */
+#define EF_STREAM_BM_SIZE 2 /* We currently expect only one, actually. */
+ {
+ uch bitmap[ EF_STREAM_BM_SIZE];
+ ext_local_file_hdr xlhdr;
+ char *cmnt;
+ int btmp_siz = EF_STREAM_BM_SIZE;
+ int sts;
+
+ sts = ef_scan_for_stream( G.extra_field,
+ G.lrec.extra_field_length,
+ &btmp_siz,
+ &bitmap[ 0],
+ &xlhdr,
+ &cmnt);
+
+ if (sts >= 0)
+ {
+ fprintf( stderr, " e_s_f_s() = %d.\n", sts);
+ fprintf( stderr, " btmp_len = %d.\n", btmp_siz);
+ fprintf( stderr, " bitmap[ 0] = %02x .\n", bitmap[ 0]);
+
+ fprintf( stderr,
+ " xlhdr.version_made_by[ 0, 1] = %02x %02x.\n",
+ xlhdr.version_made_by[ 0], xlhdr.version_made_by[ 1]);
+
+ fprintf( stderr,
+ " xlhdr.internal_file_attributes = %04x .\n",
+ xlhdr.internal_file_attributes);
+
+ fprintf( stderr,
+ " xlhdr.external_file_attributes = %08x .\n",
+ xlhdr.external_file_attributes);
+
+ fprintf( stderr, " xlhdr.file_comment_length = %d.\n",
+ xlhdr.file_comment_length);
+
+ fprintf( stderr, " cmnt = %08x .\n", cmnt);
+ if (cmnt != NULL)
+ {
+ fprintf( stderr,
+ " cmnt: >%*s<.\n", xlhdr.file_comment_length, cmnt);
+ }
+ }
+ }
+#endif /* def USE_EF_STREAM */
+
#ifndef SFX
/* Filename consistency checks must come after reading in the local
* extra field, so that a UTF-8 entry name e.f. block has already
break;
#endif /* !LZW_CLEAN */
-#ifndef COPYRIGHT_CLEAN
+#if defined( USE_UNREDUCE_PUBLIC) || defined( USE_UNREDUCE_SMITH)
case REDUCED1:
case REDUCED2:
case REDUCED3:
error = r;
}
break;
-#endif /* !COPYRIGHT_CLEAN */
+#endif /* defined( USE_UNREDUCE_PUBLIC) || defined( USE_UNREDUCE_SMITH) */
#ifndef SFX /* Implode should have its own macro. */
case IMPLODED:
/*
- Copyright (c) 1990-2014 Info-ZIP. All rights reserved.
+ Copyright (c) 1990-2015 Info-ZIP. All rights reserved.
See the accompanying file LICENSE, version 2009-Jan-02 or later
(the contents of which are also included in unzip.h) for terms of use.
process_local_file_hdr()
getZip64Data()
ef_scan_for_izux()
+ ef_scan_for_stream()
getRISCOSexfield()
---------------------------------------------------------------------------*/
}
#endif /* (RISCOS || ACORN_FTYPE_NFS) */
+
+
+#ifdef USE_EF_STREAM
+
+/*********************************/
+/* Function ef_scan_for_stream() */
+/*********************************/
+
+/* 2015-01-08 SMS. New.
+ *
+ * Returns value -1 if EF_STREAM not found, 0 if EF_STREAM found and
+ * valid, positive if error.
+ * Returns bitmap in user's btmp[ *btmp_siz] array.
+ * Returns bitmap length in user's btmp_siz.
+ * Returns data in user's xlhdr structure.
+ * Returns comment pointer in user's cmnt pointer (not NUL-terminated,
+ * but length is in xlhdr.file_comment_length). cmnt may be NULL, if
+ * the user is not interested.
+ */
+unsigned ef_scan_for_stream( ef_ptr, ef_len, btmp_siz, btmp, xlhdr, cmnt)
+ ZCONST uch *ef_ptr; /* Buffer containing extra field. */
+ long ef_len; /* Total length of extra field. */
+ int *btmp_siz; /* Size of bitmap array. */
+ uch *btmp; /* Bitmap (array). */
+ ext_local_file_hdr *xlhdr; /* Extended local header data. */
+ char **cmnt; /* File comment. */
+{
+ unsigned eb_id;
+ long eb_len;
+ uch bitmap;
+ int bitmap_byte_max = 0;
+ int bitmap_byte;
+ int data_byte;
+ unsigned sts = -1;
+
+/*---------------------------------------------------------------------------
+ This function scans the extra field for EF_STREAM.
+ ---------------------------------------------------------------------------*/
+
+ if ((ef_len == 0) || (ef_ptr == NULL))
+ return sts;
+
+ TTrace((stderr,
+ "\nef_scan_for_stream: scanning extra field of length %ld\n", ef_len));
+
+ while (ef_len >= EB_HEADSIZE)
+ {
+ eb_id = makeword( ef_ptr+ EB_ID);
+ eb_len = makeword( ef_ptr+ EB_LEN);
+ ef_ptr += EB_HEADSIZE;
+ ef_len -= EB_HEADSIZE;
+
+ if (eb_len > ef_len)
+ {
+ /* Discovered some extra field inconsistency! */
+ TTrace((stderr,
+ "ef_scan_for_stream: block length %ld > rest ef_size %ld\n",
+ eb_len, ef_len));
+ sts = 1;
+ break;
+ }
+
+ if (eb_id == EF_STREAM)
+ {
+ sts = 0; /* Indicate EF_STREAM found. */
+ if (cmnt != NULL)
+ {
+ *cmnt = NULL; /* Clear comment pointer. */
+ }
+ xlhdr->file_comment_length = 0; /* Clear comment length. */
+
+ /* Loop through (and save) the bitmap bytes. */
+ data_byte = 0;
+ do
+ {
+ if (bitmap_byte_max >= eb_len) /* Stay within the block. */
+ {
+ /* Out of data before end-of-bitmap. */
+ TTrace((stderr,
+ "ef_scan_for_stream: No end-of-bitmap.\n"));
+ sts = 2;
+ break;
+ }
+
+ /* If the user has space for another, then return a bitmap byte. */
+ bitmap = *(ef_ptr+ (data_byte++));
+ if (bitmap_byte_max < *btmp_siz)
+ {
+ btmp[ bitmap_byte_max++] = bitmap;
+ }
+ } while ((bitmap& EB_STREAM_EOB) != 0); /* Loop while more bitmap. */
+ *btmp_siz = bitmap_byte_max; /* Return bitmap length. */
+
+ /* Loop through bitmap bytes. Stay within the extra block. */
+ for (bitmap_byte = 0; bitmap_byte < bitmap_byte_max; bitmap_byte++)
+ {
+ bitmap = btmp[ bitmap_byte]; /* Next bitmap byte. */
+ switch (bitmap_byte)
+ {
+ case 0:
+ if (bitmap& (1 << 0)) /* Version made by. */
+ {
+ if (data_byte+ 2 > eb_len) /* Missing data. */
+ {
+ sts = 3;
+ break;
+ }
+ xlhdr->version_made_by[ 0] = (ef_ptr+ data_byte)[ 0];
+ xlhdr->version_made_by[ 1] = (ef_ptr+ data_byte)[ 1];
+ data_byte += 2;
+ }
+
+ if (bitmap& (1 << 1)) /* Internal file attributes. */
+ {
+ if (data_byte+ 2 > eb_len) /* Missing data. */
+ {
+ sts = 4;
+ break;
+ }
+ xlhdr->internal_file_attributes = makeword( ef_ptr+ data_byte);
+ data_byte += 2;
+ }
+
+ if (bitmap& (1 << 2)) /* External file attributes. */
+ {
+ if (data_byte+ 4 > eb_len) /* Missing data. */
+ {
+ sts = 5;
+ break;
+ }
+ xlhdr->external_file_attributes = makelong( ef_ptr+ data_byte);
+ data_byte += 4;
+ }
+
+ if (bitmap& (1 << 3)) /* File comment. */
+ {
+ if (data_byte+ 2 > eb_len) /* Missing data. */
+ {
+ sts = 6;
+ break;
+ }
+ xlhdr->file_comment_length = makeword( ef_ptr+ data_byte);
+ data_byte += 2;
+ if (xlhdr->file_comment_length > 0)
+ {
+ if (data_byte+ xlhdr->file_comment_length >
+ eb_len) /* Missing data. */
+ {
+ sts = 7;
+ break;
+ }
+ if (cmnt != NULL)
+ { /* Set comment pointer. */
+ *cmnt = (char *)(ef_ptr+ data_byte);
+ }
+ data_byte += xlhdr->file_comment_length;
+ }
+ }
+
+ default: /* Past known bits. */
+ break;
+ } /* switch */
+ bitmap_byte++; /* Next bitmap index. */
+ } /* for */
+ } /* if (eb_id == EF_STREAM) */
+
+ /* Advance to the next extra field block. */
+ ef_ptr += eb_len;
+ ef_len -= eb_len;
+ } /* while */
+
+ return sts;
+}
+
+#endif /* def USE_EF_STREAM */
- restore relevant files by running DOIT
- replace references to $T with a collector on your system
- replace references to SUPER.DAVES with whatever user id you use
-- to compile run MAKE (compiles, accelerates, licences)
+- to compile run MAKE (compiles, accelerates, licenses)
- NOTE: Always run the accelerated object on TNS/R systems, otherwise
it runs extremely slow.
#==============================================================================
# unix/Makefile
-# - For UnZip, fUnZip, UnZipSFX, and ZipInfo Revised: 2015-01-03
+# - For UnZip, fUnZip, UnZipSFX, and ZipInfo Revised: 2015-01-09
#
# Copyright (c) 2004-2014 Info-ZIP. All rights reserved.
#
$(PROD)/ubz2err.o: ubz2err.c $(H_UNZIP)
$(CC) -c $(CF) -o $@ ubz2err.c
-$(PROD)/unreduce.o: unreduce.c $(H_UNZIP)
+$(PROD)/unreduce.o: unreduce.c $(H_UNZIP) expand.c
$(CC) -c $(CF) -o $@ unreduce.c
$(PROD)/unshrink.o: unshrink.c $(H_UNZIP)
$(PROD)/ubz2err_l.o: ubz2err.c $(H_UNZIPL)
$(CC) -c $(CF) -DDLL -o $@ ubz2err.c
-$(PROD)/unreduce_l.o: unreduce.c $(H_UNZIPL)
+$(PROD)/unreduce_l.o: unreduce.c $(H_UNZIPL) expand.c
$(CC) -c $(CF) -DDLL -o $@ unreduce.c
$(PROD)/unshrink_l.o: unshrink.c $(H_UNZIPL)
/*
- Copyright (c) 1990-2002 Info-ZIP. All rights reserved.
+ Copyright (c) 1990-2015 Info-ZIP. All rights reserved.
See the accompanying file LICENSE, version 2000-Apr-09 or later
(the contents of which are also included in unzip.h) for terms of use.
unreduce.c
- Copyright-clean dummy module, without any real code.
+ Unreduce wrapper module.
- If you really need unreduce support, replace this module by the full
- source code, available as add-on package from our distribution site.
+ Define USE_UNREDUCE_SMITH to enable copyrighted Unreduce code (in
+ unreduce_full.c) from Samuel H. Smith.
- ---------------------------------------------------------------------------*/
-
-
-#define __UNREDUCE_C /* identifies this source module */
-#define UNZIP_INTERNAL
-#include "unzip.h" /* defines COPYRIGHT_CLEAN by default */
+ Define USE_UNREDUCE_PUBLIC to enable public-domain Unreduce code (in
+ expand.c) from Peter Backes.
+ ---------------------------------------------------------------------------*/
-#ifndef COPYRIGHT_CLEAN
-
- /* This line is indented to hide the #error directive from pure traditional
- * K&R C preprocessors. These do not recognize the #error directive, but
- * they also recognize only lines that start with a '#' in column 1 as
- * preprocessor directives.
- */
- #error This dummy-module does not support the unreduce method!
-
-#endif /* !COPYRIGHT_CLEAN */
+#define __UNREDUCE_C_ /* identifies this source module */
+
+#ifdef USE_UNREDUCE_PUBLIC
+# include "expand.c"
+#else
+# ifdef USE_UNREDUCE_SMITH
+# include "unreduce_full.c"
+# else
+int dummy_unreduce; /* Dummy declaration to quiet compilers. */
+# endif
+#endif
static ZCONST char Far Check_Versions[] =
"CHECK_VERSIONS (Check VMS versions, build v. run-time)";
# endif
-# ifdef COPYRIGHT_CLEAN
-static ZCONST char Far Copyright_Clean[] =
- "COPYRIGHT_CLEAN (PKZIP 0.9x unreducing method not supported)";
-# endif
# ifdef DEBUG
static ZCONST char Far UDebug[] = "DEBUG";
# endif
# endif
# ifdef DEFLATE64_SUPPORT
static ZCONST char Far Deflate64_Sup[] =
- "DEFLATE64_SUPPORT (PKZIP 4.x Deflate64(tm) supported)";
+ "DEFLATE64_SUPPORT (PKZIP 4.x Deflate64(tm) compression)";
# endif
# ifdef DLL
static ZCONST char Far Dll[] =
# endif
# ifdef LZW_CLEAN
static ZCONST char Far LZW_Clean[] =
- "LZW_CLEAN (PKZIP/Zip 1.x unshrink method not supported)";
+ "LZW_CLEAN (PKZIP/Zip 1.x Shrink compression not supported)";
# endif
# ifndef MORE
static ZCONST char Far No_More[] =
# endif
# ifndef LZW_CLEAN
static ZCONST char Far Unshrink_Sup[] =
- "UNSHRINK_SUPPORT (PKZIP/Zip 1.x unshrinking method supported)";
+ "UNSHRINK_SUPPORT (PKZIP/Zip 1.x Shrink compression)";
# endif
-# ifndef COPYRIGHT_CLEAN
-static ZCONST char Far Use_Smith_Code[] =
- "USE_SMITH_CODE (PKZIP 0.9x unreducing method supported)";
+# ifdef USE_UNREDUCE_PUBLIC
+static ZCONST char Far Use_Unreduce[] =
+ "USE_UNREDUCE_PUBLIC (PKZIP 0.9x Reduce compression, public-domain)";
+# else
+# ifdef USE_UNREDUCE_SMITH
+static ZCONST char Far Use_Unreduce[] =
+ "USE_UNREDUCE_SMITH (PKZIP 0.9x Reduce compression, (c) S. H. Smith)";
+# endif
# endif
# ifdef UNICODE_SUPPORT
# ifdef UTF8_MAYBE_NATIVE
# endif /* !defined( SFX) || defined( DIAG_SFX) */
# ifndef SFX
-# ifdef COPYRIGHT_CLEAN /* Maintainer, not Smith copyright. */
+# ifndef USE_UNREDUCE_SMITH /* Maintainer, not Smith copyright. */
# ifdef VMSCLI
/* Used in vms/cmdline.c, so not static in VMS CLI. "/lic" v. "--lic". */
ZCONST char Far UnzipUsageLine1[] = "\
UnZip %d.%d%d%s of %s, by Info-ZIP. Maintainer: <Apply Within>\n\
Copyright (c) 1990-2015 Info-ZIP. For software license: unzip --license\n";
# endif /* def VMSCLI [else] */
-# else /* def COPYRIGHT_CLEAN */ /* Smith copyright, not maintainer. */
+# else /* ndef USE_UNREDUCE_SMITH */ /* Smith copyright, not maintainer. */
# ifdef VMSCLI
/* Used in vms/cmdline.c, so not static in VMS CLI. "/lic" v. "--lic". */
ZCONST char Far UnzipUsageLine1[] = "\
UnZip %d.%d%d%s of %s, by Info-ZIP. UnReduce (c) 1989 by S. H. Smith.\n\
Copyright (c) 1990-2015 Info-ZIP. For software license: unzip --license\n";
# endif /* def VMSCLI [else] */
-# endif /* def COPYRIGHT_CLEAN [else] */
+# endif /* ndef USE_UNREDUCE_SMITH [else] */
# define UnzipUsageLine1v UnzipUsageLine1
static ZCONST char Far UnzipUsageLine2v[] = "\
}
# endif /* def IZ_CRYPT_AES_WG */
-# ifdef DEBUG
- /* 2004-11-30 SMS.
- Test the NEXTBYTE macro for proper operation.
- */
- {
- int test_char;
- static uch test_buf[2] = { 'a', 'b' };
-
- G.inptr = test_buf;
- G.incnt = 1;
-
- test_char = NEXTBYTE; /* Should get 'a'. */
- if (test_char == 'a')
- {
- test_char = NEXTBYTE; /* Should get EOF, not 'b'. */
- }
- if (test_char != EOF)
- {
- Info(slide, 0x401, ((char *)slide,
- "NEXTBYTE macro failed. Try compiling with ALT_NEXTBYTE defined?"));
-
- retcode = PK_COMPERR;
- goto cleanup_and_exit;
- }
- }
-# endif /* DEBUG */
-
/*---------------------------------------------------------------------------
First figure out if we're running in UnZip mode or ZipInfo mode, and put
the appropriate environment-variable options into the queue. Then rip
}
# endif /* DOS_FLX_H68_NLM_OS2_W32 */
-# if 0
-/* G.wildzipfn now set in command line switch as first non-option argument */
-# ifndef SFX
- G.wildzipfn = *argv++;
-# endif
-# endif
-
-# if (defined(SFX) && !defined(SFX_EXDIR)) /* only check for -x */
-
-# if 0
- /* all this should be done in the options call now */
-
-
- G.filespecs = argc;
- G.xfilespecs = 0;
-
- if (argc > 0) {
- char **pp = argv-1;
-
- G.pfnames = argv;
- while (*++pp)
- if (strcmp(*pp, "-x") == 0) {
- if (pp > argv) {
- *pp = 0; /* terminate G.pfnames */
- G.filespecs = pp - G.pfnames;
- } else {
- G.pfnames = (char **)fnames; /* defaults */
- G.filespecs = 0;
- }
- G.pxnames = pp + 1; /* excluded-names ptr: _after_ -x */
- G.xfilespecs = argc - G.filespecs - 1;
- break; /* skip rest of args */
- }
- G.process_all_files = FALSE;
- } else
- G.process_all_files = TRUE; /* for speed */
-# endif
-
-# else /* !SFX || SFX_EXDIR */ /* check for -x or -d */
-
-# if 0
- /* all this should be done in the options call now */
-
- G.filespecs = argc;
- G.xfilespecs = 0;
-
- if (argc > 0) {
- int in_files=FALSE, in_xfiles=FALSE;
- char **pp = argv-1;
-
- G.process_all_files = FALSE;
- G.pfnames = argv;
- while (*++pp) {
- Trace((stderr, "pp - argv = %d\n", pp-argv));
-# ifdef CMS_MVS
- if (!uO.exdir && STRNICMP(*pp, "-d", 2) == 0) {
-# else
- if (!uO.exdir && strncmp(*pp, "-d", 2) == 0) {
-# endif
- int firstarg = (pp == argv);
-
- uO.exdir = (*pp) + 2;
- if (in_files) { /* ... zipfile ... -d exdir ... */
- *pp = (char *)NULL; /* terminate G.pfnames */
- G.filespecs = pp - G.pfnames;
- in_files = FALSE;
- } else if (in_xfiles) {
- *pp = (char *)NULL; /* terminate G.pxnames */
- G.xfilespecs = pp - G.pxnames;
- /* "... -x xlist -d exdir": nothing left */
- }
- /* first check for "-dexdir", then for "-d exdir" */
- if (*uO.exdir == '\0') {
- if (*++pp)
- uO.exdir = *pp;
- else {
- Info(slide, 0x401, ((char *)slide,
- LoadFarString(MustGiveExdir)));
- /* don't extract here by accident */
- retcode = PK_PARAM;
- goto cleanup_and_exit;
- }
- }
- if (firstarg) { /* ... zipfile -d exdir ... */
- if (pp[1]) {
- G.pfnames = pp + 1; /* argv+2 */
- G.filespecs = argc - (G.pfnames-argv); /* for now... */
- } else {
- G.process_all_files = TRUE;
- G.pfnames = (char **)fnames; /* GRR: necessary? */
- G.filespecs = 0; /* GRR: necessary? */
- break;
- }
- }
- } else if (!in_xfiles) {
- if (strcmp(*pp, "-x") == 0) {
- in_xfiles = TRUE;
- if (pp == G.pfnames) {
- G.pfnames = (char **)fnames; /* defaults */
- G.filespecs = 0;
- } else if (in_files) {
- *pp = 0; /* terminate G.pfnames */
- G.filespecs = pp - G.pfnames; /* adjust count */
- in_files = FALSE;
- }
- G.pxnames = pp + 1; /* excluded-names ptr starts after -x */
- G.xfilespecs = argc - (G.pxnames-argv); /* anything left */
- } else
- in_files = TRUE;
- }
- }
- } else
- G.process_all_files = TRUE; /* for speed */
-# endif /* 0 */
-
- if (uO.exdir != (char *)NULL && !G.extract_flag) /* -d ignored */
+# if !defined( SFX) || defined( SFX_EXDIR)
+ if (uO.exdir != (char *)NULL && !G.extract_flag)
+ /* Have "-d exdir", but not actually extracting, so -d is ignored. */
Info(slide, 0x401, ((char *)slide, LoadFarString(NotExtracting)));
-# endif /* ?(SFX && !SFX_EXDIR) */
+# endif /* !defined( SFX) || defined( SFX_EXDIR) */
# ifdef UNICODE_SUPPORT
/* set Unicode-escape-all if option -U used */
# endif
# endif /* def KFLAG */
-
/*---------------------------------------------------------------------------
Okey dokey, we have everything we need to get started. Let's roll.
---------------------------------------------------------------------------*/
}
# endif
-# if 0
- /* 2012-12-11 SMS.
- * Disabled call of free_G_buffers() from
- * process.c:process_zipfiles(), so now DESTROYGLOBALS() should do all
- * the work (if any).
- *
- * On the other hand, the revised/reallocated argv[] is known only
- * locally, so we should free it.
- */
- /* 2012-12-10 SMS.
- * This code appears to be goofy/redundant.
- * Normally, process.c:process_zipfiles()
- * calls process.c:free_G_buffers(), which, "#ifdef MALLOC_WORK",
- * frees G.area.Slide, just like here. (With REENTRANT defined,
- * DESTROYGLOBALS() includes at least one call to free_G_buffers(), so
- * the "!defined(REENTRANT)" condition makes some sense, but why free
- * this stuff and not anything else, if not REENTRANT?)
- */
-# if defined(MALLOC_WORK) && !defined(REENTRANT)
- if (G.area.Slide != (uch *)NULL) {
- izu_free(G.area.Slide);
- G.area.Slide = (uch *)NULL;
- }
-# endif /* defined(MALLOC_WORK) && !defined(REENTRANT) */
-# endif /* 0 */
-
# ifdef REENTRANT
free_args( argv);
# endif /* def REENTRANT */
-
# if (defined(MSDOS) && !defined(SFX) && !defined(WINDLL))
if (retcode != PK_OK)
check_for_windows("UnZip");
-
-
# if (defined(REENTRANT) && !defined(NO_EXCEPT_SIGNALS))
/*******************************/
/* Function setsignalhandler() */
}
in_xfiles_count++;
value = NULL; /* In use. Don't free it. */
-
-# if 0
-# ifdef SFX
- /* now get -x list one entry at a time */
-
-
-
- /* when 'x' is the only option in this argument, and the
- * next arg is not an option, assume this initiates an
- * exclusion list (-x xlist): terminate option-scanning
- * and leave uz_opts with argv still pointing to "-x";
- * the xlist is processed later
- */
- if (s - argv[0] == 2 && *s == '\0' &&
- argc > 1 && argv[1][0] != '-') {
- /* break out of nested loops without "++argv;--argc" */
- goto opts_done;
- }
-# endif /* def SFX */
-# endif /* 0 */
break;
# if defined(RESTORE_UIDGID) || defined(RESTORE_ACL)
case ('X'): /* restore owner/group (more?) info (need privs?) */
# endif /* defined( SFX) && defined( DIAG_SFX) */
}
-#if 0 /* Duplicate below. */
-# ifdef SFX
- /* print our banner unless we're being fairly quiet */
- if (uO.qflag < 2)
- Info(slide, (uzo_err ? 1 : 0),
- ((char *)slide, LoadFarString(UnzipSFXBanner),
- UZ_MAJORVER, UZ_MINORVER, UZ_PATCHLEVEL, UZ_BETALEVEL,
- LoadFarStringSmall(VersionDate)));
-# ifdef BETA
- /* always print the beta warning: no unauthorized distribution!! */
- Info(slide, (uzo_err ? 1 : 0),
- ((char *)slide, LoadFarString(BetaVersion), "\n", "SFX"));
-# endif /* def BETA */
-# endif /* def SFX */
-#endif /* 0 Duplicate below. */
-
if (uO.cflag || uO.tflag || uO.vflag || uO.zflag
# ifdef TIMESTAMP
|| uO.T_flag
else
G.extract_flag = TRUE;
-# if 0
-# ifdef SFX
-opts_done: /* yes, very ugly...but only used by UnZipSFX with -x xlist */
-# endif /* def SFX */
-# endif /* 0 */
-
if (showhelp > 0) { /* just print help message and quit */
*pargc = -1;
# ifndef SFX
char val_type[5];
char neg[2];
-#if 0
- struct option_struct {
- int option_group; /* either UZO for UnZip or ZIO for ZipInfo syntax */
- char Far *shortopt; /* pointer to short option string */
- char Far *longopt; /* pointer to long option string */
- int value_type; /* from above */
- int negatable; /* from above */
- unsigned long option_ID; /* value returned by get_option when this option
- is found */
- char Far *name; /* optional string for option returned on some
- errors */
-#endif /* 0 */
-
sprintf(optiontext, "%s\n\n%s\n%s",
"Available options on this system",
"UNZ = UnZip option, INF = ZipInfo option",
LoadFarStringSmall(Check_Versions)));
++numopts;
# endif
-# ifdef COPYRIGHT_CLEAN
- Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat),
- LoadFarStringSmall(Copyright_Clean)));
- ++numopts;
-# endif
# ifdef DEBUG
Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat),
LoadFarStringSmall(UDebug)));
LoadFarStringSmall(Use_EF_UT_time)));
++numopts;
# endif
-# ifndef COPYRIGHT_CLEAN
- Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat),
- LoadFarStringSmall(Use_Smith_Code)));
- ++numopts;
-# endif
# ifndef LZW_CLEAN
Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat),
LoadFarStringSmall(Unshrink_Sup)));
(char *)(slide+256)));
++numopts;
# endif /* def PPMD_SUPPORT */
+# if defined( USE_UNREDUCE_PUBLIC) || defined( USE_UNREDUCE_SMITH)
+ Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat),
+ LoadFarStringSmall(Use_Unreduce)));
+ ++numopts;
+# endif
# ifdef VMS_TEXT_CONV
Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat),
LoadFarStringSmall(VmsTextConv)));
break;
}
}
-
-#if 0
- /* argument file code left out
- so for now let filenames start with @
- */
-
- } else if (allow_arg_files && arg[0] == '@') {
- /* arg file */
- oERR(PK_PARMS, no_arg_files_err);
-#endif /* 0 */
-
} else {
/* non-option */
if (enable_permute) {
/*
- Copyright (c) 1990-2014 Info-ZIP. All rights reserved.
+ Copyright (c) 1990-2015 Info-ZIP. All rights reserved.
See the accompanying file LICENSE, version 2009-Jan-02 or later
(the contents of which are also included in unzip.h) for terms of use.
# undef TIMESTAMP
#endif
+/* Accommodate old macro: USE_SMITH_CODE. */
+#if defined( USE_SMITH_CODE) && !defined( USE_UNREDUCE_SMITH)
+# define USE_UNREDUCE_SMITH
+#endif
+
+/* Disallow USE_UNREDUCE_PUBLIC and USE_UNREDUCE_SMITH together. */
+#if defined( USE_UNREDUCE_PUBLIC) && defined( USE_UNREDUCE_SMITH)
+ /* Indent to accommodate old compilers. */
+ # error USE_UNREDUCE_PUBLIC USE_UNREDUCE_SMITH both defined.
+#endif
+
/* For SFX, disable Reduce and Shrink compression methods. */
#ifdef SFX
-# ifndef COPYRIGHT_CLEAN
-# define COPYRIGHT_CLEAN /* Disable Reduce. */
+# ifdef USE_UNREDUCE_PUBLIC
+# undef USE_UNREDUCE_PUBLIC /* Disable public-domain Reduce. */
+# endif
+# ifdef USE_UNREDUCE_SMITH
+# undef USE_UNREDUCE_SMITH /* Disable Smith copyrighted Reduce. */
# endif
# ifndef LZW_CLEAN
# define LZW_CLEAN /* Disable Shrink. */
# endif
#endif
-#if (!defined(COPYRIGHT_CLEAN) && !defined(USE_SMITH_CODE))
-# define COPYRIGHT_CLEAN
-#endif
-
/* The LZW patent is expired worldwide since 2004-Jul-07, so
* UNSHRINK_SUPPORT is now enabled by default. See unshrink.c.
*/
#define EF_UNICOMNT 0x6375 /* Info-ZIP Unicode Comment ("uc") */
#define EF_BEOS 0x6542 /* BeOS ("Be") */
#define EF_THEOS 0x6854 /* Jean-Michel Dubois Theos "Th" */
-#define EF_LHDREXTN 0x6c65 /* Local header extension ("el") */
+#define EF_STREAM 0x6c78 /* Extended Local Header (Stream) ("xl") */
#define EF_UNIPATH 0x7075 /* Info-ZIP Unicode Path ("up") */
#define EF_ASIUNIX 0x756e /* ASi Unix ("nu") */
#define EF_IZUNIX2 0x7855 /* Info-ZIP second Unix[2] ("Ux") */
#define EB_ID 0 /* offset of block ID in header */
#define EB_LEN 2 /* offset of data length field in header */
#define EB_UCSIZE_P 0 /* offset of ucsize field in compr. data */
-#define EB_CMPRHEADLEN 6 /* lenght of compression header */
+#define EB_CMPRHEADLEN 6 /* length of compression header */
#define EB_UX_MINLEN 8 /* minimal "UX" field contains atime, mtime */
#define EB_UX_FULLSIZE 12 /* full "UX" field (atime, mtime, uid, gid) */
#define EB_IZVMS_BC00 1 /* 0byte -> 0bit compression */
#define EB_IZVMS_BCDEFL 2 /* Deflated */
+#define EB_STREAM_EOB 0x80 /* Stream EF End-of-bitmap flag. */
/*---------------------------------------------------------------------------
True sizes of the various headers (excluding their 4-byte signatures),
Please note that the structure members are now reordered by size
(top-down), to prevent internal padding and optimize memory usage!
*/
- typedef struct local_file_header { /* LOCAL */
+ typedef struct local_file_header { /* LOCAL */
zusz_t csize;
zusz_t ucsize;
ulg last_mod_dos_datetime;
ush extra_field_length;
} local_file_hdr;
- typedef struct central_directory_file_header { /* CENTRAL */
+ typedef struct ext_local_file_header { /* EXT. LOCAL (strm) */
+ ulg external_file_attributes;
+ zuvl_t disk_number_start;
+ ush file_comment_length;
+ ush internal_file_attributes;
+ uch version_made_by[2];
+ } ext_local_file_hdr;
+
+ typedef struct central_directory_file_header { /* CENTRAL */
zusz_t csize;
zusz_t ucsize;
zusz_t relative_offset_local_header;
ush file_comment_length;
} cdir_file_hdr;
- typedef struct end_central_dir_record { /* END CENTRAL */
+ typedef struct end_central_dir_record { /* END CENTRAL */
zusz_t size_central_directory;
zusz_t offset_start_central_directory;
zucn_t num_entries_centrl_dir_ths_disk;
unsigned ef_scan_for_izux OF((ZCONST uch *ef_buf, long ef_len,
int ef_is_c, ulg dos_mdatetime,
iztimes *z_utim, ulg *z_uidgid));
+
+#ifdef USE_EF_STREAM
+unsigned ef_scan_for_stream OF((ZCONST uch *ef_ptr, long ef_len,
+ int *btmp_siz, uch *btmp,
+ ext_local_file_hdr *xlhdr,
+ char **cmnt));
+#endif /* def USE_EF_STREAM */
+
#ifdef IZ_CRYPT_AES_WG
int ef_scan_for_aes OF((ZCONST uch *ef_buf, long ef_len,
ush *vers, ush *vend,
int inflate_free OF((__GPRO)); /* inflate.c */
#endif /* ?USE_ZLIB */
#if (!defined(SFX) && !defined(FUNZIP))
-#ifndef COPYRIGHT_CLEAN
+#if defined( USE_UNREDUCE_PUBLIC) || defined( USE_UNREDUCE_SMITH)
int unreduce OF((__GPRO)); /* unreduce.c */
-/* static void LoadFollowers OF((__GPRO__ f_array *follower, uch *Slen));
- * unreduce.c */
-#endif /* !COPYRIGHT_CLEAN */
+#endif /* defined( USE_UNREDUCE_PUBLIC) || defined( USE_UNREDUCE_SMITH) */
#ifndef LZW_CLEAN
int unshrink OF((__GPRO)); /* unshrink.c */
/* static void partial_clear OF((__GPRO)); * unshrink.c */
# endif
# ifdef BETA
-# define UZ_BETALEVEL "c14 BETA"
-# define UZ_VERSION_DATE "05 Jan 2015" /* Internal beta version. */
+# define UZ_BETALEVEL "c15 BETA"
+# define UZ_VERSION_DATE "13 Jan 2015" /* Internal beta version. */
# else
# define UZ_BETALEVEL ""
# define UZ_VERSION_DATE "?? ??? 2015" /* Official release version. */
[.$(DEST)]UBZ2ERR_L.OBJ : [.SZIP]CPUARCH.H
.ENDIF # LZMA_PPMD
[.$(DEST)]UNREDUCE.OBJ : []UNREDUCE.C
+[.$(DEST)]UNREDUCE.OBJ : []EXPAND.C
[.$(DEST)]UNREDUCE.OBJ : []UNZIP.H
[.$(DEST)]UNREDUCE.OBJ : []UNZPRIV.H
[.$(DEST)]UNREDUCE.OBJ : [.VMS]VMSCFG.H
#
# UnZip 6.10 for VMS -- MMS Dependency Description File.
#
-# Last revised: 2014-10-19
+# Last revised: 2015-01-09
#
#----------------------------------------------------------------------
-# Copyright (c) 2004-2014 Info-ZIP. All rights reserved.
+# Copyright (c) 2004-2015 Info-ZIP. All rights reserved.
#
# See the accompanying file LICENSE, version 2009-Jan-2 or later (the
# contents of which are also included in zip.h) for terms of use. If,
# is not specified. Typical usage:
#
# $ L_U = "CRYPT_AES_WG_SFX, BZIP2_SFX, USE_OWN_CRCTAB,"+ -
-# " LZMA_SFX, PPMD_SFX, API_DOC, MEMDIAG"
+# " LZMA_SFX, PPMD_SFX, API_DOC, MEMDIAG, USE_UNREDUCE_PUBLIC"
# $ MMS /EXTEND /DESCRIP = [.VMS]DESCRIP_MKDEPS.MMS /SKIP -
# /MACRO = (AES_WG=1, IZ_BZIP2=iz_bzip2, IZ_ZLIB=iz_zlib, -
# LIBUNZIP=1, "LOCAL_UNZIP=''L_U'")
-Info-Zip UnZip -- Source kit. Version 6.10c14 (BETA) 05 Jan 2015.
+Info-Zip UnZip -- Source kit. Version 6.10c15 (BETA) 13 Jan 2015.
See enclosed files INSTALL, LICENSE, and README. For information on
Info-Zip UnZip and Zip:
/*
- Copyright (c) 1990-2014 Info-ZIP. All rights reserved.
+ Copyright (c) 1990-2015 Info-ZIP. All rights reserved.
See the accompanying file LICENSE, version 2009-Jan-02 or later
(the contents of which are also included in unzip.h) for terms of use.
static ZCONST char Far efTheos[] = "Theos";
static ZCONST char Far efAES[] = "AES_WG encrypt";
static ZCONST char Far efJavaCAFE[] = "Java CAFE";
-static ZCONST char Far efLHdrExtn[] = "Local Hdr Ext'n";
+static ZCONST char Far efStream[] = "Ext'd Lcl Hdr (stream)";
static ZCONST char Far efUnknown[] = "unknown";
static ZCONST char Far OS2EAs[] = ".\n\
static ZCONST char Far First20[] = ". The first\n 20 are: ";
static ZCONST char Far ColonIndent[] = ":\n ";
static ZCONST char Far efFormat[] = " %02x";
-static ZCONST char Far efLHdrExtnBitMap[] = " Bit map:";
-static ZCONST char Far efLHdrExtnBitMapByte[] = " %02x";
-static ZCONST char Far efLHdrExtnBitMapEol[] = "\n";
+static ZCONST char Far efStreamBitMap[] = " Bit map:";
+static ZCONST char Far efStreamBitMapByte[] = " %02x";
+static ZCONST char Far efStreamBitMapEol[] = "\n";
static ZCONST char Far AesExtraField[] = ".\n\
Vers: %s, Vend ID: %c%c, Mode: %s, Cmpr mthd: %s";
Info(slide, 0, ((char *)slide, LoadFarString(ExtraFields)));
- while (ef_len >= EB_HEADSIZE) {
+ while (ef_len >= EB_HEADSIZE)
+ {
eb_id = makeword(&ef_ptr[EB_ID]);
eb_len = makeword(&ef_ptr[EB_LEN]);
ef_ptr += EB_HEADSIZE;
case EF_JAVA:
ef_fieldname = efJavaCAFE;
break;
- case EF_LHDREXTN:
- ef_fieldname = efLHdrExtn;
+ case EF_STREAM:
+ ef_fieldname = efStream;
break;
default:
ef_fieldname = efUnknown;
md5));
break;
} /* else: fall through !! */
- case EF_LHDREXTN:
- {
- long eb_ndx = 0;
- int eb_state = -1;
- uch bit_mask;
- unsigned hnum = (unsigned)-1;
- unsigned hver;
-
- Info( slide, 0, ((char *)slide,
- LoadFarString( efLHdrExtnBitMap)));
- while (eb_ndx < eb_len)
- {
- switch (eb_state)
+ break;
+ case EF_STREAM: /* (Not expected in the central directory.) */
{
- case -1: /* Seeking end of bit mask. */
- Info( slide, 0, ((char *)slide,
- LoadFarString( efLHdrExtnBitMapByte),
- *(ef_ptr+ eb_ndx)));
- if ((*(ef_ptr+ eb_ndx)& 0x80) == 0)
+ long eb_ndx = 0;
+ int eb_state = -1;
+ uch bit_mask;
+ unsigned hnum = (unsigned)-1;
+ unsigned hver;
+
+ Info( slide, 0, ((char *)slide,
+ LoadFarString( efStreamBitMap)));
+ while (eb_ndx < eb_len)
+ {
+ switch (eb_state)
{
- eb_state = 1;
- eb_ndx++;
- bit_mask = *ef_ptr;
- Info( slide, 0, ((char *)slide,
- LoadFarString( efLHdrExtnBitMapEol)));
- }
- break;
- case 0: /* bit_mask[ 0]. */
- if (bit_mask& 0x01)
- { /* Version Made By. */
- if (eb_ndx+ 2 <= eb_len)
- {
- hver = *(ef_ptr+ eb_ndx);
- hnum = *(ef_ptr+ eb_ndx+ 1);
- zi_vers_made_by( __G__ 1, hnum, hver);
- eb_ndx += 2;
- }
- else
- break;
- }
- if (bit_mask& 0x02)
- { /* Internal File Atributes. */
- if (eb_ndx+ 2 <= eb_len)
- {
- iattr = makeword( ef_ptr+ eb_ndx);
- zi_long_intern_attr( __G__ 1, iattr);
- eb_ndx += 2;
- }
- else
- break;
- }
- if (bit_mask& 0x04)
- { /* External File Atributes. */
- if (eb_ndx+ 4 <= eb_len)
- {
- xattr = makelong( ef_ptr+ eb_ndx);
- if (hnum != (unsigned)-1)
- { /* Must know host type for ext attr. */
- zi_long_extern_attr( __G__ 1, hnum, xattr);
+ case -1: /* Seeking end of bit mask. */
+ Info( slide, 0, ((char *)slide,
+ LoadFarString( efStreamBitMapByte),
+ *(ef_ptr+ eb_ndx)));
+ if ((*(ef_ptr+ eb_ndx)& EB_STREAM_EOB) == 0)
+ {
+ eb_state = 1;
+ eb_ndx++;
+ bit_mask = *ef_ptr;
+ Info( slide, 0, ((char *)slide,
+ LoadFarString( efStreamBitMapEol)));
}
- eb_ndx += 4;
- }
- else
break;
- }
- if (bit_mask& 0x08)
- {
- if (eb_ndx+ 2 <= eb_len)
- {
- fc_len = makeword( ef_ptr+ eb_ndx);
- eb_ndx += 2;
- if (eb_ndx+ (long)fc_len <= eb_len)
+ case 0: /* bit_mask[ 0]. */
+ if (bit_mask& (1 << 0))
+ { /* Version Made By. */
+ if (eb_ndx+ 2 <= eb_len)
+ {
+ hver = *(ef_ptr+ eb_ndx);
+ hnum = *(ef_ptr+ eb_ndx+ 1);
+ zi_vers_made_by( __G__ 1, hnum, hver);
+ eb_ndx += 2;
+ }
+ else
+ break;
+ }
+ if (bit_mask& (1 << 1))
+ { /* Internal File Atributes. */
+ if (eb_ndx+ 2 <= eb_len)
+ {
+ iattr = makeword( ef_ptr+ eb_ndx);
+ zi_long_intern_attr( __G__ 1, iattr);
+ eb_ndx += 2;
+ }
+ else
+ break;
+ }
+ if (bit_mask& (1 << 2))
+ { /* External File Atributes. */
+ if (eb_ndx+ 4 <= eb_len)
+ {
+ xattr = makelong( ef_ptr+ eb_ndx);
+ if (hnum != (unsigned)-1)
+ { /* Must know host type for ext attr. */
+ zi_long_extern_attr( __G__ 1, hnum, xattr);
+ }
+ eb_ndx += 4;
+ }
+ else
+ break;
+ }
+ if (bit_mask& (1 << 3))
{
- eb_ndx += fc_len;
+ if (eb_ndx+ 2 <= eb_len)
+ {
+ fc_len = makeword( ef_ptr+ eb_ndx);
+ eb_ndx += 2;
+ if (eb_ndx+ (long)fc_len <= eb_len)
+ {
+ eb_ndx += fc_len;
+ }
+ else
+ break;
+ }
+ else
+ break;
}
- else
- break;
- }
- else
+ default:
break;
- }
- default:
- break;
- } /* switch (eb_state) */
- } /* while (eb_ndx < eb_len) */
- } /* case EF_LHDREXTN */
+ } /* switch (eb_state) */
+ } /* while (eb_ndx < eb_len) */
+ } /* case EF_STREAM */
+ break;
default:
ef_default_display: