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

  1. From: zip-bugs@wkuvx1.wku.edu (Info-ZIP group)
  2. Newsgroups: comp.sources.misc
  3. Subject: v44i083:  unzip - Info-ZIP portable UnZip, version 5.12, Part18/20
  4. Date: 18 Sep 1994 23:17:01 -0500
  5. Organization: Sterling Software
  6. Sender: kent@sparky.sterling.com
  7. Approved: kent@sparky.sterling.com
  8. Message-ID: <35j3bt$qro@sparky.sterling.com>
  9. X-Md4-Signature: 1aee4ead345db0e5b7a110a0cfc34bbd
  10.  
  11. Submitted-by: zip-bugs@wkuvx1.wku.edu (Info-ZIP group)
  12. Posting-number: Volume 44, Issue 83
  13. Archive-name: unzip/part18
  14. Environment: UNIX, VMS, OS/2, MS-DOS, MACINTOSH, WIN-NT, LINUX, MINIX, COHERENT, AMIGA?, ATARI TOS, SGI, DEC, Cray, Convex, Amdahl, Sun
  15. Supersedes: unzip50: Volume 31, Issue 104-117
  16.  
  17. #! /bin/sh
  18. # This is a shell archive.  Remove anything before this line, then feed it
  19. # into a shell via "sh file" or similar.  To overwrite existing files,
  20. # type "sh file -c".
  21. # Contents:  unzip-5.12/BUGS unzip-5.12/History.512
  22. #   unzip-5.12/amiga/SMakeFile unzip-5.12/envargs.c
  23. #   unzip-5.12/os2/unzip16.def unzip-5.12/tables.h
  24. #   unzip-5.12/tops20/tops20.c unzip-5.12/unix/funzip.1
  25. #   unzip-5.12/unreduce.c unzip-5.12/vms/README
  26. #   unzip-5.12/vms/cvthelp.tpu unzip-5.12/vms/descrip.mms
  27. #   unzip-5.12/vms/unzip_def.rnh
  28. # Wrapped by kent@sparky on Sat Sep 17 23:33:48 1994
  29. PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin:$PATH ; export PATH
  30. echo If this archive is complete, you will see the following message:
  31. echo '          "shar: End of archive 18 (of 20)."'
  32. if test -f 'unzip-5.12/BUGS' -a "${1}" != "-c" ; then 
  33.   echo shar: Will not clobber existing file \"'unzip-5.12/BUGS'\"
  34. else
  35.   echo shar: Extracting \"'unzip-5.12/BUGS'\" \(4786 characters\)
  36.   sed "s/^X//" >'unzip-5.12/BUGS' <<'END_OF_FILE'
  37. XBogus bugs (not our fault!):
  38. X---------------------------
  39. X
  40. X By far THE BIGGEST source of bug reports to Info-ZIP/zip-bugs is the
  41. X incorrect transfer of zipfiles (or of the UnZip executable itself).
  42. X ALWAYS TRANSFER IN BINARY MODE!  This includes ftp transfers and *both*
  43. X ends of a Kermit connection ("set file type binary").  If your copy
  44. X isn't exactly the same size as the original, you made a mistake.
  45. X
  46. X Another common source of errors such as "compression method 8 not sup-
  47. X ported" is the existence of an old version of UnZip somewhere in your
  48. X path.  Make sure you're using the version you think you're using; give
  49. X the full path explicitly if necessary.  Executing "unzip" without any
  50. X options will print a help screen, at the top of which is the UnZip
  51. X version number and release date; and executing "unzip -v" without any
  52. X zipfile or other options will give information about what compiler was
  53. X used, the target operating system, any special UnZip options, and the 
  54. X date of compilation--only for version 5.11 and later, though!  (Also,
  55. X under Unix C shell and some Bourne shells, "which unzip" will print 
  56. X the path of the unzip you're actually using.  Under OS/2 and MS-DOS,
  57. X whch21gr.zip [on SimTel mirror sites] will do the same thing; in addi-
  58. X tion, "which -a unzip" will show *all* copies of unzip in your path.)
  59. X
  60. X
  61. XBugs (real and/or imagined):
  62. X---------------------------
  63. X
  64. X - MKS Korn shell:  unzip assumes the MKS-style command-line environment
  65. X    options are relevant to it, but this is not the case if unzip was called
  66. X    by another program (e.g., from a .BAT file).  A fix for this exists for
  67. X    Borland compilers but not for MSC, Watcom, djgpp, etc.
  68. X - OS/2:  for paths with one long component, the .LONGNAME EA may be saved for
  69. X    all components (waste of disk space):  how to check??
  70. X - VMS:  for extracting to other directories, only the VMS-style "-d [.foo]"
  71. X    format is accepted; "-d foo" should also be allowed.  Long filenames are
  72. X    not automatically truncated to 39.39.  Even with -o specified, the user
  73. X    is queried before overwriting; without -o, there are two levels of query.
  74. X - Novell Netware:  Netware drives may clear the archive bit on extracted
  75. X    files under OS/2 and/or MS-DOS.  UnZip always *tries* to set the archive
  76. X    bit, however.  [pynq@uchicago, 940527]
  77. X - DEC Ultrix:  on long zipfiles, unzip will sometimes fail (bad CRC, not always
  78. X    reproducible); this is apparently due either to a hardware bug (cache mem)
  79. X    or OS bug (page faults?) [Igor, Jean-loup, bottom of BUGS.long]
  80. X - Pyramid:  USE_FWRITE causes CRC errors (???) [Kevin]
  81. X - funzip/more/decryption/no-echo bug:  race condition(?) causes terminal to
  82. X    be "reset" to no-echo state
  83. X - directory dates/times (special Unix perms?) not restored
  84. X - Macintosh (100200), Atari (020000) external file attributes not interpreted
  85. X    correctly (both unzip and zipinfo)
  86. X - pkbug error:  zipfile with incorrect csize and/or ucsize--check for end of
  87. X    compressed (csize) data in uncompression routines:
  88. X      unreduce.c:    while (((outpos + outcnt) < ucsize) && (!zipeof)) {
  89. X    [James Birdsall, Mark, bottom of BUGS.long]
  90. X - OS/2:  directory EAs not restored if directory exists [Kai Uwe, KG27515@uark]
  91. X    (subsequent note:  no way to determine which EAs are newer ==> cannot 
  92. X    restore without user input)
  93. X - MS-DOS:  Borland executables don't allow other than 80-column, 25/43/50-line
  94. X    screen modes (Borland bug) [Michael Stillwell]
  95. X
  96. X
  97. XFeatures (possible and/or definite):
  98. X-----------------------------------
  99. X
  100. X - put man pages in more "proper" nroff format
  101. X - ignore case for internal filename match on non-Unix systems, unless file-
  102. X    specs enclosed in single quotes
  103. X - save/extract Unix mtime/ctime/atime/UID/GID info (Unix extra field)
  104. X - modify to decompress input stream if part of a pipe, but continue using
  105. X    central directory if not (BIG job!)--extended local header capability
  106. X - add zipinfo option(s) to sort alphabetically, by date/time, in reverse, etc.
  107. X - add "near" to global vars [Steve Salisbury, 92.4.21]
  108. X - modify set_file_time routines to share common code (macro?)
  109. X - when listing filenames, use '?' for non-printables? [Thomas Wolff, 92.6.1]
  110. X - add zipinfo "in-depth" option? (check local vs. central filenames, etc.)
  111. X - create zipcat program to concatenate zipfiles
  112. X - assembly-language routines?
  113. X - VM/CMS version (Walter Moore, Phil Howard, Chua Kong Sian, others)
  114. X - add -oo option (overwrite and override)?  no user queries (if bad password,
  115. X    skip file; if disk full, take default action; if VMS special on non-VMS,
  116. X    unpack anyway; etc.)
  117. X - add -Q[Q[Q]] option (quiet mode on comments, cautions, warnings and errors)?
  118. X    forget -oo, or make synonym?  Default level -Q?
  119. X - add OS/2 .INF format helpfiles for UnZip and ZipInfo?
  120. END_OF_FILE
  121.   if test 4786 -ne `wc -c <'unzip-5.12/BUGS'`; then
  122.     echo shar: \"'unzip-5.12/BUGS'\" unpacked with wrong size!
  123.   fi
  124.   # end of 'unzip-5.12/BUGS'
  125. fi
  126. if test -f 'unzip-5.12/History.512' -a "${1}" != "-c" ; then 
  127.   echo shar: Will not clobber existing file \"'unzip-5.12/History.512'\"
  128. else
  129.   echo shar: Extracting \"'unzip-5.12/History.512'\" \(4654 characters\)
  130.   sed "s/^X//" >'unzip-5.12/History.512' <<'END_OF_FILE'
  131. XUnZip, version 5.12, 28 August 1994
  132. X
  133. XNew features, you betcha:
  134. X
  135. X5.12a:
  136. X - added zipinfo patch for empty space within zipfile (Novell/PKZIP bug); moved
  137. X    newzip variable out of crypt.[ch] [CN]
  138. X - MS-DOS, OS/2:  added EMX, EMXOPT, GO32 and GO32TMP environment-variable info
  139. X    to unzip -v output [CN]
  140. X - OS/2:  replaced watcom.dif with wat_met.dif (support for Metaware C++ as
  141. X    well as 16/32-bit Watcom) [Kai Uwe]
  142. X5.12b:
  143. X - added another acknowledgment example to COPYING [CN]
  144. X - VMS:  modified VMSWILD to use () instead of [] for sets; had been disallowed
  145. X    entirely [Charles Bailey, CN]
  146. X - VMS:  added .hlp file for unzipsfx and MAKESFX.COM script [Martin Zinser]
  147. X5.12c:
  148. X - MS-DOS:  updated README with djgpp 1.12 and QEMM 7.04 info [CN, Kevin
  149. X    Fritz]
  150. X - added timezone-debugging code to file_io.c (define DEBUG_TIME) [CN]
  151. X - MS-DOS:  updated gcc_dos Makefile target and README to include notes about
  152. X    GNU make and djgpp timezone bugs [CN]
  153. X - changed "unzip -v" to print only version*100 if -qqqq (or greater) [CN]
  154. X - changed all putc/putchar calls to PUTC macro for future DLL use [CN]
  155. X - Unix, NT:  changed all local printf/fprintf calls to macros; deleted a bunch
  156. X    of OS/2 stuff in nt.c [CN]
  157. X - updated README to note Kevin's finding:  32-bit DOS UnZip *faster* than
  158. X    PKUNZIP on most archives...whoa. [CN, Keven F]
  159. X - added SFX_EXDIR option to allow use of -d in UnZipSFX [CN]
  160. X5.12d:
  161. X - Mac:  updated version numbers in *.hqx files [Antoine]
  162. X - MS-DOS:  added _gcc_dos_new sub-target to unix/Makefile, to be used when
  163. X    djgpp 1.12m1 is released (new coff2exe -g option) [CN]
  164. X - added AOL info to Where file [Audrey Beck, CN]
  165. X - removed obsolete DEBUG_STRUC code [CN]
  166. X - added regulus target and zstat() function [Paul Klahr, CN]
  167. X - updated docs, version numbers for release [CN]
  168. X - VMS:  last(!) Ident and clean: tweaks [Igor, Christian, Hunter]
  169. X5.12e:
  170. X - Unix:  changed "strip" to "$(STRIP)" for easier debugging [Marty Leisner]
  171. X - MS-DOS:  updated msdos/README with djgpp 1.12m1 timezone fixes info [CN]
  172. X
  173. XBugs fixed:
  174. X
  175. X5.12a:
  176. X - ifdef'd two unused string variables in non-crypt extract.c [CN]
  177. X - put newzip back into crypt.h:  CRYPT not yet defined in unzip.h [CN]
  178. X - fixed unzipsfx bug:  first filespec ignored [Paul Weiss, CN]
  179. X - updated unzipsfx man page to note problem with "foo -x *.c" [CN, Paul Weiss]
  180. X5.12b:
  181. X - VMS:  updated Where file entry for VMS ftp sites [Brian Tillman, Hunter]
  182. X - updated README.CR and INSTALL to note that zipcloak is for zip sources only
  183. X    [CN, Richard Lloyd]
  184. X - fixed -d bug w.r.t. extraction to / (all but VMS, TOPS-20) [CN, Piet]
  185. X - Amiga, Mac, etc.:  fixed non-OLD_EXDIR bug [CN]
  186. X - OS/2, MS-DOS:  removed left-over EMX,EMXOPT notes [CN]
  187. X - VMS:  fixed VMS_SEVERITY return values [Charles Bailey]
  188. X - VMS:  fixed(?) MAKE.COM to check for DEC C and use VAXC option [CN, Hunter]
  189. X5.12c:
  190. X - VMS:  fixed various descrip.mms bugs [Christian Spieler]
  191. X - MS-DOS:  added LOCAL_UNZIP support to makefile.msc and makefile.bc;
  192. X    fixed MED_MEM typo in unzip.h [Christian]
  193. X - moved extern declaration of CompiledWith[] from unzip.h into local files
  194. X    (avoid VMS warnings) [CN, Christian]
  195. X - fixed one overlooked fprintf/FPRINTF macro in unzip.h [CN]
  196. X - VMS:  fixed /DIRECTORY bug; fixed __DEBUG__ stuff in descrip.mms [Igor]
  197. X - VMS:  tweaked RETURN_SEVERITY levels some more [CN, Christian, Igor, Rodney]
  198. X - documented -b option in unzip.1 and UnZipSFX usage line [CN]
  199. X - fixed a bunch of broken Trace() statements in extract.c [Christian]
  200. X5.12c2:
  201. X - VMS:  real fix for do_wild() bug [Christian]
  202. X5.12d:
  203. X - swapped two PUTC's for a PRINTF in zipinfo.c [CN]
  204. X - VMS:  removed incorrect Where file info [Hunter]
  205. X - VMS:  fixed do_wild() and descrip.mms again [Christian, CN]
  206. X - MS-DOS:  updated INSTALL and Makefile to note problems with long command
  207. X    lines and LOCAL_UNZIP [Piet, CN]
  208. X - VMS:  fixed make.com [Rodney, Hunter, CN, Christian]
  209. X - VMS:  fixed cmdline.c double usage() bug with unzipsfx, VMSCLI [Rodney, CN]
  210. X - VMS:  added lots of typecasts and fixed some initializers for DEC C; added
  211. X    a newline to an inflate.c debug line [Christian]
  212. X - MS-DOS:  improved gcc_dos target's creation of empty zipinfo file via FIND
  213. X    instead of COPY [Jean-loup, Kai Uwe]
  214. X - added some more typecasts [CN, Kai Uwe]
  215. X5.12e:
  216. X - fixed explode.c comment (long-lost patch from Feb 93, blush...) [Mark]
  217. X - VMS:  fixed makefiles for unzipsfx+VMSCLI [CN, Hunter]
  218. X
  219. X==================
  220. X
  221. XThese changes occurred in beta versions 5.12a to 5.12e.  This list may have 
  222. Xleft out some bugfixes and even some features...the brain cell is going, 
  223. Xfolks (as Mark would say).  Apologies, etc.
  224. X
  225. XGreg Roelofs (a.k.a. Cave Newt)
  226. END_OF_FILE
  227.   if test 4654 -ne `wc -c <'unzip-5.12/History.512'`; then
  228.     echo shar: \"'unzip-5.12/History.512'\" unpacked with wrong size!
  229.   fi
  230.   # end of 'unzip-5.12/History.512'
  231. fi
  232. if test -f 'unzip-5.12/amiga/SMakeFile' -a "${1}" != "-c" ; then 
  233.   echo shar: Will not clobber existing file \"'unzip-5.12/amiga/SMakeFile'\"
  234. else
  235.   echo shar: Extracting \"'unzip-5.12/amiga/SMakeFile'\" \(4286 characters\)
  236.   sed "s/^X//" >'unzip-5.12/amiga/SMakeFile' <<'END_OF_FILE'
  237. X#===========================================================================
  238. X# Makefile for UnZip, ZipInfo & fUnZip:  AMIGA SAS/C Version 6.x
  239. X# Version:  5.11                                                 9 July 1993
  240. X#===========================================================================
  241. X# John Bush <john.bush@east.sun.com>               last modified:  10 Jul 94
  242. X#---------------------------------------------------------------------------
  243. X
  244. X#####################
  245. X# MACRO DEFINITIONS #
  246. X#####################
  247. X
  248. X# Compiler and loader debug flags.  Uncomment as needed.  Recomment when done.
  249. X# 
  250. X# CDBG = DEBUG=L DEF=DEBUG
  251. X# LDBG = ADDSYM
  252. X# LMAP = MAP AMIGA/UNZIP.MAP
  253. X
  254. X# Compiler definitions
  255. X#
  256. XCC = sc
  257. X#
  258. XOPT = OPT OPTINL OPTINLOCAL OPTTIME OPTCOMP=5 OPTDEP=5 OPTRDEP=5
  259. X#
  260. X# Choose one DATAOPTS & SASLIB.  NOTE!  only DATA=FAR is known to work!
  261. X#
  262. XDATAOPTS = DATA=FAR         # link with SCNB.lib
  263. XSASLIB = scnb
  264. X# DATAOPTS = DATA=FAR SINT  # link with SCSNB.lib  [not working yet!]
  265. X# SASLIB = scsnb
  266. X# DATAOPTS = DATA=NEAR      # link with SC.lib
  267. X# SASLIB = sc
  268. X#
  269. XCDEFINES = DEF=AMIGA DEF=PROTO
  270. XCOPTIONS = $(DATAOPTS) NOSTKCHK STRMERGE CPU=ANY CODE=NEAR NMINC UNSCHAR
  271. XCOPTIONS = $(COPTIONS) ERRORREXX NOERRORCONSOLE NOICONS
  272. X#
  273. XCFLAGS = $(CDEFINES) $(COPTIONS) $(CDBG) $(OPT)
  274. X
  275. X# Linker definitions
  276. X#  See SASLIB definition above
  277. X#
  278. XLD = slink
  279. XLDFLAGS =  FROM LIB:c.o
  280. XLDFLAGS2 = NOICONS $(LDBG) $(LMAP)
  281. XLIBFLAGS = LIB LIB:$(SASLIB).lib+LIB:amiga.lib
  282. X
  283. X# UnZip Objects
  284. X#
  285. XOBJS1 = unzip.o crypt.o envargs.o explode.o extract.o file_io.o
  286. XOBJS2 = inflate.o match.o unreduce.o unshrink.o zipinfo.o
  287. XOBJSA = amiga.o
  288. XOBJS  = $(OBJS1) $(OBJS2) $(OBJSA)
  289. XLOBJS = $(OBJS)
  290. X
  291. X# UnZipSFX Objects
  292. XOBJX = unzip_x.o crypt.o extract_x.o file_io.o inflate.o match.o amiga_x.o
  293. X
  294. X# fUnZip Objects
  295. XOBJF = funzip.o crypt_f.o inflate_f.o
  296. X
  297. X# Output targets
  298. XUNZIPS = unzip unzipsfx funzip
  299. X
  300. X# Temp filename for object lists to load using linker "WITH" command.
  301. XOBJLIST = ram:OBJLIST.TMP
  302. X
  303. X#######################################
  304. X# DEFAULT TARGET AND PROCESSING RULES #
  305. X#######################################
  306. X
  307. Xall: $(UNZIPS)
  308. X
  309. X.c.o :
  310. X        $(CC) $(CFLAGS) OBJNAME=$@ $*.c
  311. X
  312. X
  313. X#########################
  314. X# Final output targets. #
  315. X#########################
  316. X
  317. X# NOTE:  When generating MAP files, don't make "all" because only the last 
  318. X#        map generated will be the one that remains after this is finished.
  319. X#        Or, put specific MAP statements in below for each.  
  320. X
  321. Xunzip:    $(OBJS)
  322. X          echo "$(OBJS)" >$(OBJLIST)
  323. X          $(LD) TO UnZip $(LDFLAGS) WITH $(OBJLIST) $(LIBFLAGS) $(LDFLAGS2)
  324. X
  325. Xunzipsfx: $(OBJX)
  326. X          echo "$(OBJX)" >$(OBJLIST)
  327. X          $(LD) TO UnZipSFX $(LDFLAGS) WITH $(OBJLIST) $(LIBFLAGS) $(LDFLAGS2)
  328. X
  329. Xfunzip:   $(OBJF)
  330. X          echo "$(OBJF)" >$(OBJLIST)
  331. X          $(LD) TO fUnZip $(LDFLAGS) WITH $(OBJLIST) $(LIBFLAGS) $(LDFLAGS2)
  332. X
  333. Xclean:
  334. X        -delete >nil: $(OBJS1)
  335. X        -delete >nil: $(OBJS2)
  336. X        -delete >nil: $(OBJSA)
  337. X        -delete >nil: $(OBJF)
  338. X
  339. Xspotless: clean
  340. X        -delete >nil: UnZip UnZipSFX fUnZip
  341. X
  342. X# special rules for objects used in UnZipSFX and fUnZip
  343. X#
  344. Xunzip_x.o:     unzip.c unzip.h version.h
  345. X                $(CC) DEF=SFX $(CFLAGS) OBJNAME=unzip_x.o unzip.c
  346. X
  347. Xextract_x.o:   extract.c unzip.h crypt.h
  348. X                $(CC) DEF=SFX $(CFLAGS) OBJNAME=extract_x.o extract.c
  349. X
  350. Xamiga_x.o:     amiga/amiga.c amiga/amiga.h
  351. X                $(CC) DEF=SFX $(CFLAGS) OBJNAME=amiga_x.o amiga/amiga.c
  352. X
  353. Xcrypt_f.o:     crypt.c unzip.h zip.h crypt.h
  354. X                $(CC) DEF=FUNZIP $(CFLAGS) OBJNAME=crypt_f.o crypt.c
  355. X
  356. Xinflate_f.o:   inflate.c inflate.h unzip.h crypt.h
  357. X                $(CC) DEF=FUNZIP $(CFLAGS) OBJNAME=inflate_f.o inflate.c
  358. X
  359. X# objects common to all revisions/ports:
  360. X#
  361. Xcrypt.o:        crypt.c unzip.h zip.h crypt.h
  362. Xenvargs.o:      envargs.c unzip.h
  363. Xexplode.o:      explode.c unzip.h
  364. Xextract.o:      extract.c unzip.h crypt.h
  365. Xfile_io.o:      file_io.c unzip.h crypt.h tables.h
  366. Xfunzip.o:       funzip.c unzip.h crypt.h tables.h
  367. Xinflate.o:      inflate.c inflate.h unzip.h
  368. Xmatch.o:        match.c unzip.h
  369. Xshared.o:       shared.c unzip.h
  370. Xunreduce.o:     unreduce.c unzip.h
  371. Xunshrink.o:     unshrink.c unzip.h
  372. Xunzip.o:        unzip.c unzip.h version.h
  373. Xzipinfo.o:      zipinfo.c unzip.h
  374. X
  375. X
  376. X# objects specific to Amiga
  377. Xamiga.o:        amiga/amiga.c amiga/amiga.h
  378. X
  379. END_OF_FILE
  380.   if test 4286 -ne `wc -c <'unzip-5.12/amiga/SMakeFile'`; then
  381.     echo shar: \"'unzip-5.12/amiga/SMakeFile'\" unpacked with wrong size!
  382.   fi
  383.   chmod +x 'unzip-5.12/amiga/SMakeFile'
  384.   # end of 'unzip-5.12/amiga/SMakeFile'
  385. fi
  386. if test -f 'unzip-5.12/envargs.c' -a "${1}" != "-c" ; then 
  387.   echo shar: Will not clobber existing file \"'unzip-5.12/envargs.c'\"
  388. else
  389.   echo shar: Extracting \"'unzip-5.12/envargs.c'\" \(6181 characters\)
  390.   sed "s/^X//" >'unzip-5.12/envargs.c' <<'END_OF_FILE'
  391. X/*----------------------------------------------------------------*
  392. X | envargs - add default options from environment to command line
  393. X |---------------------------------------------------------------- 
  394. X | Author: Bill Davidsen, original 10/13/91, revised 23 Oct 1991.
  395. X | This program is in the public domain.
  396. X |---------------------------------------------------------------- 
  397. X | Minor program notes:
  398. X |  1. Yes, the indirection is a tad complex
  399. X |  2. Parenthesis were added where not needed in some cases
  400. X |     to make the action of the code less obscure.
  401. X |  3. Set tabsize to four to make this pretty
  402. X |---------------------------------------------------------------- 
  403. X | UnZip notes: 24 May 92 ("v1.4"):
  404. X |  1. #include "unzip.h" for prototypes (24 May 92)
  405. X |  2. changed ch to type char (24 May 92)
  406. X |  3. added an ifdef to avoid Borland warnings (24 May 92)
  407. X |  4. included Rich Wales' mksargs() routine (for MS-DOS, maybe
  408. X |     OS/2? NT?) (4 Dec 93)
  409. X |  5. added alternate-variable string envstr2 (21 Apr 94)
  410. X *----------------------------------------------------------------*/
  411. X
  412. X
  413. X#include "unzip.h"
  414. X
  415. Xstatic int count_args __((char *));
  416. Xstatic void mem_err __((void));
  417. X
  418. X#if (defined(SCCS) && !defined(lint))  /* causes warnings:  annoying */
  419. X   static char *SCCSid = "@(#)envargs.c    1.3 23 Oct 1991";
  420. X#endif
  421. X
  422. Xstatic char Far NoMemArguments[] = "envargs:  can't get memory for arguments";
  423. X
  424. X
  425. X
  426. Xvoid envargs(Pargc, Pargv, envstr, envstr2)
  427. X    int *Pargc;
  428. X    char ***Pargv, *envstr, *envstr2;
  429. X{
  430. X    char *getenv();
  431. X    char *envptr;       /* value returned by getenv */
  432. X    char *bufptr;       /* copy of env info */
  433. X    int argc = 0;       /* internal arg count */
  434. X    char ch;            /* spare temp value */
  435. X    char **argv;        /* internal arg vector */
  436. X    char **argvect;     /* copy of vector address */
  437. X
  438. X    /* see if anything in either of valid environment variables */
  439. X    if ((envptr = getenv(envstr)) == (char *)NULL || *envptr == 0)
  440. X        if ((envptr = getenv(envstr2)) == (char *)NULL || *envptr == 0)
  441. X            return;
  442. X
  443. X    /* count the args so we can allocate room for them */
  444. X    argc = count_args(envptr);
  445. X    bufptr = (char *)malloc(1+strlen(envptr));
  446. X    if (bufptr == (char *)NULL)
  447. X        mem_err();
  448. X    strcpy(bufptr, envptr);
  449. X
  450. X    /* allocate a vector large enough for all args */
  451. X    argv = (char **)malloc((argc+*Pargc+1)*sizeof(char *));
  452. X    if (argv == (char **)NULL)
  453. X        mem_err();
  454. X    argvect = argv;
  455. X
  456. X    /* copy the program name first, that's always true */
  457. X    *(argv++) = *((*Pargv)++);
  458. X
  459. X    /* copy the environment args next, may be changed */
  460. X    do {
  461. X        *(argv++) = bufptr;
  462. X        /* skip the arg and any trailing blanks */
  463. X        while (((ch = *bufptr) != '\0') && ch != ' ')
  464. X            ++bufptr;
  465. X        if (ch == ' ')
  466. X            *(bufptr++) = '\0';
  467. X        while (((ch = *bufptr) != '\0') && ch == ' ')
  468. X            ++bufptr;
  469. X    } while (ch);
  470. X
  471. X    /* now save old argc and copy in the old args */
  472. X    argc += *Pargc;
  473. X    while (--(*Pargc))
  474. X        *(argv++) = *((*Pargv)++);
  475. X
  476. X    /* finally, add a NULL after the last arg, like UNIX */
  477. X    *argv = (char *)NULL;
  478. X
  479. X    /* save the values and return */
  480. X    *Pargv = argvect;
  481. X    *Pargc = argc;
  482. X}
  483. X
  484. X
  485. X
  486. Xstatic int count_args(s)
  487. X    char *s;
  488. X{
  489. X    int count = 0;
  490. X    char ch;
  491. X
  492. X    do {
  493. X        /* count and skip args */
  494. X        ++count;
  495. X        while (((ch = *s) != '\0') && ch != ' ')
  496. X            ++s;
  497. X        while (((ch = *s) != '\0') && ch == ' ')
  498. X            ++s;
  499. X    } while (ch);
  500. X
  501. X    return count;
  502. X}
  503. X
  504. X
  505. X
  506. Xstatic void mem_err()
  507. X{
  508. X    perror(LoadFarString(NoMemArguments));
  509. X    exit(2);
  510. X}
  511. X
  512. X
  513. X
  514. X#ifdef TEST
  515. X
  516. Xmain(argc, argv)
  517. X    int argc;
  518. X    char **argv;
  519. X{
  520. X    int i;
  521. X
  522. X    printf("Orig argv: %p\n", argv);
  523. X    dump_args(argc, argv);
  524. X    envargs(&argc, &argv, "ENVTEST");
  525. X    printf(" New argv: %p\n", argv);
  526. X    dump_args(argc, argv);
  527. X}
  528. X
  529. X
  530. X
  531. Xdump_args(argc, argv)
  532. X    int argc;
  533. X    char *argv[];
  534. X{
  535. X    int i;
  536. X
  537. X    printf("\nDump %d args:\n", argc);
  538. X    for (i = 0; i < argc; ++i)
  539. X        printf("%3d %s\n", i, argv[i]);
  540. X}
  541. X
  542. X#endif /* TEST */
  543. X
  544. X
  545. X
  546. X#ifdef MSDOS   /* DOS_OS2?  DOS_NT_OS2? */
  547. X
  548. X/*
  549. X * void mksargs(int *argcp, char ***argvp)
  550. X *
  551. X *    Substitutes the extended command line argument list produced by
  552. X *    the MKS Korn Shell in place of the command line info from DOS.
  553. X *
  554. X *    The MKS shell gets around DOS's 128-byte limit on the length of
  555. X *    a command line by passing the "real" command line in the envi-
  556. X *    ronment.  The "real" arguments are flagged by prepending a tilde
  557. X *    (~) to each one.
  558. X *
  559. X *    This "mksargs" routine creates a new argument list by scanning
  560. X *    the environment from the beginning, looking for strings begin-
  561. X *    ning with a tilde character.  The new list replaces the original
  562. X *    "argv" (pointed to by "argvp"), and the number of arguments
  563. X *    in the new list replaces the original "argc" (pointed to by
  564. X *    "argcp").
  565. X *
  566. X *    Rich Wales
  567. X */
  568. Xvoid mksargs(argcp, argvp)
  569. X    int *argcp;
  570. X    char ***argvp;
  571. X{
  572. X#ifndef MSC /* declared differently in MSC 7.0 headers, at least */
  573. X    extern char **environ;          /* environment */
  574. X#endif
  575. X    char        **envp;             /* pointer into environment */
  576. X    char        **newargv;          /* new argument list */
  577. X    char        **argp;             /* pointer into new arg list */
  578. X    int         newargc;            /* new argument count */
  579. X
  580. X    /* sanity check */
  581. X    if (environ == NULL || argcp == NULL || argvp == NULL || *argvp == NULL)
  582. X        return;
  583. X
  584. X    /* find out how many environment arguments there are */
  585. X    for (envp = environ, newargc = 0; *envp != NULL && (*envp)[0] == '~';
  586. X         envp++, newargc++)
  587. X        ;
  588. X    if (newargc == 0)
  589. X        return;     /* no environment arguments */
  590. X
  591. X    /* set up new argument list */
  592. X    newargv = (char **) malloc(sizeof(char **) * (newargc+1));
  593. X    if (newargv == NULL)
  594. X        return;     /* malloc failed */
  595. X
  596. X    for (argp = newargv, envp = environ; *envp != NULL && (*envp)[0] == '~';
  597. X         *argp++ = &(*envp++)[1])
  598. X        ;
  599. X    *argp = NULL;   /* null-terminate the list */
  600. X
  601. X    /* substitute new argument list in place of old one */
  602. X    *argcp = newargc;
  603. X    *argvp = newargv;
  604. X}
  605. X
  606. X#endif /* MSDOS */
  607. END_OF_FILE
  608.   if test 6181 -ne `wc -c <'unzip-5.12/envargs.c'`; then
  609.     echo shar: \"'unzip-5.12/envargs.c'\" unpacked with wrong size!
  610.   fi
  611.   # end of 'unzip-5.12/envargs.c'
  612. fi
  613. if test -f 'unzip-5.12/os2/unzip16.def' -a "${1}" != "-c" ; then 
  614.   echo shar: Will not clobber existing file \"'unzip-5.12/os2/unzip16.def'\"
  615. else
  616.   echo shar: Extracting \"'unzip-5.12/os2/unzip16.def'\" \(106 characters\)
  617.   sed "s/^X//" >'unzip-5.12/os2/unzip16.def' <<'END_OF_FILE'
  618. XNAME WINDOWCOMPAT NEWFILES
  619. XDESCRIPTION 'The world-famous Info-ZIP unarchiving utilities'
  620. XSTACKSIZE 0x2000
  621. END_OF_FILE
  622.   if test 106 -ne `wc -c <'unzip-5.12/os2/unzip16.def'`; then
  623.     echo shar: \"'unzip-5.12/os2/unzip16.def'\" unpacked with wrong size!
  624.   fi
  625.   # end of 'unzip-5.12/os2/unzip16.def'
  626. fi
  627. if test -f 'unzip-5.12/tables.h' -a "${1}" != "-c" ; then 
  628.   echo shar: Will not clobber existing file \"'unzip-5.12/tables.h'\"
  629. else
  630.   echo shar: Extracting \"'unzip-5.12/tables.h'\" \(6079 characters\)
  631.   sed "s/^X//" >'unzip-5.12/tables.h' <<'END_OF_FILE'
  632. X/*---------------------------------------------------------------------------
  633. X
  634. X  tables.h
  635. X
  636. X  This file contains only the 32-bit CRC table and the EBCDIC translation
  637. X  table used in fUnZip and in UnZip's file_io.c; they're in a separate file
  638. X  because they are rather big and ugly and because they get in the way dur-
  639. X  ing editing.  This file can be included in no more than ONE source file
  640. X  per executable, of course.
  641. X
  642. X  ---------------------------------------------------------------------------*/
  643. X
  644. X
  645. X#ifdef FUNZIP
  646. X
  647. X/* Table of CRC-32's of all single-byte values (made by makecrc.c) */
  648. Xulg near crc_32_tab[] = {
  649. X    0x00000000L, 0x77073096L, 0xee0e612cL, 0x990951baL, 0x076dc419L,
  650. X    0x706af48fL, 0xe963a535L, 0x9e6495a3L, 0x0edb8832L, 0x79dcb8a4L,
  651. X    0xe0d5e91eL, 0x97d2d988L, 0x09b64c2bL, 0x7eb17cbdL, 0xe7b82d07L,
  652. X    0x90bf1d91L, 0x1db71064L, 0x6ab020f2L, 0xf3b97148L, 0x84be41deL,
  653. X    0x1adad47dL, 0x6ddde4ebL, 0xf4d4b551L, 0x83d385c7L, 0x136c9856L,
  654. X    0x646ba8c0L, 0xfd62f97aL, 0x8a65c9ecL, 0x14015c4fL, 0x63066cd9L,
  655. X    0xfa0f3d63L, 0x8d080df5L, 0x3b6e20c8L, 0x4c69105eL, 0xd56041e4L,
  656. X    0xa2677172L, 0x3c03e4d1L, 0x4b04d447L, 0xd20d85fdL, 0xa50ab56bL,
  657. X    0x35b5a8faL, 0x42b2986cL, 0xdbbbc9d6L, 0xacbcf940L, 0x32d86ce3L,
  658. X    0x45df5c75L, 0xdcd60dcfL, 0xabd13d59L, 0x26d930acL, 0x51de003aL,
  659. X    0xc8d75180L, 0xbfd06116L, 0x21b4f4b5L, 0x56b3c423L, 0xcfba9599L,
  660. X    0xb8bda50fL, 0x2802b89eL, 0x5f058808L, 0xc60cd9b2L, 0xb10be924L,
  661. X    0x2f6f7c87L, 0x58684c11L, 0xc1611dabL, 0xb6662d3dL, 0x76dc4190L,
  662. X    0x01db7106L, 0x98d220bcL, 0xefd5102aL, 0x71b18589L, 0x06b6b51fL,
  663. X    0x9fbfe4a5L, 0xe8b8d433L, 0x7807c9a2L, 0x0f00f934L, 0x9609a88eL,
  664. X    0xe10e9818L, 0x7f6a0dbbL, 0x086d3d2dL, 0x91646c97L, 0xe6635c01L,
  665. X    0x6b6b51f4L, 0x1c6c6162L, 0x856530d8L, 0xf262004eL, 0x6c0695edL,
  666. X    0x1b01a57bL, 0x8208f4c1L, 0xf50fc457L, 0x65b0d9c6L, 0x12b7e950L,
  667. X    0x8bbeb8eaL, 0xfcb9887cL, 0x62dd1ddfL, 0x15da2d49L, 0x8cd37cf3L,
  668. X    0xfbd44c65L, 0x4db26158L, 0x3ab551ceL, 0xa3bc0074L, 0xd4bb30e2L,
  669. X    0x4adfa541L, 0x3dd895d7L, 0xa4d1c46dL, 0xd3d6f4fbL, 0x4369e96aL,
  670. X    0x346ed9fcL, 0xad678846L, 0xda60b8d0L, 0x44042d73L, 0x33031de5L,
  671. X    0xaa0a4c5fL, 0xdd0d7cc9L, 0x5005713cL, 0x270241aaL, 0xbe0b1010L,
  672. X    0xc90c2086L, 0x5768b525L, 0x206f85b3L, 0xb966d409L, 0xce61e49fL,
  673. X    0x5edef90eL, 0x29d9c998L, 0xb0d09822L, 0xc7d7a8b4L, 0x59b33d17L,
  674. X    0x2eb40d81L, 0xb7bd5c3bL, 0xc0ba6cadL, 0xedb88320L, 0x9abfb3b6L,
  675. X    0x03b6e20cL, 0x74b1d29aL, 0xead54739L, 0x9dd277afL, 0x04db2615L,
  676. X    0x73dc1683L, 0xe3630b12L, 0x94643b84L, 0x0d6d6a3eL, 0x7a6a5aa8L,
  677. X    0xe40ecf0bL, 0x9309ff9dL, 0x0a00ae27L, 0x7d079eb1L, 0xf00f9344L,
  678. X    0x8708a3d2L, 0x1e01f268L, 0x6906c2feL, 0xf762575dL, 0x806567cbL,
  679. X    0x196c3671L, 0x6e6b06e7L, 0xfed41b76L, 0x89d32be0L, 0x10da7a5aL,
  680. X    0x67dd4accL, 0xf9b9df6fL, 0x8ebeeff9L, 0x17b7be43L, 0x60b08ed5L,
  681. X    0xd6d6a3e8L, 0xa1d1937eL, 0x38d8c2c4L, 0x4fdff252L, 0xd1bb67f1L,
  682. X    0xa6bc5767L, 0x3fb506ddL, 0x48b2364bL, 0xd80d2bdaL, 0xaf0a1b4cL,
  683. X    0x36034af6L, 0x41047a60L, 0xdf60efc3L, 0xa867df55L, 0x316e8eefL,
  684. X    0x4669be79L, 0xcb61b38cL, 0xbc66831aL, 0x256fd2a0L, 0x5268e236L,
  685. X    0xcc0c7795L, 0xbb0b4703L, 0x220216b9L, 0x5505262fL, 0xc5ba3bbeL,
  686. X    0xb2bd0b28L, 0x2bb45a92L, 0x5cb36a04L, 0xc2d7ffa7L, 0xb5d0cf31L,
  687. X    0x2cd99e8bL, 0x5bdeae1dL, 0x9b64c2b0L, 0xec63f226L, 0x756aa39cL,
  688. X    0x026d930aL, 0x9c0906a9L, 0xeb0e363fL, 0x72076785L, 0x05005713L,
  689. X    0x95bf4a82L, 0xe2b87a14L, 0x7bb12baeL, 0x0cb61b38L, 0x92d28e9bL,
  690. X    0xe5d5be0dL, 0x7cdcefb7L, 0x0bdbdf21L, 0x86d3d2d4L, 0xf1d4e242L,
  691. X    0x68ddb3f8L, 0x1fda836eL, 0x81be16cdL, 0xf6b9265bL, 0x6fb077e1L,
  692. X    0x18b74777L, 0x88085ae6L, 0xff0f6a70L, 0x66063bcaL, 0x11010b5cL,
  693. X    0x8f659effL, 0xf862ae69L, 0x616bffd3L, 0x166ccf45L, 0xa00ae278L,
  694. X    0xd70dd2eeL, 0x4e048354L, 0x3903b3c2L, 0xa7672661L, 0xd06016f7L,
  695. X    0x4969474dL, 0x3e6e77dbL, 0xaed16a4aL, 0xd9d65adcL, 0x40df0b66L,
  696. X    0x37d83bf0L, 0xa9bcae53L, 0xdebb9ec5L, 0x47b2cf7fL, 0x30b5ffe9L,
  697. X    0xbdbdf21cL, 0xcabac28aL, 0x53b39330L, 0x24b4a3a6L, 0xbad03605L,
  698. X    0xcdd70693L, 0x54de5729L, 0x23d967bfL, 0xb3667a2eL, 0xc4614ab8L,
  699. X    0x5d681b02L, 0x2a6f2b94L, 0xb40bbe37L, 0xc30c8ea1L, 0x5a05df1bL,
  700. X    0x2d02ef8dL
  701. X};
  702. X
  703. X#endif /* FUNZIP */
  704. X
  705. X
  706. X
  707. X#ifdef EBCDIC
  708. X
  709. X/*
  710. X * This is the MTS ASCII->EBCDIC translation table. It provides a 1-1
  711. X * translation from ISO 8859/1 8-bit ASCII to IBM Code Page 37 EBCDIC.
  712. X */
  713. X
  714. Xunsigned char ebcdic[] =
  715. X{
  716. X    0x00, 0x01, 0x02, 0x03, 0x37, 0x2d, 0x2e, 0x2f,
  717. X    0x16, 0x05, 0x25, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
  718. X    0x10, 0x11, 0x12, 0x13, 0x3c, 0x3d, 0x32, 0x26,
  719. X    0x18, 0x19, 0x3f, 0x27, 0x1c, 0x1d, 0x1e, 0x1f,
  720. X    0x40, 0x5a, 0x7f, 0x7b, 0x5b, 0x6c, 0x50, 0x7d,
  721. X    0x4d, 0x5d, 0x5c, 0x4e, 0x6b, 0x60, 0x4b, 0x61,
  722. X    0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7,
  723. X    0xf8, 0xf9, 0x7a, 0x5e, 0x4c, 0x7e, 0x6e, 0x6f,
  724. X    0x7c, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7,
  725. X    0xc8, 0xc9, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6,
  726. X    0xd7, 0xd8, 0xd9, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6,
  727. X    0xe7, 0xe8, 0xe9, 0xba, 0xe0, 0xbb, 0xb0, 0x6d,
  728. X    0x79, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
  729. X    0x88, 0x89, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96,
  730. X    0x97, 0x98, 0x99, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6,
  731. X    0xa7, 0xa8, 0xa9, 0xc0, 0x4f, 0xd0, 0xa1, 0x07,
  732. X    0x20, 0x21, 0x22, 0x23, 0x24, 0x15, 0x06, 0x17,
  733. X    0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x09, 0x0a, 0x1b,
  734. X    0x30, 0x31, 0x1a, 0x33, 0x34, 0x35, 0x36, 0x08,
  735. X    0x38, 0x39, 0x3a, 0x3b, 0x04, 0x14, 0x3e, 0xff,
  736. X    0x41, 0xaa, 0x4a, 0xb1, 0x9f, 0xb2, 0x6a, 0xb5,
  737. X    0xbd, 0xb4, 0x9a, 0x8a, 0x5f, 0xca, 0xaf, 0xbc,
  738. X    0x90, 0x8f, 0xea, 0xfa, 0xbe, 0xa0, 0xb6, 0xb3,
  739. X    0x9d, 0xda, 0x9b, 0x8b, 0xb7, 0xb8, 0xb9, 0xab,
  740. X    0x64, 0x65, 0x62, 0x66, 0x63, 0x67, 0x9e, 0x68,
  741. X    0x74, 0x71, 0x72, 0x73, 0x78, 0x75, 0x76, 0x77,
  742. X    0xac, 0x69, 0xed, 0xee, 0xeb, 0xef, 0xec, 0xbf,
  743. X    0x80, 0xfd, 0xfe, 0xfb, 0xfc, 0xad, 0xae, 0x59,
  744. X    0x44, 0x45, 0x42, 0x46, 0x43, 0x47, 0x9c, 0x48,
  745. X    0x54, 0x51, 0x52, 0x53, 0x58, 0x55, 0x56, 0x57,
  746. X    0x8c, 0x49, 0xcd, 0xce, 0xcb, 0xcf, 0xcc, 0xe1,
  747. X    0x70, 0xdd, 0xde, 0xdb, 0xdc, 0x8d, 0x8e, 0xdf
  748. X};
  749. X
  750. X#endif                          /* EBCDIC */
  751. END_OF_FILE
  752.   if test 6079 -ne `wc -c <'unzip-5.12/tables.h'`; then
  753.     echo shar: \"'unzip-5.12/tables.h'\" unpacked with wrong size!
  754.   fi
  755.   # end of 'unzip-5.12/tables.h'
  756. fi
  757. if test -f 'unzip-5.12/tops20/tops20.c' -a "${1}" != "-c" ; then 
  758.   echo shar: Will not clobber existing file \"'unzip-5.12/tops20/tops20.c'\"
  759. else
  760.   echo shar: Extracting \"'unzip-5.12/tops20/tops20.c'\" \(5608 characters\)
  761.   sed "s/^X//" >'unzip-5.12/tops20/tops20.c' <<'END_OF_FILE'
  762. X/*---------------------------------------------------------------------------
  763. X
  764. X  tops20.c
  765. X
  766. X  TOPS20-specific routines for use with Info-ZIP's UnZip 5.1 and later.
  767. X
  768. X  Contains:  mapattr()
  769. X             close_outfile()
  770. X             version()
  771. X             upper()
  772. X             enquote()
  773. X             dequote()
  774. X             fnlegal()
  775. X
  776. X  (not yet ported:  do_wild(), mapname(), checkdir(), ...)
  777. X
  778. X  ---------------------------------------------------------------------------*/
  779. X
  780. X
  781. X#include "unzip.h"
  782. X
  783. X
  784. X/**********************/
  785. X/* Function mapattr() */
  786. X/**********************/
  787. X
  788. Xint mapattr()      /* just like Unix except no umask() */
  789. X{
  790. X    ulg  tmp = crec.external_file_attributes;
  791. X
  792. X    switch (pInfo->hostnum) {
  793. X        case UNIX_:
  794. X        case VMS_:
  795. X            pInfo->file_attr = (unsigned)(tmp >> 16);
  796. X            break;
  797. X        case AMIGA_:
  798. X            tmp = (unsigned)(tmp>>1 & 7);   /* Amiga RWE bits */
  799. X            pInfo->file_attr = (unsigned)(tmp<<6 | tmp<<3 | tmp);
  800. X            break;
  801. X        case FS_FAT_:   /* MSDOS half of attributes should always be correct */
  802. X        case FS_HPFS_:
  803. X        case FS_NTFS_:
  804. X        case MAC_:
  805. X        case ATARI_:
  806. X        case TOPS20_:
  807. X        default:
  808. X            tmp = !(tmp & 1) << 1;   /* read-only bit --> write perms bits */
  809. X            pInfo->file_attr = (unsigned)(0444 | tmp<<6 | tmp<<3 | tmp);
  810. X            break;
  811. X#if 0
  812. X        case ATARI_:
  813. X        case TOPS20_:
  814. X        default:
  815. X            pInfo->file_attr = 0666;
  816. X            break;
  817. X#endif
  818. X    } /* end switch (host-OS-created-by) */
  819. X
  820. X    return 0;
  821. X
  822. X} /* end function mapattr() */
  823. X
  824. X
  825. X
  826. X
  827. X
  828. X/****************************/
  829. X/* Function close_outfile() */
  830. X/****************************/
  831. X
  832. Xvoid close_outfile()
  833. X{
  834. X#   define JSYS_CLASS           0070000000000
  835. X#   define FLD(val,mask)        (((unsigned)(val)*((mask)&(-(mask))))&(mask))
  836. X#   define _DEFJS(name,class)   (FLD(class,JSYS_CLASS) | (monsym(name)&0777777))
  837. X#   define IDTIM                _DEFJS("IDTIM%", 1)
  838. X#   define SFTAD                _DEFJS("SFTAD%", 0)
  839. X#   define YRBASE               1900
  840. X    int ablock[5], tblock[2];
  841. X    int yr, mo, dy, hh, mm, ss;
  842. X    char temp[100];
  843. X    unsigned tad;
  844. X
  845. X
  846. X    /* dissect the date */
  847. X    yr = ((lrec.last_mod_file_date >> 9) & 0x7f) + (1980 - YRBASE);
  848. X    mo = (lrec.last_mod_file_date >> 5) & 0x0f;
  849. X    dy = lrec.last_mod_file_date & 0x1f;
  850. X
  851. X    /* dissect the time */
  852. X    hh = (lrec.last_mod_file_time >> 11) & 0x1f;
  853. X    mm = (lrec.last_mod_file_time >> 5) & 0x3f;
  854. X    ss = (lrec.last_mod_file_time & 0x1f) * 2;
  855. X    
  856. X    sprintf(temp, "%02d/%02d/%02d %02d:%02d:%02d", mo, dy, yr, hh, mm, ss);
  857. X
  858. X    ablock[1] = (int)(temp - 1);
  859. X    ablock[2] = 0;
  860. X    if (!jsys(IDTIM, ablock)) {
  861. X        fprintf(stderr, "error:  IDTIM failure for %s\n", filename);
  862. X        fclose(outfile);
  863. X        return;
  864. X    }
  865. X
  866. X    tad = ablock[2];
  867. X    tblock[0] = tad;
  868. X    tblock[1] = tad;
  869. X    tblock[2] = -1;
  870. X
  871. X    ablock[1] = fcntl(fileno(outfile), F_GETSYSFD, 0); /* _uffd[outfd]->uf_ch */
  872. X    ablock[2] = (int) tblock;
  873. X    ablock[3] = 3;
  874. X    if (!jsys(SFTAD, ablock))
  875. X        fprintf(stderr, "error:  can't set the time for %s\n", filename);
  876. X
  877. X    fclose(outfile);
  878. X
  879. X} /* end function close_outfile() */
  880. X
  881. X
  882. X
  883. X
  884. X
  885. X#ifndef SFX
  886. X
  887. X/************************/
  888. X/*  Function version()  */
  889. X/************************/
  890. X
  891. Xvoid version()
  892. X{
  893. X    extern char Far  CompiledWith[];
  894. X#if 0
  895. X    char buf[40];
  896. X#endif
  897. X
  898. X    printf(LoadFarString(CompiledWith),
  899. X
  900. X#ifdef __GNUC__
  901. X      "gcc ", __VERSION__,
  902. X#else
  903. X#  if 0
  904. X      "cc ", (sprintf(buf, " version %d", _RELEASE), buf),
  905. X#  else
  906. X#  ifdef __COMPILER_KCC__
  907. X      "KCC", "",
  908. X#  else
  909. X      "unknown compiler", "",
  910. X#  endif
  911. X#  endif
  912. X#endif
  913. X
  914. X      "TOPS-20",
  915. X
  916. X#if defined(foobar) || defined(FOOBAR)
  917. X      " (Foo BAR)",   /* OS version or hardware */
  918. X#else
  919. X      "",
  920. X#endif /* Foo BAR */
  921. X
  922. X#ifdef __DATE__
  923. X      " on ", __DATE__
  924. X#else
  925. X      "", ""
  926. X#endif
  927. X      );
  928. X
  929. X} /* end function version() */
  930. X
  931. X#endif /* !SFX */
  932. X
  933. X
  934. X
  935. X
  936. X
  937. X/**********************/
  938. X/*  Function upper()  */
  939. X/**********************/
  940. X
  941. Xint upper(s)        /* returns s in uppercase */
  942. X    char *s;        /* string to be uppercased */
  943. X{
  944. X    for (;  *s;  ++s)
  945. X        *s = toupper(*s);
  946. X}
  947. X
  948. X
  949. X
  950. X
  951. X
  952. X/************************/
  953. X/*  Function enquote()  */
  954. X/************************/
  955. X
  956. Xint enquote(s)      /* calls dequote(s) to normalize string, then */
  957. X    char *s;        /*  inserts ^Vs before otherwise illegal characters */
  958. X{                   /*  in s, assuming that s is a TOPS-20 filename */
  959. X    char d[100];
  960. X    char *p, *q;
  961. X    char c;
  962. X
  963. X    if (s && *s) {
  964. X        dequote(s);
  965. X        p = s - 1;
  966. X        q = d - 1;
  967. X        while (c = *++p) {
  968. X            if (!fnlegal(c))
  969. X                *++q = '\026';
  970. X            *++q = c;
  971. X        }
  972. X        *++q = '\0';
  973. X        strcpy(s, d);
  974. X    }
  975. X    return 0;
  976. X}
  977. X
  978. X
  979. X
  980. X
  981. X
  982. X/************************/
  983. X/*  Function dequote()  */
  984. X/************************/
  985. X
  986. Xint dequote(s)        /* returns s without ^Vs */
  987. X    char *s;          /* string to be dequoted */
  988. X{
  989. X    char d[100];
  990. X    char *p, *q;
  991. X    int c;
  992. X
  993. X    if (s && *s) {
  994. X        p = s - 1;
  995. X        q = d - 1;
  996. X        while (c = *++p)
  997. X            if (c != '\026')
  998. X                *++q = c;
  999. X        *++q = '\0';
  1000. X        strcpy(s, d);
  1001. X    }
  1002. X    return 0;
  1003. X}
  1004. X
  1005. X
  1006. X
  1007. X
  1008. X
  1009. X/************************/
  1010. X/*  Function fnlegal()  */
  1011. X/************************/
  1012. X
  1013. Xint fnlegal(c)         /* returns TRUE if c is a member of the */
  1014. X    char c;            /*  legal character set for filenames */
  1015. X{
  1016. X    char *q;
  1017. X    static char *legals = {"$%**-<>>AZ[[]]__az"};
  1018. X
  1019. X    q = legals;
  1020. X    while (*q)
  1021. X        if (c < *q++)
  1022. X            break;
  1023. X        else if (c <= *q++)
  1024. X            return TRUE;
  1025. X
  1026. X    return FALSE;
  1027. X}
  1028. END_OF_FILE
  1029.   if test 5608 -ne `wc -c <'unzip-5.12/tops20/tops20.c'`; then
  1030.     echo shar: \"'unzip-5.12/tops20/tops20.c'\" unpacked with wrong size!
  1031.   fi
  1032.   # end of 'unzip-5.12/tops20/tops20.c'
  1033. fi
  1034. if test -f 'unzip-5.12/unix/funzip.1' -a "${1}" != "-c" ; then 
  1035.   echo shar: Will not clobber existing file \"'unzip-5.12/unix/funzip.1'\"
  1036. else
  1037.   echo shar: Extracting \"'unzip-5.12/unix/funzip.1'\" \(4441 characters\)
  1038.   sed "s/^X//" >'unzip-5.12/unix/funzip.1' <<'END_OF_FILE'
  1039. X.\" Info-ZIP grants permission to any individual or institution to use, copy,
  1040. X.\" or redistribute this software, so long as:  (1) all of the original files
  1041. X.\" are included; (2) it is not sold for profit; and (3) this notice is re-
  1042. X.\" tained.  See the UnZip COPYING file for details.
  1043. X.\"
  1044. X.\" funzip.1 by Greg Roelofs and others.
  1045. X.\"
  1046. X.\" =========================================================================
  1047. X.\" define .Y macro (for user-command examples; normal Courier font):
  1048. X.de Y
  1049. X.ft CW
  1050. X.in +4n
  1051. X.nf
  1052. X\&\\$1
  1053. X.ft
  1054. X.in
  1055. X.fi
  1056. X..
  1057. X.\" =========================================================================
  1058. X.TH FUNZIP 1 "28 Aug 94 (v3.83)"
  1059. X.SH NAME
  1060. Xfunzip \- filter for extracting from a ZIP archive in a pipe
  1061. X.\" =========================================================================
  1062. X.SH SYNOPSIS
  1063. X[.\|.\|.]  |\ \ \fBfunzip\fP [\fB\-password\fP]\ \ |  [.\|.\|.]
  1064. X.LP
  1065. X\fBfunzip\fP [\fB\-password\fP] \fIinput.zip\fP\ \ |  [.\|.\|.]
  1066. X.\" =========================================================================
  1067. X.SH ARGUMENTS
  1068. X.IP [\fI\-password\fP]
  1069. XOptional password to be used if ZIP archive is encrypted.  Decryption
  1070. Xmay not be supported at some sites.  See DESCRIPTION for more details.
  1071. X.PD
  1072. X.\" =========================================================================
  1073. X.SH DESCRIPTION
  1074. X.I funzip
  1075. Xacts as a filter; that is, it assumes that a ZIP archive is being piped into
  1076. Xstandard input, and it extracts the first member from the archive to stdout.
  1077. XIf there is an argument, then the input comes from the specified file
  1078. Xinstead of from stdin.  A password for encrypted zip files can be specified
  1079. Xon the command line (preceding the file name, if any) by prefixing the
  1080. Xpassword with a dash.  Note that this constitutes a security risk on many
  1081. Xsystems; currently running processes are often visible via simple commands
  1082. X(e.g., \fIps\fP(1) under Unix), and command-line histories can be read.
  1083. XIf the first entry of the zip file is encrypted and
  1084. Xno password is specified on the command line, then the user is prompted for
  1085. Xa password and the password is not echoed on the console.
  1086. X.LP
  1087. XGiven the limitation on single-member extraction, \fIfunzip\fP is most
  1088. Xuseful in conjunction with a secondary archiver program such as \fItar\fP(1).
  1089. XThe following section includes an example illustrating this usage in the
  1090. Xcase of disk backups to tape.
  1091. X.PD
  1092. X.\" =========================================================================
  1093. X.SH EXAMPLES
  1094. XTo use \fIfunzip\fP to extract the first member file of the archive test.zip
  1095. Xand to pipe it into \fImore\fP(1):
  1096. X.LP
  1097. X.Y "funzip test.zip | more"
  1098. X.LP
  1099. XTo use \fIfunzip\fP to test the first member file of test.zip (any errors
  1100. Xwill be reported on standard error):
  1101. X.LP
  1102. X.Y "funzip test.zip > /dev/null"
  1103. X.LP
  1104. XTo use \fIzip\fP and \fIfunzip\fP in place of \fIcompress\fP(1) and
  1105. X\fIzcat\fP(1) (or \fIgzip\fP(1L) and \fIgzcat\fP(1L)) for tape backups:
  1106. X.LP
  1107. X.PD 0
  1108. X.Y "tar cf \- . | zip \-7 | dd of=/dev/nrst0 obs=8k"
  1109. X.Y "dd if=/dev/nrst0 ibs=8k | funzip | tar xf \-"
  1110. X.PD
  1111. X.LP
  1112. X(where, for example, nrst0 is a SCSI tape drive).
  1113. X.PD
  1114. X.\" =========================================================================
  1115. X.SH BUGS
  1116. XWhen piping an encrypted file into \fImore\fP and allowing \fIfunzip\fP
  1117. Xto prompt for password, the terminal may sometimes be reset to a non-echo
  1118. Xmode.  This is apparently due to a race condition between the two programs;
  1119. X\fIfunzip\fP changes the terminal mode to non-echo before \fImore\fP reads
  1120. Xits state, and \fImore\fP then ``restores'' the terminal to this mode before
  1121. Xexiting.  To recover, run \fIfunzip\fP on the same file but redirect to
  1122. X/dev/null rather than piping into more; after prompting again for the 
  1123. Xpassword, \fIfunzip\fP will reset the terminal properly.
  1124. X.LP
  1125. XThere is presently no way to extract any member but the first from a ZIP
  1126. Xarchive.  This would be useful in the case where a ZIP archive is included
  1127. Xwithin another archive.  In the case where the first member is a directory,
  1128. X\fIfunzip\fP simply creates the directory and exits.
  1129. X.LP
  1130. XThe functionality of \fIfunzip\fP should be incorporated into \fIunzip\fP
  1131. Xitself (future release).
  1132. X.PD
  1133. X.\" =========================================================================
  1134. X.SH SEE ALSO
  1135. X\fIgzip\fP(1L), \fIunzip\fP(1L), \fIunzipsfx\fP(1L), \fIzip\fP(1L),
  1136. X\fIzipcloak\fP(1L), \fIzipinfo\fP(1L), \fIzipnote\fP(1L), \fIzipsplit\fP(1L)
  1137. X.PD
  1138. X.\" =========================================================================
  1139. X.SH AUTHOR
  1140. XMark Adler (Info-ZIP)
  1141. END_OF_FILE
  1142.   if test 4441 -ne `wc -c <'unzip-5.12/unix/funzip.1'`; then
  1143.     echo shar: \"'unzip-5.12/unix/funzip.1'\" unpacked with wrong size!
  1144.   fi
  1145.   # end of 'unzip-5.12/unix/funzip.1'
  1146. fi
  1147. if test -f 'unzip-5.12/unreduce.c' -a "${1}" != "-c" ; then 
  1148.   echo shar: Will not clobber existing file \"'unzip-5.12/unreduce.c'\"
  1149. else
  1150.   echo shar: Extracting \"'unzip-5.12/unreduce.c'\" \(5772 characters\)
  1151.   sed "s/^X//" >'unzip-5.12/unreduce.c' <<'END_OF_FILE'
  1152. X/*---------------------------------------------------------------------------
  1153. X
  1154. X  unreduce.c
  1155. X
  1156. X  The Reducing algorithm is actually a combination of two distinct algorithms.
  1157. X  The first algorithm compresses repeated byte sequences, and the second al-
  1158. X  gorithm takes the compressed stream from the first algorithm and applies a
  1159. X  probabilistic compression method.
  1160. X
  1161. X  ---------------------------------------------------------------------------*/
  1162. X
  1163. X
  1164. X#include "unzip.h"
  1165. X
  1166. X
  1167. X/**************************************/
  1168. X/*  UnReduce Defines, Typedefs, etc.  */
  1169. X/**************************************/
  1170. X
  1171. X#define DLE    144
  1172. X
  1173. Xtypedef uch f_array[64];        /* for followers[256][64] */
  1174. X
  1175. Xstatic void LoadFollowers __((void));
  1176. X
  1177. X
  1178. X
  1179. X/*******************************/
  1180. X/*  UnReduce Global Variables  */
  1181. X/*******************************/
  1182. X
  1183. X#if defined(MALLOC_WORK) || defined(MTS)
  1184. X   f_array *followers;     /* shared work space */
  1185. X#else
  1186. X   f_array *followers = (f_array *) (slide + 0x4000);
  1187. X#endif
  1188. X
  1189. Xuch Slen[256];
  1190. Xint factor;
  1191. X
  1192. Xint L_table[] =
  1193. X{0, 0x7f, 0x3f, 0x1f, 0x0f};
  1194. X
  1195. Xint D_shift[] =
  1196. X{0, 0x07, 0x06, 0x05, 0x04};
  1197. Xint D_mask[] =
  1198. X{0, 0x01, 0x03, 0x07, 0x0f};
  1199. X
  1200. Xint B_table[] =
  1201. X{8, 1, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 5,
  1202. X 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6,
  1203. X 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
  1204. X 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7,
  1205. X 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
  1206. X 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
  1207. X 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
  1208. X 7, 7, 7, 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, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
  1213. X 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
  1214. X 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
  1215. X 8, 8, 8, 8};
  1216. X
  1217. X
  1218. X
  1219. X
  1220. X
  1221. X/*************************/
  1222. X/*  Function unreduce()  */
  1223. X/*************************/
  1224. X
  1225. Xvoid unreduce()   /* expand probabilistically reduced data */
  1226. X{
  1227. X    register int lchar = 0;
  1228. X    int nchar;
  1229. X    int ExState = 0;
  1230. X    int V = 0;
  1231. X    int Len = 0;
  1232. X    long s = ucsize;  /* number of bytes left to decompress */
  1233. X    unsigned w = 0;      /* position in output window slide[] */
  1234. X    unsigned u = 1;      /* true if slide[] unflushed */
  1235. X
  1236. X
  1237. X#if defined(MALLOC_WORK) || defined(MTS)
  1238. X    followers = (f_array *)(slide + 0x4000);
  1239. X#endif
  1240. X
  1241. X    factor = lrec.compression_method - 1;
  1242. X    LoadFollowers();
  1243. X
  1244. X    while (s > 0 /* && (!zipeof) */) {
  1245. X        if (Slen[lchar] == 0)
  1246. X            READBITS(8, nchar)   /* ; */
  1247. X        else {
  1248. X            READBITS(1, nchar)   /* ; */
  1249. X            if (nchar != 0)
  1250. X                READBITS(8, nchar)       /* ; */
  1251. X            else {
  1252. X                int follower;
  1253. X                int bitsneeded = B_table[Slen[lchar]];
  1254. X
  1255. X                READBITS(bitsneeded, follower)   /* ; */
  1256. X                nchar = followers[lchar][follower];
  1257. X            }
  1258. X        }
  1259. X        /* expand the resulting byte */
  1260. X        switch (ExState) {
  1261. X
  1262. X        case 0:
  1263. X            if (nchar != DLE) {
  1264. X                s--;
  1265. X                slide[w++] = (uch)nchar;
  1266. X                if (w == 0x4000) {
  1267. X                    flush(slide, w, 0);
  1268. X                    w = u = 0;
  1269. X                }
  1270. X            }
  1271. X            else
  1272. X                ExState = 1;
  1273. X            break;
  1274. X
  1275. X        case 1:
  1276. X            if (nchar != 0) {
  1277. X                V = nchar;
  1278. X                Len = V & L_table[factor];
  1279. X                if (Len == L_table[factor])
  1280. X                    ExState = 2;
  1281. X                else
  1282. X                    ExState = 3;
  1283. X            } else {
  1284. X                s--;
  1285. X                slide[w++] = DLE;
  1286. X                if (w == 0x4000)
  1287. X                {
  1288. X                  flush(slide, w, 0);
  1289. X                  w = u = 0;
  1290. X                }
  1291. X                ExState = 0;
  1292. X            }
  1293. X            break;
  1294. X
  1295. X        case 2:{
  1296. X                Len += nchar;
  1297. X                ExState = 3;
  1298. X            }
  1299. X            break;
  1300. X
  1301. X        case 3:{
  1302. X                register unsigned e;
  1303. X                register unsigned n = Len + 3;
  1304. X                register unsigned d = w - ((((V >> D_shift[factor]) &
  1305. X                               D_mask[factor]) << 8) + nchar + 1);
  1306. X
  1307. X                s -= n;
  1308. X                do {
  1309. X                  n -= (e = (e = 0x4000 - ((d &= 0x3fff) > w ? d : w)) > n ?
  1310. X                        n : e);
  1311. X                  if (u && w <= d)
  1312. X                  {
  1313. X                    memzero(slide + w, e);
  1314. X                    w += e;
  1315. X                    d += e;
  1316. X                  }
  1317. X                  else
  1318. X                    if (w - d < e)      /* (assume unsigned comparison) */
  1319. X                      do {              /* slow to avoid memcpy() overlap */
  1320. X                        slide[w++] = slide[d++];
  1321. X                      } while (--e);
  1322. X                    else
  1323. X                    {
  1324. X                      memcpy(slide + w, slide + d, e);
  1325. X                      w += e;
  1326. X                      d += e;
  1327. X                    }
  1328. X                  if (w == 0x4000)
  1329. X                  {
  1330. X                    flush(slide, w, 0);
  1331. X                    w = u = 0;
  1332. X                  }
  1333. X                } while (n);
  1334. X
  1335. X                ExState = 0;
  1336. X            }
  1337. X            break;
  1338. X        }
  1339. X
  1340. X        /* store character for next iteration */
  1341. X        lchar = nchar;
  1342. X    }
  1343. X
  1344. X    /* flush out slide */
  1345. X    flush(slide, w, 0);
  1346. X}
  1347. X
  1348. X
  1349. X
  1350. X
  1351. X
  1352. X/******************************/
  1353. X/*  Function LoadFollowers()  */
  1354. X/******************************/
  1355. X
  1356. Xstatic void LoadFollowers()
  1357. X{
  1358. X    register int x;
  1359. X    register int i;
  1360. X
  1361. X    for (x = 255; x >= 0; x--) {
  1362. X        READBITS(6, Slen[x])   /* ; */
  1363. X        for (i = 0; (uch)i < Slen[x]; i++)
  1364. X            READBITS(8, followers[x][i])   /* ; */
  1365. X    }
  1366. X}
  1367. END_OF_FILE
  1368.   if test 5772 -ne `wc -c <'unzip-5.12/unreduce.c'`; then
  1369.     echo shar: \"'unzip-5.12/unreduce.c'\" unpacked with wrong size!
  1370.   fi
  1371.   # end of 'unzip-5.12/unreduce.c'
  1372. fi
  1373. if test -f 'unzip-5.12/vms/README' -a "${1}" != "-c" ; then 
  1374.   echo shar: Will not clobber existing file \"'unzip-5.12/vms/README'\"
  1375. else
  1376.   echo shar: Extracting \"'unzip-5.12/vms/README'\" \(4831 characters\)
  1377.   sed "s/^X//" >'unzip-5.12/vms/README' <<'END_OF_FILE'
  1378. Xvms/README for UnZip 5.12 and later, 25 Aug 94
  1379. X----------------------------------------------
  1380. X
  1381. XNotes about using UnZip and zipfiles under VMS (see INSTALL for instructions
  1382. Xon compiling):
  1383. X
  1384. X - Install UnZip as foreign symbol by adding this to login.com:
  1385. X      $ unzip == "$disk:[dir]unzip.exe"
  1386. X      $ zipinfo == "$disk:[dir]unzip.exe -Z"
  1387. X   where "disk" and "dir" are location of UnZip executable; the "$" before
  1388. X   the disk name is important.  Some people, including the author, prefer
  1389. X   a short alias such as "ii" instead of "zipinfo"; edit to taste.
  1390. X
  1391. X - Optionally install UnZipSFX for use with the MAKESFX.COM command file:
  1392. X      $ unzipsfx :== disk:[dir]unzipsfx.exe
  1393. X   Thereafter an archive "foo.zip" may be converted to "foo.exe" simply by
  1394. X   typing "@makesfx foo" (assuming MAKESFX.COM is in the current directory).
  1395. X   Note that there is *no* leading "$" in this case.
  1396. X
  1397. X - After proper installation, the default version of UnZip is invoked just
  1398. X   as in Unix or MS-DOS:  "unzip -opts archive files".  The hyphen ('-') is
  1399. X   the switch character, not the slash ('/') as in native VMS commands.  An
  1400. X   alternative is available if VMSCLI is defined during compilation; this
  1401. X   version does provide a native VMS-style command interface (e.g., /ZIPINFO
  1402. X   instead of -Z).  Both versions accept the command "unzip -v", which can
  1403. X   be used to check whether VMSCLI was defined or not; but an even simpler
  1404. X   method is to type "unzip" and look at the help screen.  Note that options
  1405. X   placed in an environment variable (UNZIP_OPTS) must be of the short, hy-
  1406. X   phenated form regardless of how UnZip was compiled.
  1407. X
  1408. X - VMS (or the C compiler) translates all command-line text to lowercase
  1409. X   unless it is quoted, making some options and/or filenames not work as
  1410. X   intended.  For example:
  1411. X    unzip -V zipfile vms/README
  1412. X   is tranlated to
  1413. X    unzip -v zipfile vms/readme
  1414. X   which may not match the contents of the zipfile and definitely won't
  1415. X   extract the file with its version number as intended.  This can be
  1416. X   avoided by use of the -C option (/CASE_INSENSITIVE) or by enclosing
  1417. X   the uppercase stuff in quotes:
  1418. X    unzip "-V" zipfile "vms/README"
  1419. X   Note that quoting the whole line probably won't work, since it would
  1420. X   be interpreted as a single argument by the C library.
  1421. X
  1422. X - Wildcards which refer to files internal to the archive behave like Unix
  1423. X   wildcards, not VMS ones (assuming UnZip was not compiled with VMSWILD
  1424. X   defined).  This is both a matter of consistency (see above) and power--
  1425. X   full Unix regular expressions are supported, so that one can specify
  1426. X   "all .c and .h files which start with a, b, c or d and do not have a 2
  1427. X   before the dot" as "[a-d]*[^2].[ch]".  Of course, "*.[ch]" is a much more
  1428. X   common wildcard specification, but the power is there if you need it.
  1429. X   Note that "*" matches zipfile directory separators ('/'), too.  If UnZip
  1430. X   *was* compiled with VMSWILD defined (do "unzip -v" to check), the single-
  1431. X   character wildcard is "%" rather than "?", and character sets (ranges)
  1432. X   are delimited with () instead of [] (for example, "*.(ch)").
  1433. X
  1434. X - Created files get whatever permissions were stored in the archive (mapped
  1435. X   to VMS and/or masked with your default permissions, depending on the 
  1436. X   originating operating system), but created directories additionally in-
  1437. X   herit the (possibly more restrictive) permissions of the parent directory.
  1438. X   And obviously things won't work if you don't have permission to write to
  1439. X   the extraction directory.
  1440. X
  1441. X - When transferring files, particularly via Kermit, pay attention to the
  1442. X   settings!  In particular, zipfiles must be transferred in some binary
  1443. X   mode, which is NOT Kermit's default mode, and this mode must usually be
  1444. X   set on BOTH sides of the transfer (e.g., both VAX and PC).  See the notes
  1445. X   below for details.
  1446. X
  1447. X
  1448. X
  1449. X
  1450. XFrom Info-ZIP Digest (Wed, 6 Nov 1991), Volume 91, Issue 290:
  1451. X
  1452. X   Date: Tue, 5 Nov 91 15:31 CDT
  1453. X   From: Hugh Schmidt <HUGH@macc.wisc.edu>
  1454. X
  1455. X            ****************************************************
  1456. X            *** VMS ZIP and PKZIP compatibility using KERMIT ***
  1457. X            ****************************************************
  1458. X
  1459. X   Many use Procomm's kermit to transfer zipped files between PC and VMS
  1460. X   VAX.  The following VMS kermit settings make VMS Zip/UnZip compatible
  1461. X   with PC Zip/UnZip or PKZIP/PKUNZIP:
  1462. X                                         VMS kermit          Procomm kermit
  1463. X                                    -------------------   --------------------
  1464. X   Uploading PC zipfile to VMS:     set file type fixed   set file type binary
  1465. X   Downloading VMS zipfile to PC:   set file type block   set file type binary
  1466. X
  1467. X   "Block I/O lets you bypass the VMS RMS record-processing capabilities
  1468. X   entirely", (Guide to VMS file applications, Section 8.5).  The kermit
  1469. X   guys must have known this!
  1470. END_OF_FILE
  1471.   if test 4831 -ne `wc -c <'unzip-5.12/vms/README'`; then
  1472.     echo shar: \"'unzip-5.12/vms/README'\" unpacked with wrong size!
  1473.   fi
  1474.   # end of 'unzip-5.12/vms/README'
  1475. fi
  1476. if test -f 'unzip-5.12/vms/cvthelp.tpu' -a "${1}" != "-c" ; then 
  1477.   echo shar: Will not clobber existing file \"'unzip-5.12/vms/cvthelp.tpu'\"
  1478. else
  1479.   echo shar: Extracting \"'unzip-5.12/vms/cvthelp.tpu'\" \(4377 characters\)
  1480.   sed "s/^X//" >'unzip-5.12/vms/cvthelp.tpu' <<'END_OF_FILE'
  1481. X!    TITLE    CVTHELP.TPU
  1482. X!    IDENT    01-000
  1483. X!
  1484. X!++
  1485. X!
  1486. X!  Program:    CVTHELP.TPU
  1487. X!
  1488. X!  Author:    Hunter Goatley
  1489. X!
  1490. X!  Date:    January 12, 1992
  1491. X!
  1492. X!  Purpose:    Convert .HELP files to RUNOFF .RNH files.  Substitutes
  1493. X!        RUNOFF commands for tags imbedded in the .HELP file.
  1494. X!
  1495. X!  Calling sequence:
  1496. X!
  1497. X!    $ EDIT/TPU/NOJOURNAL/NODISPLAY/COMMAND=CVTHELP file.HELP
  1498. X!
  1499. X!  Modified by:
  1500. X!
  1501. X!    01-000        Hunter Goatley         12-JAN-1992 15:15
  1502. X!        Original version.
  1503. X!
  1504. X!--
  1505. XProcedure eve_convert_help
  1506. XLocal    temp
  1507. X    ,x
  1508. X    ;
  1509. X
  1510. X   qualifier_level := 0;
  1511. X   hg$substitute_topic(current_buffer, "<MAIN>", ".indent-3", "1");
  1512. X   hg$substitute_topic(current_buffer, "<QUALIFIER>", ".sk;.indent-3", "");
  1513. X   hg$substitute_topic(current_buffer, "<TOPIC>", ".indent-3", "2");
  1514. X   hg$substitute_topic(current_buffer, "<SUBTOPIC>", ".indent-3", "3");
  1515. X   hg$substitute_topic(current_buffer, "<SUBSUBTOPIC>", ".indent-3", "4");
  1516. X   hg$substitute_comment(current_buffer,"<QUALIFIERS>",".indent-3;2 Qualifiers");
  1517. X   hg$substitute_comment(current_buffer,"<PARAMETER>",".indent-2");
  1518. X   hg$substitute_comment(current_buffer,"<PTEXT>",".lm+3");
  1519. X   hg$substitute_comment(current_buffer,"<TXETP>",".lm-3");
  1520. X   hg$substitute_comment(current_buffer,"<ETEXT>",".lm+4");
  1521. X   hg$substitute_comment(current_buffer,"<TXETE>",".lm-4");
  1522. X   hg$substitute_comment(current_buffer,"<INIT>",".noflags;.lm3;.rm70");
  1523. X   hg$substitute_comment(current_buffer,"<LITERAL>",".lm+4;.literal");
  1524. X   hg$substitute_comment(current_buffer,"<LARETIL>",".end literal;.lm-4");
  1525. X   hg$substitute_comment(current_buffer,"<DOT1LIST>",'.list 1,"o"');
  1526. X   hg$substitute_comment(current_buffer,"<DOT0LIST>",'.list 0,"o"');
  1527. X   hg$substitute_comment(current_buffer,"<ENTRY>",".le");
  1528. X   hg$substitute_comment(current_buffer,"<TSIL>",".end list");
  1529. X   hg$substitute_comment(current_buffer,"<CENTER>",".center");
  1530. X   hg$substitute_comment(current_buffer,"<FORMAT>",".sk;.indent2");
  1531. X   hg$substitute_comment(current_buffer,"<NOTE>",".note");
  1532. X   hg$substitute_comment(current_buffer,"<ETON>",".end note");
  1533. X   hg$substitute_comment(current_buffer, LINE_BEGIN & LINE_END,".sk");
  1534. X   hg$substitute_comment(current_buffer, LINE_BEGIN & "|", "");
  1535. X
  1536. XEndProcedure;        ! eve_convert_help
  1537. X
  1538. XProcedure hg$substitute_comment (the_buffer, target, new)
  1539. XLocal    temp
  1540. X    ,save_pos
  1541. X    ,x
  1542. X    ;
  1543. X  on_error;
  1544. X  endon_error;
  1545. X
  1546. X  save_pos := mark(none);
  1547. X  position(beginning_of(the_buffer));
  1548. X  loop
  1549. X    x := search(target, forward);
  1550. X    exitif x = 0;
  1551. X    position (x);
  1552. X    erase_character(length(x));
  1553. X    copy_text(new);
  1554. X  endloop;
  1555. X
  1556. X  position(save_pos);
  1557. X
  1558. XEndProcedure;        ! hg$substitute_comment
  1559. X
  1560. XProcedure hg$substitute_topic (the_buffer, target, new, level)
  1561. XLocal    temp
  1562. X    ,save_pos
  1563. X    ,x
  1564. X    ;
  1565. X  on_error;
  1566. X  endon_error;
  1567. X
  1568. X  save_pos := mark(none);
  1569. X  position(beginning_of(the_buffer));
  1570. X  loop
  1571. X    x := search(target, forward);
  1572. X    exitif x = 0;
  1573. X    position (x);
  1574. X    erase_character(length(x));
  1575. X    move_vertical(-1);
  1576. X    if (length(current_line) = 0)
  1577. X    then copy_text("|");
  1578. X    endif;
  1579. X    move_vertical(1);
  1580. X    copy_text(".!------------------------------------------------------");
  1581. X    split_line;
  1582. X    copy_text(new);
  1583. X    move_horizontal(-current_offset);
  1584. X    move_vertical(1);
  1585. X    if level <> "" then
  1586. X        copy_text(level + " ");
  1587. X!    else
  1588. X!        if qualifier_level = 0
  1589. X!        then
  1590. X!            copy_text("2 Qualifiers");
  1591. X!        split_line; split_line;
  1592. X!        copy_text(new); split_line;
  1593. X!        qualifier_level := 1;
  1594. X!        endif;
  1595. X    endif;
  1596. X    move_horizontal(-current_offset);
  1597. X    move_vertical(1);
  1598. X    if length(current_line) = 0
  1599. X    then
  1600. X        if (target = "<MAIN>") OR (target = "<TOPIC>")
  1601. X        OR (target = "<SUBTOPIC>") or (target = "<SUBSUBTOPIC>")
  1602. X        then copy_text(".br");
  1603. X        else copy_text(".sk");
  1604. X        endif;
  1605. X    endif;
  1606. X  endloop;
  1607. X
  1608. X  position(save_pos);
  1609. X
  1610. XEndProcedure;        ! hg$substitute_topic
  1611. X
  1612. X!===============================================================================
  1613. XProcedure tpu$init_procedure
  1614. XLocal    temp
  1615. X    ,orig_filespec
  1616. X    ,f
  1617. X    ;
  1618. X
  1619. X   on_error
  1620. X   endon_error;
  1621. X
  1622. X !Prompt user for information
  1623. X
  1624. X  orig_filespec := get_info(command_line, "file_name");
  1625. X  if orig_filespec = ""
  1626. X  then
  1627. X    message("No .HELP file given");
  1628. X    quit;
  1629. X  endif;
  1630. X  f := file_parse(orig_filespec, ".HELP");        !Add .LIS ending
  1631. X
  1632. X    ! Create a buffer and window for editing
  1633. X
  1634. X  main_buf := create_buffer ("MAIN",f);
  1635. X  set (eob_text, main_buf, "[End of buffer]");
  1636. X
  1637. X  position (beginning_of(main_buf));
  1638. X
  1639. X  eve_convert_help;
  1640. X
  1641. X  f := file_parse(orig_filespec,"","",NAME);
  1642. X
  1643. X  write_file (main_buf, f+".RNH");
  1644. X
  1645. X quit;
  1646. XEndProcedure;        !TPU$INIT_PROCEDURE
  1647. X
  1648. Xtpu$init_procedure;
  1649. END_OF_FILE
  1650.   if test 4377 -ne `wc -c <'unzip-5.12/vms/cvthelp.tpu'`; then
  1651.     echo shar: \"'unzip-5.12/vms/cvthelp.tpu'\" unpacked with wrong size!
  1652.   fi
  1653.   # end of 'unzip-5.12/vms/cvthelp.tpu'
  1654. fi
  1655. if test -f 'unzip-5.12/vms/descrip.mms' -a "${1}" != "-c" ; then 
  1656.   echo shar: Will not clobber existing file \"'unzip-5.12/vms/descrip.mms'\"
  1657. else
  1658.   echo shar: Extracting \"'unzip-5.12/vms/descrip.mms'\" \(5400 characters\)
  1659.   sed "s/^X//" >'unzip-5.12/vms/descrip.mms' <<'END_OF_FILE'
  1660. X!==========================================================================
  1661. X! MMS description file for UnZip/UnZipSFX 5.12                    26 Aug 94
  1662. X!==========================================================================
  1663. X!
  1664. X! To build UnZip that uses shared libraries, edit the USER CUSTOMIZATION
  1665. X! lines below to taste, then do
  1666. X!    mms
  1667. X! or
  1668. X!    mmk
  1669. X! if you use Matt's Make (free MMS-compatible make utility).
  1670. X!
  1671. X! (One-time users will find it easier to use the MAKE.COM command file,
  1672. X! which generates both UnZip and UnZipSFX.  Just type "@[.VMS]MAKE", or
  1673. X! "@[.VMS]MAKE GCC" if you want to use GNU C.)
  1674. X
  1675. X! To build UnZip without shared libraries,
  1676. X!    mms noshare
  1677. X
  1678. X! To delete all .OBJ, .EXE and .HLP files,
  1679. X!    mms clean
  1680. X
  1681. XDO_THE_BUILD :
  1682. X        @ decc = f$search("SYS$SYSTEM:DECC$COMPILER.EXE").nes.""
  1683. X        @ axp = f$getsyi("HW_MODEL").ge.1024
  1684. X        @ macro = ""
  1685. X        @ if axp.or.decc then macro = "/MACRO=("
  1686. X        @ if decc then macro = macro + "__DECC__=1,"
  1687. X        @ if axp then macro = macro + "__ALPHA__=1,"
  1688. X        @ if macro.nes."" then macro = f$extract(0,f$length(macro)-1,macro)+ ")"
  1689. X        $(MMS)$(MMSQUALIFIERS)'macro' default
  1690. X
  1691. X.IFDEF EXE
  1692. X.ELSE
  1693. XEXE = .EXE
  1694. XOBJ = .OBJ
  1695. XOLB = .OLB
  1696. X.ENDIF
  1697. X
  1698. X!!!!!!!!!!!!!!!!!!!!!!!!!!! USER CUSTOMIZATION !!!!!!!!!!!!!!!!!!!!!!!!!!!!
  1699. X! uncomment the following line if you want the VMS CLI$ interface:
  1700. X!VMSCLI = VMSCLI,
  1701. X
  1702. X! add VMSWILD, RETURN_CODES, RETURN_SEVERITY, and/or any other optional
  1703. X! macros (except VMSCLI, above) to the following line for a custom version:
  1704. XCOMMON_DEFS =
  1705. X!!!!!!!!!!!!!!!!!!!!!!!! END OF USER CUSTOMIZATION !!!!!!!!!!!!!!!!!!!!!!!!
  1706. X
  1707. XCC = cc
  1708. X
  1709. X.IFDEF __ALPHA__
  1710. XCC_OPTIONS = /STANDARD=VAXC/ANSI/NOWARNINGS/INCLUDE=[]
  1711. XCC_DEFS = MODERN,
  1712. XOPTFILE =
  1713. XOPTIONS =
  1714. X.ELSE
  1715. X.IFDEF __DECC__
  1716. XCC_OPTIONS = /STANDARD=VAXC/ANSI/NOWARNINGS/INCLUDE=[]
  1717. XCC_DEFS = MODERN,
  1718. X.ELSE
  1719. XCC_OPTIONS = /INCLUDE=[]
  1720. XCC_DEFS =
  1721. X.ENDIF
  1722. XOPTFILE = ,[.vms]vmsshare.opt
  1723. XOPTIONS = $(OPTFILE)/OPTIONS
  1724. X.ENDIF
  1725. X
  1726. X.IFDEF __DEBUG__
  1727. XCDEB = /DEBUG/NOOPTIMIZE
  1728. XLDEB = /DEBUG
  1729. X.ELSE
  1730. XCDEB =
  1731. XLDEB = /NOTRACE
  1732. X.ENDIF
  1733. X
  1734. XCFLAGS_SFX  = $(CFLAGS) $(CC_OPTIONS) $(CDEB) -
  1735. X              /def=($(CC_DEFS) $(COMMON_DEFS) $(VMSCLI) SFX, VMS)
  1736. XCFLAGS      = $(CFLAGS) $(CC_OPTIONS) $(CDEB) -
  1737. X              /def=($(CC_DEFS) $(COMMON_DEFS) $(VMSCLI) VMS)
  1738. X
  1739. XLINKFLAGS   = $(LDEB)
  1740. X
  1741. X
  1742. XCOMMON_OBJS =    unzip$(OBJ),-
  1743. X        crypt$(OBJ),-
  1744. X        envargs$(OBJ),-
  1745. X        explode$(OBJ),-
  1746. X        extract$(OBJ),-
  1747. X        file_io$(OBJ),-
  1748. X        inflate$(OBJ),-
  1749. X        match$(OBJ),-
  1750. X        unreduce$(OBJ),-
  1751. X        unshrink$(OBJ),-
  1752. X        zipinfo$(OBJ),-
  1753. X        VMS=[.vms]vms$(OBJ)
  1754. X
  1755. X.IFDEF VMSCLI
  1756. XOBJS =    $(COMMON_OBJS),-
  1757. X    VMS_UNZIP_CLD=[.vms]unz_cld$(OBJ),-
  1758. X    VMS_UNZIP_CMDLINE=[.vms]cmdline$(OBJ)
  1759. XOBJX =    UNZIP=unzipsfx$(OBJ),-
  1760. X    VMS_UNZIP_CLD=[.vms]unz_cld$(OBJ),-
  1761. X    VMS_UNZIP_CMDLINE=cmdline_$(OBJ),-
  1762. X    crypt$(OBJ),-
  1763. X    EXTRACT=extract_$(OBJ),-
  1764. X    file_io$(OBJ),-
  1765. X    inflate$(OBJ),-
  1766. X    match$(OBJ),-
  1767. X    VMS=[.vms]vms_$(OBJ)
  1768. X.ELSE
  1769. XOBJS =    $(COMMON_OBJS)
  1770. XOBJX =    UNZIP=unzipsfx$(OBJ),-
  1771. X    crypt$(OBJ),-
  1772. X    EXTRACT=extract_$(OBJ),-
  1773. X    file_io$(OBJ),-
  1774. X    inflate$(OBJ),-
  1775. X    match$(OBJ),-
  1776. X    VMS=[.vms]vms_$(OBJ)
  1777. X.ENDIF
  1778. X
  1779. Xdefault    :    unzip$(EXE) unzipsfx$(EXE) unzip.hlp
  1780. X    @    !    Do nothing.
  1781. X
  1782. Xunzip$(EXE) :    UNZIP$(OLB)($(OBJS))$(OPTFILE)
  1783. X    $(LINK)$(LINKFLAGS) UNZIP$(OLB)/INCLUDE=UNZIP/LIBRARY$(OPTIONS), -
  1784. X    [.vms]unzip.opt/OPT
  1785. X
  1786. Xunzipsfx$(EXE) :    UNZIPSFX$(OLB)($(OBJX))$(OPTFILE)
  1787. X    $(LINK)$(LINKFLAGS) UNZIPSFX$(OLB)/INCLUDE=UNZIP/LIBRARY$(OPTIONS), -
  1788. X    [.vms]unzipsfx.opt/OPT
  1789. X
  1790. Xnoshare :    $(OBJS)
  1791. X    $(LINK) /EXE=$(MMS$TARGET) $(OBJS),SYS$LIBRARY:VAXCRTL.OLB/LIB, -
  1792. X    [.vms]unzip.opt/OPT
  1793. X
  1794. Xclean :
  1795. X    ! delete *.obj;*, *.olb;*, unzip$(exe);*, unzipsfx$(exe);*, -
  1796. X    !  unzip.hlp;*, [.vms]*.obj;*, [.vms]unzip.rnh;*
  1797. X    @[.vms]clean "$(OBJS)"
  1798. X    @[.vms]clean "$(OBJX)"
  1799. X    @[.vms]clean unzip$(olb),unzipsfx$(olb)
  1800. X    @[.vms]clean unzip$(exe),unzipsfx$(exe)
  1801. X    @[.vms]clean unzip.hlp,[.vms]unzip.rnh
  1802. X
  1803. Xcrypt$(OBJ)         : crypt.c unzip.h zip.h crypt.h
  1804. Xenvargs$(OBJ)        : envargs.c unzip.h
  1805. Xexplode$(OBJ)        : explode.c unzip.h
  1806. Xextract$(OBJ)        : extract.c unzip.h crypt.h
  1807. Xfile_io$(OBJ)        : file_io.c unzip.h crypt.h tables.h
  1808. Xinflate$(OBJ)        : inflate.c inflate.h unzip.h
  1809. Xmatch$(OBJ)        : match.c unzip.h
  1810. Xunreduce$(OBJ)        : unreduce.c unzip.h
  1811. Xunshrink$(OBJ)        : unshrink.c unzip.h
  1812. Xunzip$(OBJ)        : unzip.c unzip.h crypt.h version.h
  1813. Xunzip.hlp        : [.vms]unzip.rnh
  1814. Xzipinfo$(OBJ)        : zipinfo.c unzip.h
  1815. X[.vms]cmdline$(OBJ)    : [.vms]cmdline.c version.h
  1816. X[.vms]unz_cld$(OBJ)    : [.vms]unz_cld.cld
  1817. X
  1818. Xcmdline_$(OBJ)        : [.vms]cmdline.c version.h
  1819. X    $(CC) $(CFLAGS_SFX) /INCLUDE=SYS$DISK:[] /OBJ=$(MMS$TARGET) [.vms]cmdline.c
  1820. X
  1821. Xextract_$(OBJ)        : extract.c unzip.h crypt.h
  1822. X    $(CC) $(CFLAGS_SFX) /OBJ=$(MMS$TARGET) extract.c
  1823. X
  1824. Xunzipsfx$(OBJ)        : unzip.c unzip.h crypt.h version.h
  1825. X    $(CC) $(CFLAGS_SFX) /OBJ=$(MMS$TARGET) unzip.c
  1826. X
  1827. X[.vms]vms$(OBJ)        : [.vms]vms.c [.vms]vms.h unzip.h
  1828. X    @ x = ""
  1829. X    @ if f$search("SYS$LIBRARY:SYS$LIB_C.TLB").nes."" then x = "+SYS$LIBRARY:SYS$LIB_C.TLB/LIBRARY"
  1830. X    $(CC) $(CFLAGS) /INCLUDE=SYS$DISK:[] /OBJ=$(MMS$TARGET) [.vms]vms.c'x'
  1831. X
  1832. X[.vms]vms_$(OBJ)    : [.vms]vms.c [.vms]vms.h unzip.h
  1833. X    @ x = ""
  1834. X    @ if f$search("SYS$LIBRARY:SYS$LIB_C.TLB").nes."" then x = "+SYS$LIBRARY:SYS$LIB_C.TLB/LIBRARY"
  1835. X    $(CC) $(CFLAGS_SFX) /INCLUDE=SYS$DISK:[] /OBJ=$(MMS$TARGET) [.vms]vms.c'x'
  1836. X
  1837. X
  1838. X.IFDEF VMSCLI
  1839. X
  1840. X[.vms]unzip.rnh     : [.vms]unzip_cli.help
  1841. X    @ set default [.vms]
  1842. X     edit/tpu/nosection/nodisplay/command=cvthelp.tpu unzip_cli.help
  1843. X    rename unzip_cli.rnh unzip.rnh
  1844. X    @ set default [-]
  1845. X
  1846. X.ELSE
  1847. X
  1848. X[.vms]unzip.rnh     : [.vms]unzip_def.rnh
  1849. X    copy [.vms]unzip_def.rnh [.vms]unzip.rnh
  1850. X
  1851. X.ENDIF
  1852. END_OF_FILE
  1853.   if test 5400 -ne `wc -c <'unzip-5.12/vms/descrip.mms'`; then
  1854.     echo shar: \"'unzip-5.12/vms/descrip.mms'\" unpacked with wrong size!
  1855.   fi
  1856.   # end of 'unzip-5.12/vms/descrip.mms'
  1857. fi
  1858. if test -f 'unzip-5.12/vms/unzip_def.rnh' -a "${1}" != "-c" ; then 
  1859.   echo shar: Will not clobber existing file \"'unzip-5.12/vms/unzip_def.rnh'\"
  1860. else
  1861.   echo shar: Extracting \"'unzip-5.12/vms/unzip_def.rnh'\" \(5977 characters\)
  1862.   sed "s/^X//" >'unzip-5.12/vms/unzip_def.rnh' <<'END_OF_FILE'
  1863. X.!
  1864. X.!  File:    UNZIP_DEF.RNH
  1865. X.!
  1866. X.!  Author:    Hunter Goatley
  1867. X.!
  1868. X.!  Date:    October 23, 1991
  1869. X.!
  1870. X.!  Description:
  1871. X.!
  1872. X.!    RUNOFF source file for VMS on-line help for portable UnZip.
  1873. X.!    Adapted from UNZIP.MAN (now UNZIP.DOC).
  1874. X.!
  1875. X.!    To build:    $ REN UNZIP_DEF.RNH UNZIP.RNH
  1876. X.!            $ RUNOFF UNZIP.RNH
  1877. X.!            $ LIBR/HELP/INSERT libr UNZIP
  1878. X.!
  1879. X.!  Modification history:
  1880. X.!
  1881. X.!    01-001        Hunter Goatley        23-OCT-1991 09:21
  1882. X.!        Genesis.
  1883. X.!    01-002        Cave Newt        16-MAR-1992 22:37
  1884. X.!        Updated for UnZip 4.2.
  1885. X.!    01-003        Igor Mandrichenko    23-MAY-1992 22:14
  1886. X.!        Added -X option to command syntax.
  1887. X.!    01-004        Cave Newt        24-MAY-1992 13:30
  1888. X.!        Added UNZIP_OPTS environment variable help.
  1889. X.!    01-005        Igor Mandrichenko    14-DEC-1993 18:55
  1890. X.!        Modified for UnZip V5.1
  1891. X.!    01-006        Cave Newt        21-DEC-1993 12:38
  1892. X.!        Added -x option and cleaned up.
  1893. X.!    01-007        Cave Newt        14-JUL-1994 09:45
  1894. X.!        Added -Z, -C and -L options, removed -U, minor clean-up.
  1895. X.!    01-008        Cave Newt        28-JUL-1994 08:57
  1896. X.!        Removed semi-colons from comments.
  1897. X.!
  1898. X.noflags
  1899. X.lm4 .rm72
  1900. X.indent -4
  1901. X1 UNZIP
  1902. X.br
  1903. XUnZip is used to extract files compressed and packaged by Zip (see HELP ZIP
  1904. Xfor information on ZIP).
  1905. X.sk
  1906. XFor a brief help on Zip and Unzip, run each without specifying any
  1907. Xparameters on the command line.
  1908. X.sk
  1909. XUNZIP will list, test, or extract from a ZIP archive.  ZIP archives are commonly
  1910. Xfound on MS-DOS systems; a VMS version of ZIP can also be found here.
  1911. X.sk
  1912. XArchive member extraction is implied by the absence of the -c, -p, -t, -l, -v or
  1913. X-z options.  All archive members are processed unless a filespec is provided to
  1914. Xspecify a subset of the archive members.
  1915. XFormat:
  1916. X.sk;.lm+1;.literal
  1917. XUNZIP [-cflptuvxz[ajnoqCLVX]] file[.zip] [list] [-x xlist] [-d out_dir]
  1918. X.end literal;.lm-1
  1919. X.!------------------------------------------------------------------------------
  1920. X.indent -4
  1921. X2 Parameters
  1922. X.sk;.indent -4
  1923. Xfile[.zip]
  1924. X.sk
  1925. XFile specification for the ZIP archive(s) with optional wildcards. UnZip will
  1926. Xperform actions specified for every zipfile matching the specification.
  1927. XDefault file specification is SYS$DISK:[].ZIP.
  1928. XNote that self-extracting ZIP files are supported; just specify the .EXE
  1929. Xsuffix yourself.
  1930. X.sk;.indent -4
  1931. X[list]
  1932. X.sk
  1933. XAn optional list of archive members to be processed; if no list is given, all
  1934. Xarchive members are processed.  Expressions may be
  1935. Xused to match multiple members.  Expressions should be enclosed in double-quotes
  1936. Xto prevent interpretation by DCL.  Multiple filenames should be separated by
  1937. Xblanks.  Each file specification is similar to a Unix egrep expression and may
  1938. Xcontain:
  1939. X.sk
  1940. X.literal
  1941. X     *       matches a sequence of 0 or more characters
  1942. X     ?       matches exactly 1 character
  1943. X     [...]   matches any single character found inside the brackets;
  1944. X             ranges are specified by a beginning character,
  1945. X             a hyphen, and an ending character.  If a '!' or '^'
  1946. X             immediately follows the left bracket, then any character
  1947. X             not in the given range is matched.
  1948. X.end literal
  1949. X.sk
  1950. X.sk;.indent -4
  1951. X[-x xlist]
  1952. X.sk
  1953. XAn optional list of archive members to be excluded from processing.  The xlist
  1954. Xoverrides any files included in the normal list.
  1955. X.sk;.indent -4
  1956. X[-d out_dir]
  1957. X.sk
  1958. XOptional directory specification to be used as target root directory
  1959. Xfor files to be extracted.  Directory should be specified in "[.foo]"
  1960. Xformat rather than "foo.dir" or "foo/" format.
  1961. X.!------------------------------------------------------------------------------
  1962. X.indent -4
  1963. X2 Options
  1964. X.br
  1965. XThe default action of UnZip is to extract all zipfile entries.  The following
  1966. Xoptions and modifiers can be provided:
  1967. X.sk;.literal
  1968. X   -Z   ZipInfo mode
  1969. X   -c   extract files to SYS$OUTPUT (terminal)
  1970. X   -f   freshen existing files (replace if newer); create none
  1971. X   -l   list archive files (short format)
  1972. X   -p   extract files to SYS$OUTPUT; no informational messages
  1973. X   -t   test archive files
  1974. X   -u   update existing files; create new ones if needed
  1975. X   -v   list archive files (verbose format)
  1976. X   -z   display only the archive comment
  1977. X.end literal;.sk;.literal
  1978. X MODIFIERS
  1979. X   -a   extract text files in standard VMS text file format
  1980. X   -aa  extract all files as text
  1981. X   -j   junk paths (don't recreate archive's directory structure)
  1982. X   -n   never overwrite existing files; don't prompt
  1983. X   -o   OK to overwrite files without prompting
  1984. X   -q   perform operations quietly (-qq => even quieter)
  1985. X   -C   match filenames case-insensitively
  1986. X   -L   convert filenames to lowercase if created under DOS, VMS, etc.
  1987. X   -V   retain (VMS) file version numbers
  1988. X   -X   restore owner/protection info (may require privileges)
  1989. X.end literal;.sk
  1990. XNote that uppercase options (-C, -L, -V and -X) must be specified in quotes.
  1991. XFor example:
  1992. X.sk;.literal
  1993. X    unzip "-VX" -a zipfile
  1994. X.end literal;.sk
  1995. X.![this should probably be a separate section]:
  1996. XIn addition, default options may be specified via the UNZIP_OPTS logical.
  1997. XFor example, the following will cause UnZip to restore owner/protection
  1998. Xinformation and perform all operations at quiet-level 1 by default:
  1999. X.sk;.literal
  2000. X    define UNZIP_OPTS "-qX"
  2001. X.end literal;.sk
  2002. XNote that the quotation marks here are required to preserve lowercase options
  2003. X(opposite of the command-line behavior).
  2004. XTo negate a default option on the command line, add one or more minus 
  2005. Xsigns before the option letter, in addition to the leading switch character
  2006. X`-':
  2007. X.sk;.literal
  2008. X    unzip --ql zipfile
  2009. X.end literal
  2010. Xor
  2011. X.literal
  2012. X    unzip -l-q zipfile
  2013. X.end literal;.sk
  2014. XAt present it is not possible to decrement an option below zero--that is,
  2015. Xmore than a few minuses have no effect.
  2016. X.sk
  2017. XUNZIP_OPTS may be defined as a symbol rather than a logical, but if both
  2018. Xare defined, the logical is used.
  2019. X.!-----------------------------------------------------------------------------
  2020. X.indent -4
  2021. X2 Authors
  2022. X.br
  2023. XInfo-ZIP; currently maintained by Greg Roelofs.  VMS support maintained
  2024. Xby Igor Mandrichenko and Hunter Goatley.  Originally based on a program
  2025. Xby Samuel H. Smith.
  2026. X.sk
  2027. XVMS on-line help ported from UNZIP.DOC by Hunter Goatley.
  2028. END_OF_FILE
  2029.   if test 5977 -ne `wc -c <'unzip-5.12/vms/unzip_def.rnh'`; then
  2030.     echo shar: \"'unzip-5.12/vms/unzip_def.rnh'\" unpacked with wrong size!
  2031.   fi
  2032.   # end of 'unzip-5.12/vms/unzip_def.rnh'
  2033. fi
  2034. echo shar: End of archive 18 \(of 20\).
  2035. cp /dev/null ark18isdone
  2036. MISSING=""
  2037. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ; do
  2038.     if test ! -f ark${I}isdone ; then
  2039.     MISSING="${MISSING} ${I}"
  2040.     fi
  2041. done
  2042. if test "${MISSING}" = "" ; then
  2043.     echo You have unpacked all 20 archives.
  2044.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  2045. else
  2046.     echo You still must unpack the following archives:
  2047.     echo "        " ${MISSING}
  2048. fi
  2049. exit 0
  2050. exit 0 # Just in case...
  2051.