Skip to content

Commit 4b59db4

Browse files
author
Peter Jannesen
committed
ncompress - (Ver. 4.2.3) an improved file compressor
This is version 4.2 of (N)compress (an improved version of compress 4.1). Compress is a fast, simple LZW file compressor. Compress does not have the highest compression rate, but it is one of the fastest programs to compress data. Compress is the defacto standard in the UNIX community for compressing files. 'build' is a menu driven shell script for compiling, testing and installing (N)compress. So to build and install (N)compress all you have to do is run build. Build will first test your system for default settings. The current compile settings are stored in a special file called compress.def. For user with problems with build there is a default makefile included called 'Makefile.def'. Also build is capable te generate a Makefile with all options (option genmake). (N)compress 4.2 has a special, fast compression hash algorithm. This algorithm uses more memory than the old hash table. If you don't want the faster hash table algorithm set 'Memory free for compress' below 800000. zcmp, zdiff, zmore were copied from version 4.1 without any changes. The output of (N)compress 4.2 is fully compatible with that of compress 3.0. In other words, the output of (N)compress 4.2 may be fed into uncompress 3.0 or the output of compress 3.0 may be fed into uncompress 4.2. The output of (N)compress 4.2 is not compatible with that of compress 2.0. However, compress 4.2 still accepts the output of compress 2.0. To generate output that is compatible with compress 2.0, use the undocumented "-C" flag.
1 parent 1411cb7 commit 4b59db4

16 files changed

+3047
-1995
lines changed

Acknowleds

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Acknowledgments:
2+
3+
(N)compress, Version 4.2
4+
5+
Thanks to the previous authors whom I didn't contact, for making
6+
the program available originally.
7+
Spencer W. Thomas (decvax!harpo!utah-cs!utah-gr!thomas)
8+
Jim McKie (decvax!mcvax!jim)
9+
Steve Davies (decvax!vax135!petsd!peora!srd)
10+
Ken Turkowski (decvax!decwrl!turtlevax!ken)
11+
James A. Woods (decvax!ihnp4!ames!jaw)
12+
Joe Orost (decvax!vax135!petsd!joe)
13+
Dave Mack ([email protected])
14+
15+
Also thanks to Frans Meulenbroeks, Jan Christiaan van Winkel,
16+
Peter van Hooft and the testers of comp.sources.reveiwed for testing
17+
this version on different platforms.
18+
19+
--
20+
Peter Jannesen

Acks

Lines changed: 0 additions & 18 deletions
This file was deleted.

Changes

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,30 @@
1+
(N)compress cersion 4.2.2
2+
Minor changes after the reviewes from comp.sources.reviewed
3+
o Change the name to ncompress because of version problems.
4+
o Start all scripts with ':'
5+
o Added libary options to buidl script.
6+
o Install zmore zcmp zdiff and manuals.
7+
o Added patchlevel.h
8+
o Updated README file. Created LZW.INFO
9+
o a complete grammatical go-round
10+
o Use utime.h if availble
11+
o Change de default input/output buffer size to BUFSIZ. Because
12+
of performance problems with read a head on systems.
13+
o Build generates a makefile.
14+
15+
compress version 4.2.1 improvements
16+
o Change the name to ncompress because of version problems.
17+
o Completly rewrite of the compress and decompress functions.
18+
compress speedup 25-50% (user cpu time).
19+
decompress speedup 20-30% (user cpu time).
20+
o Add special fast compress hash algorithm.
21+
o Fix some minor things.
22+
o use #include <utime.h> if availble.
23+
o Cleanup the source code (I think so).
24+
o Test if filename is not to long. This is done on runtime no fix length
25+
size any more.
26+
o Powerfull build script (test almost every thing).
27+
128
Modifications for version 4.1:
229
o Added -r command line flag to allow recursive compression/
330
decompression of directory trees. As a side-effect, compress
@@ -15,13 +42,14 @@ Modifications for version 4.1:
1542
o Removed atob/btoa/tarmail/untarmail - my versions are
1643
based on btoa 5.2 which is not compatible with the atob
1744
included with compress4.0.
45+
1846
Compress version 4.0 improvements:
1947
o compress() speedup (10-50%) by changing division hash to xor
2048
o decompress() speedup (5-10%)
2149
o Memory requirements reduced (3-30%)
2250
o Stack requirements reduced to less than 4kb
2351
o Removed 'Big+Fast' compress code (FBITS) because of compress speedup
24-
o Portability mods for Z8000 and PC/XT (but not zeus 3.2)
52+
o Portability mods for Z8000 and PC/XT (but not zeus 3.2)
2553
o Default to 'quiet' mode
2654
o Unification of 'force' flags
2755
o Manual page overhaul

LZW.INFO

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
The following article from James A. Woods, one of the earlier
2+
authors of compress, explains its relationship to the Unisys
3+
patent on the LZW compression method:
4+
5+
From uunet!zephyr.ens.tek.com!uw-beaver!mit-eddie!wuarchive!usc!ucsd!ucbvax!agate!riacs!jaw Wed Aug 1 15:06:59 EDT 1990
6+
Article: 1282 of gnu.misc.discuss
7+
Path: alembic!uunet!zephyr.ens.tek.com!uw-beaver!mit-eddie!wuarchive!usc!ucsd!ucbvax!agate!riacs!jaw
8+
From: [email protected] (James A. Woods)
9+
Newsgroups: gnu.misc.discuss
10+
Subject: Sperry patent #4,558,302 does *not* affect 'compress'
11+
Keywords: data compression, algorithm, patent
12+
Message-ID: <[email protected]>
13+
Date: 31 Jul 90 22:09:35 GMT
14+
Organization: RIACS, NASA Ames Research Center
15+
Lines: 69
16+
17+
# "The chief defect of Henry King
18+
Was chewing little bits of string."
19+
20+
-- Hilaire Belloc, Cautionary Tales [1907]
21+
22+
As a co-author of 'compress' who has had contact with an attorney for
23+
Unisys (nee Sperry), I would like to relay a very basic admission from Unisys
24+
that noncommercial use of 'compress' is perfectly legal. 'Compress' is also
25+
commercially distributed by AT&T as part of Unix System 5 release 4,
26+
with no further restrictions placed upon the use of the binary, as far
27+
as I am aware.
28+
29+
From conversations with Professor Abraham Lempel and others, it
30+
appears that neither AT&T, Sun Microsystems, Hewlett Packard, nor IBM
31+
are paying any sort of license fees to Unisys in conjunction with patent
32+
#4,558,302. It may be true that some organizations are paying fees for
33+
data compression technology licensed from one or more of the many holders
34+
of compression patents, but this is all independent from 'compress'.
35+
36+
In particular, I received a letter at NASA dated October 1, 1987 from
37+
John B. Sowell of the Unisys law department, informing me for the first
38+
time that some form of LZW was patented. I naturally expressed
39+
skepticism that an algorithm could be patented (a murky legal area
40+
which remains so), stated that 'compress' is not identical to LZW,
41+
and in fact was designed, developed, and distributed before the ink
42+
on the patent was dry. Several telephone conversations later, Mr. Sowell
43+
intimated that they would *not* seek any fees from users of 'compress'
44+
but instead were signing licensees for hardware implementations of LZW.
45+
46+
So, regardless of what you believe about a shady legal area, if anyone
47+
from Unisys contacts you to extract tribute for the use of 'compress', please
48+
tell them that, first, it is not theirs to begin with, and, second, there is
49+
someone who will testify in court about the conversation above.
50+
It is not even clear if anyone can "own" 'compress', since original developer
51+
Spencer Thomas, myself, and others placed the code in the public domain
52+
long before the adoption of the Berne copyright convention.
53+
54+
In light of the events above, it seems that the Free Software
55+
Foundation is being unduly paranoid about the use of 'compress'.
56+
Now I can well believe that FSF is more likely to be a legal target
57+
than a behemoth like AT&T, but if they are simply redistributing
58+
untouched free software developed years ago in the public sector,
59+
I see no problem.
60+
61+
Aside: I am investigating, possibly for a case history to be
62+
recycled to USENET, the particulars of data compression patents.
63+
I am aware of the following patents: IBM's Miller-Wegman LZ variant,
64+
those of Telcor and ACT [losing candidates for the British Telecom modem
65+
standard], James A. Storer's work on limited lookahead as explicated in his
66+
text "Data Compression (methods and theory)", Computer Science Press, 1988,
67+
and the various patents pending associated with the Fiala and Greene
68+
CACM article of April, 1989 on textual substitution methods.
69+
If you have any lore, send it this way.
70+
71+
72+
73+
Sincerely,
74+
75+
James A. Woods
76+
NASA Ames Research Center (RIACS)
77+
[email protected] (or ames!jaw)
78+
79+
80+
P.S. The algorithm patent issue certainly is a "topic A" at the moment.
81+
One useful reference is the review article by Anthony and Colwell --
82+
"Litigating the Validity and Infringement of Software Patents" in
83+
Washington and Lee Law Review, volume 41, fall 1984. I know Robert Colwell
84+
personally. As a practicing patent attorney, he tells me that, at a minimum,
85+
use of an invention "for research purposes" is legitimate.

MANIFEST

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
File Name Archive # Description
2+
-----------------------------------------------------------
3+
Acknowleds 1
4+
Changes 1
5+
Makefile.def 1
6+
MANIFEST 1 This shipping list
7+
LZW.INFO 1
8+
README 1
9+
build 1
10+
compress.1 1
11+
compress42.c 1/2
12+
patchlevel.h 2
13+
zcmp 1
14+
zcmp.1 1
15+
zdiff 1
16+
zmore 1
17+
zmore.1 1

Makefile

Lines changed: 0 additions & 88 deletions
This file was deleted.

Makefile.def

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Makefile
2+
3+
# C complier
4+
CC=cc
5+
6+
# Install directory for binarys
7+
BINDIR=/usr/local/bin
8+
9+
# Install directory for manual
10+
MANDIR=/usr/local/man/man1
11+
12+
# compiler options:
13+
# options is a collection of:
14+
#
15+
# -DDIRENT=1 Use dirent.h
16+
# -DSYSDIR=1 Use sys/dir.h
17+
# -DLSTAT=1 Use lstat for finding symlinks.
18+
# -DUTIME_H=1 Use utime.h
19+
# -DUSERMEM=<size> Availble memory for compress (default 800k).
20+
# -DREGISTERS=<nbr> Number of registers (default 2).
21+
# -DIBUFSIZ=<size> Input buffer size (default BUFSIZ).
22+
# -DOBUFSIZ=<size> Output buffer size (default BUFSIZ)
23+
# -DBYTEORDER=<order> Byte order (default: unknown).
24+
# -DNOALLIGN=1 Data word allignment (default: yes).
25+
# -DDEF_ERRNO=1 Define error (not defined in errno.h).
26+
# -DMAXSEG_64K=1 -BITS=16 Support segment processsor like 80286.
27+
#
28+
options= -DIRENT=1 -DUSERMEM=800000 -DREGISTERS=3
29+
30+
# libary options
31+
LBOPT=
32+
33+
compress: Makefile compress42.c patchlevel.h
34+
$(CC) -o compress $(options) "-DCOMPILE_DATE=\"`date`\"" compress42.c $(LBOPT)
35+
36+
install: compress
37+
[ -f /usr/local/bin/compress ] && { rm -f /usr/local/bin/compress.old ; mv /usr/local/bin/compress /usr/local/bin/compress.old ; }
38+
rm -f /usr/local/bin/uncompress /usr/local/bin/zcat
39+
cp compress /usr/local/bin/compress
40+
strip /usr/local/bin/compress
41+
rm -f /usr/local/bin/uncompress
42+
ln /usr/local/bin/compress /usr/local/bin/uncompress
43+
rm -f /usr/local/bin/zcat
44+
ln -f /usr/local/bin/compress /usr/local/bin/zcat
45+
cp zcmp zdiff zmore /usr/local/bin/.
46+
chmod 0755 /usr/local/bin/compress /usr/local/bin/zcmp /usr/local/bin/zdiff /usr/local/bin/zmore
47+
cp compress.1 zcmp.1 zmore.1 /usr/local/man/man1/.
48+
chmod 0644 /usr/local/man/man1/compress.1 /usr/local/man/man1/zcmp.1 /usr/local/man/man1/zmore.1
49+
50+
cleanup:
51+
rm -f compress compress.def comp.log

0 commit comments

Comments
 (0)