home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume44 / unzip / part16 < prev    next >
Encoding:
Internet Message Format  |  1994-09-19  |  70.6 KB

  1. From: zip-bugs@wkuvx1.wku.edu (Info-ZIP group)
  2. Newsgroups: comp.sources.misc
  3. Subject: v44i081:  unzip - Info-ZIP portable UnZip, version 5.12, Part16/20
  4. Date: 18 Sep 1994 23:16:50 -0500
  5. Organization: Sterling Software
  6. Sender: kent@sparky.sterling.com
  7. Approved: kent@sparky.sterling.com
  8. Message-ID: <35j3bi$qr0@sparky.sterling.com>
  9. X-Md4-Signature: fc9034042d2903ac94e0a3310d087ffd
  10.  
  11. Submitted-by: zip-bugs@wkuvx1.wku.edu (Info-ZIP group)
  12. Posting-number: Volume 44, Issue 81
  13. Archive-name: unzip/part16
  14. Environment: UNIX, VMS, OS/2, MS-DOS, MACINTOSH, WIN-NT, LINUX, MINIX, COHERENT, AMIGA?, ATARI TOS, SGI, DEC, Cray, Convex, Amdahl, Sun
  15. Supersedes: unzip50: Volume 31, Issue 104-117
  16.  
  17. #! /bin/sh
  18. # This is a shell archive.  Remove anything before this line, then feed it
  19. # into a shell via "sh file" or similar.  To overwrite existing files,
  20. # type "sh file -c".
  21. # Contents:  unzip-5.12/README unzip-5.12/amiga/flate.a
  22. #   unzip-5.12/atari/Makefile unzip-5.12/mac/macunzip.c
  23. #   unzip-5.12/unzipsfx.doc unzip-5.12/vms/unzipsfx.hlp
  24. #   unzip-5.12/vms/vms.h
  25. # Wrapped by kent@sparky on Sat Sep 17 23:33:46 1994
  26. PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin:$PATH ; export PATH
  27. echo If this archive is complete, you will see the following message:
  28. echo '          "shar: End of archive 16 (of 20)."'
  29. if test -f 'unzip-5.12/README' -a "${1}" != "-c" ; then 
  30.   echo shar: Will not clobber existing file \"'unzip-5.12/README'\"
  31. else
  32.   echo shar: Extracting \"'unzip-5.12/README'\" \(9076 characters\)
  33.   sed "s/^X//" >'unzip-5.12/README' <<'END_OF_FILE'
  34. XThis is the README file for the 28 August 1994 public release of the
  35. XInfo-ZIP group's portable UnZip zipfile-extraction program (and related
  36. Xutilities).
  37. X
  38. Xunzip512.zip    portable UnZip, version 5.12, source code distribution
  39. Xunzip512.tar.Z    same as above, but compress'd tar format
  40. X
  41. X__________________________________________________________________________
  42. X
  43. XBEFORE YOU ASK:  UnZip, its companion utility Zip, and related utilities
  44. Xand support files can be found in many places; read the file "Where" for
  45. Xfurther details.  To contact the authors with suggestions, bug reports,
  46. Xor fixes, continue reading this file (README) and, if this is part of a
  47. Xsource distribution, the file "ZipPorts".  Also in source distributions:
  48. Xread "BUGS" for a list of known bugs, non-bugs and possible future bugs;
  49. XINSTALL for instructions on how to build UnZip; and "Contents" for a com-
  50. Xmented listing of all the distributed files.
  51. X
  52. XALSO NOTE:  Info-ZIP's mailing addresses changed between UnZip 5.0p1 and
  53. X5.1 releases (and since Zip 2.0.1)!  The old BITNET address doesn't even
  54. Xexist anymore.  See below.
  55. X__________________________________________________________________________
  56. X
  57. X
  58. XGENERAL INFO
  59. X------------
  60. XUnZip is an extraction utility for archives compressed in .zip format (also
  61. Xcalled "zipfiles").  Although highly compatible both with PKWARE's PKZIP 
  62. Xand PKUNZIP utilities for MS-DOS and with Info-ZIP's own Zip program, our
  63. Xprimary objectives have been portability and non-MSDOS functionality.
  64. X
  65. XThis version of UnZip has been ported to a wide array of hardware--from 
  66. Xmicros to supercomputers--and operating systems:  Unix (many flavors),
  67. XVMS, OS/2, MSDOS (+ Windows), NT, TOPS-20 (partly), AmigaDOS, Atari TOS,
  68. XMacintosh and Human68k.  UnZip features not found in PKUNZIP include source
  69. Xcode; default extraction of directory trees (with a switch to defeat this, 
  70. Xrather than the reverse); VMS, Macintosh and OS/2 extended file attributes; 
  71. Xand, of course, the ability to run under most of your favorite operating 
  72. Xsystems.  Plus, it's free. :-)
  73. X
  74. XFor source distributions, see the main Contents file for a list of what's
  75. Xincluded, and read INSTALL for instructions on compiling (including OS-
  76. Xspecific comments).  The individual operating systems' Contents files (for 
  77. Xexample, vms/Contents) may list important compilation info in addition to 
  78. Xexplaining what files are what, so be sure to read them.  Some of the ports 
  79. Xhave their own, special README files, so be sure to look for those, too.
  80. X
  81. XSee unzip.1 or unzip.doc for usage (or the corresponding UnZipSFX, ZipInfo
  82. Xand fUnZip docs).  For VMS, unzip_def.rnh or unzip_cli.help may be compiled
  83. Xinto unzip.hlp and installed as a normal VMS help entry; see vms/descrip.mms.
  84. X
  85. X
  86. XCHANGES AND NEW FEATURES
  87. X------------------------
  88. XThe 5.12 release mainly fixes some bugs in 5.11, including a silly pointer
  89. Xerror in unzipsfx.  The only new features are fairly minor:
  90. X
  91. X   - ZipInfo check for dead space inside archives (PKZIP/Netware bug)
  92. X   - SFX_EXDIR compilation option to allow -d <exdir> with UnZipSFX
  93. X   - "unzip -vqqqq" prints just the version number (e.g., "512")
  94. X
  95. XSince neither 5.11 nor 5.1 was posted to Usenet, here's a summary of their
  96. Xnew features.  In UnZip 5.11:
  97. X
  98. X   - UnZipSFX, a self-extraction stub for prepending to (new-style) zipfiles
  99. X      (tested under Unix, VMS, MS-DOS, OS/2, etc.; NOT portable *across* OSes)
  100. X   - unshrink() rewritten to avoid copyright problems; 32-bit version only
  101. X   - strings moved to far memory in MS-DOS:  can use small model again (MSC)
  102. X   - numerous customization options (see INSTALL)
  103. X   - diagnostic screen with -v option and no zipfile (i.e., "unzip -v")
  104. X   - -C option for case-insensitive filename matching (esp. for MS-DOS, OS/2)
  105. X   - more bad-zipfile "intelligence" (can sometimes even extract concatenated
  106. X      multi-part archives)
  107. X   - former -U behavior is now the default; new -L option to provide what was
  108. X      the default behavior (auto-conversion of uppercase-OS filenames to lower
  109. X      case)
  110. X   - ZipInfo -T option to print times in decimal format (yymmdd.hhmmss) for
  111. X      piping into sort(1)
  112. X   - performance tweaks for listing archive contents
  113. X   - improved/expanded documentation, esp. man pages (*.doc files) and INSTALL
  114. X
  115. XIn UnZip 5.1:
  116. X
  117. X   - wildcard zipfiles (e.g., "unzip -tq \*.zip")
  118. X   - extract to a directory other than the current one (-d <exdir> option)
  119. X   - auto-conversion of text files
  120. X   - ANSI sequences disabled in comments and filenames (avoid "ANSI bombs")
  121. X   - ZipInfo incorporated into UnZip (-Z option)
  122. X   - full Amiga, Atari, Mac, NT and Human68K support (partial TOPS-20)
  123. X   - performance tuning for 35-70% faster extraction (depends on compression
  124. X      method)
  125. X
  126. XNote that, according to one tester, the 32-bit MS-DOS version is now *faster*
  127. Xthan PKUNZIP on most archives!  Cool.
  128. X
  129. X
  130. XDISTRIBUTION
  131. X------------
  132. XIf you have a question regarding redistribution of Info-ZIP software,
  133. Xeither as-is, as packaging for a commercial product, or as an integral
  134. Xpart of a commercial product, read the Frequently Asked Questions (FAQ)
  135. Xsection of the included COPYING file.
  136. X
  137. XInsofar as C compilers are rare on some platforms and the authors only
  138. Xhave direct access to Unix, VMS, OS/2, MS-DOS, Mac, Amiga and Atari 
  139. Xsystems, others may wish to provide ready-to-run executables for new
  140. Xsystems.  In general there is no problem with this; we require only that 
  141. Xsuch distributions include this README file, the Where file, the COPYING 
  142. Xfile (contains copyright/redistribution information), and the appropriate 
  143. Xdocumentation files (unzip.doc and/or unzip.1 for UnZip, etc.).  If the 
  144. Xlocal system provides a way to make self-extracting archives in which both 
  145. Xthe executables and text files may be stored together, that is best (in
  146. Xparticular, use UnZipSFX if at all possible, even if it's a few kilobytes
  147. Xbigger than the alternatives); otherwise we suggest a bare UnZip executable
  148. Xand a separate zipfile containing the remaining text and binary files.  If
  149. Xanother archiving method is in common use on the target system (for example,
  150. XZoo or LHa), that may also be used.
  151. X
  152. X
  153. XBUGS AND NEW PORTS:  CONTACTING INFO-ZIP
  154. X----------------------------------------
  155. XAll bug reports and patches (context diffs only, please!) should go to 
  156. Xzip-bugs@wkuvx1.wku.edu, which is the e-mail address for the Info-ZIP
  157. Xauthors.  "Dumb questions" which aren't adequately answered in the docu-
  158. Xmentation should also be directed here rather than to a global forum such
  159. Xas Usenet.  (Kindly make certain that your questions *isn't* answered by
  160. Xthe documentation, however--a great deal of effort has gone into making
  161. Xit clear and complete.)  Suggestions for new features can be sent to
  162. Xinfo-zip@wkuvx1.wku.edu, a mailing list for the Info-ZIP beta testers, 
  163. Xfor discussion (the authors hang out here as well, of course), although 
  164. Xwe don't promise to act on all suggestions.  If it is something which is 
  165. Xmanifestly useful, sending the required patches to zip-bugs directly (as
  166. Xper the instructions in the ZipPorts file) is likely to produce a quicker 
  167. Xresponse than asking us to do it--the authors are always somewhat short 
  168. Xon time.  (Please do NOT send patches or encoded zipfiles to the info-zip 
  169. Xaddress.)
  170. X
  171. XIf you are considering a port, not only should you read the ZipPorts file,
  172. Xbut also please check in with zip-bugs BEFORE getting started, since the 
  173. Xcode is constantly being updated behind the scenes.  For example, an Acorn/
  174. XArchimedes port is already almost complete, as is an OS/2 dynamic link lib-
  175. Xrary (DLL) version; VMOS, VM/CMS, Netware, QDOS and NT DLL ports are claimed
  176. Xto be under construction, although we have yet to see any up-to-date patches.
  177. XWe will arrange to send you the latest sources.  The alternative is the pos-
  178. Xsibility that your hard work will be tucked away in a sub-archive and mostly
  179. Xignored, or completely ignored if someone else has already done the port
  180. X(and you'd be surprised how often this has happened).  IBM mainframe ports
  181. X(VM/CMS and/or MVS) would be particularly welcome.  (It can't be *that* hard,
  182. Xfolks...the VMS filesystem is similar in many ways.)
  183. X
  184. X
  185. XBETA TESTING:  JOINING INFO-ZIP
  186. X-------------------------------
  187. XIf you'd like to keep up to date with our UnZip (and companion Zip utility)
  188. Xdevelopment, join the ranks of beta testers, add your own thoughts and con-
  189. Xtributions, etc., send a two-line mail message containing the commands HELP
  190. Xand LIST (on separate lines in the body of the message, not on the subject
  191. Xline) to mxserver@wkuvx1.wku.edu.  You'll receive two messages listing the 
  192. Xvarious Info-ZIP mailing-list formats which are available (and also various
  193. Xunrelated lists) and instructions on how to subscribe to one or more of them
  194. X(courtesy of Hunter Goatley).  As of mid-1994, subscribing to the announce-
  195. Xments list requires a command of the form
  196. X
  197. X    SUBSCRIBE Info-ZIP-announce "Joe Isuzu"
  198. X
  199. XThe discussion list is called either Info-ZIP or Info-ZIP-digest, depending
  200. Xon one's preference for delivery.
  201. X
  202. X
  203. X-- Greg Roelofs (Cave Newt), UnZip maintainer/container/explainer and
  204. X   developer guy, with inspiration from David Kirschbaum
  205. END_OF_FILE
  206.   if test 9076 -ne `wc -c <'unzip-5.12/README'`; then
  207.     echo shar: \"'unzip-5.12/README'\" unpacked with wrong size!
  208.   fi
  209.   # end of 'unzip-5.12/README'
  210. fi
  211. if test -f 'unzip-5.12/amiga/flate.a' -a "${1}" != "-c" ; then 
  212.   echo shar: Will not clobber existing file \"'unzip-5.12/amiga/flate.a'\"
  213. else
  214.   echo shar: Extracting \"'unzip-5.12/amiga/flate.a'\" \(8802 characters\)
  215.   sed "s/^X//" >'unzip-5.12/amiga/flate.a' <<'END_OF_FILE'
  216. X; Not copyrighted by Paul Kienitz, 20 Jun 94.
  217. X;
  218. X; Assembly language version of inflate_codes(), for Amiga.  Prototype:
  219. X;
  220. X;   int flate_codes(struct huft *tl, struct huft *td, int bl, int bd,
  221. X;                   unsigned char *slide);
  222. X;
  223. X; It is called by defining inflate_codes(tl, td, bl, bd) as
  224. X; flate_codes(tl, td, bl, bd, slide).
  225. X;
  226. X; Define the symbol FUNZIP if this is for fUnZip.  Define CRYPT if this is
  227. X; for fUnZip with decryption enabled.  Define AZTEC to use the Aztec C
  228. X; buffered input macro instead of the library getc() with FUNZIP.
  229. X;
  230. X; => int MUST BE 16 BITS!!! <=                    => WSIZE MUST BE 32K! <=
  231. X;
  232. X; struct huft is defined as follows:
  233. X;
  234. X;   struct huft {
  235. X;     uch e;                /* number of extra bits or operation */
  236. X;     uch b;                /* number of bits in this code or subcode */
  237. X;     union {
  238. X;       ush n;              /* literal, length base, or distance base */
  239. X;       struct huft *t;     /* pointer to next level of table */
  240. X;     } v;
  241. X;   };                      /* sizeof(struct huft) == 6 */
  242. X;
  243. X; so here we define the offsets of the various members of this struct:
  244. X
  245. Xh_e        equ    0
  246. Xh_b        equ    1
  247. Xh_n        equ    2
  248. Xh_t        equ    2
  249. XSIZEOF_HUFT    equ    6
  250. X
  251. X; There are several global variables we need to access.  Their definitions:
  252. X;
  253. X;   unsigned long bb;
  254. X;   unsigned int bk, wp;
  255. X;   unsigned short mask[17];
  256. X;   FILE *in;
  257. X;   int encrypted;            /* FUNZIP CRYPT only */
  258. X;
  259. X;   int incnt, mem_mode;        /* non-FUNZIP only */
  260. X;   long csize;                /* non-FUNZIP only */
  261. X;   unsigned long outcnt;        /* non-FUNZIP only */
  262. X;   unsigned char *inptr;        /* non-FUNZIP only */
  263. X;
  264. X; bb is the global buffer that holds bits from the huffman code stream, which
  265. X; we cache in the register variable b.  bk is the number of valid bits in it,
  266. X; which we cache in k.  The macros NEEDBITS(n) and DUMPBITS(n) have side effects
  267. X; on b and k.
  268. X
  269. X    xref    _bb
  270. X    xref    _bk
  271. X    xref    _mask
  272. X    xref    _wp
  273. X        IFD    FUNZIP
  274. X         IFD    CRYPT
  275. X    xref    _encrypted
  276. X    xref    _update_keys    ; int update_keys(int)
  277. X    xref    _decrypt_byte    ; int decrypt_byte(void)
  278. X         ENDC    ; CRYPT
  279. X    xref    _in
  280. X    xref    _getc        ; int getc(FILE *)
  281. X        ELSE    ; !FUNZIP
  282. X    xref    _csize
  283. X    xref    _incnt
  284. X    xref    _mem_mode
  285. X    xref    _inptr
  286. X    xref    _readbyte    ; int readbyte(void)
  287. X        ENDC
  288. X    xref    _flush        ; if FUNZIP:  int flush(unsigned long)
  289. X    ; ...if !FUNZIP:  int flush(unsigned char *, unsigned long *, int)
  290. X
  291. X; Here are our register variables.  Remember that int == short!
  292. X
  293. Xb    equr    d2        ; unsigned long
  294. Xk    equr    d3        ; unsigned int <= 32
  295. Xe    equr    d4        ; unsigned int < 256 for most use
  296. Xw    equr    d5        ; unsigned int
  297. Xn    equr    d6        ; unsigned int
  298. Xd    equr    d7        ; unsigned int
  299. X
  300. X; assert: we always maintain w and d as valid unsigned longs.
  301. X
  302. Xt    equr    a2        ; struct huft *
  303. Xslide    equr    a3        ; unsigned char *
  304. Xmask    equr    a6        ; unsigned short *
  305. X
  306. X; Couple other items we need:
  307. X
  308. Xsavregs    reg    d2-d7/a2/a3/a6
  309. X
  310. XWSIZE    equ    $8000        ; 32k... be careful not to treat as negative!
  311. X
  312. X        IFD    FUNZIP
  313. X; This does getc(in).  Aztec version is based on #define getc(fp) in stdio.h
  314. X
  315. X         IFD    AZTEC
  316. X    xref    __filbuf
  317. XGETC          MACRO
  318. X    move.l        _in,a0
  319. X    move.l        (a0),a1        ; in->_bp
  320. X    cmp.l        4(a0),a1    ; in->_bend
  321. X    blo.s        gci\@
  322. X    move.l        a0,-(sp)
  323. X    jsr        __filbuf
  324. X    addq        #4,sp
  325. X    bra.s        gce\@
  326. Xgci\@:    moveq        #0,d0        ; must be valid as longword
  327. X    move.b        (a1)+,d0
  328. X    move.l        a1,(a0)
  329. Xgce\@:
  330. X          ENDM
  331. X         ELSE    ; !AZTEC
  332. XGETC          MACRO
  333. X    move.l        _in,-(sp)
  334. X    jsr        _getc
  335. X    addq        #4,sp
  336. X          ENDM
  337. X         ENDC    ; AZTEC
  338. X        ENDC    ; FUNZIP
  339. X
  340. X; Input depends on the NEXTBYTE macro.  This exists in three different forms.
  341. X; The first two are for fUnZip, with and without decryption.  The last is for
  342. X; regular UnZip with or without decryption.  The resulting byte is returned
  343. X; in d0 as a longword, and d1, a0, and a1 are clobbered.
  344. X
  345. X        IFD    FUNZIP
  346. X         IFD    CRYPT
  347. XNEXTBYTE      MACRO
  348. X    GETC
  349. X    tst.w        _encrypted
  350. X    beq.s        nbe\@
  351. X    move.w        d0,-(sp)    ; save thru next call
  352. X    jsr        _decrypt_byte
  353. X    eor.w        d0,(sp)        ; becomes arg to update_keys
  354. X    jsr        _update_keys
  355. X    addq        #2,sp
  356. Xnbe\@:    ext.l        d0        ; assert -1 <= d0 <= 255
  357. X          ENDM
  358. X         ELSE    ; !CRYPT
  359. XNEXTBYTE      MACRO
  360. X    GETC            ; nothing else in this case
  361. X          ENDM
  362. X         ENDC
  363. X        ELSE    ; !FUNZIP
  364. XNEXTBYTE     MACRO
  365. X    subq.l        #1,_csize
  366. X    bge.s        nbg\@
  367. X    moveq        #-1,d0        ; return EOF
  368. X    bra.s        nbe\@
  369. Xnbg\@:    subq.w        #1,_incnt
  370. X    bge.s        nbs\@
  371. X    jsr        _readbyte
  372. X    bra.s        nbe\@
  373. Xnbs\@:    moveq        #0,d0
  374. X    move.l        _inptr,a0
  375. X    move.b        (a0)+,d0
  376. X    move.l        a0,_inptr
  377. Xnbe\@:
  378. X         ENDM
  379. X        ENDC
  380. X
  381. X; FLUSH has different versions for fUnZip and UnZip.  Arg must be a longword.
  382. X
  383. X        IFD    FUNZIP
  384. XFLUSH         MACRO
  385. X    move.l        \1,-(sp)
  386. X    jsr        _flush
  387. X    addq        #4,sp
  388. X         ENDM
  389. X        ELSE    ; !FUNZIP
  390. X    xref    _mem_mode
  391. X    xref    _outcnt
  392. XFLUSH         MACRO
  393. X    tst.w        _mem_mode
  394. X    bne.s        fm\@
  395. X    move.w        #0,-(sp)    ; unshrink flag: always false
  396. X    move.l        \1,-(sp)        ; length
  397. X    move.l        slide,-(sp)    ; buffer to flush
  398. X    jsr        _flush
  399. X    lea        10(sp),sp
  400. X    bra.s        fe\@
  401. Xfm\@:    move.l        w,_outcnt
  402. Xfe\@:
  403. X         ENDM
  404. X        ENDC    ; FUNZIP
  405. X
  406. X; Here are the two bit-grabbing macros, defined in their non-CHECK_EOF form:
  407. X;
  408. X;   define NEEDBITS(n) {while(k<(n)){b|=((ulg)NEXTBYTE)<<k;k+=8;}}
  409. X;   define DUMPBITS(n) {b>>=(n);k-=(n);}
  410. X;
  411. X; NEEDBITS clobbers d0, d1, a0, and a1, none of which can be used as the arg
  412. X; to the macro specifying the number of bits.  The arg can be a shortword memory
  413. X; address, or d2-d7.  The result is copied into d1 as a word ready for masking.
  414. X; DUMPBITS has no side effects; the arg must be a d-register (or immediate in the
  415. X; range 1-8?) and only the lower byte is significant.
  416. X
  417. XNEEDBITS    MACRO
  418. Xnb\@:    cmp.w        \1,k        ; assert 0 < k <= 32 ... arg may be 0
  419. X    bhs.s        ne\@
  420. X    NEXTBYTE            ; returns in d0.l
  421. X    lsl.l        k,d0
  422. X    or.l        d0,b
  423. X    addq.w        #8,k
  424. X    bra.s        nb\@
  425. Xne\@:    move.w        b,d1
  426. X        ENDM
  427. X
  428. XDUMPBITS    MACRO
  429. X    lsr.l        \1,b        ; upper bits of \1 are ignored??
  430. X    sub.b        \1,k
  431. X        ENDM
  432. X
  433. X
  434. X; ******************************************************************************
  435. X; Here we go, finally:
  436. X
  437. X    xdef    _flate_codes    ; (pointer, pointer, int, int, pointer)
  438. X
  439. X_flate_codes:
  440. X    link        a5,#-4
  441. X    movem.l        savregs,-(sp)
  442. X; 8(a5) = tl, 12(a5) = td, 16(a5) = bl, 18(a5) = bd, 20(a5) = slide,
  443. X; -2(a5) = ml, -4(a5) = md.  Here we cache some globals and args:
  444. X    move.l        20(a5),slide
  445. X    lea        _mask,mask
  446. X    move.l        _bb,b
  447. X    move.w        _bk,k
  448. X    moveq        #0,w        ; keep this usable as longword
  449. X    move.w        _wp,w
  450. X    moveq        #0,e        ; keep this usable as longword too
  451. X    move.w        16(a5),d0
  452. X    add.w        d0,d0
  453. X    move.w        (mask,d0.w),-2(a5)    ; ml = mask[bl]
  454. X    move.w        18(a5),d0
  455. X    add.w        d0,d0
  456. X    move.w        (mask,d0.w),-4(a5)    ; md = mask[bd]
  457. X
  458. Xmain_loop:
  459. X    NEEDBITS    16(a5)        ; bl
  460. X    and.w        -2(a5),d1    ; ml
  461. X    mulu        #SIZEOF_HUFT,d1
  462. X    move.l        8(a5),a0    ; tl
  463. X    lea        (a0,d1.l),t
  464. X    move.b        h_e(t),e
  465. X    cmp.w        #16,e
  466. X    bls.s        topdmp
  467. Xintop:     moveq        #1,d0
  468. X     cmp.w        #99,e
  469. X     beq        return        ; error in zipfile
  470. X     move.b        h_b(t),d0
  471. X     DUMPBITS    d0
  472. X     sub.w        #16,e
  473. X     NEEDBITS    e
  474. X     move.w        e,d0
  475. X     add.w        d0,d0
  476. X     and.w        (mask,d0.w),d1
  477. X     mulu        #SIZEOF_HUFT,d1
  478. X     move.l        h_t(t),a0
  479. X     lea        (a0,d1.l),t
  480. X     move.b        h_e(t),e
  481. X     cmp.w        #16,e
  482. X     bgt.s        intop
  483. Xtopdmp:    move.b        h_b(t),d0
  484. X    DUMPBITS    d0
  485. X
  486. X    cmp.w        #16,e        ; is this huffman code a literal?
  487. X    bne        lenchk        ; no
  488. X    move.w        h_n(t),d0    ; yes
  489. X    move.b        d0,(slide,w.l)    ; stick in the decoded byte
  490. X    addq.w        #1,w
  491. X    cmp.w        #WSIZE,w
  492. X    blo        main_loop
  493. X    FLUSH        w
  494. X    moveq        #0,w
  495. X    bra        main_loop    ; do some more
  496. X
  497. Xlenchk:    cmp.w        #15,e        ; is it an end-of-block code?
  498. X    beq        finish        ; if yes, we're done
  499. X    NEEDBITS    e        ; no: we have a duplicate string
  500. X    move.w        e,d0
  501. X    add.w        d0,d0
  502. X    and.w        (mask,d0.w),d1
  503. X    move.w        h_n(t),n
  504. X    add.w        d1,n        ; length of block to copy
  505. X    DUMPBITS    e
  506. X    NEEDBITS    18(a5)        ; bd
  507. X    and.w        -4(a5),d1    ; md
  508. X    mulu        #SIZEOF_HUFT,d1
  509. X    move.l        12(a5),a0    ; td
  510. X    lea        (a0,d1.l),t
  511. X    move.b        h_e(t),e
  512. X    cmp.w        #16,e
  513. X    bls.s        middmp
  514. Xinmid:     moveq        #1,d0
  515. X     cmp.w        #99,e
  516. X     beq        return        ; error in zipfile
  517. X     move.b        h_b(t),d0
  518. X     DUMPBITS    d0
  519. X     sub.w        #16,e
  520. X     NEEDBITS    e
  521. X     move.w        e,d0
  522. X     add.w        d0,d0
  523. X     and.w        (mask,d0.w),d1
  524. X     mulu        #SIZEOF_HUFT,d1
  525. X     move.l        h_t(t),a0
  526. X     lea        (a0,d1.l),t
  527. X     move.b        h_e(t),e
  528. X     cmp.w        #16,e
  529. X     bgt.s        inmid
  530. Xmiddmp:    move.b        h_b(t),d0
  531. X    DUMPBITS    d0
  532. X    NEEDBITS    e
  533. X    move.w        e,d0
  534. X    add.w        d0,d0
  535. X    and.w        (mask,d0.w),d1
  536. X    move.l        w,d
  537. X    sub.w        h_n(t),d
  538. X    sub.w        d1,d        ; distance back to block to copy
  539. X    DUMPBITS    e
  540. X
  541. Xindup:     move.w        #WSIZE,e    ; violate the e < 256 rule
  542. X     and.w        #WSIZE-1,d
  543. X     cmp.w        d,w
  544. X     blo.s        ddgw
  545. X      sub.w        w,e
  546. X     bra.s        dadw
  547. Xddgw:      sub.w        d,e
  548. Xdadw:     cmp.w        n,e
  549. X     bls.s        delen
  550. X      move.w    n,e
  551. Xdelen:     sub.w        e,n        ; size of sub-block to copy
  552. X     move.l        slide,a0
  553. X     move.l        a0,a1
  554. X     add.l        w,a0        ; w and d are valid longwords
  555. X     add.l        d,a1
  556. X     move.w        e,d0
  557. X     subq        #1,d0        ; assert >= 0 if sign extended
  558. Xdspin:      move.b    (a1)+,(a0)+    ; string is probably short, so
  559. X      dbra        d0,dspin    ; don't use any fancier copy method
  560. X     add.w        e,w
  561. X     add.w        e,d
  562. X     cmp.w        #WSIZE,w
  563. X     blo.s        dnfl
  564. X     FLUSH        w
  565. X     moveq        #0,w
  566. Xdnfl:     tst.w        n        ; need to do more sub-blocks?
  567. X     bne        indup        ; yes
  568. X    moveq        #0,e        ; restore zeroness in upper bytes
  569. X    bra        main_loop    ; do some more
  570. X
  571. Xfinish:    move.w        w,_wp        ; restore cached globals
  572. X    move.w        k,_bk
  573. X    move.l        b,_bb
  574. X    moveq        #0,d0            ; return "no error"
  575. Xreturn:    movem.l        (sp)+,savregs
  576. X    unlk        a5
  577. X    rts
  578. END_OF_FILE
  579.   if test 8802 -ne `wc -c <'unzip-5.12/amiga/flate.a'`; then
  580.     echo shar: \"'unzip-5.12/amiga/flate.a'\" unpacked with wrong size!
  581.   fi
  582.   # end of 'unzip-5.12/amiga/flate.a'
  583. fi
  584. if test -f 'unzip-5.12/atari/Makefile' -a "${1}" != "-c" ; then 
  585.   echo shar: Will not clobber existing file \"'unzip-5.12/atari/Makefile'\"
  586. else
  587.   echo shar: Extracting \"'unzip-5.12/atari/Makefile'\" \(4811 characters\)
  588.   sed "s/^X//" >'unzip-5.12/atari/Makefile' <<'END_OF_FILE'
  589. X#==============================================================================
  590. X# Makefile for UnZip, UnZipSFX & fUnZip:  Atari ST               Chris Herborth
  591. X# Version:  UnZip 5.11, MiNT, GNU C                                14 July 1994
  592. X#==============================================================================
  593. X
  594. X# Based on the original unix Makefile and modified by Chris Herborth
  595. X# (cherborth@semprini.waterloo-rdp.on.ca), Nov.13/93.
  596. X#
  597. X# $Id: Makefile 1.7 1993/12/28 18:52:52 root Exp $
  598. X
  599. X# Be sure to test your new UnZip (and UnZipSFX and fUnZip); successful com-
  600. X# pilation does not always imply a working program.
  601. X
  602. X
  603. X#####################
  604. X# MACRO DEFINITIONS #
  605. X#####################
  606. X
  607. X# Defaults most systems use (use LOCAL_UNZIP in environment to add flags, 
  608. X# such as -DDOSWILD).
  609. X
  610. X# UnZip flags
  611. X# NOTE: 'cgcc' is my cross-compiler; you'll probably use 'gcc' instead.
  612. XCC = cgcc
  613. XLD = cgcc
  614. XLOC = $(LOCAL_UNZIP) -ansi -D__MINT__ -U__STRICT_ANSI__
  615. X
  616. XCF = -mbaserel -mpcrel -O2 -fomit-frame-pointer -I. $(LOC)
  617. X# CF = -O -I. $(LOC)
  618. X# CF = -mbaserel -O -I. $(LOC)
  619. XLF = -mbaserel -mpcrel -o unzip.ttp
  620. XLF2 = -s -lbiio
  621. X
  622. X# UnZipSFX flags
  623. XXC = -DSFX
  624. XXL = -mbaserel -mpcrel -o unzipsfx.ttp
  625. XXL2 = $(LF2)
  626. X
  627. X# fUnZip flags
  628. XFC = -DFUNZIP
  629. XFL = -mbaserel -mpcrel -o funzip.ttp
  630. XFL2 = $(LF2)
  631. X
  632. X# general-purpose stuff
  633. XCP = cp
  634. XLN = ln -s
  635. XRM = rm -f
  636. XE = .ttp
  637. XO = .o
  638. XM = atari
  639. XSHELL = /bin/sh
  640. X
  641. X# object files
  642. XOBJS1 = unzip$O crypt$O envargs$O explode$O extract$O file_io$O
  643. XOBJS2 = inflate$O match$O unreduce$O unshrink$O zipinfo$O
  644. XOBJS = $(OBJS1) $(OBJS2) $M$O
  645. XLOBJS = $(OBJS)
  646. XOBJX = unzip_$O crypt$O extract_$O file_io$O inflate$O match$O $M_$O
  647. XOBJF = funzip$O crypt_$O inflate_$O
  648. X
  649. X# installation
  650. XINSTALL = cp#    probably can change this to 'install' if you have it
  651. X# on some systems, manext=l and MANDIR=/usr/man/man$(manext) may be appropriate
  652. Xmanext = 1
  653. XMANDIR = /usr/local/man/man$(manext)#    where to install man pages
  654. XBINDIR = /usr/local/bin#        where to install executables
  655. X#
  656. XUNZIPS = unzip$E unzipsfx$E funzip$E zipinfo$E
  657. XMANS = unzip.$(manext) unzipsfx.$(manext) zipinfo.$(manext) funzip.$(manext)
  658. XDOCS = unzip.doc unzipsfx.doc zipinfo.doc funzip.doc
  659. X# this is a little ugly...
  660. XINSTALLED = $(BINDIR)/unzip$E $(BINDIR)/zipinfo$E $(BINDIR)/funzip$E \
  661. X    $(BINDIR)/unzipsfx$E $(MANDIR)/unzipsfx.$(manext) \
  662. X    $(MANDIR)/unzip.$(manext) $(MANDIR)/zipinfo.$(manext) \
  663. X    $(MANDIR)/funzip.$(manext)
  664. X
  665. X###############################################
  666. X# BASIC COMPILE INSTRUCTIONS AND DEPENDENCIES #
  667. X###############################################
  668. X
  669. X.c$O:
  670. X    $(CC) -c $(CF) $*.c
  671. X
  672. X
  673. Xall:        unzips
  674. Xunzips:        $(UNZIPS)
  675. Xdocs:        $(DOCS)
  676. Xunzipsman:    unzips docs
  677. Xunzipsdocs:    unzips docs
  678. X
  679. X
  680. Xclean:
  681. X    rm -f $(OBJS) $(OBJF) $(OBJX) $(UNZIPS)
  682. X
  683. Xinstall:    $(UNZIPS) $(MANS)
  684. X    $(INSTALL) $(UNZIPS) $(BINDIR)
  685. X    $(LN) $(BINDIR)/unzip$E $(BINDIR)/zipinfo$E
  686. X    $(INSTALL) unix/unzip.1 $(MANDIR)/unzip.$(manext)
  687. X    $(INSTALL) unix/unzipsfx.1 $(MANDIR)/unzipsfx.$(manext)
  688. X    $(INSTALL) unix/zipinfo.1 $(MANDIR)/zipinfo.$(manext)
  689. X    $(INSTALL) unix/funzip.1 $(MANDIR)/funzip.$(manext)
  690. X
  691. X# alternatively, could use zip method:  -cd $(BINDIR); rm -f $(UNZIPS)  [etc.]
  692. Xuninstall:
  693. X    rm -f $(INSTALLED)
  694. X
  695. X
  696. Xunzip$E:    $(OBJS)            # add `&' if parallel makes supported
  697. X    $(LD) $(LF) $(LOBJS) $(LF2)
  698. X
  699. Xunzipsfx$E:    $(OBJX)            # add `&' if parallel makes supported
  700. X    $(LD) $(XL) $(OBJX) $(XL2)
  701. X
  702. Xfunzip$E:    $(OBJF)            # add `&' if parallel makes supported
  703. X    $(LD) $(FL) $(OBJF) $(FL2)
  704. X
  705. Xzipinfo$E:    unzip$E
  706. X    @echo\
  707. X '  This is a Unix-inspired target.  If your filesystem does not support'
  708. X    @echo\
  709. X '  symbolic links, copy unzip.ttp to zipinfo.ttp rather than linking it,'
  710. X    @echo\
  711. X '  or else invoke as "unzip -Z".'
  712. X    $(LN) unzip$E zipinfo$E
  713. X
  714. X
  715. Xcrypt$O:    crypt.c unzip.h zip.h crypt.h
  716. Xenvargs$O:    envargs.c unzip.h
  717. Xexplode$O:    explode.c unzip.h
  718. Xextract$O:    extract.c unzip.h crypt.h
  719. Xfile_io$O:    file_io.c unzip.h crypt.h tables.h
  720. Xfunzip$O:    funzip.c unzip.h crypt.h tables.h
  721. Xinflate$O:    inflate.c inflate.h unzip.h
  722. Xmatch$O:    match.c unzip.h
  723. Xunreduce$O:    unreduce.c unzip.h
  724. Xunshrink$O:    unshrink.c unzip.h
  725. Xunzip$O:    unzip.c unzip.h version.h
  726. Xzipinfo$O:    zipinfo.c unzip.h
  727. X
  728. Xcrypt_$O:    crypt.c unzip.h zip.h crypt.h        # funzip only
  729. X    $(CP) crypt.c crypt_.c
  730. X    $(CC) -c $(CF) $(FC) crypt_.c
  731. X    $(RM) crypt_.c
  732. X
  733. Xinflate_$O:    inflate.c inflate.h unzip.h crypt.h    # funzip only
  734. X    $(CP) inflate.c inflate_.c
  735. X    $(CC) -c $(CF) $(FC) inflate_.c
  736. X    $(RM) inflate_.c
  737. X
  738. Xunzip_$O:    unzip.c unzip.h version.h        # unzipsfx only
  739. X    $(CP) unzip.c unzip_.c
  740. X    $(CC) -c $(CF) $(XC) unzip_.c
  741. X    $(RM) unzip_.c
  742. X
  743. Xextract_$O:    extract.c unzip.h crypt.h        # unzipsfx only
  744. X    $(CP) extract.c extract_.c
  745. X    $(CC) -c $(CF) $(XC) extract_.c
  746. X    $(RM) extract_.c
  747. X
  748. X# atari$O:    atari/atari.c unzip.h            # Atari only
  749. X#    $(CC) -c $(CF) atari/atari.c
  750. X
  751. Xatari$O:    atari.c unzip.h
  752. X
  753. Xatari_$O:    atari.c unzip.h                # unzipsfx only
  754. X    $(CP) atari.c atari_.c
  755. X    $(CC) -c $(CF) $(XC) atari_.c
  756. X    $(RM) atari_.c
  757. END_OF_FILE
  758.   if test 4811 -ne `wc -c <'unzip-5.12/atari/Makefile'`; then
  759.     echo shar: \"'unzip-5.12/atari/Makefile'\" unpacked with wrong size!
  760.   fi
  761.   # end of 'unzip-5.12/atari/Makefile'
  762. fi
  763. if test -f 'unzip-5.12/mac/macunzip.c' -a "${1}" != "-c" ; then 
  764.   echo shar: Will not clobber existing file \"'unzip-5.12/mac/macunzip.c'\"
  765. else
  766.   echo shar: Extracting \"'unzip-5.12/mac/macunzip.c'\" \(12079 characters\)
  767.   sed "s/^X//" >'unzip-5.12/mac/macunzip.c' <<'END_OF_FILE'
  768. X#include "unzip.h"
  769. X
  770. X#include <Traps.h>
  771. X#include <Values.h>
  772. X
  773. Xextern char UnzipVersion[], ZipinfoVersion[];
  774. X
  775. Xvoid MacFSTest (int);
  776. Xvoid ResolveMacVol (short, short *, long *, StringPtr);
  777. X
  778. X#define aboutAlert      128
  779. X
  780. X#define selectDialog    129
  781. X#define okItem          1
  782. X#define cancelItem      2
  783. X#define editItem        3
  784. X#define staticItem      4
  785. X
  786. X#define unzipMenuBar    128
  787. X
  788. X#define appleMenu       128
  789. X#define aboutItem       1
  790. X
  791. X#define fileMenu        129
  792. X#define extractItem     1
  793. X#define infoItem        2
  794. X#define listItem        3
  795. X#define testItem        4
  796. X#define commentItem     6
  797. X#define freshenItem     8
  798. X#define updateItem      9
  799. X#define quitItem        11
  800. X
  801. X#define editMenu        130
  802. X#define cutItem         1
  803. X#define copyItem        2
  804. X#define pasteItem       3
  805. X
  806. X#define modifierMenu    131
  807. X#define selectItem      1
  808. X#define screenItem      3
  809. X#define pauseItem       4
  810. X#define scrollItem      5
  811. X#define convertItem     7
  812. X#define junkItem        8
  813. X#define lowercaseItem   9
  814. X#define neverItem       10
  815. X#define promptItem      11
  816. X#define quietItem       12
  817. X#define verboseItem     13
  818. X
  819. Xshort modifiers, modifierMask;
  820. X
  821. X#define convertFlag     0x0001
  822. X#define junkFlag        0x0002
  823. X#define lowercaseFlag   0x0004
  824. X#define neverFlag       0x0008
  825. X#define promptFlag      0x0010
  826. X#define quietFlag       0x0020
  827. X#define screenFlag      0x0040
  828. X#define scrollFlag      0x0200
  829. X#define verboseFlag     0x0080
  830. X#define allFlags        0x03FF
  831. X
  832. X#define pauseFlag       0x0100
  833. X#define scrollFlag      0x0200
  834. X
  835. X#define extractMask     0x003F
  836. X#define infoMask        0x0000
  837. X#define listMask        0x0020
  838. X#define testMask        0x0020
  839. X#define commentMask     0x0000
  840. X#define freshenMask     0x003F
  841. X#define updateMask      0x003F
  842. X
  843. XEventRecord myevent;
  844. XMenuHandle appleHandle, modifierHandle;
  845. XHandle menubar, itemHandle;
  846. Xshort itemType;
  847. XRect itemRect;
  848. X
  849. Xchar command, fileList[256];
  850. X
  851. XBoolean stop;
  852. X
  853. XSysEnvRec sysRec;
  854. X
  855. Xchar *macgetenv(s) char *s; {
  856. X    if (s == NULL) return(fileList);
  857. X    return(NULL);
  858. X}
  859. X
  860. XBoolean TrapAvailable(machineType, trapNumber, trapType)
  861. Xshort machineType;
  862. Xshort trapNumber;
  863. XTrapType trapType;
  864. X{
  865. X    if (machineType < 0)
  866. X        return (false);
  867. X
  868. X    if ((trapType == ToolTrap) &&
  869. X        (machineType > envMachUnknown) &&
  870. X        (machineType < envMacII)) {
  871. X        if ((trapNumber &= 0x03FF) > 0x01FF)
  872. X            trapNumber = _Unimplemented;
  873. X    }
  874. X    return (NGetTrapAddress(trapNumber, trapType) !=
  875. X        GetTrapAddress(_Unimplemented));
  876. X}
  877. X
  878. Xvoid domenu(menucommand) long menucommand;
  879. X{
  880. X    short check, themenu, theitem;
  881. X    DialogPtr thedialog;
  882. X    Str255 name;
  883. X
  884. X    themenu = HiWord(menucommand);
  885. X    theitem = LoWord(menucommand);
  886. X
  887. X    switch (themenu) {
  888. X
  889. X    case appleMenu:
  890. X        if (theitem == aboutItem) {
  891. X            ParamText(UnzipVersion, ZipinfoVersion, nil, nil);
  892. X            Alert(aboutAlert, nil);
  893. X        } else {
  894. X            GetItem(appleHandle, theitem, name);
  895. X            theitem = OpenDeskAcc(name);
  896. X        }
  897. X        break;
  898. X
  899. X    case fileMenu:
  900. X        switch (theitem) {
  901. X        case extractItem:
  902. X            if (modifiers & screenFlag)
  903. X                command = 'c';
  904. X            else
  905. X                command = 'x';
  906. X            modifierMask = extractMask;
  907. X            break;
  908. X        case infoItem:
  909. X            command = 'Z';
  910. X            modifierMask = infoMask;
  911. X            break;
  912. X        case listItem:
  913. X            if (modifiers & verboseFlag)
  914. X                command = 'v';
  915. X            else
  916. X                command = 'l';
  917. X            modifierMask = listMask;
  918. X            break;
  919. X        case testItem:
  920. X            command = 't';
  921. X            modifierMask = testMask;
  922. X            break;
  923. X        case commentItem:
  924. X            command = 'z';
  925. X            modifierMask = commentMask;
  926. X            break;
  927. X        case freshenItem:
  928. X            command = 'f';
  929. X            modifierMask = freshenMask;
  930. X            break;
  931. X        case updateItem:
  932. X            command = 'u';
  933. X            modifierMask = updateMask;
  934. X            break;
  935. X        case quitItem:
  936. X            stop = true;
  937. X            break;
  938. X        default:
  939. X            break;
  940. X        }
  941. X        break;
  942. X
  943. X    case editMenu:
  944. X        break;
  945. X
  946. X    case modifierMenu:
  947. X        switch (theitem) {
  948. X        case selectItem:
  949. X            thedialog = GetNewDialog(selectDialog, nil, (WindowPtr)(-1));
  950. X            SetPort(thedialog);
  951. X            do
  952. X                ModalDialog(nil, &check);
  953. X            while ((check != okItem) && (check != cancelItem));
  954. X            if (check == okItem) {
  955. X                GetDItem(thedialog, editItem, &itemType, &itemHandle, &itemRect);
  956. X                GetIText(itemHandle, &fileList);
  957. X                p2cstr(fileList);
  958. X            }
  959. X            DisposDialog(thedialog);
  960. X            check = -1;
  961. X            break;
  962. X        case screenItem:
  963. X            check = (modifiers ^= screenFlag) & screenFlag;
  964. X            break;
  965. X        case pauseItem:
  966. X            check = (modifiers ^= pauseFlag) & pauseFlag;
  967. X            screenControl("p", check);
  968. X            break;
  969. X        case scrollItem:
  970. X            check = (modifiers ^= scrollFlag) & scrollFlag;
  971. X            screenControl("s", check);
  972. X            break;
  973. X        case convertItem:
  974. X            check = (modifiers ^= convertFlag) & convertFlag;
  975. X            break;
  976. X        case junkItem:
  977. X            check = (modifiers ^= junkFlag) & junkFlag;
  978. X            break;
  979. X        case lowercaseItem:
  980. X            check = (modifiers ^= lowercaseFlag) & lowercaseFlag;
  981. X            break;
  982. X        case neverItem:
  983. X            if (check = (modifiers ^= neverFlag) & neverFlag) {
  984. X                if (modifiers & promptFlag) {
  985. X                    CheckItem(modifierHandle, promptItem, false);
  986. X                    modifiers &= (allFlags ^ promptFlag);
  987. X                }
  988. X            } else {
  989. X                CheckItem(modifierHandle, promptItem, true);
  990. X                modifiers |= promptFlag;
  991. X            }
  992. X            break;
  993. X        case promptItem:
  994. X            if (check = (modifiers ^= promptFlag) & promptFlag)
  995. X                if (modifiers & neverFlag) {
  996. X                    CheckItem(modifierHandle, neverItem, false);
  997. X                    modifiers &= (allFlags ^ neverFlag);
  998. X                }
  999. X            break;
  1000. X        case quietItem:
  1001. X            check = (modifiers ^= quietFlag) & quietFlag;
  1002. X            break;
  1003. X        case verboseItem:
  1004. X            check = (modifiers ^= verboseFlag) & verboseFlag;
  1005. X            break;
  1006. X        default:
  1007. X            break;
  1008. X        }
  1009. X        if (check == 0)
  1010. X            CheckItem(modifierHandle, theitem, false);
  1011. X        else if (check > 0)
  1012. X            CheckItem(modifierHandle, theitem, true);
  1013. X        break;
  1014. X
  1015. X    default:
  1016. X        break;
  1017. X
  1018. X    }
  1019. X
  1020. X    HiliteMenu(0);
  1021. X    return;
  1022. X}
  1023. X
  1024. Xvoid dokey(myevent) EventRecord *myevent;
  1025. X{
  1026. X    char code;
  1027. X
  1028. X    code = (char)(myevent->message & charCodeMask);
  1029. X
  1030. X    if (myevent->modifiers & cmdKey) {
  1031. X        if (myevent->what != autoKey) {
  1032. X            domenu(MenuKey(code));
  1033. X        }
  1034. X    }
  1035. X
  1036. X    return;
  1037. X}
  1038. X
  1039. Xvoid domousedown(myevent) EventRecord *myevent;
  1040. X{
  1041. X    WindowPtr whichwindow;
  1042. X    long code;
  1043. X
  1044. X    code = FindWindow(myevent->where, &whichwindow);
  1045. X
  1046. X    switch (code) {
  1047. X
  1048. X    case inSysWindow:
  1049. X        SystemClick(myevent, whichwindow);
  1050. X        break;
  1051. X
  1052. X    case inMenuBar:
  1053. X        domenu(MenuSelect(myevent->where));
  1054. X        break;
  1055. X
  1056. X    }
  1057. X
  1058. X    return;
  1059. X}
  1060. X
  1061. Xint main(argc, argv) int argc; char *argv[];
  1062. X{
  1063. X    Boolean haveEvent, useWNE;
  1064. X    short markChar;
  1065. X    FILE *fp;
  1066. X
  1067. X    FlushEvents(everyEvent, 0);
  1068. X    InitGraf(&qd.thePort);
  1069. X    InitFonts();
  1070. X    InitWindows();
  1071. X    InitMenus();
  1072. X    TEInit();
  1073. X    InitDialogs(nil);
  1074. X    InitCursor();
  1075. X
  1076. X    c2pstr(UnzipVersion);
  1077. X    c2pstr(ZipinfoVersion);
  1078. X
  1079. X    SysEnvirons(1, &sysRec);
  1080. X    useWNE = TrapAvailable(sysRec.machineType, _WaitNextEvent, ToolTrap);
  1081. X
  1082. X    SetMenuBar(menubar = GetNewMBar(unzipMenuBar));
  1083. X    DisposeHandle(menubar);
  1084. X    AddResMenu(appleHandle = GetMHandle(appleMenu), 'DRVR');
  1085. X    modifierHandle = GetMHandle(modifierMenu);
  1086. X    DrawMenuBar();
  1087. X
  1088. X    screenOpen("Unzip");
  1089. X
  1090. X    modifiers = 0;
  1091. X
  1092. X    GetItemMark(modifierHandle, pauseItem, &markChar);
  1093. X    if (markChar) modifiers ^= pauseFlag;
  1094. X    screenControl("p", markChar);
  1095. X    GetItemMark(modifierHandle, scrollItem, &markChar);
  1096. X    if (markChar) modifiers ^= scrollFlag;
  1097. X    screenControl("s", markChar);
  1098. X
  1099. X    GetItemMark(modifierHandle, screenItem, &markChar);
  1100. X    if (markChar) modifiers ^= screenFlag;
  1101. X    GetItemMark(modifierHandle, convertItem, &markChar);
  1102. X    if (markChar) modifiers ^= convertFlag;
  1103. X    GetItemMark(modifierHandle, junkItem, &markChar);
  1104. X    if (markChar) modifiers ^= junkFlag;
  1105. X    GetItemMark(modifierHandle, lowercaseItem, &markChar);
  1106. X    if (markChar) modifiers ^= lowercaseFlag;
  1107. X    GetItemMark(modifierHandle, neverItem, &markChar);
  1108. X    if (markChar) modifiers ^= neverFlag;
  1109. X    GetItemMark(modifierHandle, promptItem, &markChar);
  1110. X    if (markChar) modifiers ^= promptFlag;
  1111. X    GetItemMark(modifierHandle, quietItem, &markChar);
  1112. X    if (markChar) modifiers ^= quietFlag;
  1113. X    GetItemMark(modifierHandle, verboseItem, &markChar);
  1114. X    if (markChar) modifiers ^= verboseFlag;
  1115. X
  1116. X    if ((modifiers & (neverFlag | promptFlag)) == (neverFlag | promptFlag)) {
  1117. X        CheckItem(modifierHandle, promptItem, false);
  1118. X        modifiers &= (allFlags ^ promptFlag);
  1119. X    }
  1120. X
  1121. X    command = ' ';
  1122. X
  1123. X    stop = false;
  1124. X    while (!stop) {
  1125. X        SetCursor(&qd.arrow);
  1126. X
  1127. X        if (useWNE) {
  1128. X            haveEvent = WaitNextEvent(everyEvent, &myevent, MAXLONG, NULL);
  1129. X        } else {
  1130. X            SystemTask();
  1131. X            haveEvent = GetNextEvent(everyEvent, &myevent);
  1132. X        }
  1133. X
  1134. X        if (haveEvent) {
  1135. X            switch (myevent.what) {
  1136. X
  1137. X            case activateEvt:
  1138. X                break;
  1139. X
  1140. X            case keyDown:
  1141. X            case autoKey:
  1142. X                dokey(&myevent);
  1143. X                break;
  1144. X
  1145. X            case mouseDown:
  1146. X                domousedown(&myevent);
  1147. X                break;
  1148. X
  1149. X            case updateEvt:
  1150. X                screenUpdate(myevent.message);
  1151. X                break;
  1152. X
  1153. X            case mouseUp:
  1154. X            case keyUp:
  1155. X                break;
  1156. X
  1157. X            default:
  1158. X                break;
  1159. X
  1160. X            }
  1161. X        }
  1162. X
  1163. X        if (command != ' ') {
  1164. X            char *s, **v, modifierString[16];
  1165. X            SFReply fileRep;
  1166. X            Point p;
  1167. X            int m, n;
  1168. X
  1169. X            SetPt(&p, 40, 40);
  1170. X
  1171. X            SFGetFile(p, "\pSpecify ZIP file:", 0L, -1, nil, 0L, &fileRep);
  1172. X            if (fileRep.good) {
  1173. X                MacFSTest(fileRep.vRefNum);
  1174. X                ResolveMacVol(fileRep.vRefNum, &gnVRefNum, &glDirID, NULL);
  1175. X
  1176. X                p2cstr(fileRep.fName);
  1177. X
  1178. X                modifierMask &= modifiers;
  1179. X
  1180. X                s = modifierString;
  1181. X
  1182. X                if ((command != 'Z') || modifierMask) {
  1183. X                    *s++ = '-';
  1184. X                    *s++ = command;
  1185. X
  1186. X                    if (modifierMask & convertFlag) *s++ = 'a';
  1187. X                    if (!HFSFlag || (modifierMask & junkFlag)) *s++ = 'j';
  1188. X                    if (!modifierMask & lowercaseFlag) *s++ = 'U';
  1189. X                    if (modifierMask & neverFlag) *s++ = 'n';
  1190. X                    if (!modifierMask & promptFlag) *s++ = 'o';
  1191. X                    if (modifierMask & quietFlag) *s++ = 'q';
  1192. X                    if (modifierMask & verboseFlag) *s++ = 'v';
  1193. X                }
  1194. X
  1195. X                *s = '\0';
  1196. X
  1197. X                v = (char **)malloc(sizeof(char *));
  1198. X                *v = "unzip";
  1199. X                argc = 1;
  1200. X
  1201. X                envargs(&argc, &v, NULL, NULL);
  1202. X
  1203. X                argv = (char **)malloc((argc + 3) * sizeof(char *));
  1204. X
  1205. X                argv[m = 0] = (command == 'Z') ? "zipinfo" : "unzip";
  1206. X                if (*modifierString) argv[++m] = modifierString;
  1207. X                argv[++m] = (char *)fileRep.fName;
  1208. X                for (n = 1; n < argc; n++) argv[n + m] = v[n];
  1209. X                argv[argc += m] = NULL;
  1210. X
  1211. X                free(v);
  1212. X
  1213. X                for (n = 0; argv[n] != NULL; n++) printf("%s ", argv[n]);
  1214. X                printf("...\n\n");
  1215. X
  1216. X                unzip(argc, argv);
  1217. X
  1218. X                printf("\nDone\n");
  1219. X            }
  1220. X
  1221. X            fileList[0] = '\0';
  1222. X            command = ' ';
  1223. X        }
  1224. X    }
  1225. X
  1226. X    screenClose();
  1227. X
  1228. X    ExitToShell();
  1229. X}
  1230. END_OF_FILE
  1231.   if test 12079 -ne `wc -c <'unzip-5.12/mac/macunzip.c'`; then
  1232.     echo shar: \"'unzip-5.12/mac/macunzip.c'\" unpacked with wrong size!
  1233.   fi
  1234.   # end of 'unzip-5.12/mac/macunzip.c'
  1235. fi
  1236. if test -f 'unzip-5.12/unzipsfx.doc' -a "${1}" != "-c" ; then 
  1237.   echo shar: Will not clobber existing file \"'unzip-5.12/unzipsfx.doc'\"
  1238. else
  1239.   echo shar: Extracting \"'unzip-5.12/unzipsfx.doc'\" \(12334 characters\)
  1240.   sed "s/^X//" >'unzip-5.12/unzipsfx.doc' <<'END_OF_FILE'
  1241. X
  1242. XUNZIPSFX(1L)      MISC. REFERENCE MANUAL PAGES       UNZIPSFX(1L)
  1243. X
  1244. XNAME
  1245. X     unzipsfx  -  self-extracting  stub  for  prepending  to  ZIP
  1246. X     archives
  1247. X
  1248. XSYNOPSIS
  1249. X     <name  of  unzipsfx+archive   combo>   [-cfptuz[ajnoqsCLV$]]
  1250. X     [file(s) ... [-x xfile(s) ...]]
  1251. X
  1252. XDESCRIPTION
  1253. X     unzipsfx is a modified version of unzip(1L) designed  to  be
  1254. X     prepended  to  existing  ZIP archives in order to form self-
  1255. X     extracting archives.  Instead of taking its  first  non-flag
  1256. X     argument  to  be  the  zipfile(s)  to be extracted, unzipsfx
  1257. X     seeks itself under the name by  which  it  was  invoked  and
  1258. X     tests  or  extracts  the  contents  of the appended archive.
  1259. X     Because the executable stub adds bulk to  the  archive  (the
  1260. X     whole  purpose  of  which  is to be as small as possible), a
  1261. X     number of the regular version's less-vital capabilities have
  1262. X     been  removed.   Among these are the usage (or help) screen,
  1263. X     the listing and diagnostic functions (-l and -v), the  abil-
  1264. X     ity to decompress older compression formats (the ``reduce,''
  1265. X     ``shrink'' and ``implode''  methods),  and  the  ability  to
  1266. X     extract  to a directory other than the current one.  Decryp-
  1267. X     tion is supported as a compile-time  option  but  should  be
  1268. X     avoided  unless  the  attached  archive  contains  encrypted
  1269. X     files.
  1270. X
  1271. X     Note that self-extracting archives made with unzipsfx are no
  1272. X     more  (or  less) portable across different operating systems
  1273. X     than is the unzip executable itself.   In  general  a  self-
  1274. X     extracting  archive  made  on  a particular Unix system, for
  1275. X     example, will only self-extract under  the  same  flavor  of
  1276. X     Unix.  Regular unzip may still be used to extract the embed-
  1277. X     ded archive as with any normal  zipfile,  although  it  will
  1278. X     generate  a harmless warning about extra bytes at the begin-
  1279. X     ning of the zipfile.
  1280. X
  1281. XARGUMENTS
  1282. X     [file(s)]
  1283. X          An optional list of archive members  to  be  processed.
  1284. X          Regular  expressions  (wildcards)  similar  to those in
  1285. X          Unix egrep(1) may be used to  match  multiple  members.
  1286. X          These wildcards may contain:
  1287. X
  1288. X          *    matches a sequence of 0 or more characters
  1289. X
  1290. X          ?    matches exactly 1 character
  1291. X
  1292. X          [...]
  1293. X               matches any  single  character  found  inside  the
  1294. X               brackets;  ranges  are  specified  by  a beginning
  1295. X               character, a hyphen, and an ending character.   If
  1296. X
  1297. XInfo-ZIP         Last change: 28 Aug 94 (v5.12)                 1
  1298. X
  1299. XUNZIPSFX(1L)      MISC. REFERENCE MANUAL PAGES       UNZIPSFX(1L)
  1300. X
  1301. X               an  exclamation point or a caret (`!' or `^') fol-
  1302. X               lows the left bracket, then the range  of  charac-
  1303. X               ters within the brackets is complemented (that is,
  1304. X               anything except the characters inside the brackets
  1305. X               is considered a match).
  1306. X
  1307. X          (Be sure to quote any character which  might  otherwise
  1308. X          be  interpreted  or  modified  by the operating system,
  1309. X          particularly under Unix and VMS.)
  1310. X
  1311. X     [-x xfile(s)]
  1312. X          An optional list of archive members to be excluded from
  1313. X          processing.   Since wildcard characters match directory
  1314. X          separators (`/'), this option may be  used  to  exclude
  1315. X          any  files  which  are in subdirectories.  For example,
  1316. X          ``foosfx *.[ch] -x */*'' would  extract  all  C  source
  1317. X          files  in the main directory, but none in any subdirec-
  1318. X          tories.  Without the -x option, all C source  files  in
  1319. X          all  directories within the zipfile would be extracted.
  1320. X          Unlike in unzip(1L), the -x option may only be used  if
  1321. X          one  or more files are given.  This is because there is
  1322. X          no zipfile separating the normal options  from  the  -x
  1323. X          option,  so  unzipsfx sees it as another normal option.
  1324. X          For historical reasons, the ``normal'' -x  is  silently
  1325. X          ignored.  See the EXAMPLES section below.
  1326. X
  1327. X     If unzipsfx is compiled with SFX_EXDIR defined, the  follow-
  1328. X     ing option is also enabled:
  1329. X
  1330. X     [-d exdir]
  1331. X          An optional directory to which to  extract  files.   By
  1332. X          default,  all files and subdirectories are recreated in
  1333. X          the current directory; the -d option allows  extraction
  1334. X          in an arbitrary directory (always assuming one has per-
  1335. X          mission to write to the  directory).   The  option  and
  1336. X          directory  may  be concatenated without any white space
  1337. X          between them, but note that this may cause normal shell
  1338. X          behavior  to  be  suppressed.   In particular, ``-d ~''
  1339. X          (tilde) is expanded by Unix C shells into the  name  of
  1340. X          the  user's home directory, but ``-d~'' is treated as a
  1341. X          literal subdirectory ``~'' of  the  current  directory.
  1342. X          As  with  -x,  the -d option may only be used if one or
  1343. X          more files are given.
  1344. X
  1345. XOPTIONS
  1346. X     unzipsfx supports the following unzip(1L) options:   -c  and
  1347. X     -p  (extract  to standard output/screen), -f and -u (freshen
  1348. X     and  update  existing  files  upon  extraction),  -t   (test
  1349. X     archive) and -z (print archive comment).  All normal listing
  1350. X     options (-l, -v and -Z) have been removed, but  the  testing
  1351. X     option (-t) may be used as a ``poor man's'' listing.  Alter-
  1352. X     natively, those creating self-extracting archives  may  wish
  1353. X
  1354. XInfo-ZIP         Last change: 28 Aug 94 (v5.12)                 2
  1355. X
  1356. XUNZIPSFX(1L)      MISC. REFERENCE MANUAL PAGES       UNZIPSFX(1L)
  1357. X
  1358. X     to include a short listing in the zipfile comment.
  1359. X
  1360. X     See unzip(1L) for  a  more  complete  description  of  these
  1361. X     options.
  1362. X
  1363. XMODIFIERS
  1364. X     unzipsfx currently supports  all  unzip(1L)  modifiers:   -a
  1365. X     (convert  text  files),  -n (never overwrite), -o (overwrite
  1366. X     without prompting), -q (operate quietly),  -C  (match  names
  1367. X     case-insenstively), -L (convert uppercase-OS names to lower-
  1368. X     case), -j (junk paths) and -V (retain version numbers); plus
  1369. X     the   following   operating-system   specific  options:   -X
  1370. X     (restore VMS owner/protection info), -s (convert  spaces  in
  1371. X     filenames  to  underscores  [DOS, OS/2, NT]) and -$ (restore
  1372. X     volume label [DOS, OS/2, NT, Amiga]).
  1373. X
  1374. X     (Support for regular ASCII text-conversion may be removed in
  1375. X     future versions, since it is simple enough for the archive's
  1376. X     creator to ensure that text files have the appropriate  for-
  1377. X     mat for the local OS.  EBCDIC conversion will of course con-
  1378. X     tinue to be supported since the zipfile format implies ASCII
  1379. X     storage of text files.)
  1380. X
  1381. X     See unzip(1L) for  a  more  complete  description  of  these
  1382. X     modifiers.
  1383. X
  1384. XENVIRONMENT OPTIONS
  1385. X     unzipsfx uses the same environment  variables  as  unzip(1L)
  1386. X     does,  although  this  is likely to be an issue only for the
  1387. X     person creating and  testing  the  self-extracting  archive.
  1388. X     See unzip(1L) for details.
  1389. X
  1390. XDECRYPTION
  1391. X     Decryption is supported exactly as in  unzip(1L);  that  is,
  1392. X     interactively with a non-echoing prompt for the password(s).
  1393. X     See unzip(1L) for details.  Once again,  note  that  if  the
  1394. X     archive  has  no encrypted files there is no reason to use a
  1395. X     version of unzipsfx with decryption support; that only  adds
  1396. X     to the size of the archive.
  1397. X
  1398. XEXAMPLES
  1399. X     To create a self-extracting archive letters from  a  regular
  1400. X     zipfile letters.zip and change the new archive's permissions
  1401. X     to be world-executable under Unix:
  1402. X
  1403. X         cat unzipsfx letters.zip > letters
  1404. X         chmod 755 letters
  1405. X
  1406. X     To create the same archive under MS-DOS, OS/2  or  NT  (note
  1407. X     the use of the /b [binary] option to the copy command):
  1408. X
  1409. XInfo-ZIP         Last change: 28 Aug 94 (v5.12)                 3
  1410. X
  1411. XUNZIPSFX(1L)      MISC. REFERENCE MANUAL PAGES       UNZIPSFX(1L)
  1412. X
  1413. X         copy /b unzipsfx.exe+letters.zip letters.exe
  1414. X
  1415. X     Under VMS:
  1416. X
  1417. X         copy unzipsfx.exe,letters.zip letters.exe
  1418. X         letters == "$currentdisk:[currentdir]letters.exe"
  1419. X
  1420. X     (The VMS append command may also be used.  The  second  com-
  1421. X     mand installs the new program as a ``foreign command'' capa-
  1422. X     ble of taking  arguments.)  To  test  (or  list)  the  newly
  1423. X     created self-extracting archive:
  1424. X
  1425. X         letters -t
  1426. X
  1427. X     To test letters quietly, printing  only  a  summary  message
  1428. X     indicating whether the archive is OK or not:
  1429. X
  1430. X         letters -tq
  1431. X
  1432. X     To extract the complete contents into the current directory,
  1433. X     recreating all files and subdirectories as necessary:
  1434. X
  1435. X         letters
  1436. X
  1437. X     To extract all *.txt files (in Unix quote the `*'):
  1438. X
  1439. X         letters *.txt
  1440. X
  1441. X     To extract everything except the *.txt files:
  1442. X
  1443. X         letters * -x *.txt
  1444. X
  1445. X     (Note that with regular unzip(1L) it would not be  necessary
  1446. X     to  use the first `*'; ``unzip letters -x *.txt'' would work
  1447. X     equally well.  With unzipsfx the -x option would be silently
  1448. X     ignored  and the effect would be the same as in the previous
  1449. X     example, i.e.,  the  opposite  of  what  was  intended.)  To
  1450. X     extract  only  the  README  file  to  standard  output  (the
  1451. X     screen):
  1452. X
  1453. X         letters -c README
  1454. X
  1455. X     To print only the zipfile comment:
  1456. X
  1457. X         letters -z
  1458. X
  1459. XLIMITATIONS
  1460. X     The principle and fundamental limitation of unzipsfx is that
  1461. X     it  is  not  portable across architectures or operating sys-
  1462. X     tems, and therefore neither are the resulting archives.  For
  1463. X     some  architectures  there  is  limited portability, however
  1464. X     (e.g., between some flavors of Intel-based Unix).
  1465. X
  1466. XInfo-ZIP         Last change: 28 Aug 94 (v5.12)                 4
  1467. X
  1468. XUNZIPSFX(1L)      MISC. REFERENCE MANUAL PAGES       UNZIPSFX(1L)
  1469. X
  1470. X     unzipsfx has no knowledge of the user's PATH, so in  general
  1471. X     an  archive  must either be in the current directory when it
  1472. X     is invoked, or else a full or relative path must  be  given.
  1473. X     If  a  user attempts to extract the archive from a directory
  1474. X     in the PATH other than the current one, unzipsfx will  print
  1475. X     a  warning  to  the  effect, ``can't find myself.''  This is
  1476. X     always true under Unix and may be true in some  cases  under
  1477. X     MS-DOS,  depending  on  the compiler used (Microsoft C fully
  1478. X     qualifies the program name, but other  compilers  may  not).
  1479. X     Under OS/2 and NT there are operating-system calls available
  1480. X     which provide the full path name,  so  the  archive  may  be
  1481. X     invoked  from anywhere in the user's path.  The situation is
  1482. X     not known for Atari TOS, MacOS, etc.
  1483. X
  1484. X     As noted above, a number of the normal  unzip(1L)  functions
  1485. X     have  been removed in order to make unzipsfx smaller:  usage
  1486. X     and diagnostic info, listing  functions  and  extraction  to
  1487. X     other directories.  Also, only stored and deflated files are
  1488. X     supported.  The latter  limitation  is  mainly  relevant  to
  1489. X     those who create SFX archives, however.
  1490. X
  1491. X     VMS users must know how to set up  self-extracting  archives
  1492. X     as  foreign  commands  in  order  to  use  any of unzipsfx's
  1493. X     options.  This is not necessary for simple  extraction,  but
  1494. X     the command to do so then becomes, e.g., ``run letters'' (to
  1495. X     continue the examples given above).
  1496. X
  1497. X     unzipsfx is not supported on the Amiga because  of  the  way
  1498. X     the  loader  works;  the  entire  archive  contents would be
  1499. X     loaded into memory by default.  It may be possible  to  work
  1500. X     around this by defining the attached archive to be a ``debug
  1501. X     hunk,'' but compatibility problems between the ROM levels of
  1502. X     older  Amigas  and  newer  ones are likely to cause problems
  1503. X     regardless.
  1504. X
  1505. X     All current bugs in unzip(1L) exist in unzipsfx as well.
  1506. X
  1507. XDIAGNOSTICS
  1508. X     unzipsfx's exit status (error level) is identical to that of
  1509. X     unzip(1L); see the corresponding man page.
  1510. X
  1511. XSEE ALSO
  1512. X     funzip(1L), unzip(1L), zip(1L),  zipcloak(1L),  zipgrep(1L),
  1513. X     zipinfo(1L), zipnote(1L), zipsplit(1L)
  1514. X
  1515. XAUTHORS
  1516. X     Greg Roelofs was responsible for the basic modifications  to
  1517. X     UnZip  necessary  to create UnZipSFX.  See unzip(1L) for the
  1518. X     current list of zip-bugs authors, or the  file  CONTRIBS  in
  1519. X     the  UnZip source distribution for the full list of Info-ZIP
  1520. X     contributors.
  1521. X
  1522. XInfo-ZIP         Last change: 28 Aug 94 (v5.12)                 5
  1523. X
  1524. END_OF_FILE
  1525.   if test 12334 -ne `wc -c <'unzip-5.12/unzipsfx.doc'`; then
  1526.     echo shar: \"'unzip-5.12/unzipsfx.doc'\" unpacked with wrong size!
  1527.   fi
  1528.   # end of 'unzip-5.12/unzipsfx.doc'
  1529. fi
  1530. if test -f 'unzip-5.12/vms/unzipsfx.hlp' -a "${1}" != "-c" ; then 
  1531.   echo shar: Will not clobber existing file \"'unzip-5.12/vms/unzipsfx.hlp'\"
  1532. else
  1533.   echo shar: Extracting \"'unzip-5.12/vms/unzipsfx.hlp'\" \(9759 characters\)
  1534.   sed "s/^X//" >'unzip-5.12/vms/unzipsfx.hlp' <<'END_OF_FILE'
  1535. X1 UNZIPSFX
  1536. X
  1537. X     unzipsfx  -  self-extracting  stub  for  prepending  to  ZIP
  1538. X     archives
  1539. X
  1540. X     <name  of  unzipsfx+archive   combo>   [-cfptuz[ajnoqsCLV$]]
  1541. X     [file(s) ...] [-x xfile(s) ...]
  1542. X
  1543. X     unzipsfx is a modified version of unzip designed  to  be
  1544. X     prepended  to  existing  ZIP archives in order to form self-
  1545. X     extracting archives.  Instead of taking its  first  non-flag
  1546. X     argument  to  be  the  zipfile(s)  to be extracted, unzipsfx
  1547. X     seeks itself under the name by  which  it  was  invoked  and
  1548. X     tests  or  extracts  the  contents  of the appended archive.
  1549. X     Because the executable stub adds bulk to  the  archive  (the
  1550. X     whole  purpose  of  which  is to be as small as possible), a
  1551. X     number of the regular version's less-vital capabilities have
  1552. X     been  removed.   Among these are the usage (or help) screen,
  1553. X     the listing and diagnostic functions (-l and -v), the  abil-
  1554. X     ity to decompress older compression formats (the ``reduce,''
  1555. X     ``shrink'' and ``implode''  methods),  and  the  ability  to
  1556. X     extract  to a directory other than the current one.  Decryp-
  1557. X     tion is supported as a compile-time  option  but  should  be
  1558. X     avoided  unless  the  attached  archive  contains  encrypted
  1559. X     files.
  1560. X
  1561. X     Note that self-extracting archives made with unzipsfx are no
  1562. X     more  (or  less) portable across different operating systems
  1563. X     than is the unzip executable itself.   In  general  a  self-
  1564. X     extracting  archive  made  on  a particular Unix system, for
  1565. X     example, will only self-extract under  the  same  flavor  of
  1566. X     Unix.  Regular unzip may still be used to extract the embed-
  1567. X     ded archive as with any normal  zipfile,  although  it  will
  1568. X     generate  a harmless warning about extra bytes at the begin-
  1569. X     ning of the zipfile.
  1570. X
  1571. X
  1572. X
  1573. X[file(s)]
  1574. X
  1575. X          An optional list of archive members  to  be  processed.
  1576. X          Regular  expressions  (wildcards)  similar  to those in
  1577. X          Unix egrep(1) may be used to  match  multiple  members.
  1578. X          These wildcards may contain:
  1579. X
  1580. X          *    matches a sequence of 0 or more characters
  1581. X
  1582. X          ?    matches exactly 1 character
  1583. X
  1584. X          [...]
  1585. X               matches any  single  character  found  inside  the
  1586. X               brackets;  ranges  are  specified  by  a beginning
  1587. X               character, a hyphen, and an ending character.   If
  1588. X               an  exclamation point or a caret (`!' or `^') fol-
  1589. X               lows the left bracket, then the range  of  charac-
  1590. X               ters within the brackets is complemented (that is,
  1591. X               anything except the characters inside the brackets
  1592. X               is considered a match).
  1593. X
  1594. X          (Be sure to quote any character which  might  otherwise
  1595. X          be  interpreted  or  modified  by the operating system,
  1596. X          particularly under Unix and VMS.)
  1597. X
  1598. X[-x xfile(s)]
  1599. X
  1600. X          An optional list of archive members to be excluded from
  1601. X          processing.   Since wildcard characters match directory
  1602. X          separators (`/'), this option may be  used  to  exclude
  1603. X          any  files  which  are in subdirectories.  For example,
  1604. X          ``unzip foo *.[ch] -x */*'' would extract all C  source
  1605. X          files  in the main directory, but none in any subdirec-
  1606. X          tories.  Without the -x option, all C source  files  in
  1607. X          all directories within the zipfile would be extracted.
  1608. X
  1609. X2 Options
  1610. X
  1611. X     unzipsfx supports the following unzip options:   -c  and
  1612. X     -p  (extract  to standard output/screen), -f and -u (freshen
  1613. X     and  update  existing  files  upon  extraction),  -t   (test
  1614. X     archive) and -z (print archive comment).  All normal listing
  1615. X     options (-l, -v and -Z) have been removed, but  the  testing
  1616. X     option (-t) may be used as a ``poor man's'' listing.  Alter-
  1617. X     natively, those creating self-extracting archives  may  wish
  1618. X     to include a short listing in the zipfile comment.
  1619. X
  1620. X     See unzip for  a  more  complete  description  of  these
  1621. X     options.
  1622. X
  1623. X     MODIFIERS
  1624. X
  1625. X     unzipsfx currently supports  all  unzip  modifiers:   -a
  1626. X     (convert  text  files),  -n (never overwrite), -o (overwrite
  1627. X     without prompting), -q (operate quietly),  -C  (match  names
  1628. X     case-insenstively), -L (convert uppercase-OS names to lower-
  1629. X     case), -j (junk paths) and -V (retain version numbers); plus
  1630. X     the   following   operating-system   specific  options:   -X
  1631. X     (restore VMS owner/protection info), -s (convert  spaces  in
  1632. X     filenames  to  underscores  [DOS, OS/2, NT]) and -$ (restore
  1633. X     volume label [DOS, OS/2, NT, Amiga]).
  1634. X
  1635. X     (Support for regular ASCII text-conversion may be removed in
  1636. X     future versions, since it is simple enough for the archive's
  1637. X     creator to ensure that text files have the appropriate  for-
  1638. X     mat for the local OS.  EBCDIC conversion will of course con-
  1639. X     tinue to be supported since the zipfile format implies ASCII
  1640. X     storage of text files.)
  1641. X
  1642. X     See unzip for  a  more  complete  description  of  these
  1643. X     modifiers.
  1644. X
  1645. X2 Environment_options
  1646. X
  1647. X     unzipsfx uses the same environment  variables  as  unzip
  1648. X     does,  although  this  is likely to be an issue only for the
  1649. X     person creating and  testing  the  self-extracting  archive.
  1650. X     See unzip for details.
  1651. X
  1652. X2 Decryption
  1653. X
  1654. X     Decryption is supported exactly as in  unzip;  that  is,
  1655. X     interactively with a non-echoing prompt for the password(s).
  1656. X     See unzip for details.  Once again,  note  that  if  the
  1657. X     archive  has  no encrypted files there is no reason to use a
  1658. X     version of unzipsfx with decryption support; that only  adds
  1659. X     to the size of the archive.
  1660. X
  1661. X2 Examples
  1662. X
  1663. X     To create a self-extracting archive letters from  a  regular
  1664. X     zipfile letters.zip and change the new archive's permissions
  1665. X     to be world-executable under Unix:
  1666. X
  1667. X         cat unzipsfx letters.zip > letters
  1668. X         chmod 755 letters
  1669. X
  1670. X     To create the same archive under MS-DOS, OS/2  or  NT  (note
  1671. X     the use of the /b [binary] option to the copy command):
  1672. X
  1673. X         copy /b unzipsfx.exe+letters.zip letters.exe
  1674. X
  1675. X     Under VMS:
  1676. X
  1677. X         copy unzipsfx.exe,letters.zip letters.exe
  1678. X         letters == "$currentdisk:[currentdir]letters.exe"
  1679. X
  1680. X     (The VMS append command may also be used.  The  second  com-
  1681. X     mand installs the new program as a ``foreign command'' capa-
  1682. X     ble of taking  arguments.)  To  test  (or  list)  the  newly
  1683. X     created self-extracting archive:
  1684. X
  1685. X         letters -t
  1686. X
  1687. X     To test letters quietly, printing  only  a  summary  message
  1688. X     indicating whether the archive is OK or not:
  1689. X
  1690. X         letters -tq
  1691. X
  1692. X     To extract the complete contents into the current directory,
  1693. X     recreating all files and subdirectories as necessary:
  1694. X
  1695. X         letters
  1696. X
  1697. X     To extract only the README  file  to  standard  output  (the
  1698. X     screen):
  1699. X
  1700. X         letters -c README
  1701. X
  1702. X     To print only the zipfile comment:
  1703. X
  1704. X         letters -z
  1705. X
  1706. X2 Limitations
  1707. X
  1708. X     The principle and fundamental limitation of unzipsfx is that
  1709. X     it  is  not  portable across architectures or operating sys-
  1710. X     tems, and therefore neither are the resulting archives.  For
  1711. X     some  architectures  there  is  limited portability, however
  1712. X     (e.g., between some flavors of Intel-based Unix).
  1713. X
  1714. X     unzipsfx has no knowledge of the user's PATH, so in  general
  1715. X     an  archive  must either be in the current directory when it
  1716. X     is invoked, or else a full or relative path must  be  given.
  1717. X     If  a  user attempts to extract the archive from a directory
  1718. X     in the PATH other than the current one, unzipsfx will  print
  1719. X     a  warning  to  the  effect, ``can't find myself.''  This is
  1720. X     always true under Unix and may be true in some  cases  under
  1721. X     MS-DOS,  depending  on  the compiler used (Microsoft C fully
  1722. X     qualifies the program name, but other  compilers  may  not).
  1723. X     Under OS/2 and NT there are operating-system calls available
  1724. X     which provide the full path name,  so  the  archive  may  be
  1725. X     invoked  from anywhere in the user's path.  The situation is
  1726. X     not known for Atari TOS, MacOS, etc.
  1727. X
  1728. X     As noted above, a number of the normal  unzip  functions
  1729. X     have  been removed in order to make unzipsfx smaller:  usage
  1730. X     and diagnostic info, listing  functions  and  extraction  to
  1731. X     other directories.  Also, only stored and deflated files are
  1732. X     supported.  The latter  limitation  is  mainly  relevant  to
  1733. X     those who create SFX archives, however.
  1734. X
  1735. X     VMS users must know how to set up  self-extracting  archives
  1736. X     as  foreign  commands  in  order  to  use  any of unzipsfx's
  1737. X     options.  This is not necessary for simple  extraction,  but
  1738. X     the command to do so then becomes, e.g., ``run letters'' (to
  1739. X     continue the examples given above).
  1740. X
  1741. X     unzipsfx is not supported on the Amiga because  of  the  way
  1742. X     the  loader  works;  the  entire  archive  contents would be
  1743. X     loaded into memory by default.  It may be possible  to  work
  1744. X     around this by defining the attached archive to be a ``debug
  1745. X     hunk,'' but compatibility problems between the ROM levels of
  1746. X     older  Amigas  and  newer  ones are likely to cause problems
  1747. X     regardless.
  1748. X
  1749. X     All current bugs in unzip exist in unzipsfx as well.
  1750. X
  1751. X2 Diagnostics
  1752. X
  1753. X     unzipsfx's exit status (error level) is identical to that of
  1754. X     unzip; see the corresponding man page.
  1755. X
  1756. X2 See_also
  1757. X
  1758. X     funzip, unzip, zip,  zipcloak,  zipgrep,
  1759. X     zipinfo, zipnote, zipsplit
  1760. X
  1761. X2 Authors
  1762. X
  1763. X     Greg Roelofs was responsible for the basic modifications  to
  1764. X     UnZip  necessary  to create UnZipSFX.  See unzip for the
  1765. X     current list of zip-bugs authors, or the  file  CONTRIBS  in
  1766. X     the  UnZip source distribution for the full list of Info-ZIP
  1767. X     contributors.
  1768. END_OF_FILE
  1769.   if test 9759 -ne `wc -c <'unzip-5.12/vms/unzipsfx.hlp'`; then
  1770.     echo shar: \"'unzip-5.12/vms/unzipsfx.hlp'\" unpacked with wrong size!
  1771.   fi
  1772.   # end of 'unzip-5.12/vms/unzipsfx.hlp'
  1773. fi
  1774. if test -f 'unzip-5.12/vms/vms.h' -a "${1}" != "-c" ; then 
  1775.   echo shar: Will not clobber existing file \"'unzip-5.12/vms/vms.h'\"
  1776. else
  1777.   echo shar: Extracting \"'unzip-5.12/vms/vms.h'\" \(8436 characters\)
  1778.   sed "s/^X//" >'unzip-5.12/vms/vms.h' <<'END_OF_FILE'
  1779. X/*---------------------------------------------------------------------------
  1780. X
  1781. X  vms.h
  1782. X
  1783. X  Generic VMS header file for Info-ZIP's UnZip; now includes VMSmunch.h (at
  1784. X  end, except fchdef part deleted).
  1785. X
  1786. X  ---------------------------------------------------------------------------*/
  1787. X
  1788. X#include <descrip.h>
  1789. X#include <starlet.h>
  1790. X#include <syidef.h>
  1791. X#include <atrdef.h>
  1792. X#include <fibdef.h>
  1793. X#include <iodef.h>
  1794. X#include <fchdef.h>
  1795. X/* #include <rms.h>  already included in unzip.h */
  1796. X#include <lib$routines.h>
  1797. X#include <unixlib.h>
  1798. X
  1799. X#define ERR(s) !((s) & 1)    /* VMS system error */
  1800. X
  1801. X#ifndef SYI$_VERSION
  1802. X#define SYI$_VERSION 4096    /* VMS 5.4 definition */
  1803. X#endif
  1804. X
  1805. X/*
  1806. X *  Under Alpha (DEC C?), the FIB unions are declared as variant_unions.
  1807. X *  FIBDEF.H includes the definition of __union, which we check
  1808. X *  below to make sure we access the structure correctly.
  1809. X */
  1810. X#define variant_union 1
  1811. X#if defined(__union) && (__union == variant_union)
  1812. X#  define FIB$W_DID       fib$w_did
  1813. X#  define FIB$W_FID       fib$w_fid
  1814. X#  define FIB$L_ACCTL     fib$l_acctl
  1815. X#  define FIB$W_EXCTL     fib$w_exctl
  1816. X#else
  1817. X#  define FIB$W_DID       fib$r_did_overlay.fib$w_did
  1818. X#  define FIB$W_FID       fib$r_fid_overlay.fib$w_fid
  1819. X#  define FIB$L_ACCTL     fib$r_acctl_overlay.fib$l_acctl
  1820. X#  define FIB$W_EXCTL     fib$r_exctl_overlay.fib$w_exctl
  1821. X#endif
  1822. X#undef variant_union
  1823. X
  1824. X
  1825. Xstruct EB_header    /* Common header of extra block */
  1826. X{   ush tag;
  1827. X    ush size;
  1828. X    uch data[1];
  1829. X};
  1830. X
  1831. X/*------ Old style INFO-ZIP extra field definitions -----*/
  1832. X
  1833. X#if (!defined(VAXC) && !defined(_RMS_H) && !defined(__RMS_LOADED))
  1834. X
  1835. Xstruct XAB {                    /* This definition may be skipped */
  1836. X    unsigned char xab$b_cod;
  1837. X    unsigned char xab$b_bln;
  1838. X    short int xabdef$$_fill_1;
  1839. X    char *xab$l_nxt;
  1840. X};
  1841. X
  1842. X#endif /* !VAXC && !_RMS_H */
  1843. X
  1844. X#define BC_MASK    07   /* 3 bits for compression type */
  1845. X#define BC_STORED  0    /* Stored */
  1846. X#define BC_00      1    /* 0byte -> 0bit compression */
  1847. X#define BC_DEFL    2    /* Deflated */
  1848. X
  1849. X/*
  1850. X *  Extra record format
  1851. X *  ===================
  1852. X *  signature       (2 bytes)   = 'I','M'
  1853. X *  size            (2 bytes)
  1854. X *  block signature (4 bytes)
  1855. X *  flags           (2 bytes)
  1856. X *  uncomprssed size(2 bytes)
  1857. X *  reserved        (4 bytes)
  1858. X *  data            ((size-12) bytes)
  1859. X *  ....
  1860. X */
  1861. X
  1862. Xstruct IZ_block
  1863. X{
  1864. X    ush sig;            /* Extra field block header structure */
  1865. X    ush size;
  1866. X    ulg bid;
  1867. X    ush flags;
  1868. X    ush length;
  1869. X    ulg reserved;
  1870. X    uch body[1];
  1871. X};
  1872. X
  1873. X/*
  1874. X *   Extra field signature and block signatures
  1875. X */
  1876. X
  1877. X#define IZ_SIGNATURE "IM"
  1878. X#define FABL    (cc$rms_fab.fab$b_bln)
  1879. X#define RABL    (cc$rms_rab.rab$b_bln)
  1880. X#define XALLL   (cc$rms_xaball.xab$b_bln)
  1881. X#define XDATL   (cc$rms_xabdat.xab$b_bln)
  1882. X#define XFHCL   (cc$rms_xabfhc.xab$b_bln)
  1883. X#define XKEYL   (cc$rms_xabkey.xab$b_bln)
  1884. X#define XPROL   (cc$rms_xabpro.xab$b_bln)
  1885. X#define XRDTL   (cc$rms_xabrdt.xab$b_bln)
  1886. X#define XSUML   (cc$rms_xabsum.xab$b_bln)
  1887. X#define EXTBSL  4            /* Block signature length */
  1888. X#define RESL    8            /* Reserved 8 bytes */
  1889. X#define EXTHL   (4+EXTBSL)
  1890. X#define FABSIG  "VFAB"
  1891. X#define XALLSIG "VALL"
  1892. X#define XFHCSIG "VFHC"
  1893. X#define XDATSIG "VDAT"
  1894. X#define XRDTSIG "VRDT"
  1895. X#define XPROSIG "VPRO"
  1896. X#define XKEYSIG "VKEY"
  1897. X#define XNAMSIG "VNAM"
  1898. X#define VERSIG  "VMSV"
  1899. X
  1900. Xtypedef unsigned char byte;
  1901. X
  1902. Xstruct iosb
  1903. X{   ush status;
  1904. X    ush count;
  1905. X    ulg spec;
  1906. X};
  1907. X
  1908. X/*------------ PKWARE extra block definitions ----------*/
  1909. X
  1910. X/* Structure of PKWARE extra header */
  1911. X
  1912. X#ifdef VMS_ZIP
  1913. X
  1914. Xstruct PK_info
  1915. X{
  1916. X    ush tag_ra; ush len_ra;     byte ra[ATR$S_RECATTR];
  1917. X    ush tag_uc; ush len_uc;     byte uc[ATR$S_UCHAR];
  1918. X    ush tag_jr; ush len_jr;     byte jr[ATR$S_JOURNAL];
  1919. X    ush tag_cd; ush len_cd;     byte cd[ATR$S_CREDATE];
  1920. X    ush tag_rd; ush len_rd;     byte rd[ATR$S_REVDATE];
  1921. X    ush tag_ed; ush len_ed;     byte ed[ATR$S_EXPDATE];
  1922. X    ush tag_bd; ush len_bd;     byte bd[ATR$S_BAKDATE];
  1923. X    ush tag_rn; ush len_rn;     ush  rn;
  1924. X    ush tag_ui; ush len_ui;     byte ui[ATR$S_UIC];
  1925. X    ush tag_fp; ush len_fp;     byte fp[ATR$S_FPRO];
  1926. X    ush tag_rp; ush len_rp;     byte rp[ATR$S_RPRO];
  1927. X};
  1928. X
  1929. X#endif /* ?VMS_ZIP */
  1930. X
  1931. X/* PKWARE "VMS" tag */
  1932. X#define PK_SIGNATURE        0x000C
  1933. X#define IZ_NEW_SIGNATURE    0x010C  /* New signature, extra record format
  1934. X                    *  mostly compatible with PKWARE's */
  1935. X
  1936. X/* Total number of attributes to be saved */
  1937. X#define VMS_ATTR_COUNT    11
  1938. X#define VMS_MAX_ATRCNT    20
  1939. X
  1940. Xstruct PK_field
  1941. X{   ush        tag;
  1942. X    ush        size;
  1943. X    byte    value[1];
  1944. X};
  1945. X
  1946. X#define PK_FLDHDR_SIZE    4
  1947. X
  1948. Xstruct PK_header
  1949. X{   ush    tag;
  1950. X    ush    size;
  1951. X    ulg    crc32;
  1952. X    byte data[1];
  1953. X};
  1954. X
  1955. X#define    PK_HEADER_SIZE    8
  1956. X
  1957. X#ifdef    VMS_ZIP
  1958. X/* File description structure for Zip low level I/O */
  1959. Xstruct ioctx
  1960. X{   ush            chan;
  1961. X    int            status;
  1962. X    struct iosb        iosb;
  1963. X    long        vbn;
  1964. X    long        size;
  1965. X    long        rest;
  1966. X    struct PK_info    PKi;
  1967. X    long        acllen;
  1968. X    uch            aclbuf[ATR$S_READACL];
  1969. X};
  1970. X#endif    /* VMS_ZIP */
  1971. X
  1972. X
  1973. X
  1974. X/*---------------------------------------------------------------------------
  1975. X
  1976. X  VMSmunch.h
  1977. X
  1978. X  A few handy #defines, plus the contents of three header files from Joe
  1979. X  Meadows' FILE program.  Used by VMSmunch and by various routines which
  1980. X  call VMSmunch (e.g., in Zip and UnZip).
  1981. X
  1982. X  ---------------------------------------------------------------------------*/
  1983. X
  1984. X#define GET_TIMES       4
  1985. X#define SET_TIMES       0
  1986. X#define GET_RTYPE       1
  1987. X#define CHANGE_RTYPE    2
  1988. X#define RESTORE_RTYPE   3
  1989. X
  1990. X/*---------------------------------------------------------------------------
  1991. X    fatdef.h
  1992. X  ---------------------------------------------------------------------------*/
  1993. X
  1994. X/* This header file was created by Joe Meadows, and is not copyrighted
  1995. X   in any way. No guarantee is made as to the accuracy of the contents
  1996. X   of this header file. This header file was last modified on Sep. 22th,
  1997. X   1987. (Modified to include this statement) */
  1998. X#define FAT$K_LENGTH 32
  1999. X#define FAT$C_LENGTH 32
  2000. X#define FAT$S_FATDEF 32
  2001. X
  2002. Xstruct fatdef {
  2003. X  union  {
  2004. X    unsigned char fat$b_rtype;
  2005. X    struct  {
  2006. X      unsigned fat$v_rtype : 4;
  2007. X      unsigned fat$v_fileorg : 4;
  2008. X    } fat$r_rtype_bits;
  2009. X  } fat$r_rtype_overlay;
  2010. X# define FAT$S_RTYPE 4
  2011. X# define FAT$V_RTYPE 0
  2012. X#   define FAT$C_UNDEFINED 0
  2013. X#   define FAT$C_FIXED 1
  2014. X#   define FAT$C_VARIABLE 2
  2015. X#   define FAT$C_VFC 3
  2016. X#   define FAT$C_STREAM 4
  2017. X#   define FAT$C_STREAMLF 5
  2018. X#   define FAT$C_STREAMCR 6
  2019. X# define FAT$S_FILEORG 4
  2020. X# define FAT$V_FILEORG 4
  2021. X#   define FAT$C_SEQUENTIAL 0
  2022. X#   define FAT$C_RELATIVE 1
  2023. X#   define FAT$C_INDEXED 2
  2024. X#   define FAT$C_DIRECT 3
  2025. X  union  {
  2026. X    unsigned char fat$b_rattrib;
  2027. X    struct  {
  2028. X      unsigned fat$v_fortrancc : 1;
  2029. X      unsigned fat$v_impliedcc : 1;
  2030. X      unsigned fat$v_printcc : 1;
  2031. X      unsigned fat$v_nospan : 1;
  2032. X    } fat$r_rattrib_bits;
  2033. X  } fat$r_rattrib_overlay;
  2034. X#   define FAT$V_FORTRANCC 0
  2035. X#   define FAT$M_FORTRANCC 1
  2036. X#   define FAT$V_IMPLIEDCC 1
  2037. X#   define FAT$M_IMPLIEDCC 2
  2038. X#   define FAT$V_PRINTCC 2
  2039. X#   define FAT$M_PRINTCC 4
  2040. X#   define FAT$V_NOSPAN 3
  2041. X#   define FAT$M_NOSPAN 8
  2042. X  unsigned short int fat$w_rsize;
  2043. X  union
  2044. X  {
  2045. X    unsigned long int fat$l_hiblk;
  2046. X    struct
  2047. X    {
  2048. X      unsigned short int fat$w_hiblkh;
  2049. X      unsigned short int fat$w_hiblkl;
  2050. X    } fat$r_hiblk_fields;
  2051. X  } fat$r_hiblk_overlay;
  2052. X  union
  2053. X  {
  2054. X    unsigned long int fat$l_efblk;
  2055. X    struct
  2056. X    {
  2057. X      unsigned short int fat$w_efblkh;
  2058. X      unsigned short int fat$w_efblkl;
  2059. X    } fat$r_efblk_fields;
  2060. X  } fat$r_efblk_overlay;
  2061. X  unsigned short int fat$w_ffbyte;
  2062. X  unsigned char fat$b_bktsize;
  2063. X  unsigned char fat$b_vfcsize;
  2064. X  unsigned short int fat$w_maxrec;
  2065. X  unsigned short int fat$w_defext;
  2066. X  unsigned short int fat$w_gbc;
  2067. X  char fat$fill[8];
  2068. X  unsigned short int fat$w_versions;
  2069. X};
  2070. X
  2071. X
  2072. X/*---------------------------------------------------------------------------
  2073. X    fjndef.h
  2074. X  ---------------------------------------------------------------------------*/
  2075. X
  2076. X/* This header file was created by Joe Meadows, and is not copyrighted
  2077. X   in any way. No guarantee is made as to the accuracy of the contents
  2078. X   of this header file. This header file was last modified on Sep. 22th,
  2079. X   1987. (Modified to include this statement) */
  2080. X
  2081. X#define FJN$M_ONLY_RU 1
  2082. X#define FJN$M_RUJNL 2
  2083. X#define FJN$M_BIJNL 4
  2084. X#define FJN$M_AIJNL 8
  2085. X#define FJN$M_ATJNL 16
  2086. X#define FJN$M_NEVER_RU 32
  2087. X#define FJN$M_JOURNAL_FILE 64
  2088. X#define FJN$S_FJNDEF 1
  2089. Xstruct fjndef  {
  2090. X  unsigned fjn$v_only_ru : 1;
  2091. X  unsigned fjn$v_rujnl : 1;
  2092. X  unsigned fjn$v_bijnl : 1;
  2093. X  unsigned fjn$v_aijnl : 1;
  2094. X  unsigned fjn$v_atjnl : 1;
  2095. X  unsigned fjn$v_never_ru : 1;
  2096. X  unsigned fjn$v_journal_file:1;
  2097. X} ;
  2098. END_OF_FILE
  2099.   if test 8436 -ne `wc -c <'unzip-5.12/vms/vms.h'`; then
  2100.     echo shar: \"'unzip-5.12/vms/vms.h'\" unpacked with wrong size!
  2101.   fi
  2102.   # end of 'unzip-5.12/vms/vms.h'
  2103. fi
  2104. echo shar: End of archive 16 \(of 20\).
  2105. cp /dev/null ark16isdone
  2106. MISSING=""
  2107. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ; do
  2108.     if test ! -f ark${I}isdone ; then
  2109.     MISSING="${MISSING} ${I}"
  2110.     fi
  2111. done
  2112. if test "${MISSING}" = "" ; then
  2113.     echo You have unpacked all 20 archives.
  2114.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  2115. else
  2116.     echo You still must unpack the following archives:
  2117.     echo "        " ${MISSING}
  2118. fi
  2119. exit 0
  2120. exit 0 # Just in case...
  2121.