home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume19 / unzip / part05 < prev    next >
Text File  |  1991-05-19  |  55KB  |  1,618 lines

  1. Newsgroups: comp.sources.misc
  2. From: David Kirschbaum <kirsch@usasoc.soc.mil>
  3. Subject:  v19i100:  unzip - Portable unzip v4.1, Part05/06
  4. Message-ID: <1991May20.012430.29372@sparky.IMD.Sterling.COM>
  5. X-Md4-Signature: 7753988994983368a9866f30d8cd0884
  6. Date: Mon, 20 May 1991 01:24:30 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: David Kirschbaum <kirsch@usasoc.soc.mil>
  10. Posting-number: Volume 19, Issue 100
  11. Archive-name: unzip/part05
  12. Supersedes: unzip-3.1: Volume 14, Issue 102-106
  13.  
  14. #! /bin/sh
  15. # into a shell via "sh file" or similar.  To overwrite existing files,
  16. # type "sh file -c".
  17. # The tool that generated this appeared in the comp.sources.unix newsgroup;
  18. # send mail to comp-sources-unix@uunet.uu.net if you want that tool.
  19. # Contents:  ./v41/ATARI_ST/README.ST ./v41/ATARI_ST/TLINK.OPT
  20. #   ./v41/ATARI_ST/tc_cfg.uue ./v41/MAC/macfile.c
  21. #   ./v41/MSDOS/MAKEFILE.DOS ./v41/VMS/VMSnotes ./v41/VMS/vms_attr.c
  22. #   ./v41/unreduce.c ./v41/unshrink.c ./v41/unzip.1 ./v41/unzip.man
  23. #   ./v41/ziprules.txt
  24. # Wrapped by kent@sparky on Sun May 19 19:40:39 1991
  25. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  26. echo If this archive is complete, you will see the following message:
  27. echo '          "shar: End of archive 5 (of 6)."'
  28. if test -f './v41/ATARI_ST/README.ST' -a "${1}" != "-c" ; then 
  29.   echo shar: Will not clobber existing file \"'./v41/ATARI_ST/README.ST'\"
  30. else
  31.   echo shar: Extracting \"'./v41/ATARI_ST/README.ST'\" \(3193 characters\)
  32.   sed "s/^X//" >'./v41/ATARI_ST/README.ST' <<'END_OF_FILE'
  33. Xunzip 4.01 for the Atari ST
  34. X===========================
  35. X
  36. XI have compiled unzip.prg with TURBO C 2.0 for the ATARI ST, probably
  37. Xthe best C compiler available for the Atari ST.
  38. X
  39. XMy modifications to unzip have been:
  40. X
  41. X- forget about the maze of #ifdefs. Until someone cleans it up,
  42. X  use just the setup in the beginning of unzip.h.  Essentially
  43. X  after that setup, the code compiles like a MSDOS/TURBOC
  44. X  variant.  However this link is quite fragile since the
  45. X  MSDOS side might hack the code so that it can no longer compile
  46. X  on the Atari.
  47. X
  48. X- an alignment problem in the data (unzip.c)
  49. X
  50. X- set '\' as the path character for the Atari ST (misc.c)
  51. X
  52. X- misc. optimizations (ReadByte, READBIT), which you can safely ignore.
  53. X
  54. X- I did not clean up the code, so that some warnings will still
  55. X  appear (prototypes, casts etc.)
  56. X
  57. XI am providing UNZIP.PRG for the Atari ST as unz_prg.arc.
  58. XThis file, and the patches are contained in unz_st.tar.Z
  59. Xsince 'patch' is required to apply the modifications.
  60. XAlso I think that the Atari ST version might be somehow integrated
  61. Xinto the main distribution.
  62. X
  63. XAttention:
  64. X==========
  65. X1)
  66. X The accompanying binary contains a special version of the startup file
  67. X which is capable to recognize extended parameters a la Beckemeyer/Mark
  68. X Williams shell, using the "ARGV=" Environment variable.
  69. X
  70. X2)
  71. X Although the Turbo C compiler is quite good, the libs are buggy!
  72. X Therefore I cannot garantee that any unzip.prg compiled with Turbo C
  73. X will ever run successfully. Mine seems to be ok., but I have fixed
  74. X various problems for my lib. Especially the stat() was making trouble.
  75. X
  76. XHowever, if someone wants to compile it the same way I did,
  77. Xthere are essentially 3 ways:
  78. X- using a shell, and the command line compiler TCC,
  79. X  as indicated by the script 'MAKEIT',
  80. X
  81. X- using some sort of make and 'MAKEFILE.ST'
  82. X  ( in my special case, I had to call make through the script 'TCM')
  83. X  This and the previous case bothrequire also 'TLINK.OPT'
  84. X
  85. X- using the interactive version 'TC' of Turbo C and
  86. X  the supplied 'UNZIP.PRJ'.
  87. X
  88. XPlease read the note above about problems which might arise
  89. Xwhen you recompile unzip on your Atari.
  90. X
  91. XGeneral considerations:
  92. X=======================
  93. X
  94. XThe configuration of a widely portable tool is always a little bit
  95. Xcomplicated, but unzip.h is really not up to the task.
  96. X
  97. XI could not manage to compile anything correctly (on the Atari)
  98. Xuntil I had thrown away all of those #ifdefs.
  99. X
  100. XFor good portability (using the preprocessor) you must:
  101. X
  102. X- not use #ifdef/ifndef but rathe rely on #if THIS or
  103. X  #if THAT == 0. That will allow you to combine those constants
  104. X  in any way you want.
  105. X
  106. X- use something like ANSI_C which you can control yourself.
  107. X  __STDC__ is not a safe way to handle this, since e.g. TURBO C
  108. X  does not set __STDC__ as soon as additional keywords are allowed.
  109. X  However __STDC__ implies ANSI_C. Also, since ANSI C is the
  110. X  mainstream C, the major version should comply to it.
  111. X
  112. X- break down important sections (MSDOS/OS2), UNIX, VMS, others;
  113. X  perhaps allow more categories as OS, COMPILER, TERMINAL type etc.
  114. X  and let these be configured in central place.
  115. X
  116. X- don't rely on guesses from switches set by the compiler. That works
  117. X  only for a few versions.
  118. END_OF_FILE
  119.   if test 3193 -ne `wc -c <'./v41/ATARI_ST/README.ST'`; then
  120.     echo shar: \"'./v41/ATARI_ST/README.ST'\" unpacked with wrong size!
  121.   fi
  122.   # end of './v41/ATARI_ST/README.ST'
  123. fi
  124. if test -f './v41/ATARI_ST/TLINK.OPT' -a "${1}" != "-c" ; then 
  125.   echo shar: Will not clobber existing file \"'./v41/ATARI_ST/TLINK.OPT'\"
  126. else
  127.   echo shar: Extracting \"'./v41/ATARI_ST/TLINK.OPT'\" \(189 characters\)
  128.   sed "s/^X//" >'./v41/ATARI_ST/TLINK.OPT' <<'END_OF_FILE'
  129. Xe:\tc\lib\mystart.o
  130. Xunzip.o
  131. Xfile_io.o
  132. Xmapname.o
  133. Xmatch.o
  134. Xmisc.o
  135. Xunimplod.o
  136. Xunreduce.o
  137. Xunshrink.o
  138. Xe:\tc\lib\tcstdlib.lib
  139. Xe:\tc\lib\tcextlib.lib
  140. Xe:\tc\lib\tctoslib.lib
  141. Xe:\tc\lib\tcstdlib.lib
  142. X
  143. END_OF_FILE
  144.   if test 189 -ne `wc -c <'./v41/ATARI_ST/TLINK.OPT'`; then
  145.     echo shar: \"'./v41/ATARI_ST/TLINK.OPT'\" unpacked with wrong size!
  146.   fi
  147.   # end of './v41/ATARI_ST/TLINK.OPT'
  148. fi
  149. if test -f './v41/ATARI_ST/tc_cfg.uue' -a "${1}" != "-c" ; then 
  150.   echo shar: Will not clobber existing file \"'./v41/ATARI_ST/tc_cfg.uue'\"
  151. else
  152.   echo shar: Extracting \"'./v41/ATARI_ST/tc_cfg.uue'\" \(3355 characters\)
  153.   sed "s/^X//" >'./v41/ATARI_ST/tc_cfg.uue' <<'END_OF_FILE'
  154. Xbegin 640 TC.CFG
  155. XM`@(`"C0`````````````````````````````````````````````````````
  156. XM````````````````````````````````````````````````````````````
  157. XM````````````````````````````````````````````````````````````
  158. XM````````````````````````````````````````````````````````````
  159. XM````````````````````````````````````````````````````````````
  160. XM````````````````````````````````````````````````````````````
  161. XM````````````````````````````````````````````````````````````
  162. XM````````````````````````````````````````````````````````````
  163. XM````````````````````````````````````````````````````````````
  164. XM````````````````````````````````````````````````````````````
  165. XM````````````93I<=&-<:6YC;'5D90``````````````````````````````
  166. XM`````$%405))7U-4/3$`````````````````````````````````````````
  167. XM````````````````````````````````````````````````````,C4``#$P
  168. XM,``S,@``,@``````````````````````````````````````````````````
  169. XM````````````````````````````````````````````````````````````
  170. XM````````````````````````````````````````````````````````````
  171. XM````````````````````````````````````````````````````````````
  172. XM````````````````````````````````````````````````````````````
  173. XM````````````````````````````````````````````````````````````
  174. XM````````````````````````````````````````````````````````````
  175. XM````````````````````````````````````````````````````````````
  176. XM````````````````````````````````````````````````````````````
  177. XM````````````````````````````````````````````````````````````
  178. XM````````````````````````````````````````````````````````````
  179. XM````````````````````````````````````````````````````````````
  180. XM````````````````````````````````````````````````````````````
  181. XM````````````````````````````````````````````````````````````
  182. XM``````````````0`````````````````````````````````````````93I<
  183. XM=&-<;&EB````````````````````````````````````````````````````
  184. XM````````````````````````````````````````````````````````````
  185. XM````````````````````````````````````````````````````````````
  186. XM````````````````````````````````````````````````````````````
  187. XM1CI<54Y:25!<54Y:25`N4%)*````````````````````````````````````
  188. XM````````````````````````````````````````````````````````````
  189. XM``````````````````````````````````````````````````!&.EQ53EI)
  190. XM4%P`12Y/````````````````````````````````````````````````````
  191. XM````````````````````````````````````````````````````````````
  192. XM````````````````````````````````````````````````````````````
  193. XM````````````````````````````````````````````````````````````
  194. XM````````````````````````````````````````````````````````````
  195. XM````````````````````````````````/S\_````````````````````````
  196. XM`0`"`$8`%$8Z7%5.6DE07%5.6DE0+D@`4%Q53EI)4"Y(````*`````,`````
  197. XM```````)^:8``#>*`P``")&6````$"`@`I8```!A````$`````````````C`
  198. XM=B`@`I8````!````$````````````````0`(``$`"``!`````0```!``"=(B
  199. XM``````#+````RP````$`1@`41CI<54Y:25!<54Y:25`N4%)*`%5.6DE0+D@`
  200. XM```H`````P````````````GYI@``-XH#```(D98````0("`"E@```&$````0
  201. XM````````````",!V("`"E@````$````0```````````````!``@``0`(``$`
  202. XM```!````$``)TB(``0```+(```"R`````0!&`!1-97-S86=E<P``````````
  203. XM````````````````````````````````````````````````````````````
  204. XM````````````````````````````````````````````````````````````
  205. XM```````````````````````````````"````````````````````````````
  206. XM````````````````````````````````````````````````````````````
  207. XM````````````````````````````````````````````````````````````
  208. XA````````````````````````````````````````````
  209. X`
  210. Xend
  211. END_OF_FILE
  212.   if test 3355 -ne `wc -c <'./v41/ATARI_ST/tc_cfg.uue'`; then
  213.     echo shar: \"'./v41/ATARI_ST/tc_cfg.uue'\" unpacked with wrong size!
  214.   fi
  215.   # end of './v41/ATARI_ST/tc_cfg.uue'
  216. fi
  217. if test -f './v41/MAC/macfile.c' -a "${1}" != "-c" ; then 
  218.   echo shar: Will not clobber existing file \"'./v41/MAC/macfile.c'\"
  219. else
  220.   echo shar: Extracting \"'./v41/MAC/macfile.c'\" \(3616 characters\)
  221.   sed "s/^X//" >'./v41/MAC/macfile.c' <<'END_OF_FILE'
  222. X/*---------------------------------------------------------------------------
  223. X
  224. X  mac.c
  225. X
  226. X  This source file is used by the mac port to support commands not available
  227. X  directly on the Mac, i.e. mkdir().
  228. X  It also helps determine if we're running on a Mac with HFS and a disk
  229. X  formatted for HFS (HFS - Hierarchical File System; compared to its predecessor,
  230. X  MFS - Macintosh File System).
  231. X  
  232. X  ---------------------------------------------------------------------------*/
  233. X
  234. X#include "unzip.h"
  235. X
  236. X#ifdef MACOS
  237. Xstatic short wAppVRefNum;
  238. Xstatic long lAppDirID;
  239. Xint hfsflag;            /* set if disk has hierarchical file system */
  240. X
  241. Xvoid macfstest(int vrefnum, int wd)
  242. X{
  243. X    Str255 st;
  244. X
  245. X    /* is this machine running HFS file system? */
  246. X#ifdef THINK_C
  247. X    if (FSFCBLen <= 0) {
  248. X#else
  249. X    if (*(short *)FSFCBLen <= 0) {
  250. X#endif
  251. X        hfsflag = false;
  252. X    }
  253. X    else
  254. X    {
  255. X        hfsflag = true;
  256. X    }
  257. X
  258. X    /* get the file's volume reference number and directory ID */
  259. X    if (hfsflag == true) {
  260. X        WDPBRec    wdpb;
  261. X        OSErr err = noErr;
  262. X
  263. X        if (vrefnum != 0) {
  264. X            wdpb.ioCompletion = false;
  265. X            wdpb.ioNamePtr = st;
  266. X            wdpb.ioWDIndex = 0;
  267. X            wdpb.ioVRefNum = vrefnum;
  268. X            err = PBHGetVol(&wdpb, false);
  269. X        
  270. X            if (err == noErr) {
  271. X                wAppVRefNum = wdpb.ioWDVRefNum;
  272. X                lAppDirID = wdpb.ioWDDirID;
  273. X            }
  274. X        }
  275. X
  276. X        /* is the disk we're using formatted for HFS? */
  277. X        hfsflag = IsHFSDisk(wAppVRefNum);
  278. X    }
  279. X} /* mactest */
  280. X
  281. Xstatic int IsHFSDisk(short wRefNum)
  282. X{
  283. X    /* get info about the specified volume */
  284. X    if (hfsflag == true) {
  285. X        HParamBlockRec    hpbr;
  286. X        Str255 temp;
  287. X        short wErr;
  288. X        
  289. X        hpbr.volumeParam.ioCompletion = 0;
  290. X        hpbr.volumeParam.ioNamePtr = temp;
  291. X        hpbr.volumeParam.ioVRefNum = wRefNum;
  292. X        hpbr.volumeParam.ioVolIndex = 0;
  293. X        wErr = PBHGetVInfo(&hpbr, 0);
  294. X
  295. X        if (wErr == noErr && hpbr.volumeParam.ioVFSID == 0
  296. X            && hpbr.volumeParam.ioVSigWord == 0x4244) {
  297. X                return true;
  298. X        }
  299. X    }
  300. X
  301. X    return false;
  302. X} /* IsHFSDisk */
  303. X
  304. Xint mkdir(char *path, int mode)
  305. X{
  306. X    OSErr    err = -1;
  307. X
  308. X    if (path != 0 && strlen(path)<256 && hfsflag == true) {
  309. X        HParamBlockRec    hpbr;
  310. X        Str255    st;
  311. X        short     wVol;
  312. X        long      lDirID;
  313. X
  314. X        CtoPstr(path);
  315. X        hpbr.fileParam.ioNamePtr = st;
  316. X        hpbr.fileParam.ioCompletion = NULL;
  317. X        err = PBHGetVol((WDPBPtr)&hpbr, false);
  318. X        if (err == noErr) {
  319. X            wVol = hpbr.wdParam.ioWDVRefNum;
  320. X            lDirID = hpbr.wdParam.ioWDDirID;
  321. X            hpbr.fileParam.ioCompletion = NULL;
  322. X            hpbr.fileParam.ioVRefNum = wVol;
  323. X            hpbr.fileParam.ioDirID = lDirID;
  324. X            hpbr.fileParam.ioNamePtr = path;
  325. X            err = PBDirCreate(&hpbr, false);
  326. X        }    
  327. X        PtoCstr(path);
  328. X    }
  329. X
  330. X    return err;
  331. X} /* mkdir */
  332. X
  333. Xvoid SetMacVol(char *pch, short wVRefNum)
  334. X{
  335. X    OSErr err = -1;
  336. X
  337. X    if (hfsflag == true) {
  338. X        HParamBlockRec  hpbr;
  339. X        Str255  st;
  340. X
  341. X        hpbr.wdParam.ioCompletion = NULL;
  342. X        hpbr.wdParam.ioNamePtr = st;
  343. X        hpbr.wdParam.ioVRefNum = wVRefNum;
  344. X        hpbr.wdParam.ioWDIndex = 0;
  345. X        hpbr.wdParam.ioWDProcID = 0;
  346. X        hpbr.wdParam.ioWDVRefNum = 0;
  347. X        err = PBGetWDInfo(&hpbr, false);
  348. X        if (err == noErr) {
  349. X            hpbr.wdParam.ioCompletion = NULL;
  350. X            hpbr.wdParam.ioNamePtr = NULL;
  351. X            err = PBHSetVol(&hpbr, false);
  352. X        }
  353. X    } else {
  354. X        err = SetVol(pch, wVRefNum);
  355. X    }
  356. X} /* SetMacVol */
  357. X#endif /* MACOS */
  358. END_OF_FILE
  359.   if test 3616 -ne `wc -c <'./v41/MAC/macfile.c'`; then
  360.     echo shar: \"'./v41/MAC/macfile.c'\" unpacked with wrong size!
  361.   fi
  362.   # end of './v41/MAC/macfile.c'
  363. fi
  364. if test -f './v41/MSDOS/MAKEFILE.DOS' -a "${1}" != "-c" ; then 
  365.   echo shar: Will not clobber existing file \"'./v41/MSDOS/MAKEFILE.DOS'\"
  366. else
  367.   echo shar: Extracting \"'./v41/MSDOS/MAKEFILE.DOS'\" \(2964 characters\)
  368.   sed "s/^X//" >'./v41/MSDOS/MAKEFILE.DOS' <<'END_OF_FILE'
  369. X#  Makefile.DOS    Makefile for UnZip 4.0, using Microsoft C Compiler 5.0
  370. X#                  and Microsoft MAKE 4.02 (or later versions).  Users of
  371. X#                  MSC 6.0 and NMAKE can use the regular makefile by typing
  372. X#                  "nmake msc_dos".]
  373. X#
  374. X#                  Works just fine as it stands for Turbo C v2.0.
  375. X#                  You'll have to uncomment and/or edit for Include
  376. X#                  and Library paths.
  377. X#
  378. X#  Notes:  (1) Uncomment the appropriate compiler/OS options below.
  379. X#          (2) Change the various CFLAGS as appropriate for your environment
  380. X#              and libraries.
  381. X#              For MSC:  -AS specifies small-model library; -FPi87
  382. X#              specifies inline 80x87 support (there is no floating-point
  383. X#              math in unzip, but that's my default library); and -G2 enables
  384. X#              80286 instructions.  QuickC uses the medium memory model, as
  385. X#              I recall (-AM and/or -qc).
  386. X#              The "ALL:" target is used by MSC 6.0 with old MAKE; thanks to 
  387. X#              Bo Kullmar for that fix.
  388. X#          (3) Rename this file to "unzip" on a DOS system; typing "make
  389. X#              unzip" with MSC (or "make -funzip" with TC) then builds
  390. X#              unzip.exe.
  391. X#
  392. X#  Greg Roelofs
  393. X#  roelofs@amelia.nas.nasa.gov
  394. X#
  395. X
  396. X#####################
  397. X# MACRO DEFINITIONS #
  398. X#####################
  399. X
  400. X# Turbo C 2.0 for MS-DOS:
  401. X# ----------------------
  402. X# tcc is usually configured with -I and -L set appropriately...
  403. XCC = tcc
  404. XCFLAGS = -ms -O -Z
  405. XINCL = #-Ic:\turboc\include
  406. XLD = tcc
  407. XLDFLAGS = -ms #-Lc:\turboc\lib
  408. XLDFLAGS2 =
  409. X
  410. X# MSC for MS-DOS:
  411. X# --------------
  412. X# CC = cl
  413. X# CFLAGS = -AS -Ox -G2 -FPi87    # change to -FPi if coprocessor not installed
  414. X# INCL =
  415. X# LD = link
  416. X# LDFLAGS = /NOI
  417. X# LDFLAGS2 = ,$*;
  418. X
  419. X# MSC with SDK for OS/2:
  420. X# ---------------------
  421. X# CC = cl
  422. X# CFLAGS = -AS -Ox -G2 -DOS2
  423. X# INCL = -Ic:\m5\include         # for example
  424. X# LD = link
  425. X# LDFLAGS = /NOI
  426. X# RM = del
  427. X# LIBC = c:\m5\lib\p\slibce
  428. X# LIBD = c:\m5\lib\doscalls.lib
  429. X# LIBA = c:\m5\lib\api.lib
  430. X
  431. XOBJS = unzip.obj file_io.obj mapname.obj match.obj misc.obj\
  432. X       unimplod.obj unreduce.obj unshrink.obj
  433. X
  434. X
  435. X###############################################
  436. X# BASIC COMPILE INSTRUCTIONS AND DEPENDENCIES #
  437. X###############################################
  438. X
  439. XALL    : unzip.exe
  440. X
  441. X.c.obj:
  442. X        $(CC) -c $(CFLAGS) $(INCL) $*.c
  443. X
  444. Xunzip.obj:      unzip.c unzip.h
  445. X
  446. Xfile_io.obj:    file_io.c unzip.h
  447. X
  448. Xmapname.obj:    mapname.c unzip.h
  449. X
  450. Xmatch.obj:      match.c unzip.h
  451. X
  452. Xmisc.obj:       misc.c unzip.h
  453. X
  454. Xunimplod.obj:   unimplod.c unzip.h
  455. X
  456. Xunreduce.obj:   unreduce.c unzip.h
  457. X
  458. Xunshrink.obj:   unshrink.c unzip.h
  459. X
  460. X# DOS:
  461. X# ---
  462. Xunzip.exe:     $(OBJS)
  463. X        $(LD) $(LDFLAGS) $(OBJS) $(LDFLAGS2)
  464. X
  465. X# OS/2:
  466. X# ----
  467. X# unziptmp.exe:  $(OBJS)
  468. X#         $(LD) $(LDFLAGS) $(OBJS), $*.exe,,$(LIBC)+$(LIBD);
  469. X#
  470. X# unzip.exe:     unziptmp.exe
  471. X#         bind unziptmp.exe $(LIBD) $(LIBA) -o unzip.exe
  472. X#         $(RM) unziptmp.exe
  473. X#         $(RM) *.obj
  474. X#         $(RM) *.map
  475. END_OF_FILE
  476.   if test 2964 -ne `wc -c <'./v41/MSDOS/MAKEFILE.DOS'`; then
  477.     echo shar: \"'./v41/MSDOS/MAKEFILE.DOS'\" unpacked with wrong size!
  478.   fi
  479.   # end of './v41/MSDOS/MAKEFILE.DOS'
  480. fi
  481. if test -f './v41/VMS/VMSnotes' -a "${1}" != "-c" ; then 
  482.   echo shar: Will not clobber existing file \"'./v41/VMS/VMSnotes'\"
  483. else
  484.   echo shar: Extracting \"'./v41/VMS/VMSnotes'\" \(4979 characters\)
  485.   sed "s/^X//" >'./v41/VMS/VMSnotes' <<'END_OF_FILE'
  486. X                     VMS Notes for UnZip 4.1
  487. X                           12 May 1991
  488. X
  489. X
  490. XThe various VMS tweaks to UnZip 4.1 were tested on a VAX 8600 running
  491. XVMS 5.2 and VAX C 3.0.  Older tweaks were also tested on a VAX 11/785.
  492. X
  493. XAmong other things, this system has built into its C run-time library
  494. Xmost of the standard Unix functions; the notable exception is utime().
  495. XDespite this lack, however, UnZip does manage to set the date/time of 
  496. Xeach extracted file.  The compiler also predefines the token "VMS", so 
  497. Xit is not necessary to specify this on the compiler command line.
  498. X
  499. XTo build UnZip, just run the included command file VMS_MAKE.COM (i.e.,
  500. X"@vms_make").  By default, this creates a shareable-image executable,
  501. Xwhich is smaller and (supposedly) loads faster than the normal type
  502. X(that's "loads" the verb, not the adjective...).  It also will be 
  503. Xbetter able to take advantage of any bug fixes or new capabilities 
  504. Xthat DEC might introduce, since the library code isn't built into the 
  505. Xexecutable.  The shared executable is about a quarter the size of the 
  506. Xordinary type.
  507. X
  508. X[Btw, the VMS make utility "MMS" seems not to be compatible enough with
  509. XUnix make to use the same makefile.  Antonio Querubin, Jr., sent along an 
  510. XMMS makefile, but it has a small incompatibility with the current UnZip 
  511. Xdistribution.  If DESCRIP.MMS is included with this package, read the 
  512. Xcomments at the top to see what action is required.]
  513. X
  514. XUnZip is written to return the standard PK-type return codes (or error
  515. Xcodes, or exit codes, or whatever you want to call them).  Unfortunately,
  516. XVMS insists on interpreting the codes in its own lovable way, and this
  517. Xresults in endearing commentary such as "access violation, error mask =
  518. X0005, PC = 00003afc" (or something like that) when you run UnZip with no
  519. Xarguments.  To avoid this I've added a special VMS_return() function which
  520. Xinterprets the error codes and prints a semi-informative message (enclosed
  521. Xin square [] brackets), then exits with a normal error status.  Tastes
  522. Xvary, however, and some people may not like the semi-informative messages
  523. X(I don't, for one).  If you happen to be one of those people, you may
  524. Xdisable the messages by recompiling misc.c with NO_RETURN_CODES defined.
  525. X(This knocks down the executable size by a block or 4, too.)  The syntax 
  526. Xis as follows:
  527. X    cc /def=(NO_RETURN_CODES) misc
  528. X
  529. XTo use UnZip in the normal way, define a symbol "unzip" as follows:
  530. X    unzip :== "$diskname:[directory]unzip.exe"
  531. X(substitute for "diskname" and "directory" as appropriate, and DON'T FORGET
  532. XTHE "$"!  It won't work if you omit that.)  In general it's wise to stick 
  533. Xsuch assignments in your LOGIN.COM file and THEN forget about them.  It is 
  534. Xno longer necessary to worry about the record type of the zipfile...er, 
  535. Xwell, most of the time, anyway (see the special Kermit section below).
  536. X
  537. XHaving done all this you are ready to roll.  Use the unzip command in
  538. Xthe usual way; as with the MS-DOS and Unix versions, this one uses '-'
  539. Xas a switch character.  If nothing much happens when you do a directory
  540. Xlisting, for example, you're probably trying to specify a filename which
  541. Xhas uppercase letters in it...VMS thoughtfully converts everything on the
  542. Xcommand line to lowercase, so even if you type:
  543. X    unzip -v zipfile Makefile
  544. Xwhat you get is:
  545. X    unzip -v zipfile makefile
  546. Xwhich, in my example here, doesn't match the contents of the zipfile.
  547. XThis is relatively easy to circumvent, by enclosing the filespec(s) in 
  548. Xquotes:
  549. X    unzip -tq unzip401 "Makefile" "VMS*" *.c *.h
  550. X[This example also demonstrates the use of wildcards, which act like Unix
  551. Xwildcards, not VMS ones.   In other words, "VMS*" matches files VMSNOTES,
  552. XVMS_MAKE.COM, and VMSSHARE.OPT, whereas the normal VMS behavior would be
  553. Xto match only the first file (since the others have extensions--ordinarily,
  554. Xyou would be required to specify "VMS*.*").]
  555. X
  556. XNote that created files get whatever default permissions you've set, but 
  557. Xcreated directories additionally inherit the (possibly more restrictive) 
  558. Xpermissions of the parent directory.  And, of course, things probably won't 
  559. Xwork too well if you don't have permission to write to whatever directory 
  560. Xinto which you're trying to extract things.  (That made sense; read it 
  561. Xagain if you don't believe me.)
  562. X
  563. XSPECIAL KERMIT NOTES:  Kermit files uploaded with "set file type binary"
  564. Xremain incompatible with UnZip, despite the inclusion of code from Joe
  565. XMeadows' spectacular VMS utility, FILE.  The reason is that the files
  566. Xcreated on the VMS side have "variable length, 510-byte maximum" records,
  567. Xwhich is to say, there's extra junk inside them that shouldn't be there.
  568. XAvoid this problem by uploading with "set file type fixed" and everything
  569. Xshould be hunky-dory.  If you forgot, you can convert the zipfile into
  570. XUnZip-readable form (i.e., "stream-LF" format) with Rahul Dhesi's BILF
  571. Xutility.  A similar utility will be included in future releases of UnZip.
  572. X
  573. XGreg Roelofs,
  574. X often found lurking about Info-ZIP@WSMR-Simtel20.Army.Mil
  575. END_OF_FILE
  576.   if test 4979 -ne `wc -c <'./v41/VMS/VMSnotes'`; then
  577.     echo shar: \"'./v41/VMS/VMSnotes'\" unpacked with wrong size!
  578.   fi
  579.   # end of './v41/VMS/VMSnotes'
  580. fi
  581. if test -f './v41/VMS/vms_attr.c' -a "${1}" != "-c" ; then 
  582.   echo shar: Will not clobber existing file \"'./v41/VMS/vms_attr.c'\"
  583. else
  584.   echo shar: Extracting \"'./v41/VMS/vms_attr.c'\" \(8015 characters\)
  585.   sed "s/^X//" >'./v41/VMS/vms_attr.c' <<'END_OF_FILE'
  586. X/* 
  587. X   [VMS_attr.c, based on] FILE.C, a utility to modify file characteristics.
  588. X   Written by Joe Meadows Jr, at the Fred Hutchinson Cancer Research Center
  589. X   BITNET: JOE@FHCRCVAX
  590. X   PHONE: (206) 467-4970
  591. X   [...and stripped to the bone for unzip usage by Greg Roelofs.]
  592. X   There are no restrictions on this code, you may sell it, include it with
  593. X   any commercial package, or feed it to a whale.. However, I would appreciate
  594. X   it if you kept this comment in the source code so that anyone receiving
  595. X   this code knows who to contact in case of problems. Note that I do not
  596. X   demand this condition..
  597. X */
  598. X#include <descrip.h>
  599. X#include <rms.h>
  600. X#include <stdio.h>
  601. X#include <iodef.h>
  602. X#include <atrdef.h> /* this gets created with the c3.0 compiler */
  603. X#include <fibdef.h> /* this gets created with the c3.0 compiler */
  604. X
  605. X#include "fatdef.h"
  606. X#include "fchdef.h"
  607. X#include "fjndef.h"
  608. X#define RTYPE     fat$r_rtype_overlay.fat$r_rtype_bits
  609. X#define RATTRIB   fat$r_rattrib_overlay.fat$r_rattrib_bits
  610. X
  611. Xextern char  zipfn[];    /* GRR unzip:  name of file to be modified */
  612. Xint  old_rtype;        /* save old zipfile attribute so can restore */
  613. X
  614. X/* save...
  615. Xchar *cvt_time();
  616. Xchar *format_uic();
  617. X */
  618. X
  619. Xint change_zipfile_attributes( restore )   /* GRR unzip:  used to be main() */
  620. X  int restore;
  621. X{
  622. X  static struct FAB Fab;
  623. X  static struct NAM Nam;
  624. X  static struct fibdef Fib; /* short fib */
  625. X  static struct dsc$descriptor FibDesc =
  626. X    {sizeof(Fib),DSC$K_DTYPE_Z,DSC$K_CLASS_S,&Fib};
  627. X  static struct dsc$descriptor_s DevDesc =
  628. X    {0,DSC$K_DTYPE_T,DSC$K_CLASS_S,&Nam.nam$t_dvi[1]};
  629. X  static struct fatdef Fat;
  630. X  static union {
  631. X    struct fchdef fch;
  632. X    long int dummy;
  633. X  } uchar;
  634. X  static struct fjndef jnl;
  635. X  static long int Cdate[2],Rdate[2],Edate[2],Bdate[2];
  636. X  static short int revisions;
  637. X  static unsigned long uic;
  638. X  static union {
  639. X    unsigned short int value;
  640. X    struct {
  641. X      unsigned system : 4;
  642. X      unsigned owner : 4;
  643. X      unsigned group : 4;
  644. X      unsigned world : 4;
  645. X    } bits;
  646. X  } prot;
  647. X  static struct atrdef Atr[] = {
  648. X    {sizeof(Fat),ATR$C_RECATTR,&Fat},        /* record attributes */
  649. X    {sizeof(uchar),ATR$C_UCHAR,&uchar},      /* File characteristics */
  650. X    {sizeof(Cdate),ATR$C_CREDATE,&Cdate[0]}, /* Creation date */
  651. X    {sizeof(Rdate),ATR$C_REVDATE,&Rdate[0]}, /* Revision date */
  652. X    {sizeof(Edate),ATR$C_EXPDATE,&Edate[0]}, /* Expiration date */
  653. X    {sizeof(Bdate),ATR$C_BAKDATE,&Bdate[0]}, /* Backup date */
  654. X    {sizeof(revisions),ATR$C_ASCDATES,&revisions}, /* number of revisions */
  655. X    {sizeof(prot),ATR$C_FPRO,&prot},         /* file protection  */
  656. X    {sizeof(uic),ATR$C_UIC,&uic},            /* file owner */
  657. X    {sizeof(jnl),ATR$C_JOURNAL,&jnl},        /* journal flags */
  658. X    {0,0,0}
  659. X  } ;
  660. X  static char EName[NAM$C_MAXRSS];
  661. X  static char RName[NAM$C_MAXRSS];
  662. X  static struct dsc$descriptor_s FileName =
  663. X    {0,DSC$K_DTYPE_T,DSC$K_CLASS_S,0};
  664. X  static struct dsc$descriptor_s string = {0,DSC$K_DTYPE_T,DSC$K_CLASS_S,0};
  665. X  static short int DevChan;
  666. X  static short int iosb[4];
  667. X  static long int i,status;
  668. X/* static char *retval; */
  669. X/*---------------------------------------------------------------------------
  670. X    Initialize attribute blocks, parse filename, resolve any wildcards, and
  671. X    get the file info.
  672. X  ---------------------------------------------------------------------------*/
  673. X    /* initialize RMS structures, we need a NAM to retrieve the FID */
  674. X    Fab = cc$rms_fab;
  675. X    Fab.fab$l_fna = zipfn; /* name of file */
  676. X    Fab.fab$b_fns = strlen(zipfn);
  677. X    Fab.fab$l_nam = &Nam; /* FAB has an associated NAM */
  678. X    Nam = cc$rms_nam;
  679. X    Nam.nam$l_esa = &EName; /* expanded filename */
  680. X    Nam.nam$b_ess = sizeof(EName);
  681. X    Nam.nam$l_rsa = &RName; /* resultant filename */
  682. X    Nam.nam$b_rss = sizeof(RName);
  683. X    /* do $PARSE and $SEARCH here */
  684. X    status = sys$parse(&Fab);
  685. X    if (!(status & 1)) return(status);
  686. X    /* search for the first file.. If none signal error */
  687. X    status = sys$search(&Fab);
  688. X    if (!(status & 1)) return(status);
  689. X
  690. X    while (status & 1) {
  691. X        /* initialize Device name length, note that this points into the NAM
  692. X           to get the device name filled in by the $PARSE, $SEARCH services */
  693. X        DevDesc.dsc$w_length = Nam.nam$t_dvi[0];
  694. X        status = sys$assign(&DevDesc,&DevChan,0,0);
  695. X        if (!(status & 1)) return(status);
  696. X        FileName.dsc$a_pointer = Nam.nam$l_name;
  697. X        FileName.dsc$w_length = Nam.nam$b_name+Nam.nam$b_type+Nam.nam$b_ver;
  698. X        /* Initialize the FIB */
  699. X        for (i=0;i<3;i++)
  700. X            Fib.fib$r_fid_overlay.fib$w_fid[i]=Nam.nam$w_fid[i];
  701. X        for (i=0;i<3;i++)
  702. X            Fib.fib$r_did_overlay.fib$w_did[i]=Nam.nam$w_did[i];
  703. X        /* Use the IO$_ACCESS function to return info about the file */
  704. X        /* Note, used this way, the file is not opened, and the expiration */
  705. X        /* and revision dates are not modified */
  706. X        status = sys$qiow(0,DevChan,IO$_ACCESS,&iosb,0,0,
  707. X                          &FibDesc,&FileName,0,0,&Atr,0);
  708. X        if (!(status & 1)) return(status);
  709. X        status = iosb[0];
  710. X        if (!(status & 1)) return(status);
  711. X
  712. X/* save...
  713. X        if ((Cdate[0]==0) && (Cdate[1]==0))
  714. X            printf("  /NO%s -\n",t_credate);
  715. X        else
  716. X            printf("  /%s=\"%s\" -\n",t_credate,cvt_time(Cdate));
  717. X
  718. X        if ((Rdate[0]==0) && (Rdate[1]==0))
  719. X            printf("  /NO%s",t_revdate);
  720. X        else
  721. X            printf("  /%s=\"%s\"",t_revdate,cvt_time(Rdate));
  722. X */
  723. X
  724. X        if (restore)                /* GRR unzip */
  725. X            Fat.RTYPE.fat$v_rtype = old_rtype;
  726. X        else {
  727. X            old_rtype = Fat.RTYPE.fat$v_rtype;
  728. X            Fat.RTYPE.fat$v_rtype = FAT$C_STREAMLF;   /* Unix I/O loves it */
  729. X        }
  730. X
  731. X/* save...
  732. X        status = cli_present(t_credate);
  733. X        if (status & 1) {
  734. X            status = cli_get_value(t_credate,&retval);
  735. X            bintim(retval,Cdate);
  736. X        }
  737. X        else
  738. X            if ((status == CLI$_NEGATED) || (status == CLI$_LOCNEG)) {
  739. X                Cdate[0]=0;
  740. X                Cdate[1]=0;
  741. X            };
  742. X
  743. X        status = cli_present(t_revdate);
  744. X        if (status & 1) {
  745. X            status = cli_get_value(t_revdate,&retval);
  746. X            bintim(retval,Rdate);
  747. X        }
  748. X        else
  749. X            if ((status == CLI$_NEGATED) || (status == CLI$_LOCNEG)) {
  750. X                Rdate[0]=0;
  751. X                Rdate[1]=0;
  752. X            };
  753. X */
  754. X        /* note, part of the FIB was cleared by earlier QIOW, so reset it */
  755. X        Fib.fib$r_acctl_overlay.fib$l_acctl = FIB$M_NORECORD;
  756. X        for (i=0;i<3;i++)
  757. X            Fib.fib$r_fid_overlay.fib$w_fid[i]=Nam.nam$w_fid[i];
  758. X        for (i=0;i<3;i++)
  759. X            Fib.fib$r_did_overlay.fib$w_did[i]=Nam.nam$w_did[i];
  760. X        /* Use the IO$_MODIFY function to change info about the file */
  761. X        /* Note, used this way, the file is not opened, however this would */
  762. X        /* normally cause the expiration and revision dates to be modified. */
  763. X        /* Using FIB$M_NORECORD prohibits this from happening. */
  764. X        status = sys$qiow(0,DevChan,IO$_MODIFY,&iosb,0,0,
  765. X                          &FibDesc,&FileName,0,0,&Atr,0);
  766. X        if (!(status & 1)) return(status);
  767. X        status = iosb[0];
  768. X        if (!(status & 1)) return(status);
  769. X        status = sys$dassgn(DevChan);
  770. X        if (!(status & 1)) return(status);
  771. X        /* look for next file, if none, no big deal.. */
  772. X        status = sys$search(&Fab);
  773. X    }
  774. X} /* end function change_zipfile_attributes() */
  775. X
  776. X#if 0   /* save for possible later use */ 
  777. X
  778. Xchar *cvt_time(date)
  779. X  long int date[2];
  780. X{
  781. X  static char str[27];
  782. X  static struct dsc$descriptor date_str={26,DSC$K_DTYPE_T,DSC$K_CLASS_S,&str};
  783. X  if ((date[0]==0) && (date[1]==0))
  784. X    return("none");
  785. X  sys$asctim(0,&date_str,date,0);
  786. X  str[26]='\0';
  787. X  return(&str);
  788. X}
  789. Xbintim(time,binval)
  790. X  char *time;
  791. X  long int binval[2];
  792. X{
  793. X  static struct dsc$descriptor date_str={0,DSC$K_DTYPE_T,DSC$K_CLASS_S,0};
  794. X  date_str.dsc$w_length = strlen(time);
  795. X  date_str.dsc$a_pointer = time;
  796. X  sys$bintim(&date_str,binval);
  797. X}
  798. X#endif /* 0 */ 
  799. END_OF_FILE
  800.   if test 8015 -ne `wc -c <'./v41/VMS/vms_attr.c'`; then
  801.     echo shar: \"'./v41/VMS/vms_attr.c'\" unpacked with wrong size!
  802.   fi
  803.   # end of './v41/VMS/vms_attr.c'
  804. fi
  805. if test -f './v41/unreduce.c' -a "${1}" != "-c" ; then 
  806.   echo shar: Will not clobber existing file \"'./v41/unreduce.c'\"
  807. else
  808.   echo shar: Extracting \"'./v41/unreduce.c'\" \(5034 characters\)
  809.   sed "s/^X//" >'./v41/unreduce.c' <<'END_OF_FILE'
  810. X/*---------------------------------------------------------------------------
  811. X
  812. X  unreduce.c
  813. X
  814. X  The Reducing algorithm is actually a combination of two distinct algorithms.
  815. X  The first algorithm compresses repeated byte sequences, and the second al-
  816. X  gorithm takes the compressed stream from the first algorithm and applies a
  817. X  probabilistic compression method.
  818. X
  819. X  ---------------------------------------------------------------------------*/
  820. X
  821. X
  822. X#include "unzip.h"
  823. X
  824. X
  825. X/**************************************/
  826. X/*  UnReduce Defines, Typedefs, etc.  */
  827. X/**************************************/
  828. X
  829. X#define DLE    144
  830. X
  831. Xtypedef byte f_array[64];       /* for followers[256][64] */
  832. X
  833. Xstatic void LoadFollowers __((void));
  834. X
  835. X
  836. X
  837. X/*******************************/
  838. X/*  UnReduce Global Variables  */
  839. X/*******************************/
  840. X
  841. Xf_array *followers = (f_array *) prefix_of;     /* shared work space */
  842. Xbyte Slen[256];
  843. Xint factor;
  844. X
  845. Xint L_table[] =
  846. X{0, 0x7f, 0x3f, 0x1f, 0x0f};
  847. X
  848. Xint D_shift[] =
  849. X{0, 0x07, 0x06, 0x05, 0x04};
  850. Xint D_mask[] =
  851. X{0, 0x01, 0x03, 0x07, 0x0f};
  852. X
  853. Xint B_table[] =
  854. X{8, 1, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 5,
  855. X 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6,
  856. X 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
  857. X 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7,
  858. X 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
  859. X 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
  860. X 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
  861. X 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
  862. X 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
  863. X 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
  864. X 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
  865. X 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
  866. X 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
  867. X 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
  868. X 8, 8, 8, 8};
  869. X
  870. X
  871. X
  872. X
  873. X
  874. X/*************************/
  875. X/*  Function unReduce()  */
  876. X/*************************/
  877. X
  878. Xvoid unReduce()
  879. X /* expand probabilistically reduced data */
  880. X{
  881. X    register int lchar;
  882. X    int nchar;
  883. X    int ExState;
  884. X    int V;
  885. X    int Len;
  886. X
  887. X    factor = lrec.compression_method - 1;
  888. X    ExState = 0;
  889. X    lchar = 0;
  890. X    LoadFollowers();
  891. X
  892. X    while (((outpos + outcnt) < ucsize) && (!zipeof)) {
  893. X        if (Slen[lchar] == 0)
  894. X            READBIT(8, nchar)   /* ; */
  895. X        else {
  896. X            READBIT(1, nchar);
  897. X            if (nchar != 0)
  898. X                READBIT(8, nchar)       /* ; */
  899. X            else {
  900. X                int follower;
  901. X                int bitsneeded = B_table[Slen[lchar]];
  902. X                READBIT(bitsneeded, follower);
  903. X                nchar = followers[lchar][follower];
  904. X            }
  905. X        }
  906. X        /* expand the resulting byte */
  907. X        switch (ExState) {
  908. X
  909. X        case 0:
  910. X            if (nchar != DLE)
  911. X                OUTB(nchar)     /*;*/
  912. X            else
  913. X                ExState = 1;
  914. X            break;
  915. X
  916. X        case 1:
  917. X            if (nchar != 0) {
  918. X                V = nchar;
  919. X                Len = V & L_table[factor];
  920. X                if (Len == L_table[factor])
  921. X                    ExState = 2;
  922. X                else
  923. X                    ExState = 3;
  924. X            } else {
  925. X                OUTB(DLE);
  926. X                ExState = 0;
  927. X            }
  928. X            break;
  929. X
  930. X        case 2:{
  931. X                Len += nchar;
  932. X                ExState = 3;
  933. X            }
  934. X            break;
  935. X
  936. X        case 3:{
  937. X                register int i = Len + 3;
  938. X                int offset = (((V >> D_shift[factor]) &
  939. X                               D_mask[factor]) << 8) + nchar + 1;
  940. X                longint op = (outpos + outcnt) - offset;
  941. X
  942. X                /* special case- before start of file */
  943. X                while ((op < 0L) && (i > 0)) {
  944. X                    OUTB(0);
  945. X                    op++;
  946. X                    i--;
  947. X                }
  948. X
  949. X                /* normal copy of data from output buffer */
  950. X                {
  951. X                    register int ix = (int) (op % OUTBUFSIZ);
  952. X
  953. X                    /* do a block memory copy if possible */
  954. X                    if (((ix + i) < OUTBUFSIZ) &&
  955. X                        ((outcnt + i) < OUTBUFSIZ)) {
  956. X                        memcpy(outptr, &outbuf[ix], i);
  957. X                        outptr += i;
  958. X                        outcnt += i;
  959. X                    }
  960. X                    /* otherwise copy byte by byte */
  961. X                    else
  962. X                        while (i--) {
  963. X                            OUTB(outbuf[ix]);
  964. X                            if (++ix >= OUTBUFSIZ)
  965. X                                ix = 0;
  966. X                        }
  967. X                }
  968. X
  969. X                ExState = 0;
  970. X            }
  971. X            break;
  972. X        }
  973. X
  974. X        /* store character for next iteration */
  975. X        lchar = nchar;
  976. X    }
  977. X}
  978. X
  979. X
  980. X
  981. X
  982. X
  983. X/******************************/
  984. X/*  Function LoadFollowers()  */
  985. X/******************************/
  986. X
  987. Xstatic void LoadFollowers()
  988. X{
  989. X    register int x;
  990. X    register int i;
  991. X
  992. X    for (x = 255; x >= 0; x--) {
  993. X        READBIT(6, Slen[x]);
  994. X        for (i = 0; i < Slen[x]; i++) {
  995. X            READBIT(8, followers[x][i]);
  996. X        }
  997. X    }
  998. X}
  999. END_OF_FILE
  1000.   if test 5034 -ne `wc -c <'./v41/unreduce.c'`; then
  1001.     echo shar: \"'./v41/unreduce.c'\" unpacked with wrong size!
  1002.   fi
  1003.   # end of './v41/unreduce.c'
  1004. fi
  1005. if test -f './v41/unshrink.c' -a "${1}" != "-c" ; then 
  1006.   echo shar: Will not clobber existing file \"'./v41/unshrink.c'\"
  1007. else
  1008.   echo shar: Extracting \"'./v41/unshrink.c'\" \(4365 characters\)
  1009.   sed "s/^X//" >'./v41/unshrink.c' <<'END_OF_FILE'
  1010. X/*---------------------------------------------------------------------------
  1011. X
  1012. X  unshrink.c
  1013. X
  1014. X  Shrinking is a Dynamic Lempel-Ziv-Welch compression algorithm with partial
  1015. X  clearing.
  1016. X
  1017. X  ---------------------------------------------------------------------------*/
  1018. X
  1019. X
  1020. X#include "unzip.h"
  1021. X
  1022. X
  1023. X/*************************************/
  1024. X/*  UnShrink Defines, Globals, etc.  */
  1025. X/*************************************/
  1026. X
  1027. X/*      MAX_BITS        13   (in unzip.h; defines size of global work area)  */
  1028. X#define INIT_BITS       9
  1029. X#define FIRST_ENT       257
  1030. X#define CLEAR           256
  1031. X#define GetCode(dest)   READBIT(codesize,dest)
  1032. X
  1033. Xstatic void partial_clear __((void));   /* local prototype */
  1034. X
  1035. Xint codesize, maxcode, maxcodemax, free_ent;
  1036. X
  1037. X
  1038. X
  1039. X
  1040. X/*************************/
  1041. X/*  Function unShrink()  */
  1042. X/*************************/
  1043. X
  1044. Xvoid unShrink()
  1045. X{
  1046. X    register int code;
  1047. X    register int stackp;
  1048. X    int finchar;
  1049. X    int oldcode;
  1050. X    int incode;
  1051. X
  1052. X
  1053. X    /* decompress the file */
  1054. X    codesize = INIT_BITS;
  1055. X    maxcode = (1 << codesize) - 1;
  1056. X    maxcodemax = HSIZE;         /* (1 << MAX_BITS) */
  1057. X    free_ent = FIRST_ENT;
  1058. X
  1059. X    for (code = maxcodemax; code > 255; code--)
  1060. X        prefix_of[code] = -1;
  1061. X
  1062. X    for (code = 255; code >= 0; code--) {
  1063. X        prefix_of[code] = 0;
  1064. X        suffix_of[code] = code;
  1065. X    }
  1066. X
  1067. X    GetCode(oldcode);
  1068. X    if (zipeof)
  1069. X        return;
  1070. X    finchar = oldcode;
  1071. X
  1072. X    OUTB(finchar);
  1073. X
  1074. X    stackp = HSIZE;
  1075. X
  1076. X    while (!zipeof) {
  1077. X        GetCode(code);
  1078. X        if (zipeof)
  1079. X            return;
  1080. X
  1081. X        while (code == CLEAR) {
  1082. X            GetCode(code);
  1083. X            switch (code) {
  1084. X
  1085. X            case 1:{
  1086. X                    codesize++;
  1087. X                    if (codesize == MAX_BITS)
  1088. X                        maxcode = maxcodemax;
  1089. X                    else
  1090. X                        maxcode = (1 << codesize) - 1;
  1091. X                }
  1092. X                break;
  1093. X
  1094. X            case 2:
  1095. X                partial_clear();
  1096. X                break;
  1097. X            }
  1098. X
  1099. X            GetCode(code);
  1100. X            if (zipeof)
  1101. X                return;
  1102. X        }
  1103. X
  1104. X
  1105. X        /* special case for KwKwK string */
  1106. X        incode = code;
  1107. X        if (prefix_of[code] == -1) {
  1108. X            stack[--stackp] = finchar;
  1109. X            code = oldcode;
  1110. X        }
  1111. X        /* generate output characters in reverse order */
  1112. X        while (code >= FIRST_ENT) {
  1113. X            if (prefix_of[code] == -1) {
  1114. X                stack[--stackp] = finchar;
  1115. X                code = oldcode;
  1116. X            } else {
  1117. X                stack[--stackp] = suffix_of[code];
  1118. X                code = prefix_of[code];
  1119. X            }
  1120. X        }
  1121. X
  1122. X        finchar = suffix_of[code];
  1123. X        stack[--stackp] = finchar;
  1124. X
  1125. X
  1126. X        /* and put them out in forward order, block copy */
  1127. X        if ((HSIZE - stackp + outcnt) < OUTBUFSIZ) {
  1128. X            memcpy(outptr, &stack[stackp], HSIZE - stackp);
  1129. X            outptr += HSIZE - stackp;
  1130. X            outcnt += HSIZE - stackp;
  1131. X            stackp = HSIZE;
  1132. X        }
  1133. X        /* output byte by byte if we can't go by blocks */
  1134. X        else
  1135. X            while (stackp < HSIZE)
  1136. X                OUTB(stack[stackp++]);
  1137. X
  1138. X
  1139. X        /* generate new entry */
  1140. X        code = free_ent;
  1141. X        if (code < maxcodemax) {
  1142. X            prefix_of[code] = oldcode;
  1143. X            suffix_of[code] = finchar;
  1144. X
  1145. X            do
  1146. X                code++;
  1147. X            while ((code < maxcodemax) && (prefix_of[code] != -1));
  1148. X
  1149. X            free_ent = code;
  1150. X        }
  1151. X        /* remember previous code */
  1152. X        oldcode = incode;
  1153. X    }
  1154. X}
  1155. X
  1156. X
  1157. X/******************************/
  1158. X/*  Function partial_clear()  */
  1159. X/******************************/
  1160. X
  1161. Xstatic void partial_clear()
  1162. X{
  1163. X    register int pr;
  1164. X    register int cd;
  1165. X
  1166. X    /* mark all nodes as potentially unused */
  1167. X    for (cd = FIRST_ENT; cd < free_ent; cd++)
  1168. X        prefix_of[cd] |= 0x8000;
  1169. X
  1170. X    /* unmark those that are used by other nodes */
  1171. X    for (cd = FIRST_ENT; cd < free_ent; cd++) {
  1172. X        pr = prefix_of[cd] & 0x7fff;    /* reference to another node? */
  1173. X        if (pr >= FIRST_ENT)    /* flag node as referenced */
  1174. X            prefix_of[pr] &= 0x7fff;
  1175. X    }
  1176. X
  1177. X    /* clear the ones that are still marked */
  1178. X    for (cd = FIRST_ENT; cd < free_ent; cd++)
  1179. X        if ((prefix_of[cd] & 0x8000) != 0)
  1180. X            prefix_of[cd] = -1;
  1181. X
  1182. X    /* find first cleared node as next free_ent */
  1183. X    cd = FIRST_ENT;
  1184. X    while ((cd < maxcodemax) && (prefix_of[cd] != -1))
  1185. X        cd++;
  1186. X    free_ent = cd;
  1187. X}
  1188. END_OF_FILE
  1189.   if test 4365 -ne `wc -c <'./v41/unshrink.c'`; then
  1190.     echo shar: \"'./v41/unshrink.c'\" unpacked with wrong size!
  1191.   fi
  1192.   # end of './v41/unshrink.c'
  1193. fi
  1194. if test -f './v41/unzip.1' -a "${1}" != "-c" ; then 
  1195.   echo shar: Will not clobber existing file \"'./v41/unzip.1'\"
  1196. else
  1197.   echo shar: Extracting \"'./v41/unzip.1'\" \(2689 characters\)
  1198.   sed "s/^X//" >'./v41/unzip.1' <<'END_OF_FILE'
  1199. X.TH unzip 1 "UNIX UnZip version 4.1"
  1200. X.SH NAME
  1201. Xunzip - list/test/extract from a ZIP archive file
  1202. X.SH SYNOPSIS
  1203. Xunzip [ -xecptlvz[qadoUV] ] file[.zip] [filespec...]
  1204. X.SH ARGUMENTS
  1205. X.in +12
  1206. X.ti -12
  1207. Xfile[.zip]  Path of the ZIP archive.  The suffix ``.zip'' is applied
  1208. Xif the file specified does not exist.  Note that
  1209. Xself-extracting ZIP files are supported; just specify
  1210. Xthe ``.exe'' suffix yourself.
  1211. X.sp 1
  1212. X.ti -12
  1213. X[filespec]  An optional list of archive members to be processed.
  1214. XExpressions may be used to match multiple members; be sure to quote
  1215. Xexpressions that contain characters interpreted by the UNIX shell. See
  1216. XDESCRIPTION (below) for more details.
  1217. X.SH OPTIONS
  1218. X.nf
  1219. X-x,-e  extract files in archive (default--i.e., this flag is optional)
  1220. X-c     extract files to stdout (``CRT'')
  1221. X-p     extract files to stdout and no informational messages (for pipes)
  1222. X-t     test archive contents for validity
  1223. X-l     list archive contents (short format)
  1224. X-v     verbose listing of archive contents
  1225. X-z     display only the archive comment
  1226. X.fi
  1227. X.SH MODIFIERS
  1228. X.nf
  1229. X-q     perform operations quietly (up to two q's allowed)
  1230. X-a     convert to MS-DOS textfile format (CR LF), Mac format (CR),
  1231. X         Unix/VMS format (LF), OR from ASCII to EBCDIC, depending on 
  1232. X         your system
  1233. X-d     recreate directory structure contained in archive
  1234. X-o     OK to overwrite files without prompting
  1235. X-U     don't map filenames to lowercase for selected (uppercase) OS's
  1236. X-V     retain file version numbers
  1237. X.fi
  1238. X.SH DESCRIPTION
  1239. X.B unzip
  1240. Xwill list, test, or extract from a ZIP archive, commonly found on MSDOS
  1241. Xsystems.
  1242. XArchive member extraction is implied by the absence of the -c, -p, -t, 
  1243. X-l, -v or -z options.  All archive members are processed unless a
  1244. X.B filespec
  1245. Xis provided to specify a subset of the archive members.
  1246. XThe
  1247. X.B filespec
  1248. Xis similar to an egrep expression, and may contain:
  1249. X.sp 1
  1250. X.in +8
  1251. X.ti -8
  1252. X*       matches a sequence of 0 or more characters
  1253. X.ti -8
  1254. X?       matches exactly 1 character
  1255. X.ti -8
  1256. X\\nnn    matches the character having octal code nnn
  1257. X.ti -8
  1258. X[...]   matches any single character found inside the brackets; ranges
  1259. Xare specified by a beginning character, a hyphen, and an ending
  1260. Xcharacter.  If a '!' follows the left bracket, then the range
  1261. Xof characters matched is complemented with respect to the ASCII
  1262. Xcharacter set.
  1263. X.SH AUTHORS
  1264. X.nf
  1265. Xv1.2   3/15/89   Samuel H. Smith
  1266. Xv2.x   1989      Many contributors.    
  1267. Xv3.0   5/1/90    David Kirschbaum, consolidator, and the Info-ZIP 
  1268. X                   workgroup (Info-ZIP@WSMR-SIMTEL20.Army.Mil).
  1269. Xv3.1   8/15/90   Same luvable gang.
  1270. Xv4.0   12/1/90   Getting more luvable by the day.
  1271. Xv4.1   5/12/91   We got too luvable, so we toned it down a bit (for Mom).
  1272. X.fi
  1273. END_OF_FILE
  1274.   if test 2689 -ne `wc -c <'./v41/unzip.1'`; then
  1275.     echo shar: \"'./v41/unzip.1'\" unpacked with wrong size!
  1276.   fi
  1277.   # end of './v41/unzip.1'
  1278. fi
  1279. if test -f './v41/unzip.man' -a "${1}" != "-c" ; then 
  1280.   echo shar: Will not clobber existing file \"'./v41/unzip.man'\"
  1281. else
  1282.   echo shar: Extracting \"'./v41/unzip.man'\" \(3250 characters\)
  1283.   sed "s/^X//" >'./v41/unzip.man' <<'END_OF_FILE'
  1284. X
  1285. X
  1286. X
  1287. Xunzip(1)            UNIX Programmer's Manual             unzip(1)
  1288. X
  1289. X
  1290. X
  1291. XNAME
  1292. X     unzip - list/test/extract from a ZIP archive file
  1293. X
  1294. XSYNOPSIS
  1295. X     unzip [ -xecptlvz[qadoUV] ] file[.zip] [filespec...]
  1296. X
  1297. XARGUMENTS
  1298. X     file[.zip]  Path of the ZIP archive.  The suffix ``.zip'' is
  1299. X                 applied if the file specified does not exist.
  1300. X                 Note that self-extracting ZIP files are sup-
  1301. X                 ported; just specify the ``.exe'' suffix your-
  1302. X                 self.
  1303. X
  1304. X     [filespec]  An optional list of archive members to be pro-
  1305. X                 cessed.  Expressions may be used to match multi-
  1306. X                 ple members; be sure to quote expressions that
  1307. X                 contain characters interpreted by the UNIX
  1308. X                 shell. See DESCRIPTION (below) for more details.
  1309. X
  1310. XOPTIONS
  1311. X     -x,-e  extract files in archive (default--i.e., this flag is optional)
  1312. X     -c     extract files to stdout (``CRT'')
  1313. X     -p     extract files to stdout and no informational messages (for pipes)
  1314. X     -t     test archive contents for validity
  1315. X     -l     list archive contents (short format)
  1316. X     -v     verbose listing of archive contents
  1317. X     -z     display only the archive comment
  1318. X
  1319. XMODIFIERS
  1320. X     -q     perform operations quietly (up to two q's allowed)
  1321. X     -a     convert to MS-DOS textfile format (CR LF), Mac format (CR),
  1322. X              Unix/VMS format (LF), OR from ASCII to EBCDIC, depending on
  1323. X              your system
  1324. X     -d     recreate directory structure contained in archive
  1325. X     -o     OK to overwrite files without prompting
  1326. X     -U     don't map filenames to lowercase for selected (uppercase) OS's
  1327. X     -V     retain file version numbers
  1328. X
  1329. XDESCRIPTION
  1330. X     unzip will list, test, or extract from a ZIP archive, com-
  1331. X     monly found on MSDOS systems.  Archive member extraction is
  1332. X     implied by the absence of the -c, -p, -t, -l, -v or -z
  1333. X     options.  All archive members are processed unless a
  1334. X     filespec is provided to specify a subset of the archive
  1335. X     members.  The filespec is similar to an egrep expression,
  1336. X     and may contain:
  1337. X
  1338. X     *       matches a sequence of 0 or more characters
  1339. X     ?       matches exactly 1 character
  1340. X     \nnn    matches the character having octal code nnn
  1341. X     [...]   matches any single character found inside the brack-
  1342. X             ets; ranges are specified by a beginning character,
  1343. X
  1344. X
  1345. X
  1346. XPrinted 5/13/91      UNIX UnZip version 4.1                     1
  1347. X
  1348. X
  1349. X
  1350. X
  1351. X
  1352. X
  1353. Xunzip(1)            UNIX Programmer's Manual             unzip(1)
  1354. X
  1355. X
  1356. X
  1357. X             a hyphen, and an ending character.  If a '!' follows
  1358. X             the left bracket, then the range of characters
  1359. X             matched is complemented with respect to the ASCII
  1360. X             character set.
  1361. X
  1362. XAUTHORS
  1363. X     v1.2   3/15/89   Samuel H. Smith
  1364. X     v2.x   1989      Many contributors.
  1365. X     v3.0   5/1/90    David Kirschbaum, consolidator, and the Info-ZIP
  1366. X                        workgroup (Info-ZIP@WSMR-SIMTEL20.Army.Mil).
  1367. X     v3.1   8/15/90   Same luvable gang.
  1368. X     v4.0   12/1/90   Getting more luvable by the day.
  1369. X     v4.1   5/12/91   We got too luvable, so we toned it down a bit (for Mom).
  1370. X
  1371. X
  1372. X
  1373. X
  1374. X
  1375. X
  1376. X
  1377. X
  1378. X
  1379. X
  1380. X
  1381. X
  1382. X
  1383. X
  1384. X
  1385. X
  1386. X
  1387. X
  1388. X
  1389. X
  1390. X
  1391. X
  1392. X
  1393. X
  1394. X
  1395. X
  1396. X
  1397. X
  1398. X
  1399. X
  1400. X
  1401. X
  1402. X
  1403. X
  1404. X
  1405. X
  1406. X
  1407. X
  1408. X
  1409. X
  1410. X
  1411. X
  1412. XPrinted 5/13/91      UNIX UnZip version 4.1                     2
  1413. X
  1414. X
  1415. X
  1416. END_OF_FILE
  1417.   if test 3250 -ne `wc -c <'./v41/unzip.man'`; then
  1418.     echo shar: \"'./v41/unzip.man'\" unpacked with wrong size!
  1419.   fi
  1420.   # end of './v41/unzip.man'
  1421. fi
  1422. if test -f './v41/ziprules.txt' -a "${1}" != "-c" ; then 
  1423.   echo shar: Will not clobber existing file \"'./v41/ziprules.txt'\"
  1424. else
  1425.   echo shar: Extracting \"'./v41/ziprules.txt'\" \(5218 characters\)
  1426.   sed "s/^X//" >'./v41/ziprules.txt' <<'END_OF_FILE'
  1427. XSubject: Info-ZIP Rules (No Feelthy ...)
  1428. X
  1429. XIn discussions with Mark Adler (and others), I realized we in the Info-ZIP
  1430. Xcommunity have been evolving a set of rules that maybe oughtta be
  1431. Xdocumented, archived, and available to potential contributors.
  1432. X
  1433. XThe following appear to meet our requirements.  Please observe these
  1434. Xrules when submitting source, context diff, or other files to Info-ZIP.
  1435. X
  1436. X
  1437. X1 - "NO FEELTHY TABS"
  1438. X
  1439. X    Many editors and EMail systems either have no capability to use and/or
  1440. Xdisplay the Ascii 9 TAB character correctly, or there are variable tab
  1441. Xcolumns, or other horrors.  (My MaxEMail offline email editor for one.)
  1442. X
  1443. X    Bottom line:  use spaces, not tabs.
  1444. X
  1445. X    Related utility programs:  Unix and MS-DOS :  expand, unexpand.
  1446. XMS-DOS: Buerg's TABS; Toad Hall's TOADSOFT.  And some editors have the
  1447. Xconversion built-in.
  1448. X
  1449. X    Exceptions:  The Unix Makefile.  Some makes seem to require "real"
  1450. Xtabs.  If they need it there, fine.  So don't fiddle the Makefile.
  1451. X
  1452. X
  1453. X2 - "NO FEELTHY CRS"
  1454. X
  1455. X    All source, documentation and other text files shall have Unix style
  1456. Xline endings (LF, Ctrl-J), NOT the MS-DOS CR/LF or Mac CR line endings.
  1457. X
  1458. X    Reason:  "Real programmers" in any environment can convert back and
  1459. Xforth between Unix and DOS/Mac style.  MS-DOS Turbo C can use Unix or
  1460. XMS-DOS line endings (donno about Mac Turbo C).  Buerg's LIST file display
  1461. Xutility for MS-DOS can use Unix or MS-DOS line endings.  Unix utilities
  1462. Xlike diff and patch die a horrible death (or produce horrible output) if
  1463. Xtarget files have CRs.
  1464. X
  1465. X    Related utilities:  flip for Unix and MS-DOS.
  1466. X
  1467. X    Exceptions:  The zip archive README and zip.doc files, which Mark
  1468. XAdler wants to leave in MSDOS for "unsophisticated" (read brain-dead) DOS
  1469. Xusers.  Also the batch files to compile under MS-DOS (where it requires
  1470. Xthe CRs.)
  1471. X
  1472. X
  1473. X3 - "NO FEELTHY HEX"
  1474. X
  1475. X    We'll use uuencode/uudecode compatible converters to move binary files
  1476. Xthrough our 7-bit EMail systems (xxencode on special request).  Uuencoded
  1477. Xfiles, if larger than +/- 32Kb, will be broken into smaller (< 32Kb)
  1478. Xfiles (via David M. Read's UUXFER utility).
  1479. X
  1480. X    Reason:  to prevent sounds of gagging mailers from resounding
  1481. Xthroughout the land.  To be standard with the Uunet side of the world.
  1482. XTo be relatively efficient in the binary->Ascii conversion.  (Yeah, yeah,
  1483. XI know, there's better conversions out there.  But not as widely known.)
  1484. X
  1485. X    Related utilities:  uuencode, uudecode, uuxfer20, quux, others.
  1486. XJust make sure they don't leave imbedded or trailing spaces.  (E.g., they
  1487. Xshould use the "`" character in place of Ascii 32.)  Else mailers are
  1488. Xprone to truncate or whatever.  Message me if you need one.
  1489. X
  1490. X
  1491. X4 - "NO FEELTHY TARS"
  1492. X
  1493. X    unzip will be available in .tar.Z (16-bit compressed tar), .arc (as
  1494. Xavailable on Unix, SIMTEL20, PKPAK, etc., *NOT* the latest proprietary
  1495. XSEA version), or .zip format.  (If requesting we EMail you source,
  1496. Xspecify desired format.)  zip source will only be distributed in .zip
  1497. Xarchives.
  1498. X
  1499. X    Reason:  For unzip development or use, anyone should have one of the
  1500. Xspecified dearchivers.  For zip development or use, you shouldn't be
  1501. Xmessing with zip unless you can already unzip.  (This protects the
  1502. Xinnocent.)
  1503. X
  1504. X    Related utilities:  Unix:  arc, tar, compress, zip, unzip.  MS-DOS:
  1505. XPKUNPAK, PKUNZIP, PAK, TAR, COMPRESS, and others.
  1506. X
  1507. X    Exceptions:  EMail me directly for any special circumstances or
  1508. Xrequirements (zoo, BinHex, 12-bit compress, etc.)
  1509. X
  1510. X
  1511. X5 - "NO FEELTHY FANCY_NAMES"
  1512. X
  1513. X    Assume the worst:  that someone on a brain-damaged DOS system has to
  1514. Xwork with everything your magic fingers produced.  Keep the file names
  1515. Xunimaginative and within MS-DOS limits (e.g., ordinary A..Z, 1..9, "-$_!"
  1516. Xtype characters, in the "filename.typ" 8-dot-3 format).  MacUsers, giggle
  1517. Xall you want, but no spaces.
  1518. X
  1519. X    Reason:  Compatibility with different file systems.  MS-DOS is the
  1520. Xmost limited.
  1521. X
  1522. X
  1523. X6 - "NO FEELTHY GRAPHICS"
  1524. X
  1525. X    Do all your editing in a plain-text ASCII editor.  No WordPerfect,
  1526. XWord, WordStar document mode, or other word processor files, thenkyew.
  1527. XNo desktop publishing.  No TIFFs, no GIFs, no imbedded pictures or dancing
  1528. Xladies (too bad, Cave Newt).
  1529. X
  1530. X    Reason:  Compatibility with different consoles.  My old XT clone is
  1531. Xthe most limited!
  1532. X
  1533. X    Related utilities:  vi, ed, EDLIN, Turbo C editor, UED, EASYEDIT, cat
  1534. Xor "COPY CON UNZIP.C"; various word processor -> text conversion utilities.
  1535. X
  1536. X
  1537. X7 - "NO FEELTHY DASHES"
  1538. X
  1539. X    Don't have repeated dashes (starting at the left margin) in any
  1540. Xsource code or patches you try to EMail to me or Info-ZIP.  Instead, be
  1541. Xsure to always prefix them with a space, asterisk, comment, whatever, like
  1542. Xthis:
  1543. X#---------------   or
  1544. X/*--------------   or even
  1545. X ---------------   (just indented)
  1546. X
  1547. X    Reason:  Most "undigestify" utilities (that break down newsletters
  1548. Xinto their separate messages) use that "--------" (starting at the left
  1549. Xmargin) as the symbol that it's hit the end of a message.  I'd rather not
  1550. Xhave your C source file broken up into a dozen separate untitled messages
  1551. Xin my mail system, thank you.  I'll be going through the unzip source Any
  1552. XDay Now and changing anything like that by indenting, prefixing, whatever.
  1553. X
  1554. X
  1555. X*-------------------*
  1556. X
  1557. XDavid Kirschbaum
  1558. XInfo-ZIP Coordinator
  1559. END_OF_FILE
  1560.   if test 5218 -ne `wc -c <'./v41/ziprules.txt'`; then
  1561.     echo shar: \"'./v41/ziprules.txt'\" unpacked with wrong size!
  1562.   fi
  1563.   # end of './v41/ziprules.txt'
  1564. fi
  1565. echo shar: End of archive 5 \(of 6\).
  1566. cp /dev/null ark5isdone
  1567. MISSING=""
  1568. for I in 1 2 3 4 5 6 ; do
  1569.     if test ! -f ark${I}isdone ; then
  1570.     MISSING="${MISSING} ${I}"
  1571.     fi
  1572. done
  1573. if test "${MISSING}" = "" ; then
  1574.     echo You have unpacked all 6 archives.
  1575.     rm -f ark[1-9]isdone
  1576. else
  1577.     echo You still must unpack the following archives:
  1578.     echo "        " ${MISSING}
  1579. fi
  1580. exit 0
  1581. exit 0 # Just in case...
  1582. -- 
  1583. Kent Landfield                   INTERNET: kent@sparky.IMD.Sterling.COM
  1584. Sterling Software, IMD           UUCP:     uunet!sparky!kent
  1585. Phone:    (402) 291-8300         FAX:      (402) 291-4362
  1586. Please send comp.sources.misc-related mail to kent@uunet.uu.net.
  1587.