home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 9 Archive
/
09-Archive.zip
/
UnzpHist.zip
/
History.396
< prev
next >
Wrap
Text File
|
1990-10-27
|
7KB
|
137 lines
28 September 1990
Yes, folks, it's true: nunzip (as in, "new(t) unzip") is, at long
last, more-or-less done. For those of you just joining us, or those
of you who make a habit of ignoring my messages, this is nearly a
complete rewrite of unzip...at least, I like to think so. I didn't
fool with the uncompression routines, of course (except to make sure
one or two recent patches were installed), nor did I abuse most of the
other low-level support stuff. The overall structure, however, is
another matter entirely.
Basically, this version processes the central directory rather than
the individual file headers scattered throughout the zipfile. This
gains you several advantages: speed (especially in listing the
zipfile directory); the ability to process self-extracting zipfiles
without additional shenanigans; and, of course, access to all the
information in the central directory. Among the goodies found there
are the OS-created-by bytes, which were the whole reason I got in-
volved with this in the first place: with them you can decide whether
or not to convert the filenames to lowercase (e.g., DOS files, yes;
Unix files, no).
So what all is different? To be honest, I forget. But some of the
things are:
- Automatic filename conversion for files coming from DOS,
VMS, VM/CMS (or whatever it's called), etc., but none for
files coming from mixed-case OS's (I may have misplaced
a couple of these, so somebody please take a look).
- A -U ("uppercase") option to disable this conversion in
case you happen to like all-uppercase names in Unix.
- Normal output now goes to stdout instead of stderr, so
you can (for example) redirect the output of a -t command
to a file and run the whole thing as a background process,
or send extraction messages to /dev/null, or whatever.
Real error messages still come through, of course.
- Full PK-compatible exit (error) codes, following Bo
Kullmar's initial patches. This part was a real bitch
to add, and it contributes around 6 or 7 KB to the nunzip
source; but it's almost entirely confined to the header-
processing routines, so program speed isn't much affected.
I haven't actually tested this part out very extensively
(not having any mangled zipfiles to play with), but it did
function properly in the combined NOTINT16/HIGH_LOW (i.e.,
non-functioning) version of nunzip I tested yesterday.
Most of the changes are of the internal, programmer-pleasing persuasion:
- Some reorganization of files--the former contents of
ascebc.c, crc32.c, and zmem*.c have been lumped together
in a new file called misc.c, along with the NOTINT16
and HIGH_LOW routines and one new one I wrote.
- "MULTICOMPILE" is no longer an option; if you don't like
it, well... :)
- A reorganized header file with 5 distinct sections,
including either real or fake prototypes (depending on
whether the compiler is ANSI or not); this section doubles
as a table of contents for where to find all the routines.
- About 80 bejillion comments, so subsequent generations of
unzip programmers (or you, even) can figure out what the
heck I (and others) did, and why.
- Incorporation of Mark Edwards' SysV mkdir patch into the
mapped_name() function, along with a tweak of my own which
should speed it up considerably in some cases.
- Incorporation of Bob Kemp's NOTINT16 code, which is how
it should have been done in the first place (not that I'm
blaming whoever did it the other way; obviously, I didn't
think of it, either). Related to this is the fix of the
NOTINT16/HIGH_LOW bug, which I reported yesterday.
- And just a whole LOT of code-cleanup.
The last point is the one about which I expect to hear the most
grumbles; I was a bit heavy-handed there. Among other things, I
rearranged code (e.g., main() is now at the top, followed by the
routines it calls, followed by the ones they call, etc.--this is
possible because of the forward declarations in the header file);
put all the redundant header stuff in unzip.h (and extern variables
in globals.h) and #included both files in each code unit; added
big hairy "title blocks" or whatever you call them to the top of
each function so they're easier to find (just look at the code,
it's obvious what I'm talking about); shuffled some stuff around
in the makefile and collapsed a couple options (sorry, David :) );
removed all the tabs I could find, except in the makefile (well, my
editor does that on its own); and a bunch of other related stuff.
Unavoidably, the code now reflects my personal style of coding, and
I apologize if it doesn't match that of everyone else out there.
But I think most of you will agree that it's a lot more coherent,
easier to read, and easier to understand than the old version was.
This really needed doing, and since I had already changed so much
of the code anyway, I figured I might as well go ahead. Besides,
the old mess was driving me nuts. :) The "new look" works really
well on laser printers when printed in the "two-up" format, btw.
Nunzip has been tested on the following machines and compilers,
and I include the sizes of the executables for amusement purposes:
386 clone, Microsoft C 5.0, "standard": 26945
386 clone, Microsoft C 5.0, NOTINT16: 27537
VAX 11/785 BSD 4.3, cc, "standard": 34816
VAX 11/785 BSD 4.3, cc, NOTINT16: 35840
Sun 3 BSD 4.2, cc, NOTINT16: 57344
Sun 3 BSD 4.2, cc, HIGH_LOW: 57344
Amdahl UTS (SysV) 1.2.4, cc, NOTINT16: 64972
Amdahl UTS (SysV) 1.2.4, cc, HIGH_LOW: 64995
Cray Y-MP UNICOS 5.1.10 (SysV + BSD), cc, NOTINT16: 179184
Cray-2 UNICOS 5.1.9 (SysV + BSD), cc, NOTINT16: 182240
Cray Y-MP UNICOS 5.1.10 (SysV + BSD), scc, NOTINT16: 198088
Cray-2 UNICOS 5.1.9 (SysV + BSD), scc, NOTINT16: 219336
In addition, David (Kirschbaum) tested an earlier version on a
PC with Turbo C; Bo Kullmar tested the next version after that
on a DIAB (Swedish) and a PC with MSC 6.0; and Bob Kemp tested
the version immediately preceding this one on an AT&T 3B2. Bo's
DIAB compiler reported an error in the do_string() routine, but
a subsequent test with an upgraded version of the compiler made
that error disappear. (Whew. :) ) Anyway, thanks to all three
for the help, comments, fixes, etc. Thanks also to Mark Edwards
and Mark Adler for their help.
That about wraps it, I'd say. There are one or two things I would
like to do yet, and Bo made a suggestion regarding international
date formats which I don't know how to implement (except for ANSI
compilers, using the locale.h header file), but we'll save those
for some other time.
With any luck, nunzip96.arc (or, as I've referred to it internally,
unzip 3.96) should be in the usual Simtel directory by sometime
tomorrow (and maybe nunzip96.zip, depending on the size difference?).
Eventually, if people decide they like it, I'm hoping we can just
make this unzip (4.0, of course :) ). Whatever.
Ahhh...fame, fortune, babes--I can see it now....
Greg Roelofs (occasionally answering to "Cave Newt"),
roelofs@amelia.nas.nasa.gov