]>
git.saurik.com Git - wxWidgets.git/blob - utils/Install/packzip/unzip.c
1 /*---------------------------------------------------------------------------
5 UnZip - a zipfile extraction utility. See below for make instructions, or
6 read the comments in Makefile and the various Contents files for more de-
7 tailed explanations. To report a bug, send a *complete* description to
8 Zip-Bugs@lists.wku.edu; include machine type, operating system and ver-
9 sion, compiler and version, and reasonably detailed error messages or prob-
10 lem report. To join Info-ZIP, see the instructions in README.
12 UnZip 5.x is a greatly expanded and partially rewritten successor to 4.x,
13 which in turn was almost a complete rewrite of version 3.x. For a detailed
14 revision history, see UnzpHist.zip at quest.jpl.nasa.gov. For a list of
15 the many (near infinite) contributors, see "CONTRIBS" in the UnZip source
18 ---------------------------------------------------------------------------
20 [from original zipinfo.c]
22 This program reads great gobs of totally nifty information, including the
23 central directory stuff, from ZIP archives ("zipfiles" for short). It
24 started as just a testbed for fooling with zipfiles, but at this point it
25 is actually a useful utility. It also became the basis for the rewrite of
26 UnZip (3.16 -> 4.0), using the central directory for processing rather than
27 the individual (local) file headers.
29 As of ZipInfo v2.0 and UnZip v5.1, the two programs are combined into one.
30 If the executable is named "unzip" (or "unzip.exe", depending), it behaves
31 like UnZip by default; if it is named "zipinfo" or "ii", it behaves like
32 ZipInfo. The ZipInfo behavior may also be triggered by use of unzip's -Z
33 option; for example, "unzip -Z [zipinfo_options] archive.zip".
35 Another dandy product from your buddies at Newtware!
37 Author: Greg Roelofs, newt@pobox.com, http://pobox.com/~newt/
38 23 August 1990 -> April 1997
40 ---------------------------------------------------------------------------
42 Version: unzip5??.{tar.Z | tar.gz | zip} for Unix, VMS, OS/2, MS-DOS, Amiga,
43 Atari, Windows 3.x/95/NT/CE, Macintosh, Human68K, Acorn RISC OS,
44 BeOS, SMS/QDOS, VM/CMS, MVS, AOS/VS and TOPS-20. Decryption
45 requires sources in zcrypt28.zip. See the accompanying "WHERE"
46 file in the main source distribution for ftp, uucp, BBS and mail-
47 server sites, or see http://www.cdrom.com/pub/infozip/UnZip.html .
49 Copyrights: see accompanying file "COPYING" in UnZip source distribution.
50 (This software is free but NOT IN THE PUBLIC DOMAIN. There
51 are some restrictions on commercial use.)
53 ---------------------------------------------------------------------------*/
58 #define UNZIP_INTERNAL
59 #include "unzip.h" /* includes, typedefs, macros, prototypes, etc. */
63 #ifndef WINDLL /* The WINDLL port uses windll/windll.c instead... */
70 static void show_version_info
OF((__GPRO
));
78 #include "consts.h" /* all constant global variables are in here */
79 /* (non-constant globals were moved to globals.c) */
81 /* constant local variables: */
84 static ZCONST
char Far EnvUnZip
[] = ENV_UNZIP
;
85 static ZCONST
char Far EnvUnZip2
[] = ENV_UNZIP2
;
86 static ZCONST
char Far EnvZipInfo
[] = ENV_ZIPINFO
;
87 static ZCONST
char Far EnvZipInfo2
[] = ENV_ZIPINFO2
;
89 static ZCONST
char Far EnvUnZipExts
[] = ENV_UNZIPEXTS
;
93 #if (!defined(SFX) || defined(SFX_EXDIR))
94 static ZCONST
char Far NotExtracting
[] =
95 "caution: not extracting; -d ignored\n";
96 static ZCONST
char Far MustGiveExdir
[] =
97 "error: must specify directory to which to extract with -d option\n";
98 static ZCONST
char Far OnlyOneExdir
[] =
99 "error: -d option used more than once (only one exdir allowed)\n";
103 static ZCONST
char Far MustGivePasswd
[] =
104 "error: must give decryption password with -P option\n";
108 static ZCONST
char Far Zfirst
[] =
109 "error: -Z must be first option for ZipInfo mode (check UNZIP variable?)\n";
111 static ZCONST
char Far InvalidOptionsMsg
[] = "error:\
112 -fn or any combination of -c, -l, -p, -t, -u and -v options invalid\n";
113 static ZCONST
char Far IgnoreOOptionMsg
[] =
114 "caution: both -n and -o specified; ignoring -o\n";
116 /* usage() strings */
119 static ZCONST
char Far Example3
[] = "vms.c";
120 static ZCONST
char Far Example2
[] = " unzip\
121 \"-V\" foo \"Bar\" => must quote uppercase options and filenames in VMS\n";
123 static ZCONST
char Far Example3
[] = "ReadMe";
125 static ZCONST
char Far Example2
[] =
126 " unzip foo -d RAM:$ => extract all files from foo into RAMDisc\n";
128 #if (defined(OS2) || (defined(DOS_FLX_OS2_W32) && defined(MORE)))
129 static ZCONST
char Far Example2
[] =
130 ""; /* no room: too many local3[] items */
133 static ZCONST
char Far Example2
[] = ""; /* not needed */
135 static ZCONST
char Far Example2
[] = " \
136 unzip -p foo | more => send contents of foo.zip via pipe into program more\n";
142 /* local1[]: command options */
143 #if (defined(DLL) && defined(API_DOC))
144 static ZCONST
char Far local1
[] =
145 " -A print extended help for API functions";
146 #else /* !(DLL && API_DOC) */
147 static ZCONST
char Far local1
[] = "";
148 #endif /* ?(DLL && API_DOC) */
150 /* local2[] and local3[]: modifier options */
151 #ifdef DOS_FLX_OS2_W32
153 static ZCONST
char Far local2
[] = "";
155 static ZCONST
char Far local2
[] =
156 " -$ label removables (-$$ => fixed disks)";
160 static ZCONST
char Far local3
[] = "\
161 -X restore ACLs if supported -s spaces in filenames => '_'\n\
162 -M pipe through \"more\" pager\n";
164 static ZCONST
char Far local3
[] = " \
165 -X restore ACLs if supported -s spaces in filenames => '_'\n\n";
170 static ZCONST
char Far local3
[] = "\
171 -X restore ACLs (-XX => use privileges) -s spaces in filenames => '_'\n\
172 -M pipe through \"more\" pager\n";
174 static ZCONST
char Far local3
[] = " \
175 -X restore ACLs (-XX => use privileges) -s spaces in filenames => '_'\n\n";
179 static ZCONST
char Far local3
[] = " -\
180 M pipe through \"more\" pager -s spaces in filenames => '_'\n\n";
182 static ZCONST
char Far local3
[] = "\
183 -s spaces in filenames => '_'\n";
186 #endif /* ?OS2 || ?WIN32 */
187 #else /* !DOS_FLX_OS2_W32 */
189 static ZCONST
char Far local2
[] = "\"-X\" restore owner/protection info";
191 static ZCONST
char Far local3
[] = " \
192 \"-M\" pipe through \"more\" pager\n";
194 static ZCONST
char Far local3
[] = "\n";
197 #if (defined(__BEOS__) || defined(TANDEM) || defined(UNIX))
198 static ZCONST
char Far local2
[] = " -X restore UID/GID info";
200 static ZCONST
char Far local3
[] = "\
201 -M pipe through \"more\" pager\n";
203 static ZCONST
char Far local3
[] = "\n";
205 #else /* !(__BEOS__ || TANDEM || UNIX) */
207 static ZCONST
char Far local2
[] = " -N restore comments as filenotes";
209 static ZCONST
char Far local3
[] = "\
210 -M pipe through \"more\" pager\n";
212 static ZCONST
char Far local3
[] = "\n";
216 static ZCONST
char Far local2
[] = " -E show Mac info during extraction";
217 static ZCONST
char Far local3
[] = " \
218 -i ignore filenames in mac extra info -J junk (ignore) Mac extra info\n\n";
221 static ZCONST
char Far local2
[] = " -M pipe through \"more\" pager";
222 static ZCONST
char Far local3
[] = "\n";
224 static ZCONST
char Far local2
[] = ""; /* Atari, Mac, CMS/MVS etc. */
225 static ZCONST
char Far local3
[] = "";
229 #endif /* ?(__BEOS__ || TANDEM || UNIX) */
231 #endif /* ?DOS_FLX_OS2_W32 */
236 static ZCONST
char Far ZipInfoExample
[] = "* or % (e.g., \"*font-%.zip\")";
238 static ZCONST
char Far ZipInfoExample
[] = "*, ?, [] (e.g., \"[a-j]*.zip\")";
241 static ZCONST
char Far ZipInfoUsageLine1
[] = "\
242 ZipInfo %d.%d%d%s of %s, by Greg Roelofs and the Info-ZIP group.\n\
244 List name, date/time, attribute, size, compression method, etc., about files\n\
245 in list (excluding those in xlist) contained in the specified .zip archive(s).\
246 \n\"file[.zip]\" may be a wildcard name containing %s.\n\n\
247 usage: zipinfo [-12smlvChMtTz] file[.zip] [list...] [-x xlist...]\n\
248 or: unzip %s-Z%s [-12smlvChMtTz] file[.zip] [list...] [-x xlist...]\n";
250 static ZCONST
char Far ZipInfoUsageLine2
[] = "\nmain\
251 listing-format options: -s short Unix \"ls -l\" format (def.)\n\
252 -1 filenames ONLY, one per line -m medium Unix \"ls -l\" format\n\
253 -2 just filenames but allow -h/-t/-z -l long Unix \"ls -l\" format\n\
254 -v verbose, multi-page format\n";
256 static ZCONST
char Far ZipInfoUsageLine3
[] = "miscellaneous options:\n\
257 -h print header line -t print totals for listed files or for all\n\
258 -z print zipfile comment %c-T%c print file times in sortable decimal format\
259 \n %c-C%c be case-insensitive %s\
260 -x exclude filenames that follow from listing\n";
263 static ZCONST
char Far ZipInfoUsageLine4
[] =
264 " \"-M\" page output through built-in \"more\"\n";
266 static ZCONST
char Far ZipInfoUsageLine4
[] =
267 " -M page output through built-in \"more\"\n";
270 static ZCONST
char Far ZipInfoUsageLine4
[] = "";
272 #endif /* !NO_ZIPINFO */
276 /* BetaVersion[] is also used in vms/cmdline.c: do not make it static */
277 ZCONST
char Far BetaVersion
[] = "%s\
278 THIS IS STILL A BETA VERSION OF UNZIP%s -- DO NOT DISTRIBUTE.\n\n";
280 static ZCONST
char Far BetaVersion
[] = "%s\
281 THIS IS STILL A BETA VERSION OF UNZIP%s -- DO NOT DISTRIBUTE.\n\n";
287 /* UnzipSFXBanner[] is also used in vms/cmdline.c: do not make it static */
288 ZCONST
char Far UnzipSFXBanner
[] =
290 static ZCONST
char Far UnzipSFXBanner
[] =
292 "UnZipSFX %d.%d%d%s of %s, by Info-ZIP (Zip-Bugs@lists.wku.edu).\n";
294 static ZCONST
char Far UnzipSFXOpts
[] =
295 "Valid options are -tfupcz and -d <exdir>; modifiers are -abjnoqCL%sV%s.\n";
297 static ZCONST
char Far UnzipSFXOpts
[] =
298 "Valid options are -tfupcz; modifiers are -abjnoqCL%sV%s.\n";
301 static ZCONST
char Far CompileOptions
[] =
302 "UnZip special compilation options:\n";
303 static ZCONST
char Far CompileOptFormat
[] = "\t%s\n";
304 static ZCONST
char Far EnvOptions
[] =
305 "\nUnZip and ZipInfo environment options:\n";
306 static ZCONST
char Far EnvOptFormat
[] = "%16s: %s\n";
307 static ZCONST
char Far None
[] = "[none]";
308 # ifdef ACORN_FTYPE_NFS
309 static ZCONST
char Far AcornFtypeNFS
[] = "ACORN_FTYPE_NFS";
312 static ZCONST
char Far AsmCRC
[] = "ASM_CRC";
314 # ifdef ASM_INFLATECODES
315 static ZCONST
char Far AsmInflateCodes
[] = "ASM_INFLATECODES";
317 # ifdef CHECK_VERSIONS
318 static ZCONST
char Far Check_Versions
[] = "CHECK_VERSIONS";
320 # ifdef COPYRIGHT_CLEAN
321 static ZCONST
char Far Copyright_Clean
[] =
322 "COPYRIGHT_CLEAN (PKZIP 0.9x unreducing method not supported)";
325 static ZCONST
char Far UDebug
[] = "DEBUG";
328 static ZCONST
char Far DebugTime
[] = "DEBUG_TIME";
331 static ZCONST
char Far Dll
[] = "DLL";
334 static ZCONST
char Far DosWild
[] = "DOSWILD";
337 static ZCONST
char Far LZW_Clean
[] =
338 "LZW_CLEAN (PKZIP/Zip 1.x unshrinking method not supported)";
341 static ZCONST
char Far No_More
[] = "NO_MORE";
344 static ZCONST
char Far No_ZipInfo
[] = "NO_ZIPINFO";
347 static ZCONST
char Far NTSDExtAttrib
[] = "NTSD_EAS";
350 static ZCONST
char Far OS2ExtAttrib
[] = "OS2_EAS";
353 static ZCONST
char Far SMSExFldOnUnix
[] = "QLZIP";
356 static ZCONST
char Far Reentrant
[] = "REENTRANT";
359 static ZCONST
char Far RegArgs
[] = "REGARGS";
362 static ZCONST
char Far Return_Codes
[] = "RETURN_CODES";
364 # ifdef SET_DIR_ATTRIB
365 static ZCONST
char Far SetDirAttrib
[] = "SET_DIR_ATTRIB";
368 static ZCONST
char Far TimeStamp
[] = "TIMESTAMP";
371 static ZCONST
char Far UnixBackup
[] = "UNIXBACKUP";
373 # ifdef USE_EF_UT_TIME
374 static ZCONST
char Far Use_EF_UT_time
[] = "USE_EF_UT_TIME";
377 static ZCONST
char Far Use_Unshrink
[] =
378 "USE_UNSHRINK (PKZIP/Zip 1.x unshrinking method supported)";
380 # ifndef COPYRIGHT_CLEAN
381 static ZCONST
char Far Use_Smith_Code
[] =
382 "USE_SMITH_CODE (PKZIP 0.9x unreducing method supported)";
385 static ZCONST
char Far Use_VFAT_support
[] = "USE_VFAT";
388 static ZCONST
char Far UseZlib
[] =
389 "USE_ZLIB (compiled with version %s; using version %s)";
391 # ifdef VMS_TEXT_CONV
392 static ZCONST
char Far VmsTextConv
[] = "VMS_TEXT_CONV";
395 static ZCONST
char Far VmsCLI
[] = "VMSCLI";
398 static ZCONST
char Far VmsWild
[] = "VMSWILD";
401 # ifdef PASSWD_FROM_STDIN
402 static ZCONST
char Far PasswdStdin
[] = "PASSWD_FROM_STDIN";
404 static ZCONST
char Far Decryption
[] =
405 "\t[decryption, version %d.%d%s of %s]\n";
406 static ZCONST
char Far CryptDate
[] = CR_VERSION_DATE
;
410 static ZCONST
char Far EnvEMX
[] = "EMX";
411 static ZCONST
char Far EnvEMXOPT
[] = "EMXOPT";
413 # if (defined(__GO32__) && (!defined(__DJGPP__) || (__DJGPP__ < 2)))
414 static ZCONST
char Far EnvGO32
[] = "GO32";
415 static ZCONST
char Far EnvGO32TMP
[] = "GO32TMP";
417 # endif /* !__RSXNT__ */
420 /* UnzipUsageLine1[] is also used in vms/cmdline.c: do not make it static */
421 ZCONST
char Far UnzipUsageLine1
[] = "\
422 UnZip %d.%d%d%s of %s, by Info-ZIP. For more details see: unzip -v.\n\n";
423 #ifdef COPYRIGHT_CLEAN
424 static ZCONST
char Far UnzipUsageLine1v
[] = "\
425 UnZip %d.%d%d%s of %s, by Info-ZIP. Maintained by C. Spieler. Send\n\
426 bug reports to the authors at Zip-Bugs@lists.wku.edu; see README for details.\
429 static ZCONST
char Far UnzipUsageLine1v
[] = "\
430 UnZip %d.%d%d%s of %s, by Info-ZIP. UnReduce (c) 1989 by S. H. Smith.\n\
431 Send bug reports to authors at Zip-Bugs@lists.wku.edu; see README for details.\
433 #endif /* ?COPYRIGHT_CLEAN */
435 #ifdef COPYRIGHT_CLEAN
436 static ZCONST
char Far UnzipUsageLine1
[] = "\
437 UnZip %d.%d%d%s of %s, by Info-ZIP. Maintained by C. Spieler. Send\n\
438 bug reports to the authors at Zip-Bugs@lists.wku.edu; see README for details.\
441 static ZCONST
char Far UnzipUsageLine1
[] = "\
442 UnZip %d.%d%d%s of %s, by Info-ZIP. UnReduce (c) 1989 by S. H. Smith.\n\
443 Send bug reports to authors at Zip-Bugs@lists.wku.edu; see README for details.\
445 #endif /* ?COPYRIGHT_CLEAN */
446 #define UnzipUsageLine1v UnzipUsageLine1
449 static ZCONST
char Far UnzipUsageLine2v
[] = "\
450 Latest sources and executables are at ftp://ftp.cdrom.com/pub/infozip/ , as of\
451 \nabove date; see http://www.cdrom.com/pub/infozip/UnZip.html for other sites.\
455 static ZCONST
char Far UnzipUsageLine2
[] = "\
456 Usage: unzip %s[-opts[modifiers]] file[.zip] [list] [-d exdir]\n \
457 Default action is to extract files in list, to exdir;\n\
458 file[.zip] may be a wildcard. %s\n";
461 static ZCONST
char Far UnzipUsageLine2
[] = "\
462 Usage: unzip %s[-opts[modifiers]] file[.zip] [list] [-x xlist] [-d fm]\n \
463 Default action is to extract files in list, except those in xlist, to disk fm;\n\
464 file[.zip] may be a wildcard. %s\n";
466 static ZCONST
char Far UnzipUsageLine2
[] = "\
467 Usage: unzip %s[-opts[modifiers]] file[.zip] [list] [-x xlist] [-d exdir]\n \
468 Default action is to extract files in list, except those in xlist, to exdir;\n\
469 file[.zip] may be a wildcard. %s\n";
474 # define ZIPINFO_MODE_OPTION ""
475 static ZCONST
char Far ZipInfoMode
[] =
476 "(ZipInfo mode is disabled in this version.)";
478 # define ZIPINFO_MODE_OPTION "[-Z] "
480 static ZCONST
char Far ZipInfoMode
[] =
481 "\"-Z\" => ZipInfo mode (`unzip \"-Z\"' for usage).";
483 static ZCONST
char Far ZipInfoMode
[] =
484 "-Z => ZipInfo mode (\"unzip -Z\" for usage).";
486 #endif /* ?NO_ZIPINFO */
489 static ZCONST
char Far VMSusageLine2b
[] = "\
490 => define foreign command symbol in LOGIN.COM: $ unzip :== $dev:[dir]unzip.exe\
495 static ZCONST
char Far UnzipUsageLine3
[] = "\n\
496 -d extract files into exdir -l list files (short format)\n\
497 -f freshen existing files, create none -t test compressed archive data\n\
498 -u update files, create if necessary -z display archive comment\n\
502 static ZCONST
char Far UnzipUsageLine3
[] = "\n\
503 -p extract files to pipe, no messages -l list files (short format)\n\
504 -f freshen existing files, create none -t test compressed archive data\n\
505 -u update files, create if necessary -z display archive comment\n\
506 -x exclude files that follow (in xlist) -d extract files onto disk fm\n\
509 static ZCONST
char Far UnzipUsageLine3
[] = "\n\
510 -p extract files to pipe, no messages -l list files (short format)\n\
511 -f freshen existing files, create none -t test compressed archive data\n\
512 -u update files, create if necessary -z display archive comment\n\
513 -x exclude files that follow (in xlist) -d extract files into exdir\n\
518 static ZCONST
char Far UnzipUsageLine4
[] = "\
519 modifiers: -q quiet mode (-qq => quieter)\n\
520 -n never overwrite existing files -a auto-convert any text files\n\
521 -o overwrite files WITHOUT prompting -aa treat ALL files as text\n \
522 -j junk paths (do not make directories) -v be verbose/print version info\n\
523 %c-C%c match filenames case-insensitively %c-L%c make (some) names \
524 lowercase\n %-42s %c-V%c retain VMS version numbers\n%s";
526 static ZCONST
char Far UnzipUsageLine5
[] = "\
527 Examples (see unzip.doc for more info):\n\
528 unzip data1 -x joe => extract all files except joe from zipfile data1.zip\n\
530 unzip -fo foo %-6s => quietly replace existing %s if archive file newer\n";
537 /*****************************/
538 /* main() / UzpMain() stub */
539 /*****************************/
541 int include_unpack(char *aname
) /* return PK-type error code (except under VMS) */
546 argv
[0] = "install.exe";
552 r
= unzip(__G__ argc
, argv
);
557 void resetglobals(void) { }
559 int pipeit(char *format
, ...)
564 int confirm(char *format
, ...)
571 /*******************************/
572 /* Primary UnZip entry point */
573 /*******************************/
575 int unzip(__G__ argc
, argv
)
583 #ifdef DOS_FLX_H68_OS2_W32
586 int retcode
, error
=FALSE
;
588 #if (defined(__IBMC__) && defined(__DEBUG_ALLOC__))
589 extern void DebugMalloc(void);
595 G
.area
.Slide
=(uch
*)calloc(8193, sizeof(shrint
)+sizeof(uch
)+sizeof(uch
));
596 G
.area
.shrink
.Parent
= (shrint
*)G
.area
.Slide
;
597 G
.area
.shrink
.value
= G
.area
.Slide
+ (sizeof(shrint
)*(HSIZE
+1));
598 G
.area
.shrink
.Stack
= G
.area
.Slide
+
599 (sizeof(shrint
) + sizeof(uch
))*(HSIZE
+1);
602 /*---------------------------------------------------------------------------
603 Macintosh initialization code.
604 ---------------------------------------------------------------------------*/
610 for (a
= 0; a
< 4; ++a
)
611 G
.rghCursor
[a
] = GetCursor(a
+128);
616 /*---------------------------------------------------------------------------
617 Human68K initialization code.
618 ---------------------------------------------------------------------------*/
624 /*---------------------------------------------------------------------------
625 Acorn RISC OS initialization code.
626 ---------------------------------------------------------------------------*/
632 /*---------------------------------------------------------------------------
633 Set signal handler for restoring echo, warn of zipfile corruption, etc.
634 ---------------------------------------------------------------------------*/
637 signal(SIGINT
, handler
);
639 #ifdef SIGTERM /* some systems really have no SIGTERM */
640 signal(SIGTERM
, handler
);
643 signal(SIGBUS
, handler
);
646 signal(SIGSEGV
, handler
);
649 #if (defined(WIN32) && defined(__RSXNT__))
650 for (i
= 0 ; i
< argc
; i
++) {
651 _ISO_INTERN(argv
[i
]);
655 /*---------------------------------------------------------------------------
656 First figure out if we're running in UnZip mode or ZipInfo mode, and put
657 the appropriate environment-variable options into the queue. Then rip
658 through any command-line options lurking about...
659 ---------------------------------------------------------------------------*/
663 #if (defined(OS2) || defined(WIN32))
664 G
.zipfn
= GetLoadPath(__G
);/* non-MSC NT puts path into G.filename[] */
671 ulg status
= vms_unzip_cmdline(&argc
, &argv
);
677 uO
.zipinfo_mode
= FALSE
;
678 error
= uz_opts(__G__
&argc
, &argv
); /* UnZipSFX call only */
683 /* get the extensions to swap from environment */
684 getRISCOSexts(ENV_UNZIPEXTS
);
688 /* extract MKS extended argument list from environment (before envargs!) */
689 mksargs(&argc
, &argv
);
694 ulg status
= vms_unzip_cmdline(&argc
, &argv
);
700 G
.noargs
= (argc
== 1); /* no options, no zipfile, no anything */
703 for (p
= argv
[0] + strlen(argv
[0]); p
>= argv
[0]; --p
) {
713 if (STRNICMP(p
, LoadFarStringSmall(Zipnfo
), 7) == 0 ||
714 STRNICMP(p
, "ii", 2) == 0 ||
715 (argc
> 1 && strncmp(argv
[1], "-Z", 2) == 0))
717 uO
.zipinfo_mode
= TRUE
;
718 envargs(__G__
&argc
, &argv
, LoadFarStringSmall(EnvZipInfo
),
719 LoadFarStringSmall2(EnvZipInfo2
));
720 error
= zi_opts(__G__
&argc
, &argv
);
722 #endif /* NO_ZIPINFO */
724 uO
.zipinfo_mode
= FALSE
;
725 envargs(__G__
&argc
, &argv
, LoadFarStringSmall(EnvUnZip
),
726 LoadFarStringSmall2(EnvUnZip2
));
727 error
= uz_opts(__G__
&argc
, &argv
);
732 if ((argc
< 0) || error
)
735 /*---------------------------------------------------------------------------
736 Now get the zipfile name from the command line and then process any re-
737 maining options and file specifications.
738 ---------------------------------------------------------------------------*/
740 #ifdef DOS_FLX_H68_OS2_W32
741 /* convert MSDOS-style directory separators to Unix-style ones for
742 * user's convenience (include zipfile name itself)
745 for (G
.pfnames
= argv
, i
= argc
; i
> 0; --i
) {
747 /* argc does not include the zipfile specification */
748 for (G
.pfnames
= argv
, i
= argc
+1; i
> 0; --i
) {
752 for (q
= *G
.pfnames
; *q
; ++q
)
757 #endif /* DOS_FLX_H68_OS2_W32 */
760 G
.wildzipfn
= *argv
++;
763 #if (defined(SFX) && !defined(SFX_EXDIR)) /* only check for -x */
773 if (strcmp(*pp
, "-x") == 0) {
775 *pp
= 0; /* terminate G.pfnames */
776 G
.filespecs
= pp
- G
.pfnames
;
778 G
.pfnames
= (char **)fnames
; /* defaults */
781 G
.pxnames
= pp
+ 1; /* excluded-names ptr: _after_ -x */
782 G
.xfilespecs
= argc
- G
.filespecs
- 1;
783 break; /* skip rest of args */
785 G
.process_all_files
= FALSE
;
787 G
.process_all_files
= TRUE
; /* for speed */
789 #else /* !SFX || SFX_EXDIR */ /* check for -x or -d */
795 int in_files
=FALSE
, in_xfiles
=FALSE
;
798 G
.process_all_files
= FALSE
;
801 Trace((stderr
, "pp - argv = %d\n", pp
-argv
));
803 if (!uO
.exdir
&& STRNICMP(*pp
, "-d", 2) == 0) {
805 if (!uO
.exdir
&& strncmp(*pp
, "-d", 2) == 0) {
807 int firstarg
= (pp
== argv
);
809 uO
.exdir
= (*pp
) + 2;
810 if (in_files
) { /* ... zipfile ... -d exdir ... */
811 *pp
= (char *)NULL
; /* terminate G.pfnames */
812 G
.filespecs
= pp
- G
.pfnames
;
814 } else if (in_xfiles
) {
815 *pp
= (char *)NULL
; /* terminate G.pxnames */
816 G
.xfilespecs
= pp
- G
.pxnames
;
817 /* "... -x xlist -d exdir": nothing left */
819 /* first check for "-dexdir", then for "-d exdir" */
820 if (*uO
.exdir
== '\0') {
824 Info(slide
, 0x401, ((char *)slide
,
825 LoadFarString(MustGiveExdir
)));
826 return(PK_PARAM
); /* don't extract here by accident */
829 if (firstarg
) { /* ... zipfile -d exdir ... */
831 G
.pfnames
= pp
+ 1; /* argv+2 */
832 G
.filespecs
= argc
- (G
.pfnames
-argv
); /* for now... */
834 G
.process_all_files
= TRUE
;
835 G
.pfnames
= (char **)fnames
; /* GRR: necessary? */
836 G
.filespecs
= 0; /* GRR: necessary? */
840 } else if (!in_xfiles
) {
841 if (strcmp(*pp
, "-x") == 0) {
843 if (pp
== G
.pfnames
) {
844 G
.pfnames
= (char **)fnames
; /* defaults */
846 } else if (in_files
) {
847 *pp
= 0; /* terminate G.pfnames */
848 G
.filespecs
= pp
- G
.pfnames
; /* adjust count */
851 G
.pxnames
= pp
+ 1; /* excluded-names ptr starts after -x */
852 G
.xfilespecs
= argc
- (G
.pxnames
-argv
); /* anything left */
858 G
.process_all_files
= TRUE
; /* for speed */
860 if (uO
.exdir
!= (char *)NULL
&& !G
.extract_flag
) /* -d ignored */
861 Info(slide
, 0x401, ((char *)slide
, LoadFarString(NotExtracting
)));
862 #endif /* ?(SFX && !SFX_EXDIR) */
864 /*---------------------------------------------------------------------------
865 Okey dokey, we have everything we need to get started. Let's roll.
866 ---------------------------------------------------------------------------*/
868 retcode
= process_zipfiles(__G
);
871 } /* end main()/unzip() */
877 /**********************/
878 /* Function uz_opts() */
879 /**********************/
881 int uz_opts(__G__ pargc
, pargv
)
887 int argc
, c
, error
=FALSE
, negative
=0;
893 while (++argv
, (--argc
> 0 && *argv
!= NULL
&& **argv
== '-')) {
895 while ((c
= *s
++) != 0) { /* "!= 0": prevent Turbo C warning */
907 uO
.aflag
= MAX(uO
.aflag
-negative
,0);
912 #if (defined(DLL) && defined(API_DOC))
913 case ('A'): /* extended help for API */
914 APIhelp(__G__ argc
, argv
);
915 *pargc
= -1; /* signal to exit successfully */
921 uO
.bflag
= MAX(uO
.bflag
-negative
,0);
923 negative
= 0; /* do nothing: "-b" is default */
933 case ('B'): /* -B: back up existing files */
935 uO
.B_flag
= FALSE
, negative
= 0;
942 uO
.cflag
= FALSE
, negative
= 0;
949 uO
.aflag
= 2; /* so you can read it on the screen */
958 case ('C'): /* -C: match filenames case-insensitively */
960 uO
.C_flag
= FALSE
, negative
= 0;
964 #endif /* !CMS_MVS */
965 #if (!defined(SFX) || defined(SFX_EXDIR))
967 if (negative
) { /* negative not allowed with -d exdir */
968 Info(slide
, 0x401, ((char *)slide
,
969 LoadFarString(MustGiveExdir
)));
970 return(PK_PARAM
); /* don't extract here by accident */
972 if (uO
.exdir
!= (char *)NULL
) {
973 Info(slide
, 0x401, ((char *)slide
,
974 LoadFarString(OnlyOneExdir
)));
975 return(PK_PARAM
); /* GRR: stupid restriction? */
977 /* first check for "-dexdir", then for "-d exdir" */
979 if (*uO
.exdir
== '\0') {
983 if (*uO
.exdir
== '-') {
984 Info(slide
, 0x401, ((char *)slide
,
985 LoadFarString(MustGiveExdir
)));
988 /* else uO.exdir points at extraction dir */
990 Info(slide
, 0x401, ((char *)slide
,
991 LoadFarString(MustGiveExdir
)));
995 /* uO.exdir now points at extraction dir (-dexdir or
996 * -d exdir); point s at end of exdir to avoid mis-
997 * interpretation of exdir characters as more options
1004 #endif /* !SFX || SFX_EXDIR */
1005 case ('e'): /* just ignore -e, -x options (extract) */
1008 case ('E'): /* -E [MacOS] display Mac e.f. when restoring */
1010 uO
.E_flag
= FALSE
, negative
= 0;
1016 case ('f'): /* "freshen" (extract only newer files) */
1018 uO
.fflag
= uO
.uflag
= FALSE
, negative
= 0;
1020 uO
.fflag
= uO
.uflag
= TRUE
;
1022 #if (defined(RISCOS) || defined(ACORN_FTYPE_NFS))
1023 case ('F'): /* Acorn filetype & NFS extension handling */
1025 uO
.acorn_nfs_ext
= FALSE
, negative
= 0;
1027 uO
.acorn_nfs_ext
= TRUE
;
1029 #endif /* RISCOS || ACORN_FTYPE_NFS */
1030 case ('h'): /* just print help message and quit */
1032 return USAGE(PK_OK
);
1034 case ('i'): /* -i [MacOS] ignore filenames stored in Mac ef */
1036 uO
.i_flag
= FALSE
, negative
= 0;
1042 case ('j'): /* junk pathnames/directory structure */
1044 uO
.jflag
= FALSE
, negative
= 0;
1048 #if (defined(__BEOS__) || defined(MACOS))
1049 case ('J'): /* Junk BeOS or MacOS file attributes */
1051 uO
.J_flag
= FALSE
, negative
= 0;
1056 #endif /* __BEOS__ || MACOS */
1060 uO
.vflag
= MAX(uO
.vflag
-negative
,0);
1067 case ('L'): /* convert (some) filenames to lowercase */
1069 uO
.L_flag
= FALSE
, negative
= 0;
1073 #endif /* !CMS_MVS */
1078 case ('M'): /* send all screen output through "more" fn. */
1079 /* GRR: eventually check for numerical argument => height */
1081 G
.M_flag
= FALSE
, negative
= 0;
1086 case ('n'): /* don't overwrite any files */
1088 uO
.overwrite_none
= FALSE
, negative
= 0;
1090 uO
.overwrite_none
= TRUE
;
1093 case ('N'): /* restore comments as filenotes */
1095 uO
.N_flag
= FALSE
, negative
= 0;
1100 case ('o'): /* OK to overwrite files without prompting */
1102 uO
.overwrite_all
= MAX(uO
.overwrite_all
-negative
,0);
1107 case ('p'): /* pipes: extract to stdout, no messages */
1110 uO
.qflag
= MAX(uO
.qflag
-999,0);
1118 /* GRR: yes, this is highly insecure, but dozens of people
1119 * have pestered us for this, so here we go... */
1121 if (negative
) { /* negative not allowed with -P passwd */
1122 Info(slide
, 0x401, ((char *)slide
,
1123 LoadFarString(MustGivePasswd
)));
1124 return(PK_PARAM
); /* don't extract here by accident */
1126 if (uO
.pwdarg
!= (char *)NULL
) {
1128 GRR: eventually support multiple passwords?
1129 Info(slide, 0x401, ((char *)slide,
1130 LoadFarString(OnlyOnePasswd)));
1134 /* first check for "-Ppasswd", then for "-P passwd" */
1136 if (*uO
.pwdarg
== '\0') {
1139 uO
.pwdarg
= *++argv
;
1140 if (*uO
.pwdarg
== '-') {
1141 Info(slide
, 0x401, ((char *)slide
,
1142 LoadFarString(MustGivePasswd
)));
1145 /* else pwdarg points at decryption password */
1147 Info(slide
, 0x401, ((char *)slide
,
1148 LoadFarString(MustGivePasswd
)));
1152 /* pwdarg now points at decryption password (-Ppasswd or
1153 * -P passwd); point s at end of passwd to avoid mis-
1154 * interpretation of passwd characters as more options
1162 case ('q'): /* quiet: fewer comments/messages */
1164 uO
.qflag
= MAX(uO
.qflag
-negative
,0);
1170 case ('Q'): /* QDOS flags */
1171 qlflag
^= strtol(s
, &s
, 10);
1172 break; /* we XOR this as we can config qlflags */
1174 #ifdef DOS_FLX_OS2_W32
1175 case ('s'): /* spaces in filenames: allow by default */
1177 uO
.sflag
= FALSE
, negative
= 0;
1181 #endif /* DOS_FLX_OS2_W32 */
1184 uO
.tflag
= FALSE
, negative
= 0;
1191 uO
.T_flag
= FALSE
, negative
= 0;
1196 case ('u'): /* update (extract only new and newer files) */
1198 uO
.uflag
= FALSE
, negative
= 0;
1203 case ('U'): /* obsolete; to be removed in version 6.0 */
1205 uO
.L_flag
= TRUE
, negative
= 0;
1209 #endif /* !CMS_MVS */
1211 case ('v'): /* verbose */
1213 uO
.vflag
= MAX(uO
.vflag
-negative
,0);
1215 } else if (uO
.vflag
)
1222 case ('V'): /* Version (retain VMS/DEC-20 file versions) */
1224 uO
.V_flag
= FALSE
, negative
= 0;
1228 #endif /* !CMS_MVS */
1229 case ('x'): /* extract: default */
1231 /* when 'x' is the only option in this argument, and the
1232 * next arg is not an option, assume this initiates an
1233 * exclusion list (-x xlist): terminate option-scanning
1234 * and leave uz_opts with argv still pointing to "-x";
1235 * the xlist is processed later
1237 if (s
- argv
[0] == 2 && *s
== '\0' &&
1238 argc
> 1 && argv
[1][0] != '-') {
1239 /* break out of nested loops without "++argv;--argc" */
1244 #if (defined(RESTORE_UIDGID) || defined(OS2_W32))
1245 case ('X'): /* restore owner/protection info (need privs?) */
1247 uO
.X_flag
= MAX(uO
.X_flag
-negative
,0);
1252 #endif /* RESTORE_UIDGID || OS2_W32 */
1253 case ('z'): /* display only the archive comment */
1255 uO
.zflag
= MAX(uO
.zflag
-negative
,0);
1261 case ('Z'): /* should have been first option (ZipInfo) */
1262 Info(slide
, 0x401, ((char *)slide
, LoadFarString(Zfirst
)));
1269 uO
.volflag
= MAX(uO
.volflag
-negative
,0);
1274 #endif /* DOS_OS2_W32 */
1280 } /* end while (not end of argument string) */
1281 } /* end while (not done with switches) */
1283 /*---------------------------------------------------------------------------
1284 Check for nonsensical combinations of options.
1285 ---------------------------------------------------------------------------*/
1288 opts_done
: /* yes, very ugly...but only used by UnZipSFX with -x xlist */
1291 if ((uO
.cflag
&& uO
.tflag
) || (uO
.cflag
&& uO
.uflag
) ||
1292 (uO
.tflag
&& uO
.uflag
) || (uO
.fflag
&& uO
.overwrite_none
))
1294 Info(slide
, 0x401, ((char *)slide
, LoadFarString(InvalidOptionsMsg
)));
1303 if (uO
.overwrite_all
&& uO
.overwrite_none
) {
1304 Info(slide
, 0x401, ((char *)slide
, LoadFarString(IgnoreOOptionMsg
)));
1305 uO
.overwrite_all
= FALSE
;
1308 if (G
.M_flag
&& !isatty(1)) /* stdout redirected: "more" func. useless */
1315 if ((argc
-- == 0) || error
)
1321 if (uO
.vflag
>= 2 && argc
== -1) { /* "unzip -v" */
1322 show_version_info(__G
);
1325 if (!G
.noargs
&& !error
)
1326 error
= PK_PARAM
; /* had options (not -h or -v) but no zipfile */
1328 return USAGE(error
);
1332 /* print our banner unless we're being fairly quiet */
1334 Info(slide
, error
? 1 : 0, ((char *)slide
, LoadFarString(UnzipSFXBanner
),
1335 UZ_MAJORVER
, UZ_MINORVER
, PATCHLEVEL
, BETALEVEL
,
1336 LoadFarStringSmall(VersionDate
)));
1338 /* always print the beta warning: no unauthorized distribution!! */
1339 Info(slide
, error
? 1 : 0, ((char *)slide
, LoadFarString(BetaVersion
), "\n",
1344 if (uO
.cflag
|| uO
.tflag
|| uO
.vflag
|| uO
.zflag
1349 G
.extract_flag
= FALSE
;
1351 G
.extract_flag
= TRUE
;
1357 } /* end function uz_opts() */
1362 /********************/
1363 /* Function usage() */
1364 /********************/
1368 # define LOCAL "X. Quote uppercase options"
1382 /* Default for all other systems: */
1388 # define SFXOPT1 "M"
1393 int usage(__G__ error
) /* return PK-type error code */
1397 Info(slide
, error
? 1 : 0, ((char *)slide
, LoadFarString(UnzipSFXBanner
),
1398 UZ_MAJORVER
, UZ_MINORVER
, PATCHLEVEL
, BETALEVEL
,
1399 LoadFarStringSmall(VersionDate
)));
1400 Info(slide
, error
? 1 : 0, ((char *)slide
, LoadFarString(UnzipSFXOpts
),
1403 Info(slide
, error
? 1 : 0, ((char *)slide
, LoadFarString(BetaVersion
), "\n",
1410 return PK_COOL
; /* just wanted usage screen: no error */
1412 } /* end function usage() */
1427 int usage(__G__ error
) /* return PK-type error code */
1431 int flag
= (error
? 1 : 0);
1434 /*---------------------------------------------------------------------------
1435 Print either ZipInfo usage or UnZip usage, depending on incantation.
1436 (Strings must be no longer than 512 bytes for Turbo C, apparently.)
1437 ---------------------------------------------------------------------------*/
1439 if (uO
.zipinfo_mode
) {
1443 Info(slide
, flag
, ((char *)slide
, LoadFarString(ZipInfoUsageLine1
),
1444 ZI_MAJORVER
, ZI_MINORVER
, PATCHLEVEL
, BETALEVEL
,
1445 LoadFarStringSmall(VersionDate
),
1446 LoadFarStringSmall2(ZipInfoExample
), QUOTS
,QUOTS
));
1447 Info(slide
, flag
, ((char *)slide
, LoadFarString(ZipInfoUsageLine2
)));
1448 Info(slide
, flag
, ((char *)slide
, LoadFarString(ZipInfoUsageLine3
),
1449 QUOT
,QUOT
, QUOT
,QUOT
, LoadFarStringSmall(ZipInfoUsageLine4
)));
1451 Info(slide
, flag
, ((char *)slide
, "\nRemember that non-lowercase\
1452 filespecs must be quoted in VMS (e.g., \"Makefile\").\n"));
1455 #endif /* !NO_ZIPINFO */
1457 } else { /* UnZip mode */
1459 Info(slide
, flag
, ((char *)slide
, LoadFarString(UnzipUsageLine1
),
1460 UZ_MAJORVER
, UZ_MINORVER
, PATCHLEVEL
, BETALEVEL
,
1461 LoadFarStringSmall(VersionDate
)));
1463 Info(slide
, flag
, ((char *)slide
, LoadFarString(BetaVersion
), "", ""));
1466 Info(slide
, flag
, ((char *)slide
, LoadFarString(UnzipUsageLine2
),
1467 ZIPINFO_MODE_OPTION
, LoadFarStringSmall(ZipInfoMode
)));
1469 if (!error
) /* maybe no command-line tail found; show extra help */
1470 Info(slide
, flag
, ((char *)slide
, LoadFarString(VMSusageLine2b
)));
1473 Info(slide
, flag
, ((char *)slide
, LoadFarString(UnzipUsageLine3
),
1474 LoadFarStringSmall(local1
)));
1476 Info(slide
, flag
, ((char *)slide
, LoadFarString(UnzipUsageLine4
),
1477 QUOT
,QUOT
, QUOT
,QUOT
, LoadFarStringSmall(local2
), QUOT
,QUOT
,
1478 LoadFarStringSmall2(local3
)));
1480 /* This is extra work for SMALL_MEM, but it will work since
1481 * LoadFarStringSmall2 uses the same buffer. Remember, this
1483 Info(slide
, flag
, ((char *)slide
, LoadFarString(UnzipUsageLine5
),
1484 LoadFarStringSmall(Example2
), LoadFarStringSmall2(Example3
),
1485 LoadFarStringSmall2(Example3
)));
1487 } /* end if (uO.zipinfo_mode) */
1492 return PK_COOL
; /* just wanted usage screen: no error */
1494 } /* end function usage() */
1503 /********************************/
1504 /* Function show_version_info() */
1505 /********************************/
1507 static void show_version_info(__G
)
1510 if (uO
.qflag
> 3) /* "unzip -vqqqq" */
1511 Info(slide
, 0, ((char *)slide
, "%d\n",
1512 (UZ_MAJORVER
*100 + UZ_MINORVER
*10 + PATCHLEVEL
)));
1514 char *envptr
, *getenv();
1517 Info(slide
, 0, ((char *)slide
, LoadFarString(UnzipUsageLine1v
),
1518 UZ_MAJORVER
, UZ_MINORVER
, PATCHLEVEL
, BETALEVEL
,
1519 LoadFarStringSmall(VersionDate
)));
1520 Info(slide
, 0, ((char *)slide
,
1521 LoadFarString(UnzipUsageLine2v
)));
1523 Info(slide
, 0, ((char *)slide
, LoadFarString(CompileOptions
)));
1524 #ifdef ACORN_FTYPE_NFS
1525 Info(slide
, 0, ((char *)slide
, LoadFarString(CompileOptFormat
),
1526 LoadFarStringSmall(AcornFtypeNFS
)));
1530 Info(slide
, 0, ((char *)slide
, LoadFarString(CompileOptFormat
),
1531 LoadFarStringSmall(AsmCRC
)));
1534 #ifdef ASM_INFLATECODES
1535 Info(slide
, 0, ((char *)slide
, LoadFarString(CompileOptFormat
),
1536 LoadFarStringSmall(AsmInflateCodes
)));
1539 #ifdef CHECK_VERSIONS
1540 Info(slide
, 0, ((char *)slide
, LoadFarString(CompileOptFormat
),
1541 LoadFarStringSmall(Check_Versions
)));
1544 #ifdef COPYRIGHT_CLEAN
1545 Info(slide
, 0, ((char *)slide
, LoadFarString(CompileOptFormat
),
1546 LoadFarStringSmall(Copyright_Clean
)));
1550 Info(slide
, 0, ((char *)slide
, LoadFarString(CompileOptFormat
),
1551 LoadFarStringSmall(UDebug
)));
1555 Info(slide
, 0, ((char *)slide
, LoadFarString(CompileOptFormat
),
1556 LoadFarStringSmall(DebugTime
)));
1560 Info(slide
, 0, ((char *)slide
, LoadFarString(CompileOptFormat
),
1561 LoadFarStringSmall(Dll
)));
1565 Info(slide
, 0, ((char *)slide
, LoadFarString(CompileOptFormat
),
1566 LoadFarStringSmall(DosWild
)));
1570 Info(slide
, 0, ((char *)slide
, LoadFarString(CompileOptFormat
),
1571 LoadFarStringSmall(LZW_Clean
)));
1575 Info(slide
, 0, ((char *)slide
, LoadFarString(CompileOptFormat
),
1576 LoadFarStringSmall(No_More
)));
1580 Info(slide
, 0, ((char *)slide
, LoadFarString(CompileOptFormat
),
1581 LoadFarStringSmall(No_ZipInfo
)));
1585 Info(slide
, 0, ((char *)slide
, LoadFarString(CompileOptFormat
),
1586 LoadFarStringSmall(NTSDExtAttrib
)));
1590 Info(slide
, 0, ((char *)slide
, LoadFarString(CompileOptFormat
),
1591 LoadFarStringSmall(OS2ExtAttrib
)));
1595 Info(slide
, 0, ((char *)slide
, LoadFarString(CompileOptFormat
),
1596 LoadFarStringSmall(SMSExFldOnUnix
)));
1600 Info(slide
, 0, ((char *)slide
, LoadFarString(CompileOptFormat
),
1601 LoadFarStringSmall(Reentrant
)));
1605 Info(slide
, 0, ((char *)slide
, LoadFarString(CompileOptFormat
),
1606 LoadFarStringSmall(RegArgs
)));
1610 Info(slide
, 0, ((char *)slide
, LoadFarString(CompileOptFormat
),
1611 LoadFarStringSmall(Return_Codes
)));
1614 #ifdef SET_DIR_ATTRIB
1615 Info(slide
, 0, ((char *)slide
, LoadFarString(CompileOptFormat
),
1616 LoadFarStringSmall(SetDirAttrib
)));
1620 Info(slide
, 0, ((char *)slide
, LoadFarString(CompileOptFormat
),
1621 LoadFarStringSmall(TimeStamp
)));
1625 Info(slide
, 0, ((char *)slide
, LoadFarString(CompileOptFormat
),
1626 LoadFarStringSmall(UnixBackup
)));
1629 #ifdef USE_EF_UT_TIME
1630 Info(slide
, 0, ((char *)slide
, LoadFarString(CompileOptFormat
),
1631 LoadFarStringSmall(Use_EF_UT_time
)));
1634 #ifndef COPYRIGHT_CLEAN
1635 Info(slide
, 0, ((char *)slide
, LoadFarString(CompileOptFormat
),
1636 LoadFarStringSmall(Use_Smith_Code
)));
1640 Info(slide
, 0, ((char *)slide
, LoadFarString(CompileOptFormat
),
1641 LoadFarStringSmall(Use_Unshrink
)));
1645 Info(slide
, 0, ((char *)slide
, LoadFarString(CompileOptFormat
),
1646 LoadFarStringSmall(Use_VFAT_support
)));
1650 sprintf((char *)(slide
+256), LoadFarStringSmall(UseZlib
),
1651 ZLIB_VERSION
, zlib_version
);
1652 Info(slide
, 0, ((char *)slide
, LoadFarString(CompileOptFormat
),
1653 (char *)(slide
+256)));
1656 #ifdef VMS_TEXT_CONV
1657 Info(slide
, 0, ((char *)slide
, LoadFarString(CompileOptFormat
),
1658 LoadFarStringSmall(VmsTextConv
)));
1662 Info(slide
, 0, ((char *)slide
, LoadFarString(CompileOptFormat
),
1663 LoadFarStringSmall(VmsCLI
)));
1667 Info(slide
, 0, ((char *)slide
, LoadFarString(CompileOptFormat
),
1668 LoadFarStringSmall(VmsWild
)));
1672 # ifdef PASSWD_FROM_STDIN
1673 Info(slide
, 0, ((char *)slide
, LoadFarString(CompileOptFormat
),
1674 LoadFarStringSmall(PasswdStdin
)));
1676 Info(slide
, 0, ((char *)slide
, LoadFarString(Decryption
),
1677 CR_MAJORVER
, CR_MINORVER
, CR_BETA_VER
,
1678 LoadFarStringSmall(CryptDate
)));
1682 Info(slide
, 0, ((char *)slide
,
1683 LoadFarString(CompileOptFormat
),
1684 LoadFarStringSmall(None
)));
1686 Info(slide
, 0, ((char *)slide
, LoadFarString(EnvOptions
)));
1687 envptr
= getenv(LoadFarStringSmall(EnvUnZip
));
1688 Info(slide
, 0, ((char *)slide
, LoadFarString(EnvOptFormat
),
1689 LoadFarStringSmall(EnvUnZip
),
1690 (envptr
== (char *)NULL
|| *envptr
== 0)?
1691 LoadFarStringSmall2(None
) : envptr
));
1692 envptr
= getenv(LoadFarStringSmall(EnvUnZip2
));
1693 Info(slide
, 0, ((char *)slide
, LoadFarString(EnvOptFormat
),
1694 LoadFarStringSmall(EnvUnZip2
),
1695 (envptr
== (char *)NULL
|| *envptr
== 0)?
1696 LoadFarStringSmall2(None
) : envptr
));
1697 envptr
= getenv(LoadFarStringSmall(EnvZipInfo
));
1698 Info(slide
, 0, ((char *)slide
, LoadFarString(EnvOptFormat
),
1699 LoadFarStringSmall(EnvZipInfo
),
1700 (envptr
== (char *)NULL
|| *envptr
== 0)?
1701 LoadFarStringSmall2(None
) : envptr
));
1702 envptr
= getenv(LoadFarStringSmall(EnvZipInfo2
));
1703 Info(slide
, 0, ((char *)slide
, LoadFarString(EnvOptFormat
),
1704 LoadFarStringSmall(EnvZipInfo2
),
1705 (envptr
== (char *)NULL
|| *envptr
== 0)?
1706 LoadFarStringSmall2(None
) : envptr
));
1709 envptr
= getenv(LoadFarStringSmall(EnvEMX
));
1710 Info(slide
, 0, ((char *)slide
, LoadFarString(EnvOptFormat
),
1711 LoadFarStringSmall(EnvEMX
),
1712 (envptr
== (char *)NULL
|| *envptr
== 0)?
1713 LoadFarStringSmall2(None
) : envptr
));
1714 envptr
= getenv(LoadFarStringSmall(EnvEMXOPT
));
1715 Info(slide
, 0, ((char *)slide
, LoadFarString(EnvOptFormat
),
1716 LoadFarStringSmall(EnvEMXOPT
),
1717 (envptr
== (char *)NULL
|| *envptr
== 0)?
1718 LoadFarStringSmall2(None
) : envptr
));
1719 #endif /* __EMX__ */
1720 #if (defined(__GO32__) && (!defined(__DJGPP__) || (__DJGPP__ < 2)))
1721 envptr
= getenv(LoadFarStringSmall(EnvGO32
));
1722 Info(slide
, 0, ((char *)slide
, LoadFarString(EnvOptFormat
),
1723 LoadFarStringSmall(EnvGO32
),
1724 (envptr
== (char *)NULL
|| *envptr
== 0)?
1725 LoadFarStringSmall2(None
) : envptr
));
1726 envptr
= getenv(LoadFarStringSmall(EnvGO32TMP
));
1727 Info(slide
, 0, ((char *)slide
, LoadFarString(EnvOptFormat
),
1728 LoadFarStringSmall(EnvGO32TMP
),
1729 (envptr
== (char *)NULL
|| *envptr
== 0)?
1730 LoadFarStringSmall2(None
) : envptr
));
1731 #endif /* __GO32__ && !(__DJGPP__ >= 2) */
1732 #endif /* !__RSXNT__ */
1734 envptr
= getenv(LoadFarStringSmall(EnvUnZipExts
));
1735 Info(slide
, 0, ((char *)slide
, LoadFarString(EnvOptFormat
),
1736 LoadFarStringSmall(EnvUnZipExts
),
1737 (envptr
== (char *)NULL
|| *envptr
== 0)?
1738 LoadFarStringSmall2(None
) : envptr
));
1741 } /* end function show_version() */
1744 #endif /* !WINDLL */