home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / sources / misc / 3864 < prev    next >
Encoding:
Text File  |  1992-08-23  |  59.3 KB  |  1,650 lines

  1. Newsgroups: comp.sources.misc
  2. Path: sparky!kent
  3. From: zip-bugs@cs.ucla.edu (Info-ZIP group)
  4. Subject:  v31i114:  unzip50 - Info-ZIP portable UnZip, version 5.0, Part11/14
  5. Message-ID: <1992Aug24.025746.25199@sparky.imd.sterling.com>
  6. Followup-To: comp.sources.d
  7. X-Md4-Signature: 6e6454980638d97b5b1e6f57cf138bc6
  8. Sender: kent@sparky.imd.sterling.com (Kent Landfield)
  9. Organization: Sterling Software
  10. References: <csm-v31i104=unzip50.215137@sparky.IMD.Sterling.COM>
  11. Date: Mon, 24 Aug 1992 02:57:46 GMT
  12. Approved: kent@sparky.imd.sterling.com
  13. Lines: 1635
  14.  
  15. Submitted-by: zip-bugs@cs.ucla.edu (Info-ZIP group)
  16. Posting-number: Volume 31, Issue 114
  17. Archive-name: unzip50/part11
  18. Supersedes: unzip: Volume 29, Issue 31-42
  19. Environment: UNIX, VMS, OS/2, MS-DOS, MACINTOSH, WIN-NT, LINUX, MINIX, COHERENT AMIGA?, !ATARI, symlink, SGI, DEC, Cray, Convex, Amdahl, Sun
  20.  
  21. #! /bin/sh
  22. # This is a shell archive.  Remove anything before this line, then feed it
  23. # into a shell via "sh file" or similar.  To overwrite existing files,
  24. # type "sh file -c".
  25. # The tool that generated this appeared in the comp.sources.unix newsgroup;
  26. # send mail to comp-sources-unix@uunet.uu.net if you want that tool.
  27. # Contents:  ATARI/AtariST.pat ATARI/tc.cfg.UU COPYING MAC/macstat.c
  28. #   VMS/bilf/bilf.c VMS/bilf/bilf.exe.UU ZipRules unreduce.c unzip.1
  29. # Wrapped by kent@sparky on Sun Aug 23 21:09:35 1992
  30. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  31. echo If this archive is complete, you will see the following message:
  32. echo '          "shar: End of archive 11 (of 14)."'
  33. if test -f 'ATARI/AtariST.pat' -a "${1}" != "-c" ; then 
  34.   echo shar: Will not clobber existing file \"'ATARI/AtariST.pat'\"
  35. else
  36.   echo shar: Extracting \"'ATARI/AtariST.pat'\" \(5779 characters\)
  37.   sed "s/^X//" >'ATARI/AtariST.pat' <<'END_OF_FILE'
  38. X*** mapname.c.orig    Fri Feb  7 22:56:19 1992
  39. X--- mapname.c    Fri Feb  7 23:06:32 1992
  40. X***************
  41. X*** 209,215 ****
  42. X--- 209,219 ----
  43. X  #ifdef MACOS
  44. X                      strcat(cdp, ":");
  45. X  #else /* !MACOS */
  46. X+ #if    ATARI_ST
  47. X+                     strcat(cdp, "\\");
  48. X+ #else  /* !ATARI_ST */
  49. X                      strcat(cdp, "/");
  50. X+ #endif /* ?ATARI_ST */
  51. X  #endif /* ?MACOS */
  52. X  #endif /* ?VMS */
  53. X                  }               /***** FALL THROUGH to ':' case  **** */
  54. X*** unzip.c.orig    Fri Feb  7 22:56:20 1992
  55. X--- unzip.c    Fri Feb  7 23:17:06 1992
  56. X***************
  57. X*** 119,124 ****
  58. X--- 119,131 ----
  59. X  byte *stack;
  60. X  #else
  61. X  byte suffix_of[HSIZE + 1];      /* also s-f length_nodes (smaller) */
  62. X+ #if    ATARI_ST
  63. X+ /* now this is the third time I had to fix this...
  64. X+  * does NOBODY understand that you C_A_N_N_O_T reuse a byte array
  65. X+  * for anything of larger type because of possible alignment problems?
  66. X+  */
  67. X+ int    HadToAlignStackElseItCrashed;
  68. X+ #endif
  69. X  byte stack[HSIZE + 1];          /* also s-f distance_nodes (smaller) */
  70. X  #endif
  71. X  
  72. X*** unzip.h.orig    Fri Feb  7 22:56:21 1992
  73. X--- unzip.h    Sat Feb  8 00:47:55 1992
  74. X***************
  75. X*** 27,34 ****
  76. X  #  if defined(THINK_C) || defined(MPW) /* for Macs */
  77. X  #    include <stddef.h>
  78. X  #  else
  79. X! #    include <sys/types.h> /* off_t, time_t, dev_t, ... */
  80. X! #    include <sys/stat.h>  /* Everybody seems to need this. */
  81. X  #  endif
  82. X  #endif                   /*   This include file defines
  83. X                            *     #define S_IREAD 0x0100  (owner may read)
  84. X--- 27,39 ----
  85. X  #  if defined(THINK_C) || defined(MPW) /* for Macs */
  86. X  #    include <stddef.h>
  87. X  #  else
  88. X! #    ifdef ATARI_ST
  89. X! #      include <stddef.h>
  90. X! #      define __STDC__ 1 /* see note below */
  91. X! #    else
  92. X! #      include <sys/types.h> /* off_t, time_t, dev_t, ... */
  93. X! #      include <sys/stat.h>  /* Everybody seems to need this. */
  94. X! #    endif
  95. X  #  endif
  96. X  #endif                   /*   This include file defines
  97. X                            *     #define S_IREAD 0x0100  (owner may read)
  98. X***************
  99. X*** 71,76 ****
  100. X--- 76,95 ----
  101. X      And now, our MS-DOS and OS/2 corner:
  102. X    ---------------------------------------------------------------------------*/
  103. X  
  104. X+ /*
  105. X+  * How comes poor little Atari ST 's playing with these boys of the 'hood ?
  106. X+  *
  107. X+  * For everybody: TURBO C for the Atari ST also defines __TURBOC__
  108. X+  *                You (yes YOU!!) may NOT RELY ON __TURBOC__ to tell
  109. X+  *                that this is MSDOS or whatever!
  110. X+  */
  111. X+ #ifdef ATARI_ST
  112. X+ /* KLUDGE KLUDGE KLUDGE KLUDGE KLUDGE KLUDGE KLUDGE KLUDGE KLUDGE KLUDGE    */
  113. X+ #undef __TURBOC__
  114. X+ #endif
  115. X+ 
  116. X+ /* FIXME FIXME FIXME FIXME FIXME FIXME FIXME FIXME FIXME FIXME FIXME FIXME  */
  117. X+ /*       vvvvvv    */
  118. X  #ifdef __TURBOC__
  119. X  #  define DOS_OS2             /* Turbo C under DOS, MSC under DOS or OS2    */
  120. X  #  include <sys/timeb.h>      /* for structure ftime                        */
  121. X***************
  122. X*** 123,132 ****
  123. X  #    ifdef MTS
  124. X  #      include <sys/file.h>     /* MTS uses this instead of fcntl.h */
  125. X  #    else
  126. X! #      include <fcntl.h>
  127. X  #    endif
  128. X  #  endif
  129. X  #endif
  130. X  /*
  131. X   *   fcntl.h (above):   This include file defines
  132. X   *                        #define O_BINARY 0x8000  (no cr-lf translation)
  133. X--- 142,162 ----
  134. X  #    ifdef MTS
  135. X  #      include <sys/file.h>     /* MTS uses this instead of fcntl.h */
  136. X  #    else
  137. X!      /*
  138. X!       * FIXME:
  139. X!       *
  140. X!       * Again, just by not being VMS, V7 or MTS, the little Atari ST
  141. X!       * winds up here (and everybody else too). WHOEVER NEEDS this stuff,
  142. X!       * DECLARE YOURSELF and DONT rely on this kind of negative logic!
  143. X!       */
  144. X! #      ifndef ATARI_ST
  145. X!          /* KLUDGE KLUDGE KLUDGE KLUDGE KLUDGE KLUDGE KLUDGE KLUDGE KLUDGE    */
  146. X! #        include <fcntl.h>
  147. X! #      endif
  148. X  #    endif
  149. X  #  endif
  150. X  #endif
  151. X+ 
  152. X  /*
  153. X   *   fcntl.h (above):   This include file defines
  154. X   *                        #define O_BINARY 0x8000  (no cr-lf translation)
  155. X***************
  156. X*** 159,164 ****
  157. X--- 189,203 ----
  158. X      And finally, some random extra stuff:
  159. X    ---------------------------------------------------------------------------*/
  160. X  
  161. X+ /* FIXME:
  162. X+  *
  163. X+  * As used by Turbo C (at least for the Atari ST),
  164. X+  * __STDC__ means that the compiler has been RESTRICTED to standard ANSI C.
  165. X+  *
  166. X+  * What we want here is: do we have a compiler which has ANSI C prototypes
  167. X+  * and includes.
  168. X+  * So better use somthing like: ANSI_C or so...
  169. X+  */
  170. X  #ifdef __STDC__
  171. X  #  include <stdlib.h>      /* standard library prototypes, malloc(), etc. */
  172. X  #  include <string.h>      /* defines strcpy, strcmp, memcpy, etc. */
  173. X***************
  174. X*** 169,174 ****
  175. X--- 208,245 ----
  176. X  #endif
  177. X  
  178. X  
  179. X+ /* Incidently, for Turbo C on the Atari ST we just order the following items:
  180. X+  */
  181. X+ #if ATARI_ST
  182. X+ #  include <time.h>
  183. X+ /* the following includes are really specific for Turbo C 2.0 !!      */
  184. X+ #  include <ext.h>      /* this gives us stat()                         */
  185. X+ #  include <tos.h>      /* OS specific functions (Fdup)                 */
  186. X+ #  define MSDOS         1               /* from here on. */
  187. X+ #  define DOS_OS2       1               /* from here on. */
  188. X+ #  define __TURBOC__    1               /* from here on. */
  189. X+ /*
  190. X+  * FIXME:
  191. X+  * Although the Atari ST (MC68000) and Turbo C use 16 bit ints,
  192. X+  * we have to use NOTINT16, since its an high-endian, and therefore
  193. X+  * we cannot read the intel little-endian structs.
  194. X+  * For that reason, NOTINT16 is another misnomer.
  195. X+  */
  196. X+ #  define NOTINT16      1
  197. X+ 
  198. X+ #  ifndef S_IFMT
  199. X+ #  define S_IFMT        (S_IFCHR|S_IFREG|S_IFDIR)
  200. X+ #  endif
  201. X+ 
  202. X+ #  ifndef O_BINARY
  203. X+ #  define O_BINARY 0
  204. X+ #  endif
  205. X+ 
  206. X+ /* replace dup by corresponding tos function  */
  207. X+ #  define       dup             Fdup
  208. X+ #  define       mkdir           Dcreate
  209. X+ 
  210. X+ #endif
  211. X  
  212. X  
  213. X  
  214. END_OF_FILE
  215.   if test 5779 -ne `wc -c <'ATARI/AtariST.pat'`; then
  216.     echo shar: \"'ATARI/AtariST.pat'\" unpacked with wrong size!
  217.   fi
  218.   # end of 'ATARI/AtariST.pat'
  219. fi
  220. if test -f 'ATARI/tc.cfg.UU' -a "${1}" != "-c" ; then 
  221.   echo shar: Will not clobber existing file \"'ATARI/tc.cfg.UU'\"
  222. else
  223.   echo shar: Extracting \"'ATARI/tc.cfg.UU'\" \(3361 characters\)
  224.   sed "s/^X//" >'ATARI/tc.cfg.UU' <<'END_OF_FILE'
  225. Xbegin 666 ATARI/tc.cfg
  226. XM @( "C0                                                     
  227. XM                                                            
  228. XM                                                            
  229. XM                                                            
  230. XM                                                            
  231. XM                                                            
  232. XM                                                            
  233. XM                                                            
  234. XM                                                            
  235. XM                                                            
  236. XM            93I<=&-<:6YC;'5D90                              
  237. XM     $%405))7U-4/3$                                         
  238. XM                                                    ,C4  #$P
  239. XM,  S,@  ,@                                                  
  240. XM                                                            
  241. XM                                                            
  242. XM                                                            
  243. XM                                                            
  244. XM                                                            
  245. XM                                                            
  246. XM                                                            
  247. XM                                                            
  248. XM                                                            
  249. XM                                                            
  250. XM                                                            
  251. XM                                                            
  252. XM                                                            
  253. XM              0                                         93I<
  254. XM=&-<;&EB                                                    
  255. XM                                                            
  256. XM                                                            
  257. XM                                                            
  258. XM1CI<54Y:25!<54Y:25 N4%)*                                    
  259. XM                                                            
  260. XM                                                  !&.EQ53EI)
  261. XM4%P 12Y/                                                    
  262. XM                                                            
  263. XM                                                            
  264. XM                                                            
  265. XM                                                            
  266. XM                                /S\_                        
  267. XM 0 " $8 %$8Z7%5.6DE07%5.6DE0+D@ 4%Q53EI)4"Y(    *     ,     
  268. XM       )^:8  #>* P  ")&6    $" @ I8   !A    $             C 
  269. XM=B @ I8    !    $                0 (  $ "  !     0   !  "=(B
  270. XM      #+    RP    $ 1@ 41CI<54Y:25!<54Y:25 N4%)* %5.6DE0+D@ 
  271. XM   H     P            GYI@  -XH#   (D98    0(" "E@   &$    0
  272. XM            ",!V(" "E@    $    0               !  @  0 (  $ 
  273. XM   !    $  )TB(  0   +(   "R     0!& !1-97-S86=E<P          
  274. XM                                                            
  275. XM                                                            
  276. XM                               "                            
  277. XM                                                            
  278. XM                                                            
  279. XA                                            
  280. Xend
  281. END_OF_FILE
  282.  if test 3361 -ne `wc -c <'ATARI/tc.cfg.UU'`; then
  283.     echo shar: \"'ATARI/tc.cfg.UU'\" unpacked with wrong size!
  284.   else
  285.     echo shar: Uudecoding \"'ATARI/tc.cfg'\" \(2418 characters\)
  286.     cat ATARI/tc.cfg.UU | uudecode
  287.     if test 2418 -ne `wc -c <'ATARI/tc.cfg'`; then
  288.       echo shar: \"'ATARI/tc.cfg'\" uudecoded with wrong size!
  289.     else
  290.       rm ATARI/tc.cfg.UU
  291.     fi
  292.   fi
  293.   # end of 'ATARI/tc.cfg.UU'
  294. fi
  295. if test -f 'COPYING' -a "${1}" != "-c" ; then 
  296.   echo shar: Will not clobber existing file \"'COPYING'\"
  297. else
  298.   echo shar: Extracting \"'COPYING'\" \(4903 characters\)
  299.   sed "s/^X//" >'COPYING' <<'END_OF_FILE'
  300. X===============================================================================
  301. X   The following copyrights are claimed on portions of the UnZip source code.
  302. X   Further comments are at the bottom.
  303. X===============================================================================
  304. X
  305. X  Copyright in unzip.c, originally from unzip version 1.2 (?):
  306. X
  307. X     * Copyright 1989 Samuel H. Smith;  All rights reserved
  308. X     *
  309. X     * Do not distribute modified versions without my permission.
  310. X     * Do not remove or alter this notice or any other copyright notice.
  311. X     * If you use this in your own program you must distribute source code.
  312. X     * Do not use any of this in a commercial product.
  313. X
  314. X-------------------------------------------------------------------------------
  315. X
  316. X  Copyright in misc.c, applying to UpdateCRC() and crc_32_tab[]:
  317. X
  318. X     COPYRIGHT (C) 1986 Gary S. Brown.  You may use this program, or code
  319. X     or tables extracted from it, as desired without restriction.
  320. X
  321. X-------------------------------------------------------------------------------
  322. X
  323. X  Copyright in vms.c, distributed with UnZip versions 4.2 and later:
  324. X
  325. X     * Copyright (C) 1992 Igor Mandrichenko.
  326. X     * Permission is granted to any individual or institution to use, copy,
  327. X     * or redistribute this software so long as all of the original files
  328. X     * are included unmodified, that it is not sold for profit, and that
  329. X     * this copyright notice is retained.
  330. X
  331. X-------------------------------------------------------------------------------
  332. X
  333. X  Additional copyright information:
  334. X
  335. X     BILF (distributed with the VMS stuff) is copyrighted by Rahul Dhesi,
  336. X     but it is freely distributable.
  337. X
  338. X     The functions extract_or_test_files() and store_info() in extract.c,
  339. X     do_string() and return_VMS() in misc.c, VMS version of echo() in
  340. X     file_io.c, and find_end_central_dir() in unzip.c, were written by
  341. X     Greg Roelofs and subsequently modified by many others via Info-ZIP.
  342. X     I do not claim a copyright on these routines, but I do ask that no
  343. X     one else do so either, :-) and that anyone using them in other pro-
  344. X     grams note their source.
  345. X
  346. X     The function decrypt_member() in extract.c and the password functions
  347. X     in file_io.c were written by Mark Adler, as were the inflate.c and
  348. X     explode.c modules.
  349. X
  350. X     The function mapped_name() in mapname.c was written by David Kirschbaum,
  351. X     based on the XXU program by Frank Da Cruz.
  352. X
  353. X     The module match.c was written by J. Kercheval and modified by David
  354. X     Kirschbaum for use in UnZip.
  355. X
  356. X     Original notes from unzip 2.0a by Carl Mascott, cmascott@world.std.com
  357. X     (these are only the modifications which seem still to exist):
  358. X        * 12/14/89  C. Mascott  2.0a   adapt for UNIX
  359. X        *              don't pre-allocate output file space
  360. X        *              implement -t, -v, member file specs
  361. X        *              buffer all input
  362. X        *              fix "Bad CRC" msg: good/bad CRCs were swapped
  363. X        *              check for write error on output file
  364. X
  365. X     Most of the remaining routines have contributions from all of us, and
  366. X     show it. :-)
  367. X
  368. X===============================================================================
  369. X
  370. X   Info-ZIP comments:
  371. X
  372. X   Info-ZIP has very little interest in legal matters, aside from the usual
  373. X   "CYA" sense (that's an acronym, and you can figure it out yourself :-) ).
  374. X
  375. X   As far as we are aware--and please note that the numerous contributors 
  376. X   and copyright holders make this a little uncertain--the UnZip code is now 
  377. X   "clean" in the sense that an UnZip executable may be distributed with a
  378. X   commercial product SO LONG AS IT IS CLEAR THAT UNZIP IS NOT BEING SOLD,
  379. X   THAT THE SOURCE CODE IS FREELY AVAILABLE, AND THAT THERE ARE NO EXTRA OR
  380. X   HIDDEN CHARGES RESULTING FROM ITS USE BY OR INCLUSION WITH THE COMMERCIAL
  381. X   PRODUCT.  In particular, the retroactive copyright on unimplode.c which
  382. X   Carl Mascott requested we include in UnZip 4.2 is no longer in force, since
  383. X   Mark Adler has rewritten the module in question from scratch (it's about
  384. X   twice as fast, too! :-) ).
  385. X
  386. X   Regarding the original copyright by Mr. Smith:  Info-ZIP has finally found
  387. X   him again (he's moved to southern California), and he's apparently happy
  388. X   with the current code and restrictions.  More specifically, since the 
  389. X   current incarnation of UnZip can be considered "our own"--it bears very 
  390. X   little resemblance to his original program, in either content or size :-)
  391. X   --and since we freely distribute the source code, we believe that we are 
  392. X   within the bounds of his third stipulation.
  393. X
  394. X   Info-ZIP continues to rewrite portions of the code as time permits, in an
  395. X   effort to eliminate as many of the restrictions (and bugs) as possible.
  396. X   The bugs are our primary concern, however, so don't hold your breath. :-)
  397. X
  398. X===============================================================================
  399. END_OF_FILE
  400.   if test 4903 -ne `wc -c <'COPYING'`; then
  401.     echo shar: \"'COPYING'\" unpacked with wrong size!
  402.   fi
  403.   # end of 'COPYING'
  404. fi
  405. if test -f 'MAC/macstat.c' -a "${1}" != "-c" ; then 
  406.   echo shar: Will not clobber existing file \"'MAC/macstat.c'\"
  407. else
  408.   echo shar: Extracting \"'MAC/macstat.c'\" \(5863 characters\)
  409.   sed "s/^X//" >'MAC/macstat.c' <<'END_OF_FILE'
  410. X#ifdef THINK_C
  411. X#define MACOS
  412. X#include    <pascal.h>
  413. X#endif
  414. X#ifdef MPW
  415. X#define MACOS
  416. X#include    <Files.h>
  417. X#include    <Errors.h>
  418. X#define FSFCBLen    (*(short *)0x3F6)
  419. X#define CtoPstr c2pstr
  420. X#define PtoCstr p2cstr
  421. X#endif
  422. X
  423. X#ifdef MACOS
  424. X#include    <string.h>
  425. X#include    "macstat.h"
  426. Xint macstat(char *path, struct stat *buf, short nVRefNum, long lDirID );
  427. X
  428. X#define unixTime(t) ((t) = ((t) < (time_t)0x7c25b080) ? 0 : (t) - (time_t)0x7c25b080)
  429. X
  430. X/* assume that the path will contain a Mac-type pathname, i.e. ':'s, etc. */
  431. Xint macstat(char *path, struct stat *buf, short nVRefNum, long lDirID )
  432. X{
  433. X    char    temp[256];
  434. X    short   nVRefNumT;
  435. X    long    lDirIDT;
  436. X    short   fIsHFS = false;
  437. X    OSErr   err;
  438. X    short   fUseDefault = ((nVRefNum == 0) && (lDirID == 0));
  439. X
  440. X    if (buf == (struct stat *)0L || path == (char *)0L) {
  441. X        SysBeep(1);
  442. X        return -1;
  443. X    }
  444. X
  445. X    if (path[0] == '\0' || strlen(path)>255) {
  446. X        return -1;
  447. X    }
  448. X
  449. X    if ( fUseDefault )
  450. X    {
  451. X        if (GetVol((StringPtr)&temp[0], &nVRefNumT) != noErr) {
  452. X            SysBeep(1);
  453. X            return -1;
  454. X        }
  455. X    }
  456. X
  457. X    /* get info about the specified volume */
  458. X    if (FSFCBLen > 0)   /* HFS Disk? */
  459. X    {
  460. X        HParamBlockRec    hpbr;
  461. X
  462. X        if ( fUseDefault )
  463. X        {
  464. X            WDPBRec wdpb;
  465. X    
  466. X            wdpb.ioCompletion = 0;
  467. X            wdpb.ioNamePtr = (StringPtr)temp;
  468. X            err = PBHGetVol(&wdpb, 0);
  469. X            nVRefNumT = wdpb.ioWDVRefNum;
  470. X            lDirIDT = wdpb.ioWDDirID;
  471. X        }
  472. X        else
  473. X        {
  474. X            nVRefNumT = nVRefNum;
  475. X            lDirIDT = lDirID;
  476. X            err = noErr;
  477. X        }
  478. X        if (err == noErr)
  479. X        {
  480. X            hpbr.volumeParam.ioCompletion = 0;
  481. X            hpbr.volumeParam.ioNamePtr = (StringPtr)temp;
  482. X            hpbr.volumeParam.ioVRefNum = nVRefNumT;
  483. X            hpbr.volumeParam.ioVolIndex = 0;
  484. X            err = PBHGetVInfo(&hpbr, 0);
  485. X
  486. X            if (err == noErr && hpbr.volumeParam.ioVFSID == 0
  487. X                && hpbr.volumeParam.ioVSigWord == 0x4244) {
  488. X                    fIsHFS = true;
  489. X            }
  490. X        }
  491. X    }
  492. X
  493. X
  494. X    /* number of links, at least in System 6.0x, 0 */
  495. X    buf->st_nlink = 0;
  496. X    /* user id */
  497. X    buf->st_uid = 0;
  498. X    /* group id */
  499. X    buf->st_gid = 0;
  500. X
  501. X    if (fIsHFS == true)   /* HFS? */
  502. X    {
  503. X        CInfoPBRec  cPB;
  504. X        HParamBlockRec  hPB;
  505. X
  506. X        /* get information about file */
  507. X        cPB.hFileInfo.ioCompletion = (ProcPtr)0L;
  508. X        CtoPstr(path);
  509. X        strncpy(temp,path, path[0]+1);
  510. X        PtoCstr(path);
  511. X        cPB.hFileInfo.ioNamePtr = (StringPtr)temp;
  512. X        cPB.hFileInfo.ioVRefNum = nVRefNumT;
  513. X        cPB.hFileInfo.ioDirID = lDirIDT;
  514. X        cPB.hFileInfo.ioFDirIndex = 0;
  515. X
  516. X        err = PBGetCatInfo(&cPB, false); 
  517. X
  518. X        if (err != noErr) {
  519. X            if (err != fnfErr) {
  520. X                SysBeep(1);
  521. X            }
  522. X            return -1;
  523. X        }
  524. X        
  525. X        /* Type of file: directory or regular file + access */
  526. X        buf->st_mode = (cPB.hFileInfo.ioFlAttrib & ioDirMask) ? S_IFDIR : S_IFREG |
  527. X                       (cPB.hFileInfo.ioFlAttrib & 0x01) ? S_IREAD : (S_IREAD | S_IWRITE);
  528. X        
  529. X        /* last access time, modification time and creation time(?) */
  530. X        buf->st_atime = buf->st_mtime = cPB.hFileInfo.ioFlMdDat;
  531. X        buf->st_ctime = cPB.hFileInfo.ioFlCrDat;
  532. X        /* dev number */
  533. X        buf->st_dev = (long)cPB.hFileInfo.ioVRefNum;
  534. X        /* inode number */
  535. X        buf->st_ino = cPB.hFileInfo.ioDirID;
  536. X        /* size of file - use only the data fork */
  537. X        buf->st_size = cPB.hFileInfo.ioFlLgLen;
  538. X
  539. X        /* size of disk block */
  540. X        hPB.volumeParam.ioCompletion = (ProcPtr)0L;
  541. X        hPB.volumeParam.ioNamePtr = (StringPtr)temp;
  542. X        hPB.volumeParam.ioVRefNum = nVRefNumT;
  543. X        hPB.volumeParam.ioVolIndex = 0;
  544. X
  545. X        err = PBHGetVInfo(&hPB, false);
  546. X
  547. X        if (err != noErr) {
  548. X            SysBeep(1);
  549. X            return -1;
  550. X        }
  551. X            
  552. X        buf->st_blksize = cPB.hFileInfo.ioFlPyLen / hPB.volumeParam.ioVAlBlkSiz;
  553. X    }
  554. X    else    /* MFS? */
  555. X    {
  556. X        ParamBlockRec   pPB;
  557. X        ParamBlockRec   hPB;
  558. X
  559. X        CtoPstr(path);
  560. X        strncpy(temp, path, path[0]+1);
  561. X        PtoCstr(path);
  562. X        pPB.fileParam.ioCompletion = (ProcPtr)0;
  563. X        pPB.fileParam.ioNamePtr = (StringPtr)temp;
  564. X        pPB.fileParam.ioVRefNum = nVRefNumT;
  565. X        pPB.fileParam.ioFVersNum = 0;
  566. X        pPB.fileParam.ioFDirIndex = 0;
  567. X
  568. X        err = PBGetFInfo(&pPB, false);
  569. X
  570. X        if (err != noErr) {
  571. X            SysBeep(1);
  572. X            return -1;
  573. X        }
  574. X
  575. X        /* Type of file: either directory or regular file + access */
  576. X        buf->st_mode = (pPB.fileParam.ioFlAttrib & ioDirMask) ? S_IFDIR : S_IFREG;
  577. X                       (pPB.fileParam.ioFlAttrib & 0x01) ? S_IREAD : (S_IREAD | S_IWRITE);
  578. X
  579. X        /* last access time, modification time and creation time(?) */
  580. X        buf->st_atime = buf->st_mtime = pPB.fileParam.ioFlMdDat;
  581. X        buf->st_ctime = pPB.fileParam.ioFlCrDat;
  582. X        /* dev number */
  583. X        buf->st_dev = (long)pPB.fileParam.ioVRefNum;
  584. X        /* inode number */
  585. X        buf->st_ino = pPB.fileParam.ioFlNum;
  586. X        /* size of file - use only the data fork */
  587. X        buf->st_size = pPB.fileParam.ioFlLgLen;
  588. X
  589. X        /* size of disk block */
  590. X        hPB.volumeParam.ioCompletion = (ProcPtr)0;
  591. X        hPB.volumeParam.ioNamePtr = (StringPtr)temp;
  592. X        hPB.volumeParam.ioVRefNum = nVRefNumT;
  593. X        hPB.volumeParam.ioVolIndex = 0;
  594. X
  595. X        err = PBGetVInfo(&hPB, false);
  596. X
  597. X        if (err != noErr) {
  598. X            SysBeep(1);
  599. X            return -1;
  600. X        }
  601. X
  602. X        buf->st_blksize = pPB.fileParam.ioFlPyLen / hPB.volumeParam.ioVAlBlkSiz;
  603. X    }
  604. X
  605. X    /* Convert from Macintosh time format to Unix time format. */
  606. X
  607. X    unixTime(buf->st_atime);
  608. X    unixTime(buf->st_mtime);
  609. X    unixTime(buf->st_ctime);
  610. X
  611. X    return 0;
  612. X}
  613. X#else
  614. X#error 1
  615. X#endif
  616. END_OF_FILE
  617.   if test 5863 -ne `wc -c <'MAC/macstat.c'`; then
  618.     echo shar: \"'MAC/macstat.c'\" unpacked with wrong size!
  619.   fi
  620.   # end of 'MAC/macstat.c'
  621. fi
  622. if test -f 'VMS/bilf/bilf.c' -a "${1}" != "-c" ; then 
  623.   echo shar: Will not clobber existing file \"'VMS/bilf/bilf.c'\"
  624. else
  625.   echo shar: Extracting \"'VMS/bilf/bilf.c'\" \(6109 characters\)
  626.   sed "s/^X//" >'VMS/bilf/bilf.c' <<'END_OF_FILE'
  627. X/*
  628. XThis program performs conversion of files between stream-LF format
  629. X(as used by zoo) and fixed-length record binary format (used for Kermit
  630. Xtransfers of zoo archives).
  631. X
  632. XThis program is:
  633. X   (C) Copyright 1987 Rahul Dhesi.
  634. X   All Rights Reserved.
  635. X
  636. XPermission is hereby granted to copy and modify this for any purpose,
  637. Xwhether commercial or noncommercial, provided only that the above
  638. Xcopyright notice and this paragraph be preserved and included
  639. Xin all copies.
  640. X
  641. X                                 -- Rahul Dhesi 1987/07/25
  642. X*/
  643. X
  644. X#include <stdio.h>
  645. X#include <ssdef.h>
  646. X#define STAT_NORM SS$_NORMAL
  647. X#define STAT_ABORT SS$_ABORT
  648. X
  649. Xchar *strrchr();
  650. Xchar *strdup ();
  651. X
  652. Xmain (argc, argv)
  653. Xint argc;
  654. Xchar *argv[];
  655. X{
  656. X   char *inname;
  657. X   char *outname;
  658. X   char *option;
  659. X   int status;
  660. X
  661. X   if (argc < 3 || argc > 4) {
  662. X      printf ("BILF version 1.00 for VAX/VMS by Rahul Dhesi (1987/07/25)\n\n");
  663. X      printf ("(C) Copyright 1987 Rahul Dhesi,  All Rights Reserved\n");
  664. X      printf ("Permission to use and distribute is granted provided this copyright\n"); 
  665. X      printf ("notice is preserved and included in all copies.\n\n");
  666. X      printf ("Usage:  BILF {lb} infile [ outfile ]\n\n");
  667. X      printf ("Choose one character from within braces.  If outfile is not supplied\n");
  668. X      printf ("it has the same name as infile but a higher version number.\n");
  669. X      printf ("Options are:\n\n");
  670. X      printf ("l:  Write output file in stream-LF format.  This is the format that\n");
  671. X      printf ("    zoo expects all zoo archives to be in.  If a zoo archive was\n");
  672. X      printf ("    uploaded to a VAX/VMS system, it will need to be converted to\n");
  673. X      printf ("    stream-LF format before manipulating with zoo.\n\n");
  674. X      printf ("b:  Write output file in fixed-length 512-byte binary record format.  Before\n");
  675. X      printf ("    a zoo archive can be downloaded from a VAX/VMS system to a\n");
  676. X      printf ("    microcomputer using VAX/VMS Kermit, it must be converted to\n");
  677. X      printf ("    this binary format.  Failure to do so will result in a corrupted\n");
  678. X      printf ("    download.\n");
  679. X      exit (STAT_NORM);
  680. X   }
  681. X
  682. X   inname = argv[2];
  683. X   option = argv[1];
  684. X
  685. X   if (argc == 3) {                    /* use same filename for output */
  686. X      char *p;
  687. X      outname = strdup (inname);
  688. X      p = strrchr (outname, ';');      /* strip trailing version field */
  689. X      if (p != NULL)
  690. X         *p = '\0';
  691. X   } else
  692. X      outname = argv[3];
  693. X
  694. X   if (*option == 'l')
  695. X      status = cvtstream (outname, inname);
  696. X   else if (*option == 'b')
  697. X      status = cvtbin (outname, inname);
  698. X   else
  699. X      prterror ('f', "Option %s is invalid\n", option);
  700. X   if (status == -1)
  701. X      prterror ('w', "An error occurred -- output file may be corrupted\n");
  702. X   exit (STAT_NORM);
  703. X}
  704. X
  705. X#define  MYBUFSIZ    8192
  706. X
  707. X/* writes input file to output file in stream format */
  708. Xint cvtstream (outname, inname)
  709. Xchar *outname, *inname;
  710. X{
  711. X   FILE *infile, *outfile;
  712. X   char buffer[MYBUFSIZ];
  713. X   int count;
  714. X
  715. X   infile = fopen (inname, "r");
  716. X   if (infile == NULL)
  717. X      prterror ('f', "Could not open input file %s\n", inname);
  718. X   outfile = fopen (outname, "w");
  719. X   if (outfile == NULL)
  720. X      prterror ('f', "Could not open output file %s\n", outname);
  721. X
  722. X   while ((count = fread (buffer, 1, sizeof (buffer), infile)) > 0)
  723. X      count = fwrite (buffer, 1, count, outfile);
  724. X
  725. X   close (infile); close (outfile);
  726. X   if (count == -1)
  727. X      return (-1);
  728. X   else
  729. X      return (0);
  730. X}
  731. X
  732. X/*
  733. XVMS C doesn't have strdup().
  734. X*/
  735. Xchar *strdup (str)
  736. Xchar *str;
  737. X{
  738. X   char *malloc();
  739. X   char *newstr = malloc (strlen (str) + 1);
  740. X   if (newstr != NULL) {
  741. X      strcpy (newstr, str);
  742. X      return (newstr);
  743. X   } else
  744. X      return ((char *) NULL);
  745. X}
  746. X
  747. X/* BLKSIZ must correspond to block size specified below in creat() */
  748. X#define BLKSIZ 512
  749. X
  750. X/*
  751. XWrites input file to output in fixed-length BLKSIZ-byte record format.
  752. X*/
  753. X
  754. X#if 1
  755. X#include <file.h>
  756. X#else
  757. X#include <fcntl.h>
  758. X#endif
  759. X
  760. Xint convert ();
  761. X
  762. Xint cvtbin (outname, inname)
  763. Xchar *outname, *inname;
  764. X{
  765. X   int status, inhan, outhan;
  766. X   inhan = open (inname, O_RDONLY);
  767. X   if (inhan == -1)
  768. X      prterror ('f', "Could not open input file %s\n", inname);
  769. X   outhan = creat (outname, 0, "rfm=fix", "mrs=512");
  770. X   if (outhan == -1)
  771. X      prterror ('f', "Could not open output file %s\n", outname);
  772. X   status = convert (outhan, inhan);
  773. X   close (inhan);
  774. X   close (outhan);
  775. X   return (status);
  776. X}
  777. X
  778. X/*
  779. XFunction convert() reads from inhan and writes to outhan, always
  780. Xwriting in BLKSIZ-byte blocks, padding with nulls if necessary
  781. X*/
  782. X
  783. Xint convert (outhan, inhan)
  784. Xint inhan, outhan;
  785. X{
  786. X   char junk[BLKSIZ];
  787. X   int count;
  788. X   int done = 0;
  789. X   do {
  790. X      count = vmsread (inhan, junk, BLKSIZ);
  791. X      if (count <= 0)
  792. X         break;
  793. X      if (count < BLKSIZ) {
  794. X         int i;
  795. X         for (i = count; i < BLKSIZ; i++)
  796. X            junk[i] = 0;
  797. X         done++;
  798. X      }
  799. X      count = write (outhan, junk, BLKSIZ);
  800. X      if (count == -1)
  801. X         break;
  802. X   } while (!done);
  803. X   if (count == -1)
  804. X      return (-1);
  805. X   else
  806. X      return (0);
  807. X}
  808. X
  809. X/**** Function vmsread() does a standard read() but gets around bugs
  810. Xin the read() function of VAX/VMS C which make it unable to always
  811. Xread the entire amount requested in a single read() call.
  812. X*/
  813. Xint vmsread (han, buf, amount)
  814. Xint han;
  815. Xchar *buf;
  816. Xint amount;
  817. X{
  818. X   int count;
  819. X   int thiscount;
  820. X   count = 0;
  821. X   while (count != -1 && count < amount) {
  822. X      thiscount = read (han, &buf[count], amount - count);
  823. X      if (thiscount == 0)
  824. X         thiscount = read (han, &buf[count], amount - count);
  825. X      if (thiscount == 0)
  826. X          break;
  827. X      if (thiscount == -1)
  828. X         count = -1;
  829. X      else
  830. X         count += thiscount;
  831. X   }
  832. X   return (count);
  833. X}
  834. X
  835. Xprterror (level, msg1, msg2)
  836. Xchar level;
  837. Xchar *msg1, *msg2;
  838. X{
  839. X   if (level == 'e' || level == 'w' || level == 'f')
  840. X      printf ("BILF: ");
  841. X
  842. X   switch (level) {
  843. X      case 'e': printf ("ERROR: ");    break;
  844. X      case 'w': printf ("WARNING: ");  break;
  845. X      case 'f': printf ("FATAL: ");    break;
  846. X      default:  prterror ('f', "Internal error in prterror()\n");
  847. X   }
  848. X
  849. X   printf (msg1, msg2);
  850. X   if (level == 'f')
  851. X      exit (STAT_ABORT);
  852. X}
  853. END_OF_FILE
  854.   if test 6109 -ne `wc -c <'VMS/bilf/bilf.c'`; then
  855.     echo shar: \"'VMS/bilf/bilf.c'\" unpacked with wrong size!
  856.   fi
  857.   # end of 'VMS/bilf/bilf.c'
  858. fi
  859. if test -f 'VMS/bilf/bilf.exe.UU' -a "${1}" != "-c" ; then 
  860.   echo shar: Will not clobber existing file \"'VMS/bilf/bilf.exe.UU'\"
  861. else
  862.   echo shar: Extracting \"'VMS/bilf/bilf.exe.UU'\" \(7798 characters\)
  863.   sed "s/^X//" >'VMS/bilf/bilf.exe.UU' <<'END_OF_FILE'
  864. Xbegin 666 VMS/bilf/bilf.exe
  865. XMJ  P $0 6       ,#(P-0$!  #__________P     H   !/6@O20      
  866. XM$@  :-_^?P (                   +          $               1"
  867. XM24Q&                                               $5C$N,   
  868. XM            8! ]:"])E  %,#4M,#4             $  #  $   "*    
  869. XM @   !  !0 $    @     4    0  $ "0    H$   *    #  4 .S_/P",
  870. XM  #](  $       A   #      ,   0+5D%80U)43%\P,#$? +X      "$ 
  871. XM  ,     #@   0I,24)25$Q?,# Q'P".       A   #      R  ($*351(
  872. XM4E1,7S P,0  ________________________________________________
  873. XM____________________________________________________________
  874. XM____________________________________________________________
  875. XM____________________________________________________________
  876. XM______________________]"24Q&('9E<G-I;VX@,2XP,"!F;W(@5D%8+U9-
  877. XM4R!B>2!286AU;"!$:&5S:2 H,3DX-R\P-R\R-2D*"@ H0RD@0V]P>7)I9VAT
  878. XM(#$Y.#<@4F%H=6P@1&AE<VDL("!!;&P@4FEG:'1S(%)E<V5R=F5D"@!097)M
  879. XM:7-S:6]N('1O('5S92!A;F0@9&ES=')I8G5T92!I<R!G<F%N=&5D('!R;W9I
  880. XM9&5D('1H:7,@8V]P>7)I9VAT"@!N;W1I8V4@:7,@<')E<V5R=F5D(&%N9"!I
  881. XM;F-L=61E9"!I;B!A;&P@8V]P:65S+@H* %5S86=E.B @0DE,1B![;&)](&EN
  882. XM9FEL92!;(&]U=&9I;&4@70H* $-H;V]S92!O;F4@8VAA<F%C=&5R(&9R;VT@
  883. XM=VET:&EN(&)R86-E<RX@($EF(&]U=&9I;&4@:7,@;F]T('-U<'!L:65D"@!I
  884. XM="!H87,@=&AE('-A;64@;F%M92!A<R!I;F9I;&4@8G5T(&$@:&EG:&5R('9E
  885. XM<G-I;VX@;G5M8F5R+@H 3W!T:6]N<R!A<F4Z"@H ;#H@(%=R:71E(&]U='!U
  886. XM="!F:6QE(&EN('-T<F5A;2U,1B!F;W)M870N("!4:&ES(&ES('1H92!F;W)M
  887. XM870@=&AA= H (" @('IO;R!E>'!E8W1S(&%L;"!Z;V\@87)C:&EV97,@=&\@
  888. XM8F4@:6XN("!)9B!A('IO;R!A<F-H:79E('=A<PH (" @('5P;&]A9&5D('1O
  889. XM(&$@5D%8+U9-4R!S>7-T96TL(&ET('=I;&P@;F5E9"!T;R!B92!C;VYV97)T
  890. XM960@=&\* " @("!S=')E86TM3$8@9F]R;6%T(&)E9F]R92!M86YI<'5L871I
  891. XM;F<@=VET:"!Z;V\N"@H 8CH@(%=R:71E(&]U='!U="!F:6QE(&EN(&9I>&5D
  892. XM+6QE;F=T:" U,3(M8GET92!B:6YA<GD@<F5C;W)D(&9O<FUA="X@($)E9F]R
  893. XM90H (" @(&$@>F]O(&%R8VAI=F4@8V%N(&)E(&1O=VYL;V%D960@9G)O;2!A
  894. XM(%9!6"]635,@<WES=&5M('1O(&$* " @("!M:6-R;V-O;7!U=&5R('5S:6YG
  895. XM(%9!6"]635,@2V5R;6ET+"!I="!M=7-T(&)E(&-O;G9E<G1E9"!T;PH (" @
  896. XM('1H:7,@8FEN87)Y(&9O<FUA="X@($9A:6QU<F4@=&\@9&\@<V\@=VEL;"!R
  897. XM97-U;'0@:6X@82!C;W)R=7!T960* " @("!D;W=N;&]A9"X* $]P=&EO;B E
  898. XM<R!I<R!I;G9A;&ED"@!!;B!E<G)O<B!O8V-U<G)E9" M+2!O=71P=70@9FEL
  899. XM92!M87D@8F4@8V]R<G5P=&5D"@!R $-O=6QD(&YO="!O<&5N(&EN<'5T(&9I
  900. XM;&4@)7,* '< 0V]U;&0@;F]T(&]P96X@;W5T<'5T(&9I;&4@)7,* $-O=6QD
  901. XM(&YO="!O<&5N(&EN<'5T(&9I;&4@)7,* ')F;3UF:7@ ;7)S/34Q,@!#;W5L
  902. XM9"!N;W0@;W!E;B!O=71P=70@9FEL92 E<PH 0DE,1CH@ $524D]2.B  5T%2
  903. XM3DE.1SH@ $9!5$%,.B  26YT97)N86P@97)R;W(@:6X@<')T97)R;W(H*0H 
  904. XM                                                            
  905. XM                                                            
  906. XM                                                            
  907. XM                                                            
  908. XM                                                            
  909. XM                                                            
  910. XM                              #\ 9ZNB%X6_SP*  ">[^[Y__]3T:P$
  911. XM QD)T:P$!!0#,8, WV.>_U(*  !2^P%BWZ,\^P%BWZ-R^P%BW\.W /L!8M_#
  912. XMZ0#[ 6+?PQ !^P%BW\-6 ?L!8M_#DP'[ 6+?PZ(!^P%BW\/G ?L!8M_#*0+[
  913. XM 6+?PVP"^P%BW\.A OL!8M_#[P+[ 6+?PR\#^P%BW\-P _L!8M_#M@/[ 6+=
  914. XM ?L!_\<)  #0K A5T*4(5M"E!%?1K 0#$D'05E3=5/L!_YT)  #64-U0^P'_
  915. XMC@D  -!04A,-W53=4OL"_X8)   1 M12T%)4W3O=5/L"_Y )  #54!,(E& 1
  916. XM!-"E#%219X]L$A+=5MU4^P+O"P$  -!06#'?  &19X]B$A+=5MU4^P+O5P, 
  917. XM -!06#''  &:CV:N<-[#Q0-4T%=2D:YPCV43#I&N<(]W$P>1KG"/9A(+W\.<
  918. XM!/L!_R,)  "8KG!0SU"/90   !(S %, 8P!C &, 8P!C &, 8P!C &, 8P!C
  919. XM &, 8P!C &, 8P!# !$[U5 !%^]J_O\_U5#?PZ,$^P'_V0@  !$RU5 !W\.K
  920. XM!/L!_\D(   1(M50 =_#M03[ ?^Y"   $1+54 '?P[T$FH]F?OL"[^$%  #=
  921. XM4MU4^P+_F@@  )&N<(]F$@G=+/L!_WH(  #16(______$@_?P]L#FH]W?OL"
  922. XM[ZX%  #= ?L!_UD(  "8CP%0!'P GLZTWUZ>[]OW__]3W\,.!-VL"/L"_SP(
  923. XM  #04%43 S'& )J/9JY$WL,0!%30K A2D:Y$CV43#I&N1(]W$P>1KD2/9A(+
  924. XMW\.<!/L!_Q((  "8KD10SU"/90   !(R %( 8@!B &( 8@!B &( 8@!B &( 
  925. XM8@!B &( 8@!B &( 8@!" !$ZU5 7[UK]_S_54-_#HP3[ ?_)!P  $3+54 '?
  926. XMPZL$^P'_N0<  !$BU5 !W\.U!/L!_ZD'   1$M50 =_#O02:CV9^^P+OT00 
  927. XM -U2W53[ O^*!P  D:Y$CV82"=TL^P'_:@<  -_#+@3=K 3[ O]@!P  T%!4
  928. XM$P,QQ@":CV:N0-[#, 16T*P$4I&N0(]E$PZ1KD"/=Q,'D:Y CV82"]_#G 3[
  929. XM ?\V!P  F*Y 4,]0CV4    2,@!2 &( 8@!B &( 8@!B &( 8@!B &( 8@!B
  930. XM &( 8@!B &( 0@ 1.M50%^]^_/\_U5#?PZ,$^P'_[08  !$RU5 !W\.K!/L!
  931. XM_]T&   1(M50 =_#M03[ ?_-!@  $1+54 '?P[T$FH]F?OL"[_4#  #=4MU6
  932. XM^P+_K@8  )&N0(]F$@G=+/L!_XX&  #=53R/ "!^W0'?S?S?^P3_@@8  -!0
  933. XM4A4N =U4W5+= =_-_-_[!/]O!@  T%!2W54\CP @?MT!W\W\W_L$_U0&  #0
  934. XM4%(4T]U5^P'_.@8  -U4^P'_,08  -%2C_____\2!,X!4 344 0!! #""%[=
  935. XMK 3[ ?\)!@  UE#=4/L!__H%  #04%(3$-VL!-U2^P+_\04  -!24 344 35
  936. XM4'P GJZT7I[O>/7__U/= -VL"/L"_[\%  #04%;15H______$P,QQ@":CV:N
  937. XM1-[#3P14T*P(4I&N1(]E$PZ1KD2/=Q,'D:Y$CV82"]_#G 3[ ?^J!0  F*Y$
  938. XM4,]0CV4    2,@!2 &( 8@!B &( 8@!B &( 8@!B &( 8@!B &( 8@!B &( 
  939. XM0@ 1.M50%^_R^O\_U5#?PZ,$^P'_804  !$RU5 !W\.K!/L!_U$%   1(M50
  940. XM =_#M03[ ?]!!0  $1+54 '?P[T$FH]F?OL"[VD"  #=4MU4^P+_(@4  )&N
  941. XM1(]F$@G=+/L!_P(%  #?PW4$W\-M!-T W:P$^P3_V@0  -!05-%4C_____\3
  942. XM S'% )J/9JY WL-]!%70K 12D:Y CV43#I&N0(]W$P>1KD"/9A(+W\.<!/L!
  943. XM_\$$  "8KD!0SU"/90   !(Q %$ 80!A &$ 80!A &$ 80!A &$ 80!A &$ 
  944. XM80!A &$ 80!! !$Y 1?O"OK_/]50W\.C!/L!_WD$   1,M50 =_#JP3[ ?]I
  945. XM!   $2+54 '?P[4$^P'_600  !$2U5 !W\.]!)J/9G[[ N^! 0  W5+=5?L"
  946. XM_SH$  "1KD"/9A()W2S[ ?\:!   W5;=5/L"[QL   #04%+=5OL!__\#  #=
  947. XM5/L!__8#  #04E $U5#\ Y[.^/U>U%B>_\4#  !7T*P(5M[-_/UNWFY9/(\ 
  948. XM E744M55%48!PU)55-U4GT*^!-U6^P-GT%!3$@[=5)]"O@3=5OL#9]!04]53
  949. XM$Q_14X______$@7. 5(1 \!34M%2C_____\3!=%251F[T%)4%4[15(\  @  
  950. XM&!_05%#14(\  @  &!$!E$#-_/W64-%0CP "   9\-98/(\  G[?S?S]W:P$
  951. XM^P/_*P,  -!05-%4C_____\3!]58$@,Q4/_15(______$@3. 5 $U% $_ '"
  952. XM!%[44]ZL#%714V486=ZL"%30I !8WLP$ %>>_^$"  !6PU-E?I]#:-UG^P-F
  953. XMT%!2$A##4V5^GT.T -UG^P-FT%!2U5(3(-%2C_____\2!LX!4Q$$ <!24]%3
  954. XMC_____\3!=%391F[T%-0!-50 00 PB!>GN\]\O__4I"L!%"14(]E$PR14(]W
  955. XM$P:14(]F$@O?PIP$^P'_EP(  )BL!%#/4(]E    $C, 4P!C &, 8P!C &, 
  956. XM8P!C &, 8P!C &, 8P!C &, 8P!C $, $3O54 $7[][W_S_54-_"HP3[ ?]-
  957. XM @  $3+54 '?PJL$^P'_/0(  !$BU5 !W\*U!/L!_RT"   1$M50 =_"O02:
  958. XMCV9^^P+O5?___]VL#-VL"/L"_PP"  "1K 2/9A()W2S[ ?_L 0  !       
  959. XM                                                            
  960. XM                                                            
  961. XM                                                            
  962. XM                                                            
  963. XM                                                            
  964. XM                                                            
  965. XM                                                            
  966. XM                                                            
  967. XM                                  !     0         "(    E   
  968. XM  0                                               \    !    
  969. XM"@   "0!  !D 0  ]    !P   #\ P  G (  (P"   4    S $  &P   ",
  970. XM    M     0!  #$ @        $     $    0 -                    
  971. XM  !                                                         
  972. XM                                       '5D%80U)43           
  973. XM                                                            
  974. XM    !DQ)0E)43                                               
  975. XM                              9-5$A25$P                     
  976. XM                                                            
  977. XM                                                            
  978. XM                                               +O  '    !$))
  979. XM3$8+O@  "   !&UA:6X&OP 8 @  $+X & H   EC=G1S=')E86T&OP O @  
  980. XM#;X 2 P   9S=')D=7 &OP R    #;X ? P   9C=G1B:6X&OP#Z 0  #KX 
  981. XM> X   =C;VYV97)T!K\ T     Z^ $@/   '=FUS<F5A9 :_ &T    /O@"X
  982. XM#P  "'!R=&5R<F]R!K\ R0    FY"8<#$  (  "TN0 "!^WQ]/KZ^?GY^?GY
  983. XM^?GY^?GY^?GW @$ ^ (!_ (!^M+U_/[^ @'\^O+V\OP!Q@#W\?<"!?L"!?+O
  984. XM^P'& ._[ @$!Q@#F @'3[O?\ /T"!?\" OOH_O3\ /T"(/X" O/Q] '& .GT
  985. XM <4 \O?W_ ('_@(#^?[YH/X  @'W\_#^ .KW /GW_ #] @8  @7[_N/Q_O#\
  986. XM /?]_?WR_ ("_0("].H" ?7!\/#P\0(! //Y]PX! ;T                 
  987. XM                                                            
  988. XM                                                            
  989. XM                                                            
  990. X'            
  991. Xend
  992. END_OF_FILE
  993.  if test 7798 -ne `wc -c <'VMS/bilf/bilf.exe.UU'`; then
  994.     echo shar: \"'VMS/bilf/bilf.exe.UU'\" unpacked with wrong size!
  995.   else
  996.     echo shar: Uudecoding \"'VMS/bilf/bilf.exe'\" \(5632 characters\)
  997.     cat VMS/bilf/bilf.exe.UU | uudecode
  998.     if test 5632 -ne `wc -c <'VMS/bilf/bilf.exe'`; then
  999.       echo shar: \"'VMS/bilf/bilf.exe'\" uudecoded with wrong size!
  1000.     else
  1001.       rm VMS/bilf/bilf.exe.UU
  1002.     fi
  1003.   fi
  1004.   # end of 'VMS/bilf/bilf.exe.UU'
  1005. fi
  1006. if test -f 'ZipRules' -a "${1}" != "-c" ; then 
  1007.   echo shar: Will not clobber existing file \"'ZipRules'\"
  1008. else
  1009.   echo shar: Extracting \"'ZipRules'\" \(5218 characters\)
  1010.   sed "s/^X//" >'ZipRules' <<'END_OF_FILE'
  1011. XSubject: Info-ZIP Rules (No Feelthy ...)
  1012. X
  1013. XIn discussions with Mark Adler (and others), I realized we in the Info-ZIP
  1014. Xcommunity have been evolving a set of rules that maybe oughtta be
  1015. Xdocumented, archived, and available to potential contributors.
  1016. X
  1017. XThe following appear to meet our requirements.  Please observe these
  1018. Xrules when submitting source, context diff, or other files to Info-ZIP.
  1019. X
  1020. X
  1021. X1 - "NO FEELTHY TABS"
  1022. X
  1023. X    Many editors and EMail systems either have no capability to use and/or
  1024. Xdisplay the Ascii 9 TAB character correctly, or there are variable tab
  1025. Xcolumns, or other horrors.  (My MaxEMail offline email editor for one.)
  1026. X
  1027. X    Bottom line:  use spaces, not tabs.
  1028. X
  1029. X    Related utility programs:  Unix and MS-DOS :  expand, unexpand.
  1030. XMS-DOS: Buerg's TABS; Toad Hall's TOADSOFT.  And some editors have the
  1031. Xconversion built-in.
  1032. X
  1033. X    Exceptions:  The Unix Makefile.  Some makes seem to require "real"
  1034. Xtabs.  If they need it there, fine.  So don't fiddle the Makefile.
  1035. X
  1036. X
  1037. X2 - "NO FEELTHY CRS"
  1038. X
  1039. X    All source, documentation and other text files shall have Unix style
  1040. Xline endings (LF, Ctrl-J), NOT the MS-DOS CR/LF or Mac CR line endings.
  1041. X
  1042. X    Reason:  "Real programmers" in any environment can convert back and
  1043. Xforth between Unix and DOS/Mac style.  MS-DOS Turbo C can use Unix or
  1044. XMS-DOS line endings (donno about Mac Turbo C).  Buerg's LIST file display
  1045. Xutility for MS-DOS can use Unix or MS-DOS line endings.  Unix utilities
  1046. Xlike diff and patch die a horrible death (or produce horrible output) if
  1047. Xtarget files have CRs.
  1048. X
  1049. X    Related utilities:  flip for Unix and MS-DOS.
  1050. X
  1051. X    Exceptions:  The zip archive README and zip.doc files, which Mark
  1052. XAdler wants to leave in MSDOS for "unsophisticated" (read brain-dead) DOS
  1053. Xusers.  Also the batch files to compile under MS-DOS (where it requires
  1054. Xthe CRs.)
  1055. X
  1056. X
  1057. X3 - "NO FEELTHY HEX"
  1058. X
  1059. X    We'll use uuencode/uudecode compatible converters to move binary files
  1060. Xthrough our 7-bit EMail systems (xxencode on special request).  Uuencoded
  1061. Xfiles, if larger than +/- 32Kb, will be broken into smaller (< 32Kb)
  1062. Xfiles (via David M. Read's UUXFER utility).
  1063. X
  1064. X    Reason:  to prevent sounds of gagging mailers from resounding
  1065. Xthroughout the land.  To be standard with the Uunet side of the world.
  1066. XTo be relatively efficient in the binary->Ascii conversion.  (Yeah, yeah,
  1067. XI know, there's better conversions out there.  But not as widely known.)
  1068. X
  1069. X    Related utilities:  uuencode, uudecode, uuxfer20, quux, others.
  1070. XJust make sure they don't leave imbedded or trailing spaces.  (E.g., they
  1071. Xshould use the "`" character in place of Ascii 32.)  Else mailers are
  1072. Xprone to truncate or whatever.  Message me if you need one.
  1073. X
  1074. X
  1075. X4 - "NO FEELTHY TARS"
  1076. X
  1077. X    unzip will be available in .tar.Z (16-bit compressed tar), .arc (as
  1078. Xavailable on Unix, SIMTEL20, PKPAK, etc., *NOT* the latest proprietary
  1079. XSEA version), or .zip format.  (If requesting we EMail you source,
  1080. Xspecify desired format.)  zip source will only be distributed in .zip
  1081. Xarchives.
  1082. X
  1083. X    Reason:  For unzip development or use, anyone should have one of the
  1084. Xspecified dearchivers.  For zip development or use, you shouldn't be
  1085. Xmessing with zip unless you can already unzip.  (This protects the
  1086. Xinnocent.)
  1087. X
  1088. X    Related utilities:  Unix:  arc, tar, compress, zip, unzip.  MS-DOS:
  1089. XPKUNPAK, PKUNZIP, PAK, TAR, COMPRESS, and others.
  1090. X
  1091. X    Exceptions:  EMail me directly for any special circumstances or
  1092. Xrequirements (zoo, BinHex, 12-bit compress, etc.)
  1093. X
  1094. X
  1095. X5 - "NO FEELTHY FANCY_NAMES"
  1096. X
  1097. X    Assume the worst:  that someone on a brain-damaged DOS system has to
  1098. Xwork with everything your magic fingers produced.  Keep the file names
  1099. Xunimaginative and within MS-DOS limits (e.g., ordinary A..Z, 1..9, "-$_!"
  1100. Xtype characters, in the "filename.typ" 8-dot-3 format).  MacUsers, giggle
  1101. Xall you want, but no spaces.
  1102. X
  1103. X    Reason:  Compatibility with different file systems.  MS-DOS is the
  1104. Xmost limited.
  1105. X
  1106. X
  1107. X6 - "NO FEELTHY GRAPHICS"
  1108. X
  1109. X    Do all your editing in a plain-text ASCII editor.  No WordPerfect,
  1110. XWord, WordStar document mode, or other word processor files, thenkyew.
  1111. XNo desktop publishing.  No TIFFs, no GIFs, no imbedded pictures or dancing
  1112. Xladies (too bad, Cave Newt).
  1113. X
  1114. X    Reason:  Compatibility with different consoles.  My old XT clone is
  1115. Xthe most limited!
  1116. X
  1117. X    Related utilities:  vi, ed, EDLIN, Turbo C editor, UED, EASYEDIT, cat
  1118. Xor "COPY CON UNZIP.C"; various word processor -> text conversion utilities.
  1119. X
  1120. X
  1121. X7 - "NO FEELTHY DASHES"
  1122. X
  1123. X    Don't have repeated dashes (starting at the left margin) in any
  1124. Xsource code or patches you try to EMail to me or Info-ZIP.  Instead, be
  1125. Xsure to always prefix them with a space, asterisk, comment, whatever, like
  1126. Xthis:
  1127. X#---------------   or
  1128. X/*--------------   or even
  1129. X ---------------   (just indented)
  1130. X
  1131. X    Reason:  Most "undigestify" utilities (that break down newsletters
  1132. Xinto their separate messages) use that "--------" (starting at the left
  1133. Xmargin) as the symbol that it's hit the end of a message.  I'd rather not
  1134. Xhave your C source file broken up into a dozen separate untitled messages
  1135. Xin my mail system, thank you.  I'll be going through the unzip source Any
  1136. XDay Now and changing anything like that by indenting, prefixing, whatever.
  1137. X
  1138. X
  1139. X*-------------------*
  1140. X
  1141. XDavid Kirschbaum
  1142. XInfo-ZIP Coordinator
  1143. END_OF_FILE
  1144.   if test 5218 -ne `wc -c <'ZipRules'`; then
  1145.     echo shar: \"'ZipRules'\" unpacked with wrong size!
  1146.   fi
  1147.   # end of 'ZipRules'
  1148. fi
  1149. if test -f 'unreduce.c' -a "${1}" != "-c" ; then 
  1150.   echo shar: Will not clobber existing file \"'unreduce.c'\"
  1151. else
  1152.   echo shar: Extracting \"'unreduce.c'\" \(5765 characters\)
  1153.   sed "s/^X//" >'unreduce.c' <<'END_OF_FILE'
  1154. X/*---------------------------------------------------------------------------
  1155. X
  1156. X  unreduce.c
  1157. X
  1158. X  The Reducing algorithm is actually a combination of two distinct algorithms.
  1159. X  The first algorithm compresses repeated byte sequences, and the second al-
  1160. X  gorithm takes the compressed stream from the first algorithm and applies a
  1161. X  probabilistic compression method.
  1162. X
  1163. X  ---------------------------------------------------------------------------*/
  1164. X
  1165. X
  1166. X#include "unzip.h"
  1167. X
  1168. X
  1169. X/**************************************/
  1170. X/*  UnReduce Defines, Typedefs, etc.  */
  1171. X/**************************************/
  1172. X
  1173. X#define DLE    144
  1174. X
  1175. Xtypedef byte f_array[64];       /* for followers[256][64] */
  1176. X
  1177. Xstatic void LoadFollowers __((void));
  1178. Xvoid flush OF((unsigned));      /* routine from inflate.c */
  1179. X
  1180. X
  1181. X
  1182. X/*******************************/
  1183. X/*  UnReduce Global Variables  */
  1184. X/*******************************/
  1185. X
  1186. X#if (defined(MACOS) || defined(MTS))
  1187. X   f_array *followers;     /* shared work space */
  1188. X#else
  1189. X   f_array *followers = (f_array *) (slide + 0x4000);
  1190. X#endif
  1191. X
  1192. Xbyte Slen[256];
  1193. Xint factor;
  1194. X
  1195. Xint L_table[] =
  1196. X{0, 0x7f, 0x3f, 0x1f, 0x0f};
  1197. X
  1198. Xint D_shift[] =
  1199. X{0, 0x07, 0x06, 0x05, 0x04};
  1200. Xint D_mask[] =
  1201. X{0, 0x01, 0x03, 0x07, 0x0f};
  1202. X
  1203. Xint B_table[] =
  1204. X{8, 1, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 5,
  1205. X 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6,
  1206. X 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
  1207. X 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7,
  1208. X 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
  1209. X 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
  1210. X 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
  1211. X 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
  1212. X 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
  1213. X 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
  1214. X 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
  1215. X 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
  1216. X 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
  1217. X 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
  1218. X 8, 8, 8, 8};
  1219. X
  1220. X
  1221. X
  1222. X
  1223. X
  1224. X/*************************/
  1225. X/*  Function unReduce()  */
  1226. X/*************************/
  1227. X
  1228. Xvoid unReduce()   /* expand probabilistically reduced data */
  1229. X{
  1230. X    register int lchar = 0;
  1231. X    int nchar;
  1232. X    int ExState = 0;
  1233. X    int V = 0;
  1234. X    int Len = 0;
  1235. X    longint s = ucsize;  /* number of bytes left to decompress */
  1236. X    unsigned w = 0;      /* position in output window slide[] */
  1237. X    unsigned u = 1;      /* true if slide[] unflushed */
  1238. X
  1239. X
  1240. X#if (defined(MACOS) || defined(MTS))
  1241. X    followers = (f_array *) (slide + 0x4000);
  1242. X#endif
  1243. X
  1244. X    factor = lrec.compression_method - 1;
  1245. X    LoadFollowers();
  1246. X
  1247. X    while (s > 0 /* && (!zipeof) */) {
  1248. X        if (Slen[lchar] == 0)
  1249. X            READBIT(8, nchar)   /* ; */
  1250. X        else {
  1251. X            READBIT(1, nchar);
  1252. X            if (nchar != 0)
  1253. X                READBIT(8, nchar)       /* ; */
  1254. X            else {
  1255. X                int follower;
  1256. X                int bitsneeded = B_table[Slen[lchar]];
  1257. X                READBIT(bitsneeded, follower);
  1258. X                nchar = followers[lchar][follower];
  1259. X            }
  1260. X        }
  1261. X        /* expand the resulting byte */
  1262. X        switch (ExState) {
  1263. X
  1264. X        case 0:
  1265. X            if (nchar != DLE) {
  1266. X                s--;
  1267. X                slide[w++] = (byte) nchar;
  1268. X                if (w == 0x4000) {
  1269. X                    flush(w);
  1270. X                    w = u = 0;
  1271. X                }
  1272. X            }
  1273. X            else
  1274. X                ExState = 1;
  1275. X            break;
  1276. X
  1277. X        case 1:
  1278. X            if (nchar != 0) {
  1279. X                V = nchar;
  1280. X                Len = V & L_table[factor];
  1281. X                if (Len == L_table[factor])
  1282. X                    ExState = 2;
  1283. X                else
  1284. X                    ExState = 3;
  1285. X            } else {
  1286. X                s--;
  1287. X                slide[w++] = DLE;
  1288. X                if (w == 0x4000)
  1289. X                {
  1290. X                  flush(w);
  1291. X                  w = u = 0;
  1292. X                }
  1293. X                ExState = 0;
  1294. X            }
  1295. X            break;
  1296. X
  1297. X        case 2:{
  1298. X                Len += nchar;
  1299. X                ExState = 3;
  1300. X            }
  1301. X            break;
  1302. X
  1303. X        case 3:{
  1304. X                register unsigned e;
  1305. X                register unsigned n = Len + 3;
  1306. X                register unsigned d = w - ((((V >> D_shift[factor]) &
  1307. X                               D_mask[factor]) << 8) + nchar + 1);
  1308. X
  1309. X                s -= n;
  1310. X                do {
  1311. X                  n -= (e = (e = 0x4000 - ((d &= 0x3fff) > w ? d : w)) > n ?
  1312. X                        n : e);
  1313. X                  if (u && w <= d)
  1314. X                  {
  1315. X                    memset(slide + w, 0, e);
  1316. X                    w += e;
  1317. X                    d += e;
  1318. X                  }
  1319. X                  else
  1320. X                    if (w - d < e)      /* (assume unsigned comparison) */
  1321. X                      do {              /* slow to avoid memcpy() overlap */
  1322. X                        slide[w++] = slide[d++];
  1323. X                      } while (--e);
  1324. X                    else
  1325. X                    {
  1326. X                      memcpy(slide + w, slide + d, e);
  1327. X                      w += e;
  1328. X                      d += e;
  1329. X                    }
  1330. X                  if (w == 0x4000)
  1331. X                  {
  1332. X                    flush(w);
  1333. X                    w = u = 0;
  1334. X                  }
  1335. X                } while (n);
  1336. X
  1337. X                ExState = 0;
  1338. X            }
  1339. X            break;
  1340. X        }
  1341. X
  1342. X        /* store character for next iteration */
  1343. X        lchar = nchar;
  1344. X    }
  1345. X
  1346. X    /* flush out slide */
  1347. X    flush(w);
  1348. X}
  1349. X
  1350. X
  1351. X
  1352. X
  1353. X
  1354. X/******************************/
  1355. X/*  Function LoadFollowers()  */
  1356. X/******************************/
  1357. X
  1358. Xstatic void LoadFollowers()
  1359. X{
  1360. X    register int x;
  1361. X    register int i;
  1362. X
  1363. X    for (x = 255; x >= 0; x--) {
  1364. X        READBIT(6, Slen[x]);
  1365. X        for (i = 0; (byte) i < Slen[x]; i++) {
  1366. X            READBIT(8, followers[x][i]);
  1367. X        }
  1368. X    }
  1369. X}
  1370. END_OF_FILE
  1371.   if test 5765 -ne `wc -c <'unreduce.c'`; then
  1372.     echo shar: \"'unreduce.c'\" unpacked with wrong size!
  1373.   fi
  1374.   # end of 'unreduce.c'
  1375. fi
  1376. if test -f 'unzip.1' -a "${1}" != "-c" ; then 
  1377.   echo shar: Will not clobber existing file \"'unzip.1'\"
  1378. else
  1379.   echo shar: Extracting \"'unzip.1'\" \(8449 characters\)
  1380.   sed "s/^X//" >'unzip.1' <<'END_OF_FILE'
  1381. X.TH UNZIP 1 "22 Aug 92 (v5.0)"
  1382. X.SH NAME
  1383. Xunzip \- list/test/extract from a ZIP archive file
  1384. X.SH SYNOPSIS
  1385. X\fBunzip\fP [ \-\fBcflptuvxz\fP[\fBajnoqUV\fP] ] \fIfile\fP[\fI.zip\fP] [\fIfilespec\fP\ ...]
  1386. X.SH ARGUMENTS
  1387. X.IP \fIfile\fP[\fI.zip\fP] \w'[\fIfilespec\fP]'u+2m
  1388. XPath of the ZIP archive.  The suffix
  1389. X``\fI.zip\fP'' is applied if the \fIfile\fP specified does not exist.
  1390. XNote that self-extracting ZIP files are supported; just specify the
  1391. X``\fI.exe\fP'' suffix yourself.
  1392. X.IP [\fIfilespec\fP]
  1393. XAn optional list of archive members to be processed.
  1394. XExpressions may be used to match multiple members; be sure to quote
  1395. Xexpressions that contain characters interpreted by the operating
  1396. Xsystem. See DESCRIPTION (below) for more details.
  1397. X.SH OPTIONS
  1398. X.PD 0
  1399. X.IP \-c \w'\-c'u+2m
  1400. Xextract files to stdout/screen (``CRT'')
  1401. X.IP \-f
  1402. Xfreshen existing files (replace if newer); create none
  1403. X.IP \-l
  1404. Xlist archive files (short format)
  1405. X.IP \-p
  1406. Xextract files to pipe; no informational messages
  1407. X.IP \-t
  1408. Xtest archive files
  1409. X.IP \-u
  1410. Xupdate existing files; create new ones if needed
  1411. X.IP \-v
  1412. Xlist archive files (verbose format)
  1413. X.IP \-x
  1414. Xextract files in archive (default)
  1415. X.IP \-z
  1416. Xdisplay only the archive comment
  1417. X.PD
  1418. X.SH MODIFIERS
  1419. X.PD 0
  1420. X.IP \-a \w'\-a'u+2m
  1421. Xconvert to MS-DOS textfile format (CR LF), Mac format (CR), Unix/VMS
  1422. Xformat (LF), OR from ASCII to EBCDIC, depending on your system (only
  1423. Xuse for TEXT files!)
  1424. X.IP \-j
  1425. Xjunk paths (don't recreate archive's directory structure)
  1426. X.IP \-n
  1427. Xnever overwrite existing files; don't prompt
  1428. X.IP \-o
  1429. XOK to overwrite files without prompting
  1430. X.IP \-q
  1431. Xperform operations quietly (\-qq \(rh even quieter)
  1432. X.IP \-s
  1433. X[OS/2, MS-DOS] allow spaces in filenames (e.g., ``EA\ DATA.\ SF'')
  1434. X.IP \-U
  1435. Xleave filenames uppercase if created under MS-DOS, VMS, etc.
  1436. X.IP \-V
  1437. Xretain (VMS) file version numbers
  1438. X.IP \-X
  1439. X[VMS] restore owner/protection info (may require privileges)
  1440. X.PD
  1441. X.SH DESCRIPTION
  1442. X.I UnZip
  1443. Xwill list, test, or extract from a ZIP archive, commonly found on MSDOS
  1444. Xsystems.
  1445. XArchive member extraction is implied by the absence of the \-c, \-p,
  1446. X\-t, \-l, \-v or \-z options.  All archive members are processed unless a
  1447. X.I filespec
  1448. Xis provided to specify a subset of the archive members.  The
  1449. X.I filespec
  1450. Xis similar to an egrep expression, and may contain:
  1451. X.sp 1
  1452. X.ta \w'[...]'u+2m
  1453. X*    matches a sequence of 0 or more characters
  1454. X.br
  1455. X?    matches exactly 1 character
  1456. X.br
  1457. X\\nnn    matches the character having octal code nnn
  1458. X.PD 0
  1459. X.IP [...] \w'[...]'u+2m
  1460. Xmatches any single character found inside the brackets; ranges
  1461. Xare specified by a beginning character, a hyphen, and an ending
  1462. Xcharacter.  If an exclamation point or a carat (`!' or `^') follows
  1463. Xthe left bracket, then the range of characters matched is complemented
  1464. Xwith respect to the ASCII character set (that is, anything except the
  1465. Xcharacters inside the brackets is considered a match).
  1466. X.PD
  1467. X.SH ENVIRONMENT OPTIONS
  1468. X\fIUnZip\fP's default behavior may be modified via options placed in
  1469. Xan environment variable.  This can be done with any option, but it
  1470. Xis probably most useful with the
  1471. X\-q, \-o, or \-n modifiers:  in order to make \fIUnZip\fP quieter by 
  1472. Xdefault, or to make it always overwrite or never overwrite files as it
  1473. Xextracts them.  For example, to
  1474. Xmake \fIUnZip\fP act as quietly as possible, only reporting errors, one would
  1475. Xuse one of the following commands:
  1476. X.ta \w'tabset'u +\w'UNZIP=-qq; export UNZIP'u+4m
  1477. X.PP
  1478. X.IP "\tsetenv UNZIP -qq\tUnix C shell"
  1479. X.br
  1480. X.IP "\tUNZIP=-qq; export UNZIP\tUnix Bourne shell"
  1481. X.PP
  1482. X.IP "\tset UNZIP=-qq\tOS/2 or MS-DOS"
  1483. X.PP
  1484. X.IP "\tdefine UNZIP_OPTS ""-qq""\tVMS (quotes for LOWERCASE)"
  1485. X.PP
  1486. XEnvironment options are, in effect, considered to be just like any other
  1487. Xcommand-line options, except that they are effectively the first options
  1488. Xon the command line.  To override
  1489. Xan environment option, one may use the ``minus operator'' to remove it.  For
  1490. Xinstance, to override one of the quiet-flags in the example above, use the
  1491. Xcommand
  1492. X.PP
  1493. X.IP "\t\fIunzip\fP \-\-q[other options] zipfile"
  1494. X.PP
  1495. XThe first hyphen is the normal
  1496. Xswitch character, and the second is a minus sign, acting on the q option.
  1497. XThus the effect here is to cancel a single quantum of quietness.  To cancel
  1498. Xboth quiet flags, two (or more) minuses may be used:
  1499. X.PP
  1500. X.IP "\t\fIunzip\fP \-x\-\-q zipfile"
  1501. X.PP
  1502. Xor
  1503. X.PP
  1504. X.IP "\t\fIunzip\fP \-\-\-qx zipfile"
  1505. X.PP
  1506. X(the two are equivalent).  This may seem awkward
  1507. Xor confusing, but it is reasonably intuitive:  just ignore the first
  1508. Xhyphen and go from there.  It is also consistent with the behavior of Unix
  1509. Xnice(1).
  1510. X.PD
  1511. X.SH EXAMPLES
  1512. XTo use \fIUnZip\fP to extract all members of the archive letters.zip,
  1513. Xcreating any directories as necessary:
  1514. X.PP
  1515. X.IP "\t\fIunzip\fP letters"
  1516. X.PP
  1517. XTo extract all members of letters.zip to the current directory:
  1518. X.PP
  1519. X.IP "\t\fIunzip\fP -j letters"
  1520. X.PP
  1521. XTo test letters.zip, printing only a summary message indicating
  1522. Xwhether the archive is OK or not:
  1523. X.PP
  1524. X.IP "\t\fIunzip\fP -tq letters"
  1525. X.PP
  1526. XTo extract to standard output all members of letters.zip whose names end
  1527. Xin ``.tex'', converting to the local end-of-line convention and piping the
  1528. Xoutput into more(1):
  1529. X.PP
  1530. X.IP "\t\fIunzip\fP \-ca letters \e*.tex | more"
  1531. X.PP
  1532. X(The backslash before the asterisk is only required if the shell expands
  1533. Xwildcards, as in Unix; double quotes could have been used instead, as in
  1534. Xthe source example below.)\ \ To extract the binary file paper1.dvi to 
  1535. Xstandard output and pipe it to a printing program:
  1536. X.PP
  1537. X.IP "\t\fIunzip\fP \-p articles paper1.dvi | dvips"
  1538. X.PP
  1539. XTo extract all FORTRAN and C source files--*.f, *.c, *.h, Makefile (the
  1540. Xdouble quotes are necessary only in Unix and only if globbing is turned on):
  1541. X.PP
  1542. X.IP "\t\fIunzip\fP source.zip ""*.[fch]"" Makefile"
  1543. X.PP
  1544. XTo extract only newer versions of the files already in the current directory,
  1545. Xwithout querying (NOTE:  be careful of unzipping in one timezone a zipfile 
  1546. Xcreated in another--ZIP archives contain no timezone information, and a 
  1547. X``newer'' file from an eastern timezone may, in fact, be older):
  1548. X.PP
  1549. X.IP "\t\fIunzip\fP \-fo sources"
  1550. X.PP
  1551. XTo extract newer versions of the files already in the current directory and
  1552. Xto create any files not already there (same caveat as previous example):
  1553. X.PP
  1554. X.IP "\t\fIunzip\fP \-uo sources"
  1555. X.PP
  1556. X.PP
  1557. XIn the last five examples, assume that UNZIP or UNZIP_OPTS is set to -q.
  1558. XTo do a singly quiet listing:
  1559. X.PP
  1560. X.IP "\t\fIunzip\fP \-\fIl\fP \fIfile\fP"
  1561. X.PP
  1562. XTo do a doubly quiet listing:
  1563. X.PP
  1564. X.IP "\t\fIunzip\fP \-\fIql\fP \fIfile\fP"
  1565. X.PP
  1566. XTo do a standard listing:
  1567. X.PP
  1568. X.IP "\t\fIunzip\fP \-\-\fIql\fP \fIfile\fP"
  1569. X.PP
  1570. Xor
  1571. X.PP
  1572. X.IP "\t\fIunzip\fP \-\fIl\fP\-\fIq\fP \fIfile\fP"
  1573. X.PP
  1574. Xor
  1575. X.PP
  1576. X.IP "\t\fIunzip\fP \-\fIl\fP\-\-\fIq\fP \fIfile\fP"
  1577. X.PP
  1578. X(extra minuses don't hurt).
  1579. X.PD
  1580. X.SH TIPS
  1581. XThe current maintainer, being a lazy sort, finds it very useful to define
  1582. Xan alias ``tt'' for ``unzip -tq''.  One may then simply type ``tt zipfile''
  1583. Xto test the archive, something which one ought make a habit of doing.
  1584. XWith luck \fIUnZip\fP will report ``No errors detected in zipfile.zip,''
  1585. Xafter which one may breathe a sigh of relief.
  1586. X.PD
  1587. X.SH SEE ALSO
  1588. Xfunzip(1), zip(1), zipcloak(1), zipinfo(1), zipnote(1), zipsplit(1)
  1589. X.PD
  1590. X.SH AUTHORS
  1591. XSamuel H. Smith, Carl Mascott, David P. Kirschbaum, Greg R. Roelofs, Mark
  1592. XAdler, Kai Uwe Rommel, Igor Mandrichenko, Johnny Lee, Jean-loup Gailly; Glenn
  1593. XAndrews, Joel Aycock, Allan Bjorklund, James Birdsall, Wim Bonner, John Cowan,
  1594. XFrank da Cruz, Bill Davidsen, Arjan de Vet, James Dugal, Jim Dumser, Mark
  1595. XEdwards, David Feinleib, Mike Freeman, Hunter Goatley, Robert Heath, Dave
  1596. XHeiland, Larry Jones, Kjetil J(o)rgenson, Bob Kemp, J. Kercheval, Alvin Koh,
  1597. XBo Kullmar, Johnny Lee, Warner Losh, Fulvio Marino, Gene McManus, Joe Meadows,
  1598. XMike O'Carroll, Humberto Ortiz-Zuazaga, Piet W. Plomp, Antonio Querubin Jr.,
  1599. XSteve Salisbury, Georg Sassen, Jon Saxton, Hugh Schmidt, Martin Schulz, Charles
  1600. XScripter, Chris Seaman, Richard Seay, Alex Sergejew, Cliff Stanford, Onno van
  1601. Xder Linden, Jim Van Zandt, Antoine Verheijen, Paul Wells.
  1602. X.PD
  1603. X.SH VERSIONS
  1604. X.ta \w'vx.x\ \ 'u +\w'fall 1989\ \ 'u
  1605. X.PD 0
  1606. X.IP "v1.2\t15 Mar 89" \w'\t\t'u
  1607. XSamuel H. Smith
  1608. X.IP "v2.0\t\ 9 Sep 89"
  1609. XSamuel H. Smith
  1610. X.IP "v2.x\tfall 1989"
  1611. Xmany Usenet contributors
  1612. X.IP "v3.0\t\ 1 May 90"
  1613. XInfo-ZIP (DPK, consolidator)
  1614. X.IP "v3.1\t15 Aug 90"
  1615. XInfo-ZIP (DPK, consolidator)
  1616. X.IP "v4.0\t\ 1 Dec 90"
  1617. XInfo-ZIP (GRR, maintainer)
  1618. X.IP "v4.1\t12 May 91"
  1619. XInfo-ZIP
  1620. X.IP "v4.2\t20 Mar 92"
  1621. XInfo-ZIP (zip-bugs subgroup; GRR, maint.)
  1622. X.IP "v5.0\t21 Aug 92"
  1623. XInfo-ZIP (zip-bugs subgroup; GRR, maint.)
  1624. X.PD
  1625. END_OF_FILE
  1626.   if test 8449 -ne `wc -c <'unzip.1'`; then
  1627.     echo shar: \"'unzip.1'\" unpacked with wrong size!
  1628.   fi
  1629.   # end of 'unzip.1'
  1630. fi
  1631. echo shar: End of archive 11 \(of 14\).
  1632. cp /dev/null ark11isdone
  1633. MISSING=""
  1634. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 ; do
  1635.     if test ! -f ark${I}isdone ; then
  1636.     MISSING="${MISSING} ${I}"
  1637.     fi
  1638. done
  1639. if test "${MISSING}" = "" ; then
  1640.     echo You have unpacked all 14 archives.
  1641.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1642. else
  1643.     echo You still must unpack the following archives:
  1644.     echo "        " ${MISSING}
  1645. fi
  1646. exit 0
  1647. exit 0 # Just in case...
  1648.