home *** CD-ROM | disk | FTP | other *** search
- From: zip-bugs@wkuvx1.wku.edu (Info-ZIP group)
- Newsgroups: comp.sources.misc
- Subject: v44i081: unzip - Info-ZIP portable UnZip, version 5.12, Part16/20
- Date: 18 Sep 1994 23:16:50 -0500
- Organization: Sterling Software
- Sender: kent@sparky.sterling.com
- Approved: kent@sparky.sterling.com
- Message-ID: <35j3bi$qr0@sparky.sterling.com>
- X-Md4-Signature: fc9034042d2903ac94e0a3310d087ffd
-
- Submitted-by: zip-bugs@wkuvx1.wku.edu (Info-ZIP group)
- Posting-number: Volume 44, Issue 81
- Archive-name: unzip/part16
- Environment: UNIX, VMS, OS/2, MS-DOS, MACINTOSH, WIN-NT, LINUX, MINIX, COHERENT, AMIGA?, ATARI TOS, SGI, DEC, Cray, Convex, Amdahl, Sun
- Supersedes: unzip50: Volume 31, Issue 104-117
-
- #! /bin/sh
- # This is a shell archive. Remove anything before this line, then feed it
- # into a shell via "sh file" or similar. To overwrite existing files,
- # type "sh file -c".
- # Contents: unzip-5.12/README unzip-5.12/amiga/flate.a
- # unzip-5.12/atari/Makefile unzip-5.12/mac/macunzip.c
- # unzip-5.12/unzipsfx.doc unzip-5.12/vms/unzipsfx.hlp
- # unzip-5.12/vms/vms.h
- # Wrapped by kent@sparky on Sat Sep 17 23:33:46 1994
- PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin:$PATH ; export PATH
- echo If this archive is complete, you will see the following message:
- echo ' "shar: End of archive 16 (of 20)."'
- if test -f 'unzip-5.12/README' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'unzip-5.12/README'\"
- else
- echo shar: Extracting \"'unzip-5.12/README'\" \(9076 characters\)
- sed "s/^X//" >'unzip-5.12/README' <<'END_OF_FILE'
- XThis is the README file for the 28 August 1994 public release of the
- XInfo-ZIP group's portable UnZip zipfile-extraction program (and related
- Xutilities).
- X
- Xunzip512.zip portable UnZip, version 5.12, source code distribution
- Xunzip512.tar.Z same as above, but compress'd tar format
- X
- X__________________________________________________________________________
- X
- XBEFORE YOU ASK: UnZip, its companion utility Zip, and related utilities
- Xand support files can be found in many places; read the file "Where" for
- Xfurther details. To contact the authors with suggestions, bug reports,
- Xor fixes, continue reading this file (README) and, if this is part of a
- Xsource distribution, the file "ZipPorts". Also in source distributions:
- Xread "BUGS" for a list of known bugs, non-bugs and possible future bugs;
- XINSTALL for instructions on how to build UnZip; and "Contents" for a com-
- Xmented listing of all the distributed files.
- X
- XALSO NOTE: Info-ZIP's mailing addresses changed between UnZip 5.0p1 and
- X5.1 releases (and since Zip 2.0.1)! The old BITNET address doesn't even
- Xexist anymore. See below.
- X__________________________________________________________________________
- X
- X
- XGENERAL INFO
- X------------
- XUnZip is an extraction utility for archives compressed in .zip format (also
- Xcalled "zipfiles"). Although highly compatible both with PKWARE's PKZIP
- Xand PKUNZIP utilities for MS-DOS and with Info-ZIP's own Zip program, our
- Xprimary objectives have been portability and non-MSDOS functionality.
- X
- XThis version of UnZip has been ported to a wide array of hardware--from
- Xmicros to supercomputers--and operating systems: Unix (many flavors),
- XVMS, OS/2, MSDOS (+ Windows), NT, TOPS-20 (partly), AmigaDOS, Atari TOS,
- XMacintosh and Human68k. UnZip features not found in PKUNZIP include source
- Xcode; default extraction of directory trees (with a switch to defeat this,
- Xrather than the reverse); VMS, Macintosh and OS/2 extended file attributes;
- Xand, of course, the ability to run under most of your favorite operating
- Xsystems. Plus, it's free. :-)
- X
- XFor source distributions, see the main Contents file for a list of what's
- Xincluded, and read INSTALL for instructions on compiling (including OS-
- Xspecific comments). The individual operating systems' Contents files (for
- Xexample, vms/Contents) may list important compilation info in addition to
- Xexplaining what files are what, so be sure to read them. Some of the ports
- Xhave their own, special README files, so be sure to look for those, too.
- X
- XSee unzip.1 or unzip.doc for usage (or the corresponding UnZipSFX, ZipInfo
- Xand fUnZip docs). For VMS, unzip_def.rnh or unzip_cli.help may be compiled
- Xinto unzip.hlp and installed as a normal VMS help entry; see vms/descrip.mms.
- X
- X
- XCHANGES AND NEW FEATURES
- X------------------------
- XThe 5.12 release mainly fixes some bugs in 5.11, including a silly pointer
- Xerror in unzipsfx. The only new features are fairly minor:
- X
- X - ZipInfo check for dead space inside archives (PKZIP/Netware bug)
- X - SFX_EXDIR compilation option to allow -d <exdir> with UnZipSFX
- X - "unzip -vqqqq" prints just the version number (e.g., "512")
- X
- XSince neither 5.11 nor 5.1 was posted to Usenet, here's a summary of their
- Xnew features. In UnZip 5.11:
- X
- X - UnZipSFX, a self-extraction stub for prepending to (new-style) zipfiles
- X (tested under Unix, VMS, MS-DOS, OS/2, etc.; NOT portable *across* OSes)
- X - unshrink() rewritten to avoid copyright problems; 32-bit version only
- X - strings moved to far memory in MS-DOS: can use small model again (MSC)
- X - numerous customization options (see INSTALL)
- X - diagnostic screen with -v option and no zipfile (i.e., "unzip -v")
- X - -C option for case-insensitive filename matching (esp. for MS-DOS, OS/2)
- X - more bad-zipfile "intelligence" (can sometimes even extract concatenated
- X multi-part archives)
- X - former -U behavior is now the default; new -L option to provide what was
- X the default behavior (auto-conversion of uppercase-OS filenames to lower
- X case)
- X - ZipInfo -T option to print times in decimal format (yymmdd.hhmmss) for
- X piping into sort(1)
- X - performance tweaks for listing archive contents
- X - improved/expanded documentation, esp. man pages (*.doc files) and INSTALL
- X
- XIn UnZip 5.1:
- X
- X - wildcard zipfiles (e.g., "unzip -tq \*.zip")
- X - extract to a directory other than the current one (-d <exdir> option)
- X - auto-conversion of text files
- X - ANSI sequences disabled in comments and filenames (avoid "ANSI bombs")
- X - ZipInfo incorporated into UnZip (-Z option)
- X - full Amiga, Atari, Mac, NT and Human68K support (partial TOPS-20)
- X - performance tuning for 35-70% faster extraction (depends on compression
- X method)
- X
- XNote that, according to one tester, the 32-bit MS-DOS version is now *faster*
- Xthan PKUNZIP on most archives! Cool.
- X
- X
- XDISTRIBUTION
- X------------
- XIf you have a question regarding redistribution of Info-ZIP software,
- Xeither as-is, as packaging for a commercial product, or as an integral
- Xpart of a commercial product, read the Frequently Asked Questions (FAQ)
- Xsection of the included COPYING file.
- X
- XInsofar as C compilers are rare on some platforms and the authors only
- Xhave direct access to Unix, VMS, OS/2, MS-DOS, Mac, Amiga and Atari
- Xsystems, others may wish to provide ready-to-run executables for new
- Xsystems. In general there is no problem with this; we require only that
- Xsuch distributions include this README file, the Where file, the COPYING
- Xfile (contains copyright/redistribution information), and the appropriate
- Xdocumentation files (unzip.doc and/or unzip.1 for UnZip, etc.). If the
- Xlocal system provides a way to make self-extracting archives in which both
- Xthe executables and text files may be stored together, that is best (in
- Xparticular, use UnZipSFX if at all possible, even if it's a few kilobytes
- Xbigger than the alternatives); otherwise we suggest a bare UnZip executable
- Xand a separate zipfile containing the remaining text and binary files. If
- Xanother archiving method is in common use on the target system (for example,
- XZoo or LHa), that may also be used.
- X
- X
- XBUGS AND NEW PORTS: CONTACTING INFO-ZIP
- X----------------------------------------
- XAll bug reports and patches (context diffs only, please!) should go to
- Xzip-bugs@wkuvx1.wku.edu, which is the e-mail address for the Info-ZIP
- Xauthors. "Dumb questions" which aren't adequately answered in the docu-
- Xmentation should also be directed here rather than to a global forum such
- Xas Usenet. (Kindly make certain that your questions *isn't* answered by
- Xthe documentation, however--a great deal of effort has gone into making
- Xit clear and complete.) Suggestions for new features can be sent to
- Xinfo-zip@wkuvx1.wku.edu, a mailing list for the Info-ZIP beta testers,
- Xfor discussion (the authors hang out here as well, of course), although
- Xwe don't promise to act on all suggestions. If it is something which is
- Xmanifestly useful, sending the required patches to zip-bugs directly (as
- Xper the instructions in the ZipPorts file) is likely to produce a quicker
- Xresponse than asking us to do it--the authors are always somewhat short
- Xon time. (Please do NOT send patches or encoded zipfiles to the info-zip
- Xaddress.)
- X
- XIf you are considering a port, not only should you read the ZipPorts file,
- Xbut also please check in with zip-bugs BEFORE getting started, since the
- Xcode is constantly being updated behind the scenes. For example, an Acorn/
- XArchimedes port is already almost complete, as is an OS/2 dynamic link lib-
- Xrary (DLL) version; VMOS, VM/CMS, Netware, QDOS and NT DLL ports are claimed
- Xto be under construction, although we have yet to see any up-to-date patches.
- XWe will arrange to send you the latest sources. The alternative is the pos-
- Xsibility that your hard work will be tucked away in a sub-archive and mostly
- Xignored, or completely ignored if someone else has already done the port
- X(and you'd be surprised how often this has happened). IBM mainframe ports
- X(VM/CMS and/or MVS) would be particularly welcome. (It can't be *that* hard,
- Xfolks...the VMS filesystem is similar in many ways.)
- X
- X
- XBETA TESTING: JOINING INFO-ZIP
- X-------------------------------
- XIf you'd like to keep up to date with our UnZip (and companion Zip utility)
- Xdevelopment, join the ranks of beta testers, add your own thoughts and con-
- Xtributions, etc., send a two-line mail message containing the commands HELP
- Xand LIST (on separate lines in the body of the message, not on the subject
- Xline) to mxserver@wkuvx1.wku.edu. You'll receive two messages listing the
- Xvarious Info-ZIP mailing-list formats which are available (and also various
- Xunrelated lists) and instructions on how to subscribe to one or more of them
- X(courtesy of Hunter Goatley). As of mid-1994, subscribing to the announce-
- Xments list requires a command of the form
- X
- X SUBSCRIBE Info-ZIP-announce "Joe Isuzu"
- X
- XThe discussion list is called either Info-ZIP or Info-ZIP-digest, depending
- Xon one's preference for delivery.
- X
- X
- X-- Greg Roelofs (Cave Newt), UnZip maintainer/container/explainer and
- X developer guy, with inspiration from David Kirschbaum
- END_OF_FILE
- if test 9076 -ne `wc -c <'unzip-5.12/README'`; then
- echo shar: \"'unzip-5.12/README'\" unpacked with wrong size!
- fi
- # end of 'unzip-5.12/README'
- fi
- if test -f 'unzip-5.12/amiga/flate.a' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'unzip-5.12/amiga/flate.a'\"
- else
- echo shar: Extracting \"'unzip-5.12/amiga/flate.a'\" \(8802 characters\)
- sed "s/^X//" >'unzip-5.12/amiga/flate.a' <<'END_OF_FILE'
- X; Not copyrighted by Paul Kienitz, 20 Jun 94.
- X;
- X; Assembly language version of inflate_codes(), for Amiga. Prototype:
- X;
- X; int flate_codes(struct huft *tl, struct huft *td, int bl, int bd,
- X; unsigned char *slide);
- X;
- X; It is called by defining inflate_codes(tl, td, bl, bd) as
- X; flate_codes(tl, td, bl, bd, slide).
- X;
- X; Define the symbol FUNZIP if this is for fUnZip. Define CRYPT if this is
- X; for fUnZip with decryption enabled. Define AZTEC to use the Aztec C
- X; buffered input macro instead of the library getc() with FUNZIP.
- X;
- X; => int MUST BE 16 BITS!!! <= => WSIZE MUST BE 32K! <=
- X;
- X; struct huft is defined as follows:
- X;
- X; struct huft {
- X; uch e; /* number of extra bits or operation */
- X; uch b; /* number of bits in this code or subcode */
- X; union {
- X; ush n; /* literal, length base, or distance base */
- X; struct huft *t; /* pointer to next level of table */
- X; } v;
- X; }; /* sizeof(struct huft) == 6 */
- X;
- X; so here we define the offsets of the various members of this struct:
- X
- Xh_e equ 0
- Xh_b equ 1
- Xh_n equ 2
- Xh_t equ 2
- XSIZEOF_HUFT equ 6
- X
- X; There are several global variables we need to access. Their definitions:
- X;
- X; unsigned long bb;
- X; unsigned int bk, wp;
- X; unsigned short mask[17];
- X; FILE *in;
- X; int encrypted; /* FUNZIP CRYPT only */
- X;
- X; int incnt, mem_mode; /* non-FUNZIP only */
- X; long csize; /* non-FUNZIP only */
- X; unsigned long outcnt; /* non-FUNZIP only */
- X; unsigned char *inptr; /* non-FUNZIP only */
- X;
- X; bb is the global buffer that holds bits from the huffman code stream, which
- X; we cache in the register variable b. bk is the number of valid bits in it,
- X; which we cache in k. The macros NEEDBITS(n) and DUMPBITS(n) have side effects
- X; on b and k.
- X
- X xref _bb
- X xref _bk
- X xref _mask
- X xref _wp
- X IFD FUNZIP
- X IFD CRYPT
- X xref _encrypted
- X xref _update_keys ; int update_keys(int)
- X xref _decrypt_byte ; int decrypt_byte(void)
- X ENDC ; CRYPT
- X xref _in
- X xref _getc ; int getc(FILE *)
- X ELSE ; !FUNZIP
- X xref _csize
- X xref _incnt
- X xref _mem_mode
- X xref _inptr
- X xref _readbyte ; int readbyte(void)
- X ENDC
- X xref _flush ; if FUNZIP: int flush(unsigned long)
- X ; ...if !FUNZIP: int flush(unsigned char *, unsigned long *, int)
- X
- X; Here are our register variables. Remember that int == short!
- X
- Xb equr d2 ; unsigned long
- Xk equr d3 ; unsigned int <= 32
- Xe equr d4 ; unsigned int < 256 for most use
- Xw equr d5 ; unsigned int
- Xn equr d6 ; unsigned int
- Xd equr d7 ; unsigned int
- X
- X; assert: we always maintain w and d as valid unsigned longs.
- X
- Xt equr a2 ; struct huft *
- Xslide equr a3 ; unsigned char *
- Xmask equr a6 ; unsigned short *
- X
- X; Couple other items we need:
- X
- Xsavregs reg d2-d7/a2/a3/a6
- X
- XWSIZE equ $8000 ; 32k... be careful not to treat as negative!
- X
- X IFD FUNZIP
- X; This does getc(in). Aztec version is based on #define getc(fp) in stdio.h
- X
- X IFD AZTEC
- X xref __filbuf
- XGETC MACRO
- X move.l _in,a0
- X move.l (a0),a1 ; in->_bp
- X cmp.l 4(a0),a1 ; in->_bend
- X blo.s gci\@
- X move.l a0,-(sp)
- X jsr __filbuf
- X addq #4,sp
- X bra.s gce\@
- Xgci\@: moveq #0,d0 ; must be valid as longword
- X move.b (a1)+,d0
- X move.l a1,(a0)
- Xgce\@:
- X ENDM
- X ELSE ; !AZTEC
- XGETC MACRO
- X move.l _in,-(sp)
- X jsr _getc
- X addq #4,sp
- X ENDM
- X ENDC ; AZTEC
- X ENDC ; FUNZIP
- X
- X; Input depends on the NEXTBYTE macro. This exists in three different forms.
- X; The first two are for fUnZip, with and without decryption. The last is for
- X; regular UnZip with or without decryption. The resulting byte is returned
- X; in d0 as a longword, and d1, a0, and a1 are clobbered.
- X
- X IFD FUNZIP
- X IFD CRYPT
- XNEXTBYTE MACRO
- X GETC
- X tst.w _encrypted
- X beq.s nbe\@
- X move.w d0,-(sp) ; save thru next call
- X jsr _decrypt_byte
- X eor.w d0,(sp) ; becomes arg to update_keys
- X jsr _update_keys
- X addq #2,sp
- Xnbe\@: ext.l d0 ; assert -1 <= d0 <= 255
- X ENDM
- X ELSE ; !CRYPT
- XNEXTBYTE MACRO
- X GETC ; nothing else in this case
- X ENDM
- X ENDC
- X ELSE ; !FUNZIP
- XNEXTBYTE MACRO
- X subq.l #1,_csize
- X bge.s nbg\@
- X moveq #-1,d0 ; return EOF
- X bra.s nbe\@
- Xnbg\@: subq.w #1,_incnt
- X bge.s nbs\@
- X jsr _readbyte
- X bra.s nbe\@
- Xnbs\@: moveq #0,d0
- X move.l _inptr,a0
- X move.b (a0)+,d0
- X move.l a0,_inptr
- Xnbe\@:
- X ENDM
- X ENDC
- X
- X; FLUSH has different versions for fUnZip and UnZip. Arg must be a longword.
- X
- X IFD FUNZIP
- XFLUSH MACRO
- X move.l \1,-(sp)
- X jsr _flush
- X addq #4,sp
- X ENDM
- X ELSE ; !FUNZIP
- X xref _mem_mode
- X xref _outcnt
- XFLUSH MACRO
- X tst.w _mem_mode
- X bne.s fm\@
- X move.w #0,-(sp) ; unshrink flag: always false
- X move.l \1,-(sp) ; length
- X move.l slide,-(sp) ; buffer to flush
- X jsr _flush
- X lea 10(sp),sp
- X bra.s fe\@
- Xfm\@: move.l w,_outcnt
- Xfe\@:
- X ENDM
- X ENDC ; FUNZIP
- X
- X; Here are the two bit-grabbing macros, defined in their non-CHECK_EOF form:
- X;
- X; define NEEDBITS(n) {while(k<(n)){b|=((ulg)NEXTBYTE)<<k;k+=8;}}
- X; define DUMPBITS(n) {b>>=(n);k-=(n);}
- X;
- X; NEEDBITS clobbers d0, d1, a0, and a1, none of which can be used as the arg
- X; to the macro specifying the number of bits. The arg can be a shortword memory
- X; address, or d2-d7. The result is copied into d1 as a word ready for masking.
- X; DUMPBITS has no side effects; the arg must be a d-register (or immediate in the
- X; range 1-8?) and only the lower byte is significant.
- X
- XNEEDBITS MACRO
- Xnb\@: cmp.w \1,k ; assert 0 < k <= 32 ... arg may be 0
- X bhs.s ne\@
- X NEXTBYTE ; returns in d0.l
- X lsl.l k,d0
- X or.l d0,b
- X addq.w #8,k
- X bra.s nb\@
- Xne\@: move.w b,d1
- X ENDM
- X
- XDUMPBITS MACRO
- X lsr.l \1,b ; upper bits of \1 are ignored??
- X sub.b \1,k
- X ENDM
- X
- X
- X; ******************************************************************************
- X; Here we go, finally:
- X
- X xdef _flate_codes ; (pointer, pointer, int, int, pointer)
- X
- X_flate_codes:
- X link a5,#-4
- X movem.l savregs,-(sp)
- X; 8(a5) = tl, 12(a5) = td, 16(a5) = bl, 18(a5) = bd, 20(a5) = slide,
- X; -2(a5) = ml, -4(a5) = md. Here we cache some globals and args:
- X move.l 20(a5),slide
- X lea _mask,mask
- X move.l _bb,b
- X move.w _bk,k
- X moveq #0,w ; keep this usable as longword
- X move.w _wp,w
- X moveq #0,e ; keep this usable as longword too
- X move.w 16(a5),d0
- X add.w d0,d0
- X move.w (mask,d0.w),-2(a5) ; ml = mask[bl]
- X move.w 18(a5),d0
- X add.w d0,d0
- X move.w (mask,d0.w),-4(a5) ; md = mask[bd]
- X
- Xmain_loop:
- X NEEDBITS 16(a5) ; bl
- X and.w -2(a5),d1 ; ml
- X mulu #SIZEOF_HUFT,d1
- X move.l 8(a5),a0 ; tl
- X lea (a0,d1.l),t
- X move.b h_e(t),e
- X cmp.w #16,e
- X bls.s topdmp
- Xintop: moveq #1,d0
- X cmp.w #99,e
- X beq return ; error in zipfile
- X move.b h_b(t),d0
- X DUMPBITS d0
- X sub.w #16,e
- X NEEDBITS e
- X move.w e,d0
- X add.w d0,d0
- X and.w (mask,d0.w),d1
- X mulu #SIZEOF_HUFT,d1
- X move.l h_t(t),a0
- X lea (a0,d1.l),t
- X move.b h_e(t),e
- X cmp.w #16,e
- X bgt.s intop
- Xtopdmp: move.b h_b(t),d0
- X DUMPBITS d0
- X
- X cmp.w #16,e ; is this huffman code a literal?
- X bne lenchk ; no
- X move.w h_n(t),d0 ; yes
- X move.b d0,(slide,w.l) ; stick in the decoded byte
- X addq.w #1,w
- X cmp.w #WSIZE,w
- X blo main_loop
- X FLUSH w
- X moveq #0,w
- X bra main_loop ; do some more
- X
- Xlenchk: cmp.w #15,e ; is it an end-of-block code?
- X beq finish ; if yes, we're done
- X NEEDBITS e ; no: we have a duplicate string
- X move.w e,d0
- X add.w d0,d0
- X and.w (mask,d0.w),d1
- X move.w h_n(t),n
- X add.w d1,n ; length of block to copy
- X DUMPBITS e
- X NEEDBITS 18(a5) ; bd
- X and.w -4(a5),d1 ; md
- X mulu #SIZEOF_HUFT,d1
- X move.l 12(a5),a0 ; td
- X lea (a0,d1.l),t
- X move.b h_e(t),e
- X cmp.w #16,e
- X bls.s middmp
- Xinmid: moveq #1,d0
- X cmp.w #99,e
- X beq return ; error in zipfile
- X move.b h_b(t),d0
- X DUMPBITS d0
- X sub.w #16,e
- X NEEDBITS e
- X move.w e,d0
- X add.w d0,d0
- X and.w (mask,d0.w),d1
- X mulu #SIZEOF_HUFT,d1
- X move.l h_t(t),a0
- X lea (a0,d1.l),t
- X move.b h_e(t),e
- X cmp.w #16,e
- X bgt.s inmid
- Xmiddmp: move.b h_b(t),d0
- X DUMPBITS d0
- X NEEDBITS e
- X move.w e,d0
- X add.w d0,d0
- X and.w (mask,d0.w),d1
- X move.l w,d
- X sub.w h_n(t),d
- X sub.w d1,d ; distance back to block to copy
- X DUMPBITS e
- X
- Xindup: move.w #WSIZE,e ; violate the e < 256 rule
- X and.w #WSIZE-1,d
- X cmp.w d,w
- X blo.s ddgw
- X sub.w w,e
- X bra.s dadw
- Xddgw: sub.w d,e
- Xdadw: cmp.w n,e
- X bls.s delen
- X move.w n,e
- Xdelen: sub.w e,n ; size of sub-block to copy
- X move.l slide,a0
- X move.l a0,a1
- X add.l w,a0 ; w and d are valid longwords
- X add.l d,a1
- X move.w e,d0
- X subq #1,d0 ; assert >= 0 if sign extended
- Xdspin: move.b (a1)+,(a0)+ ; string is probably short, so
- X dbra d0,dspin ; don't use any fancier copy method
- X add.w e,w
- X add.w e,d
- X cmp.w #WSIZE,w
- X blo.s dnfl
- X FLUSH w
- X moveq #0,w
- Xdnfl: tst.w n ; need to do more sub-blocks?
- X bne indup ; yes
- X moveq #0,e ; restore zeroness in upper bytes
- X bra main_loop ; do some more
- X
- Xfinish: move.w w,_wp ; restore cached globals
- X move.w k,_bk
- X move.l b,_bb
- X moveq #0,d0 ; return "no error"
- Xreturn: movem.l (sp)+,savregs
- X unlk a5
- X rts
- END_OF_FILE
- if test 8802 -ne `wc -c <'unzip-5.12/amiga/flate.a'`; then
- echo shar: \"'unzip-5.12/amiga/flate.a'\" unpacked with wrong size!
- fi
- # end of 'unzip-5.12/amiga/flate.a'
- fi
- if test -f 'unzip-5.12/atari/Makefile' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'unzip-5.12/atari/Makefile'\"
- else
- echo shar: Extracting \"'unzip-5.12/atari/Makefile'\" \(4811 characters\)
- sed "s/^X//" >'unzip-5.12/atari/Makefile' <<'END_OF_FILE'
- X#==============================================================================
- X# Makefile for UnZip, UnZipSFX & fUnZip: Atari ST Chris Herborth
- X# Version: UnZip 5.11, MiNT, GNU C 14 July 1994
- X#==============================================================================
- X
- X# Based on the original unix Makefile and modified by Chris Herborth
- X# (cherborth@semprini.waterloo-rdp.on.ca), Nov.13/93.
- X#
- X# $Id: Makefile 1.7 1993/12/28 18:52:52 root Exp $
- X
- X# Be sure to test your new UnZip (and UnZipSFX and fUnZip); successful com-
- X# pilation does not always imply a working program.
- X
- X
- X#####################
- X# MACRO DEFINITIONS #
- X#####################
- X
- X# Defaults most systems use (use LOCAL_UNZIP in environment to add flags,
- X# such as -DDOSWILD).
- X
- X# UnZip flags
- X# NOTE: 'cgcc' is my cross-compiler; you'll probably use 'gcc' instead.
- XCC = cgcc
- XLD = cgcc
- XLOC = $(LOCAL_UNZIP) -ansi -D__MINT__ -U__STRICT_ANSI__
- X
- XCF = -mbaserel -mpcrel -O2 -fomit-frame-pointer -I. $(LOC)
- X# CF = -O -I. $(LOC)
- X# CF = -mbaserel -O -I. $(LOC)
- XLF = -mbaserel -mpcrel -o unzip.ttp
- XLF2 = -s -lbiio
- X
- X# UnZipSFX flags
- XXC = -DSFX
- XXL = -mbaserel -mpcrel -o unzipsfx.ttp
- XXL2 = $(LF2)
- X
- X# fUnZip flags
- XFC = -DFUNZIP
- XFL = -mbaserel -mpcrel -o funzip.ttp
- XFL2 = $(LF2)
- X
- X# general-purpose stuff
- XCP = cp
- XLN = ln -s
- XRM = rm -f
- XE = .ttp
- XO = .o
- XM = atari
- XSHELL = /bin/sh
- X
- X# object files
- XOBJS1 = unzip$O crypt$O envargs$O explode$O extract$O file_io$O
- XOBJS2 = inflate$O match$O unreduce$O unshrink$O zipinfo$O
- XOBJS = $(OBJS1) $(OBJS2) $M$O
- XLOBJS = $(OBJS)
- XOBJX = unzip_$O crypt$O extract_$O file_io$O inflate$O match$O $M_$O
- XOBJF = funzip$O crypt_$O inflate_$O
- X
- X# installation
- XINSTALL = cp# probably can change this to 'install' if you have it
- X# on some systems, manext=l and MANDIR=/usr/man/man$(manext) may be appropriate
- Xmanext = 1
- XMANDIR = /usr/local/man/man$(manext)# where to install man pages
- XBINDIR = /usr/local/bin# where to install executables
- X#
- XUNZIPS = unzip$E unzipsfx$E funzip$E zipinfo$E
- XMANS = unzip.$(manext) unzipsfx.$(manext) zipinfo.$(manext) funzip.$(manext)
- XDOCS = unzip.doc unzipsfx.doc zipinfo.doc funzip.doc
- X# this is a little ugly...
- XINSTALLED = $(BINDIR)/unzip$E $(BINDIR)/zipinfo$E $(BINDIR)/funzip$E \
- X $(BINDIR)/unzipsfx$E $(MANDIR)/unzipsfx.$(manext) \
- X $(MANDIR)/unzip.$(manext) $(MANDIR)/zipinfo.$(manext) \
- X $(MANDIR)/funzip.$(manext)
- X
- X###############################################
- X# BASIC COMPILE INSTRUCTIONS AND DEPENDENCIES #
- X###############################################
- X
- X.c$O:
- X $(CC) -c $(CF) $*.c
- X
- X
- Xall: unzips
- Xunzips: $(UNZIPS)
- Xdocs: $(DOCS)
- Xunzipsman: unzips docs
- Xunzipsdocs: unzips docs
- X
- X
- Xclean:
- X rm -f $(OBJS) $(OBJF) $(OBJX) $(UNZIPS)
- X
- Xinstall: $(UNZIPS) $(MANS)
- X $(INSTALL) $(UNZIPS) $(BINDIR)
- X $(LN) $(BINDIR)/unzip$E $(BINDIR)/zipinfo$E
- X $(INSTALL) unix/unzip.1 $(MANDIR)/unzip.$(manext)
- X $(INSTALL) unix/unzipsfx.1 $(MANDIR)/unzipsfx.$(manext)
- X $(INSTALL) unix/zipinfo.1 $(MANDIR)/zipinfo.$(manext)
- X $(INSTALL) unix/funzip.1 $(MANDIR)/funzip.$(manext)
- X
- X# alternatively, could use zip method: -cd $(BINDIR); rm -f $(UNZIPS) [etc.]
- Xuninstall:
- X rm -f $(INSTALLED)
- X
- X
- Xunzip$E: $(OBJS) # add `&' if parallel makes supported
- X $(LD) $(LF) $(LOBJS) $(LF2)
- X
- Xunzipsfx$E: $(OBJX) # add `&' if parallel makes supported
- X $(LD) $(XL) $(OBJX) $(XL2)
- X
- Xfunzip$E: $(OBJF) # add `&' if parallel makes supported
- X $(LD) $(FL) $(OBJF) $(FL2)
- X
- Xzipinfo$E: unzip$E
- X @echo\
- X ' This is a Unix-inspired target. If your filesystem does not support'
- X @echo\
- X ' symbolic links, copy unzip.ttp to zipinfo.ttp rather than linking it,'
- X @echo\
- X ' or else invoke as "unzip -Z".'
- X $(LN) unzip$E zipinfo$E
- X
- X
- Xcrypt$O: crypt.c unzip.h zip.h crypt.h
- Xenvargs$O: envargs.c unzip.h
- Xexplode$O: explode.c unzip.h
- Xextract$O: extract.c unzip.h crypt.h
- Xfile_io$O: file_io.c unzip.h crypt.h tables.h
- Xfunzip$O: funzip.c unzip.h crypt.h tables.h
- Xinflate$O: inflate.c inflate.h unzip.h
- Xmatch$O: match.c unzip.h
- Xunreduce$O: unreduce.c unzip.h
- Xunshrink$O: unshrink.c unzip.h
- Xunzip$O: unzip.c unzip.h version.h
- Xzipinfo$O: zipinfo.c unzip.h
- X
- Xcrypt_$O: crypt.c unzip.h zip.h crypt.h # funzip only
- X $(CP) crypt.c crypt_.c
- X $(CC) -c $(CF) $(FC) crypt_.c
- X $(RM) crypt_.c
- X
- Xinflate_$O: inflate.c inflate.h unzip.h crypt.h # funzip only
- X $(CP) inflate.c inflate_.c
- X $(CC) -c $(CF) $(FC) inflate_.c
- X $(RM) inflate_.c
- X
- Xunzip_$O: unzip.c unzip.h version.h # unzipsfx only
- X $(CP) unzip.c unzip_.c
- X $(CC) -c $(CF) $(XC) unzip_.c
- X $(RM) unzip_.c
- X
- Xextract_$O: extract.c unzip.h crypt.h # unzipsfx only
- X $(CP) extract.c extract_.c
- X $(CC) -c $(CF) $(XC) extract_.c
- X $(RM) extract_.c
- X
- X# atari$O: atari/atari.c unzip.h # Atari only
- X# $(CC) -c $(CF) atari/atari.c
- X
- Xatari$O: atari.c unzip.h
- X
- Xatari_$O: atari.c unzip.h # unzipsfx only
- X $(CP) atari.c atari_.c
- X $(CC) -c $(CF) $(XC) atari_.c
- X $(RM) atari_.c
- END_OF_FILE
- if test 4811 -ne `wc -c <'unzip-5.12/atari/Makefile'`; then
- echo shar: \"'unzip-5.12/atari/Makefile'\" unpacked with wrong size!
- fi
- # end of 'unzip-5.12/atari/Makefile'
- fi
- if test -f 'unzip-5.12/mac/macunzip.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'unzip-5.12/mac/macunzip.c'\"
- else
- echo shar: Extracting \"'unzip-5.12/mac/macunzip.c'\" \(12079 characters\)
- sed "s/^X//" >'unzip-5.12/mac/macunzip.c' <<'END_OF_FILE'
- X#include "unzip.h"
- X
- X#include <Traps.h>
- X#include <Values.h>
- X
- Xextern char UnzipVersion[], ZipinfoVersion[];
- X
- Xvoid MacFSTest (int);
- Xvoid ResolveMacVol (short, short *, long *, StringPtr);
- X
- X#define aboutAlert 128
- X
- X#define selectDialog 129
- X#define okItem 1
- X#define cancelItem 2
- X#define editItem 3
- X#define staticItem 4
- X
- X#define unzipMenuBar 128
- X
- X#define appleMenu 128
- X#define aboutItem 1
- X
- X#define fileMenu 129
- X#define extractItem 1
- X#define infoItem 2
- X#define listItem 3
- X#define testItem 4
- X#define commentItem 6
- X#define freshenItem 8
- X#define updateItem 9
- X#define quitItem 11
- X
- X#define editMenu 130
- X#define cutItem 1
- X#define copyItem 2
- X#define pasteItem 3
- X
- X#define modifierMenu 131
- X#define selectItem 1
- X#define screenItem 3
- X#define pauseItem 4
- X#define scrollItem 5
- X#define convertItem 7
- X#define junkItem 8
- X#define lowercaseItem 9
- X#define neverItem 10
- X#define promptItem 11
- X#define quietItem 12
- X#define verboseItem 13
- X
- Xshort modifiers, modifierMask;
- X
- X#define convertFlag 0x0001
- X#define junkFlag 0x0002
- X#define lowercaseFlag 0x0004
- X#define neverFlag 0x0008
- X#define promptFlag 0x0010
- X#define quietFlag 0x0020
- X#define screenFlag 0x0040
- X#define scrollFlag 0x0200
- X#define verboseFlag 0x0080
- X#define allFlags 0x03FF
- X
- X#define pauseFlag 0x0100
- X#define scrollFlag 0x0200
- X
- X#define extractMask 0x003F
- X#define infoMask 0x0000
- X#define listMask 0x0020
- X#define testMask 0x0020
- X#define commentMask 0x0000
- X#define freshenMask 0x003F
- X#define updateMask 0x003F
- X
- XEventRecord myevent;
- XMenuHandle appleHandle, modifierHandle;
- XHandle menubar, itemHandle;
- Xshort itemType;
- XRect itemRect;
- X
- Xchar command, fileList[256];
- X
- XBoolean stop;
- X
- XSysEnvRec sysRec;
- X
- Xchar *macgetenv(s) char *s; {
- X if (s == NULL) return(fileList);
- X return(NULL);
- X}
- X
- XBoolean TrapAvailable(machineType, trapNumber, trapType)
- Xshort machineType;
- Xshort trapNumber;
- XTrapType trapType;
- X{
- X if (machineType < 0)
- X return (false);
- X
- X if ((trapType == ToolTrap) &&
- X (machineType > envMachUnknown) &&
- X (machineType < envMacII)) {
- X if ((trapNumber &= 0x03FF) > 0x01FF)
- X trapNumber = _Unimplemented;
- X }
- X return (NGetTrapAddress(trapNumber, trapType) !=
- X GetTrapAddress(_Unimplemented));
- X}
- X
- Xvoid domenu(menucommand) long menucommand;
- X{
- X short check, themenu, theitem;
- X DialogPtr thedialog;
- X Str255 name;
- X
- X themenu = HiWord(menucommand);
- X theitem = LoWord(menucommand);
- X
- X switch (themenu) {
- X
- X case appleMenu:
- X if (theitem == aboutItem) {
- X ParamText(UnzipVersion, ZipinfoVersion, nil, nil);
- X Alert(aboutAlert, nil);
- X } else {
- X GetItem(appleHandle, theitem, name);
- X theitem = OpenDeskAcc(name);
- X }
- X break;
- X
- X case fileMenu:
- X switch (theitem) {
- X case extractItem:
- X if (modifiers & screenFlag)
- X command = 'c';
- X else
- X command = 'x';
- X modifierMask = extractMask;
- X break;
- X case infoItem:
- X command = 'Z';
- X modifierMask = infoMask;
- X break;
- X case listItem:
- X if (modifiers & verboseFlag)
- X command = 'v';
- X else
- X command = 'l';
- X modifierMask = listMask;
- X break;
- X case testItem:
- X command = 't';
- X modifierMask = testMask;
- X break;
- X case commentItem:
- X command = 'z';
- X modifierMask = commentMask;
- X break;
- X case freshenItem:
- X command = 'f';
- X modifierMask = freshenMask;
- X break;
- X case updateItem:
- X command = 'u';
- X modifierMask = updateMask;
- X break;
- X case quitItem:
- X stop = true;
- X break;
- X default:
- X break;
- X }
- X break;
- X
- X case editMenu:
- X break;
- X
- X case modifierMenu:
- X switch (theitem) {
- X case selectItem:
- X thedialog = GetNewDialog(selectDialog, nil, (WindowPtr)(-1));
- X SetPort(thedialog);
- X do
- X ModalDialog(nil, &check);
- X while ((check != okItem) && (check != cancelItem));
- X if (check == okItem) {
- X GetDItem(thedialog, editItem, &itemType, &itemHandle, &itemRect);
- X GetIText(itemHandle, &fileList);
- X p2cstr(fileList);
- X }
- X DisposDialog(thedialog);
- X check = -1;
- X break;
- X case screenItem:
- X check = (modifiers ^= screenFlag) & screenFlag;
- X break;
- X case pauseItem:
- X check = (modifiers ^= pauseFlag) & pauseFlag;
- X screenControl("p", check);
- X break;
- X case scrollItem:
- X check = (modifiers ^= scrollFlag) & scrollFlag;
- X screenControl("s", check);
- X break;
- X case convertItem:
- X check = (modifiers ^= convertFlag) & convertFlag;
- X break;
- X case junkItem:
- X check = (modifiers ^= junkFlag) & junkFlag;
- X break;
- X case lowercaseItem:
- X check = (modifiers ^= lowercaseFlag) & lowercaseFlag;
- X break;
- X case neverItem:
- X if (check = (modifiers ^= neverFlag) & neverFlag) {
- X if (modifiers & promptFlag) {
- X CheckItem(modifierHandle, promptItem, false);
- X modifiers &= (allFlags ^ promptFlag);
- X }
- X } else {
- X CheckItem(modifierHandle, promptItem, true);
- X modifiers |= promptFlag;
- X }
- X break;
- X case promptItem:
- X if (check = (modifiers ^= promptFlag) & promptFlag)
- X if (modifiers & neverFlag) {
- X CheckItem(modifierHandle, neverItem, false);
- X modifiers &= (allFlags ^ neverFlag);
- X }
- X break;
- X case quietItem:
- X check = (modifiers ^= quietFlag) & quietFlag;
- X break;
- X case verboseItem:
- X check = (modifiers ^= verboseFlag) & verboseFlag;
- X break;
- X default:
- X break;
- X }
- X if (check == 0)
- X CheckItem(modifierHandle, theitem, false);
- X else if (check > 0)
- X CheckItem(modifierHandle, theitem, true);
- X break;
- X
- X default:
- X break;
- X
- X }
- X
- X HiliteMenu(0);
- X return;
- X}
- X
- Xvoid dokey(myevent) EventRecord *myevent;
- X{
- X char code;
- X
- X code = (char)(myevent->message & charCodeMask);
- X
- X if (myevent->modifiers & cmdKey) {
- X if (myevent->what != autoKey) {
- X domenu(MenuKey(code));
- X }
- X }
- X
- X return;
- X}
- X
- Xvoid domousedown(myevent) EventRecord *myevent;
- X{
- X WindowPtr whichwindow;
- X long code;
- X
- X code = FindWindow(myevent->where, &whichwindow);
- X
- X switch (code) {
- X
- X case inSysWindow:
- X SystemClick(myevent, whichwindow);
- X break;
- X
- X case inMenuBar:
- X domenu(MenuSelect(myevent->where));
- X break;
- X
- X }
- X
- X return;
- X}
- X
- Xint main(argc, argv) int argc; char *argv[];
- X{
- X Boolean haveEvent, useWNE;
- X short markChar;
- X FILE *fp;
- X
- X FlushEvents(everyEvent, 0);
- X InitGraf(&qd.thePort);
- X InitFonts();
- X InitWindows();
- X InitMenus();
- X TEInit();
- X InitDialogs(nil);
- X InitCursor();
- X
- X c2pstr(UnzipVersion);
- X c2pstr(ZipinfoVersion);
- X
- X SysEnvirons(1, &sysRec);
- X useWNE = TrapAvailable(sysRec.machineType, _WaitNextEvent, ToolTrap);
- X
- X SetMenuBar(menubar = GetNewMBar(unzipMenuBar));
- X DisposeHandle(menubar);
- X AddResMenu(appleHandle = GetMHandle(appleMenu), 'DRVR');
- X modifierHandle = GetMHandle(modifierMenu);
- X DrawMenuBar();
- X
- X screenOpen("Unzip");
- X
- X modifiers = 0;
- X
- X GetItemMark(modifierHandle, pauseItem, &markChar);
- X if (markChar) modifiers ^= pauseFlag;
- X screenControl("p", markChar);
- X GetItemMark(modifierHandle, scrollItem, &markChar);
- X if (markChar) modifiers ^= scrollFlag;
- X screenControl("s", markChar);
- X
- X GetItemMark(modifierHandle, screenItem, &markChar);
- X if (markChar) modifiers ^= screenFlag;
- X GetItemMark(modifierHandle, convertItem, &markChar);
- X if (markChar) modifiers ^= convertFlag;
- X GetItemMark(modifierHandle, junkItem, &markChar);
- X if (markChar) modifiers ^= junkFlag;
- X GetItemMark(modifierHandle, lowercaseItem, &markChar);
- X if (markChar) modifiers ^= lowercaseFlag;
- X GetItemMark(modifierHandle, neverItem, &markChar);
- X if (markChar) modifiers ^= neverFlag;
- X GetItemMark(modifierHandle, promptItem, &markChar);
- X if (markChar) modifiers ^= promptFlag;
- X GetItemMark(modifierHandle, quietItem, &markChar);
- X if (markChar) modifiers ^= quietFlag;
- X GetItemMark(modifierHandle, verboseItem, &markChar);
- X if (markChar) modifiers ^= verboseFlag;
- X
- X if ((modifiers & (neverFlag | promptFlag)) == (neverFlag | promptFlag)) {
- X CheckItem(modifierHandle, promptItem, false);
- X modifiers &= (allFlags ^ promptFlag);
- X }
- X
- X command = ' ';
- X
- X stop = false;
- X while (!stop) {
- X SetCursor(&qd.arrow);
- X
- X if (useWNE) {
- X haveEvent = WaitNextEvent(everyEvent, &myevent, MAXLONG, NULL);
- X } else {
- X SystemTask();
- X haveEvent = GetNextEvent(everyEvent, &myevent);
- X }
- X
- X if (haveEvent) {
- X switch (myevent.what) {
- X
- X case activateEvt:
- X break;
- X
- X case keyDown:
- X case autoKey:
- X dokey(&myevent);
- X break;
- X
- X case mouseDown:
- X domousedown(&myevent);
- X break;
- X
- X case updateEvt:
- X screenUpdate(myevent.message);
- X break;
- X
- X case mouseUp:
- X case keyUp:
- X break;
- X
- X default:
- X break;
- X
- X }
- X }
- X
- X if (command != ' ') {
- X char *s, **v, modifierString[16];
- X SFReply fileRep;
- X Point p;
- X int m, n;
- X
- X SetPt(&p, 40, 40);
- X
- X SFGetFile(p, "\pSpecify ZIP file:", 0L, -1, nil, 0L, &fileRep);
- X if (fileRep.good) {
- X MacFSTest(fileRep.vRefNum);
- X ResolveMacVol(fileRep.vRefNum, &gnVRefNum, &glDirID, NULL);
- X
- X p2cstr(fileRep.fName);
- X
- X modifierMask &= modifiers;
- X
- X s = modifierString;
- X
- X if ((command != 'Z') || modifierMask) {
- X *s++ = '-';
- X *s++ = command;
- X
- X if (modifierMask & convertFlag) *s++ = 'a';
- X if (!HFSFlag || (modifierMask & junkFlag)) *s++ = 'j';
- X if (!modifierMask & lowercaseFlag) *s++ = 'U';
- X if (modifierMask & neverFlag) *s++ = 'n';
- X if (!modifierMask & promptFlag) *s++ = 'o';
- X if (modifierMask & quietFlag) *s++ = 'q';
- X if (modifierMask & verboseFlag) *s++ = 'v';
- X }
- X
- X *s = '\0';
- X
- X v = (char **)malloc(sizeof(char *));
- X *v = "unzip";
- X argc = 1;
- X
- X envargs(&argc, &v, NULL, NULL);
- X
- X argv = (char **)malloc((argc + 3) * sizeof(char *));
- X
- X argv[m = 0] = (command == 'Z') ? "zipinfo" : "unzip";
- X if (*modifierString) argv[++m] = modifierString;
- X argv[++m] = (char *)fileRep.fName;
- X for (n = 1; n < argc; n++) argv[n + m] = v[n];
- X argv[argc += m] = NULL;
- X
- X free(v);
- X
- X for (n = 0; argv[n] != NULL; n++) printf("%s ", argv[n]);
- X printf("...\n\n");
- X
- X unzip(argc, argv);
- X
- X printf("\nDone\n");
- X }
- X
- X fileList[0] = '\0';
- X command = ' ';
- X }
- X }
- X
- X screenClose();
- X
- X ExitToShell();
- X}
- END_OF_FILE
- if test 12079 -ne `wc -c <'unzip-5.12/mac/macunzip.c'`; then
- echo shar: \"'unzip-5.12/mac/macunzip.c'\" unpacked with wrong size!
- fi
- # end of 'unzip-5.12/mac/macunzip.c'
- fi
- if test -f 'unzip-5.12/unzipsfx.doc' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'unzip-5.12/unzipsfx.doc'\"
- else
- echo shar: Extracting \"'unzip-5.12/unzipsfx.doc'\" \(12334 characters\)
- sed "s/^X//" >'unzip-5.12/unzipsfx.doc' <<'END_OF_FILE'
- X
- XUNZIPSFX(1L) MISC. REFERENCE MANUAL PAGES UNZIPSFX(1L)
- X
- XNAME
- X unzipsfx - self-extracting stub for prepending to ZIP
- X archives
- X
- XSYNOPSIS
- X <name of unzipsfx+archive combo> [-cfptuz[ajnoqsCLV$]]
- X [file(s) ... [-x xfile(s) ...]]
- X
- XDESCRIPTION
- X unzipsfx is a modified version of unzip(1L) designed to be
- X prepended to existing ZIP archives in order to form self-
- X extracting archives. Instead of taking its first non-flag
- X argument to be the zipfile(s) to be extracted, unzipsfx
- X seeks itself under the name by which it was invoked and
- X tests or extracts the contents of the appended archive.
- X Because the executable stub adds bulk to the archive (the
- X whole purpose of which is to be as small as possible), a
- X number of the regular version's less-vital capabilities have
- X been removed. Among these are the usage (or help) screen,
- X the listing and diagnostic functions (-l and -v), the abil-
- X ity to decompress older compression formats (the ``reduce,''
- X ``shrink'' and ``implode'' methods), and the ability to
- X extract to a directory other than the current one. Decryp-
- X tion is supported as a compile-time option but should be
- X avoided unless the attached archive contains encrypted
- X files.
- X
- X Note that self-extracting archives made with unzipsfx are no
- X more (or less) portable across different operating systems
- X than is the unzip executable itself. In general a self-
- X extracting archive made on a particular Unix system, for
- X example, will only self-extract under the same flavor of
- X Unix. Regular unzip may still be used to extract the embed-
- X ded archive as with any normal zipfile, although it will
- X generate a harmless warning about extra bytes at the begin-
- X ning of the zipfile.
- X
- XARGUMENTS
- X [file(s)]
- X An optional list of archive members to be processed.
- X Regular expressions (wildcards) similar to those in
- X Unix egrep(1) may be used to match multiple members.
- X These wildcards may contain:
- X
- X * matches a sequence of 0 or more characters
- X
- X ? matches exactly 1 character
- X
- X [...]
- X matches any single character found inside the
- X brackets; ranges are specified by a beginning
- X character, a hyphen, and an ending character. If
- X
- XInfo-ZIP Last change: 28 Aug 94 (v5.12) 1
- X
- XUNZIPSFX(1L) MISC. REFERENCE MANUAL PAGES UNZIPSFX(1L)
- X
- X an exclamation point or a caret (`!' or `^') fol-
- X lows the left bracket, then the range of charac-
- X ters within the brackets is complemented (that is,
- X anything except the characters inside the brackets
- X is considered a match).
- X
- X (Be sure to quote any character which might otherwise
- X be interpreted or modified by the operating system,
- X particularly under Unix and VMS.)
- X
- X [-x xfile(s)]
- X An optional list of archive members to be excluded from
- X processing. Since wildcard characters match directory
- X separators (`/'), this option may be used to exclude
- X any files which are in subdirectories. For example,
- X ``foosfx *.[ch] -x */*'' would extract all C source
- X files in the main directory, but none in any subdirec-
- X tories. Without the -x option, all C source files in
- X all directories within the zipfile would be extracted.
- X Unlike in unzip(1L), the -x option may only be used if
- X one or more files are given. This is because there is
- X no zipfile separating the normal options from the -x
- X option, so unzipsfx sees it as another normal option.
- X For historical reasons, the ``normal'' -x is silently
- X ignored. See the EXAMPLES section below.
- X
- X If unzipsfx is compiled with SFX_EXDIR defined, the follow-
- X ing option is also enabled:
- X
- X [-d exdir]
- X An optional directory to which to extract files. By
- X default, all files and subdirectories are recreated in
- X the current directory; the -d option allows extraction
- X in an arbitrary directory (always assuming one has per-
- X mission to write to the directory). The option and
- X directory may be concatenated without any white space
- X between them, but note that this may cause normal shell
- X behavior to be suppressed. In particular, ``-d ~''
- X (tilde) is expanded by Unix C shells into the name of
- X the user's home directory, but ``-d~'' is treated as a
- X literal subdirectory ``~'' of the current directory.
- X As with -x, the -d option may only be used if one or
- X more files are given.
- X
- XOPTIONS
- X unzipsfx supports the following unzip(1L) options: -c and
- X -p (extract to standard output/screen), -f and -u (freshen
- X and update existing files upon extraction), -t (test
- X archive) and -z (print archive comment). All normal listing
- X options (-l, -v and -Z) have been removed, but the testing
- X option (-t) may be used as a ``poor man's'' listing. Alter-
- X natively, those creating self-extracting archives may wish
- X
- XInfo-ZIP Last change: 28 Aug 94 (v5.12) 2
- X
- XUNZIPSFX(1L) MISC. REFERENCE MANUAL PAGES UNZIPSFX(1L)
- X
- X to include a short listing in the zipfile comment.
- X
- X See unzip(1L) for a more complete description of these
- X options.
- X
- XMODIFIERS
- X unzipsfx currently supports all unzip(1L) modifiers: -a
- X (convert text files), -n (never overwrite), -o (overwrite
- X without prompting), -q (operate quietly), -C (match names
- X case-insenstively), -L (convert uppercase-OS names to lower-
- X case), -j (junk paths) and -V (retain version numbers); plus
- X the following operating-system specific options: -X
- X (restore VMS owner/protection info), -s (convert spaces in
- X filenames to underscores [DOS, OS/2, NT]) and -$ (restore
- X volume label [DOS, OS/2, NT, Amiga]).
- X
- X (Support for regular ASCII text-conversion may be removed in
- X future versions, since it is simple enough for the archive's
- X creator to ensure that text files have the appropriate for-
- X mat for the local OS. EBCDIC conversion will of course con-
- X tinue to be supported since the zipfile format implies ASCII
- X storage of text files.)
- X
- X See unzip(1L) for a more complete description of these
- X modifiers.
- X
- XENVIRONMENT OPTIONS
- X unzipsfx uses the same environment variables as unzip(1L)
- X does, although this is likely to be an issue only for the
- X person creating and testing the self-extracting archive.
- X See unzip(1L) for details.
- X
- XDECRYPTION
- X Decryption is supported exactly as in unzip(1L); that is,
- X interactively with a non-echoing prompt for the password(s).
- X See unzip(1L) for details. Once again, note that if the
- X archive has no encrypted files there is no reason to use a
- X version of unzipsfx with decryption support; that only adds
- X to the size of the archive.
- X
- XEXAMPLES
- X To create a self-extracting archive letters from a regular
- X zipfile letters.zip and change the new archive's permissions
- X to be world-executable under Unix:
- X
- X cat unzipsfx letters.zip > letters
- X chmod 755 letters
- X
- X To create the same archive under MS-DOS, OS/2 or NT (note
- X the use of the /b [binary] option to the copy command):
- X
- XInfo-ZIP Last change: 28 Aug 94 (v5.12) 3
- X
- XUNZIPSFX(1L) MISC. REFERENCE MANUAL PAGES UNZIPSFX(1L)
- X
- X copy /b unzipsfx.exe+letters.zip letters.exe
- X
- X Under VMS:
- X
- X copy unzipsfx.exe,letters.zip letters.exe
- X letters == "$currentdisk:[currentdir]letters.exe"
- X
- X (The VMS append command may also be used. The second com-
- X mand installs the new program as a ``foreign command'' capa-
- X ble of taking arguments.) To test (or list) the newly
- X created self-extracting archive:
- X
- X letters -t
- X
- X To test letters quietly, printing only a summary message
- X indicating whether the archive is OK or not:
- X
- X letters -tq
- X
- X To extract the complete contents into the current directory,
- X recreating all files and subdirectories as necessary:
- X
- X letters
- X
- X To extract all *.txt files (in Unix quote the `*'):
- X
- X letters *.txt
- X
- X To extract everything except the *.txt files:
- X
- X letters * -x *.txt
- X
- X (Note that with regular unzip(1L) it would not be necessary
- X to use the first `*'; ``unzip letters -x *.txt'' would work
- X equally well. With unzipsfx the -x option would be silently
- X ignored and the effect would be the same as in the previous
- X example, i.e., the opposite of what was intended.) To
- X extract only the README file to standard output (the
- X screen):
- X
- X letters -c README
- X
- X To print only the zipfile comment:
- X
- X letters -z
- X
- XLIMITATIONS
- X The principle and fundamental limitation of unzipsfx is that
- X it is not portable across architectures or operating sys-
- X tems, and therefore neither are the resulting archives. For
- X some architectures there is limited portability, however
- X (e.g., between some flavors of Intel-based Unix).
- X
- XInfo-ZIP Last change: 28 Aug 94 (v5.12) 4
- X
- XUNZIPSFX(1L) MISC. REFERENCE MANUAL PAGES UNZIPSFX(1L)
- X
- X unzipsfx has no knowledge of the user's PATH, so in general
- X an archive must either be in the current directory when it
- X is invoked, or else a full or relative path must be given.
- X If a user attempts to extract the archive from a directory
- X in the PATH other than the current one, unzipsfx will print
- X a warning to the effect, ``can't find myself.'' This is
- X always true under Unix and may be true in some cases under
- X MS-DOS, depending on the compiler used (Microsoft C fully
- X qualifies the program name, but other compilers may not).
- X Under OS/2 and NT there are operating-system calls available
- X which provide the full path name, so the archive may be
- X invoked from anywhere in the user's path. The situation is
- X not known for Atari TOS, MacOS, etc.
- X
- X As noted above, a number of the normal unzip(1L) functions
- X have been removed in order to make unzipsfx smaller: usage
- X and diagnostic info, listing functions and extraction to
- X other directories. Also, only stored and deflated files are
- X supported. The latter limitation is mainly relevant to
- X those who create SFX archives, however.
- X
- X VMS users must know how to set up self-extracting archives
- X as foreign commands in order to use any of unzipsfx's
- X options. This is not necessary for simple extraction, but
- X the command to do so then becomes, e.g., ``run letters'' (to
- X continue the examples given above).
- X
- X unzipsfx is not supported on the Amiga because of the way
- X the loader works; the entire archive contents would be
- X loaded into memory by default. It may be possible to work
- X around this by defining the attached archive to be a ``debug
- X hunk,'' but compatibility problems between the ROM levels of
- X older Amigas and newer ones are likely to cause problems
- X regardless.
- X
- X All current bugs in unzip(1L) exist in unzipsfx as well.
- X
- XDIAGNOSTICS
- X unzipsfx's exit status (error level) is identical to that of
- X unzip(1L); see the corresponding man page.
- X
- XSEE ALSO
- X funzip(1L), unzip(1L), zip(1L), zipcloak(1L), zipgrep(1L),
- X zipinfo(1L), zipnote(1L), zipsplit(1L)
- X
- XAUTHORS
- X Greg Roelofs was responsible for the basic modifications to
- X UnZip necessary to create UnZipSFX. See unzip(1L) for the
- X current list of zip-bugs authors, or the file CONTRIBS in
- X the UnZip source distribution for the full list of Info-ZIP
- X contributors.
- X
- XInfo-ZIP Last change: 28 Aug 94 (v5.12) 5
- X
- END_OF_FILE
- if test 12334 -ne `wc -c <'unzip-5.12/unzipsfx.doc'`; then
- echo shar: \"'unzip-5.12/unzipsfx.doc'\" unpacked with wrong size!
- fi
- # end of 'unzip-5.12/unzipsfx.doc'
- fi
- if test -f 'unzip-5.12/vms/unzipsfx.hlp' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'unzip-5.12/vms/unzipsfx.hlp'\"
- else
- echo shar: Extracting \"'unzip-5.12/vms/unzipsfx.hlp'\" \(9759 characters\)
- sed "s/^X//" >'unzip-5.12/vms/unzipsfx.hlp' <<'END_OF_FILE'
- X1 UNZIPSFX
- X
- X unzipsfx - self-extracting stub for prepending to ZIP
- X archives
- X
- X <name of unzipsfx+archive combo> [-cfptuz[ajnoqsCLV$]]
- X [file(s) ...] [-x xfile(s) ...]
- X
- X unzipsfx is a modified version of unzip designed to be
- X prepended to existing ZIP archives in order to form self-
- X extracting archives. Instead of taking its first non-flag
- X argument to be the zipfile(s) to be extracted, unzipsfx
- X seeks itself under the name by which it was invoked and
- X tests or extracts the contents of the appended archive.
- X Because the executable stub adds bulk to the archive (the
- X whole purpose of which is to be as small as possible), a
- X number of the regular version's less-vital capabilities have
- X been removed. Among these are the usage (or help) screen,
- X the listing and diagnostic functions (-l and -v), the abil-
- X ity to decompress older compression formats (the ``reduce,''
- X ``shrink'' and ``implode'' methods), and the ability to
- X extract to a directory other than the current one. Decryp-
- X tion is supported as a compile-time option but should be
- X avoided unless the attached archive contains encrypted
- X files.
- X
- X Note that self-extracting archives made with unzipsfx are no
- X more (or less) portable across different operating systems
- X than is the unzip executable itself. In general a self-
- X extracting archive made on a particular Unix system, for
- X example, will only self-extract under the same flavor of
- X Unix. Regular unzip may still be used to extract the embed-
- X ded archive as with any normal zipfile, although it will
- X generate a harmless warning about extra bytes at the begin-
- X ning of the zipfile.
- X
- X
- X
- X[file(s)]
- X
- X An optional list of archive members to be processed.
- X Regular expressions (wildcards) similar to those in
- X Unix egrep(1) may be used to match multiple members.
- X These wildcards may contain:
- X
- X * matches a sequence of 0 or more characters
- X
- X ? matches exactly 1 character
- X
- X [...]
- X matches any single character found inside the
- X brackets; ranges are specified by a beginning
- X character, a hyphen, and an ending character. If
- X an exclamation point or a caret (`!' or `^') fol-
- X lows the left bracket, then the range of charac-
- X ters within the brackets is complemented (that is,
- X anything except the characters inside the brackets
- X is considered a match).
- X
- X (Be sure to quote any character which might otherwise
- X be interpreted or modified by the operating system,
- X particularly under Unix and VMS.)
- X
- X[-x xfile(s)]
- X
- X An optional list of archive members to be excluded from
- X processing. Since wildcard characters match directory
- X separators (`/'), this option may be used to exclude
- X any files which are in subdirectories. For example,
- X ``unzip foo *.[ch] -x */*'' would extract all C source
- X files in the main directory, but none in any subdirec-
- X tories. Without the -x option, all C source files in
- X all directories within the zipfile would be extracted.
- X
- X2 Options
- X
- X unzipsfx supports the following unzip options: -c and
- X -p (extract to standard output/screen), -f and -u (freshen
- X and update existing files upon extraction), -t (test
- X archive) and -z (print archive comment). All normal listing
- X options (-l, -v and -Z) have been removed, but the testing
- X option (-t) may be used as a ``poor man's'' listing. Alter-
- X natively, those creating self-extracting archives may wish
- X to include a short listing in the zipfile comment.
- X
- X See unzip for a more complete description of these
- X options.
- X
- X MODIFIERS
- X
- X unzipsfx currently supports all unzip modifiers: -a
- X (convert text files), -n (never overwrite), -o (overwrite
- X without prompting), -q (operate quietly), -C (match names
- X case-insenstively), -L (convert uppercase-OS names to lower-
- X case), -j (junk paths) and -V (retain version numbers); plus
- X the following operating-system specific options: -X
- X (restore VMS owner/protection info), -s (convert spaces in
- X filenames to underscores [DOS, OS/2, NT]) and -$ (restore
- X volume label [DOS, OS/2, NT, Amiga]).
- X
- X (Support for regular ASCII text-conversion may be removed in
- X future versions, since it is simple enough for the archive's
- X creator to ensure that text files have the appropriate for-
- X mat for the local OS. EBCDIC conversion will of course con-
- X tinue to be supported since the zipfile format implies ASCII
- X storage of text files.)
- X
- X See unzip for a more complete description of these
- X modifiers.
- X
- X2 Environment_options
- X
- X unzipsfx uses the same environment variables as unzip
- X does, although this is likely to be an issue only for the
- X person creating and testing the self-extracting archive.
- X See unzip for details.
- X
- X2 Decryption
- X
- X Decryption is supported exactly as in unzip; that is,
- X interactively with a non-echoing prompt for the password(s).
- X See unzip for details. Once again, note that if the
- X archive has no encrypted files there is no reason to use a
- X version of unzipsfx with decryption support; that only adds
- X to the size of the archive.
- X
- X2 Examples
- X
- X To create a self-extracting archive letters from a regular
- X zipfile letters.zip and change the new archive's permissions
- X to be world-executable under Unix:
- X
- X cat unzipsfx letters.zip > letters
- X chmod 755 letters
- X
- X To create the same archive under MS-DOS, OS/2 or NT (note
- X the use of the /b [binary] option to the copy command):
- X
- X copy /b unzipsfx.exe+letters.zip letters.exe
- X
- X Under VMS:
- X
- X copy unzipsfx.exe,letters.zip letters.exe
- X letters == "$currentdisk:[currentdir]letters.exe"
- X
- X (The VMS append command may also be used. The second com-
- X mand installs the new program as a ``foreign command'' capa-
- X ble of taking arguments.) To test (or list) the newly
- X created self-extracting archive:
- X
- X letters -t
- X
- X To test letters quietly, printing only a summary message
- X indicating whether the archive is OK or not:
- X
- X letters -tq
- X
- X To extract the complete contents into the current directory,
- X recreating all files and subdirectories as necessary:
- X
- X letters
- X
- X To extract only the README file to standard output (the
- X screen):
- X
- X letters -c README
- X
- X To print only the zipfile comment:
- X
- X letters -z
- X
- X2 Limitations
- X
- X The principle and fundamental limitation of unzipsfx is that
- X it is not portable across architectures or operating sys-
- X tems, and therefore neither are the resulting archives. For
- X some architectures there is limited portability, however
- X (e.g., between some flavors of Intel-based Unix).
- X
- X unzipsfx has no knowledge of the user's PATH, so in general
- X an archive must either be in the current directory when it
- X is invoked, or else a full or relative path must be given.
- X If a user attempts to extract the archive from a directory
- X in the PATH other than the current one, unzipsfx will print
- X a warning to the effect, ``can't find myself.'' This is
- X always true under Unix and may be true in some cases under
- X MS-DOS, depending on the compiler used (Microsoft C fully
- X qualifies the program name, but other compilers may not).
- X Under OS/2 and NT there are operating-system calls available
- X which provide the full path name, so the archive may be
- X invoked from anywhere in the user's path. The situation is
- X not known for Atari TOS, MacOS, etc.
- X
- X As noted above, a number of the normal unzip functions
- X have been removed in order to make unzipsfx smaller: usage
- X and diagnostic info, listing functions and extraction to
- X other directories. Also, only stored and deflated files are
- X supported. The latter limitation is mainly relevant to
- X those who create SFX archives, however.
- X
- X VMS users must know how to set up self-extracting archives
- X as foreign commands in order to use any of unzipsfx's
- X options. This is not necessary for simple extraction, but
- X the command to do so then becomes, e.g., ``run letters'' (to
- X continue the examples given above).
- X
- X unzipsfx is not supported on the Amiga because of the way
- X the loader works; the entire archive contents would be
- X loaded into memory by default. It may be possible to work
- X around this by defining the attached archive to be a ``debug
- X hunk,'' but compatibility problems between the ROM levels of
- X older Amigas and newer ones are likely to cause problems
- X regardless.
- X
- X All current bugs in unzip exist in unzipsfx as well.
- X
- X2 Diagnostics
- X
- X unzipsfx's exit status (error level) is identical to that of
- X unzip; see the corresponding man page.
- X
- X2 See_also
- X
- X funzip, unzip, zip, zipcloak, zipgrep,
- X zipinfo, zipnote, zipsplit
- X
- X2 Authors
- X
- X Greg Roelofs was responsible for the basic modifications to
- X UnZip necessary to create UnZipSFX. See unzip for the
- X current list of zip-bugs authors, or the file CONTRIBS in
- X the UnZip source distribution for the full list of Info-ZIP
- X contributors.
- END_OF_FILE
- if test 9759 -ne `wc -c <'unzip-5.12/vms/unzipsfx.hlp'`; then
- echo shar: \"'unzip-5.12/vms/unzipsfx.hlp'\" unpacked with wrong size!
- fi
- # end of 'unzip-5.12/vms/unzipsfx.hlp'
- fi
- if test -f 'unzip-5.12/vms/vms.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'unzip-5.12/vms/vms.h'\"
- else
- echo shar: Extracting \"'unzip-5.12/vms/vms.h'\" \(8436 characters\)
- sed "s/^X//" >'unzip-5.12/vms/vms.h' <<'END_OF_FILE'
- X/*---------------------------------------------------------------------------
- X
- X vms.h
- X
- X Generic VMS header file for Info-ZIP's UnZip; now includes VMSmunch.h (at
- X end, except fchdef part deleted).
- X
- X ---------------------------------------------------------------------------*/
- X
- X#include <descrip.h>
- X#include <starlet.h>
- X#include <syidef.h>
- X#include <atrdef.h>
- X#include <fibdef.h>
- X#include <iodef.h>
- X#include <fchdef.h>
- X/* #include <rms.h> already included in unzip.h */
- X#include <lib$routines.h>
- X#include <unixlib.h>
- X
- X#define ERR(s) !((s) & 1) /* VMS system error */
- X
- X#ifndef SYI$_VERSION
- X#define SYI$_VERSION 4096 /* VMS 5.4 definition */
- X#endif
- X
- X/*
- X * Under Alpha (DEC C?), the FIB unions are declared as variant_unions.
- X * FIBDEF.H includes the definition of __union, which we check
- X * below to make sure we access the structure correctly.
- X */
- X#define variant_union 1
- X#if defined(__union) && (__union == variant_union)
- X# define FIB$W_DID fib$w_did
- X# define FIB$W_FID fib$w_fid
- X# define FIB$L_ACCTL fib$l_acctl
- X# define FIB$W_EXCTL fib$w_exctl
- X#else
- X# define FIB$W_DID fib$r_did_overlay.fib$w_did
- X# define FIB$W_FID fib$r_fid_overlay.fib$w_fid
- X# define FIB$L_ACCTL fib$r_acctl_overlay.fib$l_acctl
- X# define FIB$W_EXCTL fib$r_exctl_overlay.fib$w_exctl
- X#endif
- X#undef variant_union
- X
- X
- Xstruct EB_header /* Common header of extra block */
- X{ ush tag;
- X ush size;
- X uch data[1];
- X};
- X
- X/*------ Old style INFO-ZIP extra field definitions -----*/
- X
- X#if (!defined(VAXC) && !defined(_RMS_H) && !defined(__RMS_LOADED))
- X
- Xstruct XAB { /* This definition may be skipped */
- X unsigned char xab$b_cod;
- X unsigned char xab$b_bln;
- X short int xabdef$$_fill_1;
- X char *xab$l_nxt;
- X};
- X
- X#endif /* !VAXC && !_RMS_H */
- X
- X#define BC_MASK 07 /* 3 bits for compression type */
- X#define BC_STORED 0 /* Stored */
- X#define BC_00 1 /* 0byte -> 0bit compression */
- X#define BC_DEFL 2 /* Deflated */
- X
- X/*
- X * Extra record format
- X * ===================
- X * signature (2 bytes) = 'I','M'
- X * size (2 bytes)
- X * block signature (4 bytes)
- X * flags (2 bytes)
- X * uncomprssed size(2 bytes)
- X * reserved (4 bytes)
- X * data ((size-12) bytes)
- X * ....
- X */
- X
- Xstruct IZ_block
- X{
- X ush sig; /* Extra field block header structure */
- X ush size;
- X ulg bid;
- X ush flags;
- X ush length;
- X ulg reserved;
- X uch body[1];
- X};
- X
- X/*
- X * Extra field signature and block signatures
- X */
- X
- X#define IZ_SIGNATURE "IM"
- X#define FABL (cc$rms_fab.fab$b_bln)
- X#define RABL (cc$rms_rab.rab$b_bln)
- X#define XALLL (cc$rms_xaball.xab$b_bln)
- X#define XDATL (cc$rms_xabdat.xab$b_bln)
- X#define XFHCL (cc$rms_xabfhc.xab$b_bln)
- X#define XKEYL (cc$rms_xabkey.xab$b_bln)
- X#define XPROL (cc$rms_xabpro.xab$b_bln)
- X#define XRDTL (cc$rms_xabrdt.xab$b_bln)
- X#define XSUML (cc$rms_xabsum.xab$b_bln)
- X#define EXTBSL 4 /* Block signature length */
- X#define RESL 8 /* Reserved 8 bytes */
- X#define EXTHL (4+EXTBSL)
- X#define FABSIG "VFAB"
- X#define XALLSIG "VALL"
- X#define XFHCSIG "VFHC"
- X#define XDATSIG "VDAT"
- X#define XRDTSIG "VRDT"
- X#define XPROSIG "VPRO"
- X#define XKEYSIG "VKEY"
- X#define XNAMSIG "VNAM"
- X#define VERSIG "VMSV"
- X
- Xtypedef unsigned char byte;
- X
- Xstruct iosb
- X{ ush status;
- X ush count;
- X ulg spec;
- X};
- X
- X/*------------ PKWARE extra block definitions ----------*/
- X
- X/* Structure of PKWARE extra header */
- X
- X#ifdef VMS_ZIP
- X
- Xstruct PK_info
- X{
- X ush tag_ra; ush len_ra; byte ra[ATR$S_RECATTR];
- X ush tag_uc; ush len_uc; byte uc[ATR$S_UCHAR];
- X ush tag_jr; ush len_jr; byte jr[ATR$S_JOURNAL];
- X ush tag_cd; ush len_cd; byte cd[ATR$S_CREDATE];
- X ush tag_rd; ush len_rd; byte rd[ATR$S_REVDATE];
- X ush tag_ed; ush len_ed; byte ed[ATR$S_EXPDATE];
- X ush tag_bd; ush len_bd; byte bd[ATR$S_BAKDATE];
- X ush tag_rn; ush len_rn; ush rn;
- X ush tag_ui; ush len_ui; byte ui[ATR$S_UIC];
- X ush tag_fp; ush len_fp; byte fp[ATR$S_FPRO];
- X ush tag_rp; ush len_rp; byte rp[ATR$S_RPRO];
- X};
- X
- X#endif /* ?VMS_ZIP */
- X
- X/* PKWARE "VMS" tag */
- X#define PK_SIGNATURE 0x000C
- X#define IZ_NEW_SIGNATURE 0x010C /* New signature, extra record format
- X * mostly compatible with PKWARE's */
- X
- X/* Total number of attributes to be saved */
- X#define VMS_ATTR_COUNT 11
- X#define VMS_MAX_ATRCNT 20
- X
- Xstruct PK_field
- X{ ush tag;
- X ush size;
- X byte value[1];
- X};
- X
- X#define PK_FLDHDR_SIZE 4
- X
- Xstruct PK_header
- X{ ush tag;
- X ush size;
- X ulg crc32;
- X byte data[1];
- X};
- X
- X#define PK_HEADER_SIZE 8
- X
- X#ifdef VMS_ZIP
- X/* File description structure for Zip low level I/O */
- Xstruct ioctx
- X{ ush chan;
- X int status;
- X struct iosb iosb;
- X long vbn;
- X long size;
- X long rest;
- X struct PK_info PKi;
- X long acllen;
- X uch aclbuf[ATR$S_READACL];
- X};
- X#endif /* VMS_ZIP */
- X
- X
- X
- X/*---------------------------------------------------------------------------
- X
- X VMSmunch.h
- X
- X A few handy #defines, plus the contents of three header files from Joe
- X Meadows' FILE program. Used by VMSmunch and by various routines which
- X call VMSmunch (e.g., in Zip and UnZip).
- X
- X ---------------------------------------------------------------------------*/
- X
- X#define GET_TIMES 4
- X#define SET_TIMES 0
- X#define GET_RTYPE 1
- X#define CHANGE_RTYPE 2
- X#define RESTORE_RTYPE 3
- X
- X/*---------------------------------------------------------------------------
- X fatdef.h
- X ---------------------------------------------------------------------------*/
- X
- X/* This header file was created by Joe Meadows, and is not copyrighted
- X in any way. No guarantee is made as to the accuracy of the contents
- X of this header file. This header file was last modified on Sep. 22th,
- X 1987. (Modified to include this statement) */
- X#define FAT$K_LENGTH 32
- X#define FAT$C_LENGTH 32
- X#define FAT$S_FATDEF 32
- X
- Xstruct fatdef {
- X union {
- X unsigned char fat$b_rtype;
- X struct {
- X unsigned fat$v_rtype : 4;
- X unsigned fat$v_fileorg : 4;
- X } fat$r_rtype_bits;
- X } fat$r_rtype_overlay;
- X# define FAT$S_RTYPE 4
- X# define FAT$V_RTYPE 0
- X# define FAT$C_UNDEFINED 0
- X# define FAT$C_FIXED 1
- X# define FAT$C_VARIABLE 2
- X# define FAT$C_VFC 3
- X# define FAT$C_STREAM 4
- X# define FAT$C_STREAMLF 5
- X# define FAT$C_STREAMCR 6
- X# define FAT$S_FILEORG 4
- X# define FAT$V_FILEORG 4
- X# define FAT$C_SEQUENTIAL 0
- X# define FAT$C_RELATIVE 1
- X# define FAT$C_INDEXED 2
- X# define FAT$C_DIRECT 3
- X union {
- X unsigned char fat$b_rattrib;
- X struct {
- X unsigned fat$v_fortrancc : 1;
- X unsigned fat$v_impliedcc : 1;
- X unsigned fat$v_printcc : 1;
- X unsigned fat$v_nospan : 1;
- X } fat$r_rattrib_bits;
- X } fat$r_rattrib_overlay;
- X# define FAT$V_FORTRANCC 0
- X# define FAT$M_FORTRANCC 1
- X# define FAT$V_IMPLIEDCC 1
- X# define FAT$M_IMPLIEDCC 2
- X# define FAT$V_PRINTCC 2
- X# define FAT$M_PRINTCC 4
- X# define FAT$V_NOSPAN 3
- X# define FAT$M_NOSPAN 8
- X unsigned short int fat$w_rsize;
- X union
- X {
- X unsigned long int fat$l_hiblk;
- X struct
- X {
- X unsigned short int fat$w_hiblkh;
- X unsigned short int fat$w_hiblkl;
- X } fat$r_hiblk_fields;
- X } fat$r_hiblk_overlay;
- X union
- X {
- X unsigned long int fat$l_efblk;
- X struct
- X {
- X unsigned short int fat$w_efblkh;
- X unsigned short int fat$w_efblkl;
- X } fat$r_efblk_fields;
- X } fat$r_efblk_overlay;
- X unsigned short int fat$w_ffbyte;
- X unsigned char fat$b_bktsize;
- X unsigned char fat$b_vfcsize;
- X unsigned short int fat$w_maxrec;
- X unsigned short int fat$w_defext;
- X unsigned short int fat$w_gbc;
- X char fat$fill[8];
- X unsigned short int fat$w_versions;
- X};
- X
- X
- X/*---------------------------------------------------------------------------
- X fjndef.h
- X ---------------------------------------------------------------------------*/
- X
- X/* This header file was created by Joe Meadows, and is not copyrighted
- X in any way. No guarantee is made as to the accuracy of the contents
- X of this header file. This header file was last modified on Sep. 22th,
- X 1987. (Modified to include this statement) */
- X
- X#define FJN$M_ONLY_RU 1
- X#define FJN$M_RUJNL 2
- X#define FJN$M_BIJNL 4
- X#define FJN$M_AIJNL 8
- X#define FJN$M_ATJNL 16
- X#define FJN$M_NEVER_RU 32
- X#define FJN$M_JOURNAL_FILE 64
- X#define FJN$S_FJNDEF 1
- Xstruct fjndef {
- X unsigned fjn$v_only_ru : 1;
- X unsigned fjn$v_rujnl : 1;
- X unsigned fjn$v_bijnl : 1;
- X unsigned fjn$v_aijnl : 1;
- X unsigned fjn$v_atjnl : 1;
- X unsigned fjn$v_never_ru : 1;
- X unsigned fjn$v_journal_file:1;
- X} ;
- END_OF_FILE
- if test 8436 -ne `wc -c <'unzip-5.12/vms/vms.h'`; then
- echo shar: \"'unzip-5.12/vms/vms.h'\" unpacked with wrong size!
- fi
- # end of 'unzip-5.12/vms/vms.h'
- fi
- echo shar: End of archive 16 \(of 20\).
- cp /dev/null ark16isdone
- MISSING=""
- for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have unpacked all 20 archives.
- rm -f ark[1-9]isdone ark[1-9][0-9]isdone
- else
- echo You still must unpack the following archives:
- echo " " ${MISSING}
- fi
- exit 0
- exit 0 # Just in case...
-