home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / misc / volume31 / unzip50 / part11 < prev    next >
Encoding:
Text File  |  1992-08-22  |  59.1 KB  |  1,644 lines

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