#define __UNZIP_C
#define UNZIP_INTERNAL
#include "unzip.h"
#include "crypt.h"
#include "unzvers.h"
#ifndef WINDLL
#ifdef REENTRANT
typedef struct _sign_info
{
struct _sign_info *previous;
void (*sighandler)(int);
int sigtype;
} savsigs_info;
#endif
#ifdef REENTRANT
static int setsignalhandler OF((__GPRO__ savsigs_info **p_savedhandler_chain,
int signal_type, void (*newhandler)(int)));
#endif
#ifndef SFX
static void show_version_info OF((__GPRO));
#endif
#include "consts.h"
#ifndef SFX
static ZCONST char Far EnvUnZip[] = ENV_UNZIP;
static ZCONST char Far EnvUnZip2[] = ENV_UNZIP2;
static ZCONST char Far EnvZipInfo[] = ENV_ZIPINFO;
static ZCONST char Far EnvZipInfo2[] = ENV_ZIPINFO2;
#ifdef RISCOS
static ZCONST char Far EnvUnZipExts[] = ENV_UNZIPEXTS;
#endif
static ZCONST char Far NoMemArguments[] =
"envargs: cannot get memory for arguments";
#endif
#ifdef REENTRANT
static ZCONST char Far CantSaveSigHandler[] =
"error: cannot save signal handler settings\n";
#endif
#if (!defined(SFX) || defined(SFX_EXDIR))
static ZCONST char Far NotExtracting[] =
"caution: not extracting; -d ignored\n";
static ZCONST char Far MustGiveExdir[] =
"error: must specify directory to which to extract with -d option\n";
static ZCONST char Far OnlyOneExdir[] =
"error: -d option used more than once (only one exdir allowed)\n";
#endif
#if CRYPT
static ZCONST char Far MustGivePasswd[] =
"error: must give decryption password with -P option\n";
#endif
#ifndef SFX
static ZCONST char Far Zfirst[] =
"error: -Z must be first option for ZipInfo mode (check UNZIP variable?)\n";
#endif
static ZCONST char Far InvalidOptionsMsg[] = "error:\
-fn or any combination of -c, -l, -p, -t, -u and -v options invalid\n";
static ZCONST char Far IgnoreOOptionMsg[] =
"caution: both -n and -o specified; ignoring -o\n";
#ifndef SFX
#ifdef VMS
static ZCONST char Far Example3[] = "vms.c";
static ZCONST char Far Example2[] = " unzip\
\"-V\" foo \"Bar\" => must quote uppercase options and filenames in VMS\n";
#else
static ZCONST char Far Example3[] = "ReadMe";
#ifdef RISCOS
static ZCONST char Far Example2[] =
" unzip foo -d RAM:$ => extract all files from foo into RAMDisc\n";
#else
#if (defined(OS2) || (defined(DOS_FLX_OS2_W32) && defined(MORE)))
static ZCONST char Far Example2[] =
"";
#else
#ifdef MACOS
static ZCONST char Far Example2[] = "";
#else
static ZCONST char Far Example2[] = " \
unzip -p foo | more => send contents of foo.zip via pipe into program more\n";
#endif
#endif
#endif
#endif
#if (defined(DLL) && defined(API_DOC))
static ZCONST char Far local1[] =
" -A print extended help for API functions";
#else
static ZCONST char Far local1[] = "";
#endif
#ifdef DOS_FLX_H68_OS2_W32
#ifdef FLEXOS
static ZCONST char Far local2[] = "";
#else
static ZCONST char Far local2[] =
" -$ label removables (-$$ => fixed disks)";
#endif
#ifdef OS2
#ifdef MORE
static ZCONST char Far local3[] = "\
-X restore ACLs if supported -s spaces in filenames => '_'\n\
-M pipe through \"more\" pager\n";
#else
static ZCONST char Far local3[] = " \
-X restore ACLs if supported -s spaces in filenames => '_'\n\n";
#endif
#else
#ifdef WIN32
#ifdef NTSD_EAS
#ifdef MORE
static ZCONST char Far local3[] = "\
-X restore ACLs (-XX => use privileges) -s spaces in filenames => '_'\n\
-M pipe through \"more\" pager\n";
#else
static ZCONST char Far local3[] = " \
-X restore ACLs (-XX => use privileges) -s spaces in filenames => '_'\n\n";
#endif
#else
#ifdef MORE
static ZCONST char Far local3[] = "\
-M pipe through \"more\" pager \
-s spaces in filenames => '_'\n\n";
#else
static ZCONST char Far local3[] = " \
-s spaces in filenames => '_'\n\n";
#endif
#endif
#else
#ifdef MORE
static ZCONST char Far local3[] = " -\
M pipe through \"more\" pager -s spaces in filenames => '_'\n\n";
#else
static ZCONST char Far local3[] = "\
-s spaces in filenames => '_'\n";
#endif
#endif
#endif
#else
#ifdef VMS
static ZCONST char Far local2[] = "\"-X\" restore owner/protection info";
#ifdef MORE
static ZCONST char Far local3[] = " \
\"-M\" pipe through \"more\" pager\n";
#else
static ZCONST char Far local3[] = "\n";
#endif
#else
#ifdef BEO_UNX
static ZCONST char Far local2[] = " -X restore UID/GID info";
#ifdef MORE
static ZCONST char Far local3[] = "\
-M pipe through \"more\" pager\n";
#else
static ZCONST char Far local3[] = "\n";
#endif
#else
#ifdef TANDEM
static ZCONST char Far local2[] = " -X restore Tandem User ID";
#ifdef MORE
static ZCONST char Far local3[] = "\
-b create 'C' (180) text files -M pipe through \"more\" pager\n";
#else
static ZCONST char Far local3[] = " -b create 'C' (180) text files\n";
#endif
#else
#ifdef AMIGA
static ZCONST char Far local2[] = " -N restore comments as filenotes";
#ifdef MORE
static ZCONST char Far local3[] = " \
-M pipe through \"more\" pager\n";
#else
static ZCONST char Far local3[] = "\n";
#endif
#else
#ifdef MACOS
static ZCONST char Far local2[] = " -E show Mac info during extraction";
static ZCONST char Far local3[] = " \
-i ignore filenames in mac extra info -J junk (ignore) Mac extra info\n\
\n";
#else
#ifdef MORE
static ZCONST char Far local2[] = " -M pipe through \"more\" pager";
static ZCONST char Far local3[] = "\n";
#else
static ZCONST char Far local2[] = "";
static ZCONST char Far local3[] = "";
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#endif
#ifndef NO_ZIPINFO
#ifdef VMS
static ZCONST char Far ZipInfoExample[] = "* or % (e.g., \"*font-%.zip\")";
#else
static ZCONST char Far ZipInfoExample[] = "*, ?, [] (e.g., \"[a-j]*.zip\")";
#endif
static ZCONST char Far ZipInfoUsageLine1[] = "\
ZipInfo %d.%d%d%s of %s, by Greg Roelofs and the Info-ZIP group.\n\
\n\
List name, date/time, attribute, size, compression method, etc., about files\n\
in list (excluding those in xlist) contained in the specified .zip archive(s).\
\n\"file[.zip]\" may be a wildcard name containing %s.\n\n\
usage: zipinfo [-12smlvChMtTz] file[.zip] [list...] [-x xlist...]\n\
or: unzip %s-Z%s [-12smlvChMtTz] file[.zip] [list...] [-x xlist...]\n";
static ZCONST char Far ZipInfoUsageLine2[] = "\nmain\
listing-format options: -s short Unix \"ls -l\" format (def.)\n\
-1 filenames ONLY, one per line -m medium Unix \"ls -l\" format\n\
-2 just filenames but allow -h/-t/-z -l long Unix \"ls -l\" format\n\
-v verbose, multi-page format\n";
static ZCONST char Far ZipInfoUsageLine3[] = "miscellaneous options:\n\
-h print header line -t print totals for listed files or for all\n\
-z print zipfile comment %c-T%c print file times in sortable decimal format\
\n %c-C%c be case-insensitive %s\
-x exclude filenames that follow from listing\n";
#ifdef MORE
#ifdef VMS
static ZCONST char Far ZipInfoUsageLine4[] =
" \"-M\" page output through built-in \"more\"\n";
#else
static ZCONST char Far ZipInfoUsageLine4[] =
" -M page output through built-in \"more\"\n";
#endif
#else
static ZCONST char Far ZipInfoUsageLine4[] = "";
#endif
#endif
#ifdef BETA
# ifdef VMSCLI
ZCONST char Far BetaVersion[] = "%s\
THIS IS STILL A BETA VERSION OF UNZIP%s -- DO NOT DISTRIBUTE.\n\n";
# else
static ZCONST char Far BetaVersion[] = "%s\
THIS IS STILL A BETA VERSION OF UNZIP%s -- DO NOT DISTRIBUTE.\n\n";
# endif
#endif
#ifdef SFX
# ifdef VMSCLI
ZCONST char Far UnzipSFXBanner[] =
# else
static ZCONST char Far UnzipSFXBanner[] =
# endif
"UnZipSFX %d.%d%d%s of %s, by Info-ZIP (Zip-Bugs@lists.wku.edu).\n";
# ifdef SFX_EXDIR
static ZCONST char Far UnzipSFXOpts[] =
"Valid options are -tfupcz and -d <exdir>; modifiers are -abjnoqCL%sV%s.\n";
# else
static ZCONST char Far UnzipSFXOpts[] =
"Valid options are -tfupcz; modifiers are -abjnoqCL%sV%s.\n";
# endif
#else
static ZCONST char Far CompileOptions[] =
"UnZip special compilation options:\n";
static ZCONST char Far CompileOptFormat[] = "\t%s\n";
static ZCONST char Far EnvOptions[] =
"\nUnZip and ZipInfo environment options:\n";
static ZCONST char Far EnvOptFormat[] = "%16s: %s\n";
static ZCONST char Far None[] = "[none]";
# ifdef ACORN_FTYPE_NFS
static ZCONST char Far AcornFtypeNFS[] = "ACORN_FTYPE_NFS";
# endif
# ifdef ASM_CRC
static ZCONST char Far AsmCRC[] = "ASM_CRC";
# endif
# ifdef ASM_INFLATECODES
static ZCONST char Far AsmInflateCodes[] = "ASM_INFLATECODES";
# endif
# ifdef CHECK_VERSIONS
static ZCONST char Far Check_Versions[] = "CHECK_VERSIONS";
# endif
# ifdef COPYRIGHT_CLEAN
static ZCONST char Far Copyright_Clean[] =
"COPYRIGHT_CLEAN (PKZIP 0.9x unreducing method not supported)";
# endif
# ifdef DEBUG
static ZCONST char Far UDebug[] = "DEBUG";
# endif
# ifdef DEBUG_TIME
static ZCONST char Far DebugTime[] = "DEBUG_TIME";
# endif
# ifdef DLL
static ZCONST char Far Dll[] = "DLL";
# endif
# ifdef DOSWILD
static ZCONST char Far DosWild[] = "DOSWILD";
# endif
# ifdef LZW_CLEAN
static ZCONST char Far LZW_Clean[] =
"LZW_CLEAN (PKZIP/Zip 1.x unshrinking method not supported)";
# endif
# ifndef MORE
static ZCONST char Far No_More[] = "NO_MORE";
# endif
# ifdef NO_ZIPINFO
static ZCONST char Far No_ZipInfo[] = "NO_ZIPINFO";
# endif
# ifdef NTSD_EAS
static ZCONST char Far NTSDExtAttrib[] = "NTSD_EAS";
# endif
# ifdef OLD_THEOS_EXTRA
static ZCONST char Far OldTheosExtra[] =
"OLD_THEOS_EXTRA (handle also old Theos port extra field)";
# endif
# ifdef OS2_EAS
static ZCONST char Far OS2ExtAttrib[] = "OS2_EAS";
# endif
# ifdef QLZIP
static ZCONST char Far SMSExFldOnUnix[] = "QLZIP";
# endif
# ifdef REENTRANT
static ZCONST char Far Reentrant[] = "REENTRANT";
# endif
# ifdef REGARGS
static ZCONST char Far RegArgs[] = "REGARGS";
# endif
# ifdef RETURN_CODES
static ZCONST char Far Return_Codes[] = "RETURN_CODES";
# endif
# ifdef SET_DIR_ATTRIB
static ZCONST char Far SetDirAttrib[] = "SET_DIR_ATTRIB";
# endif
# ifdef TIMESTAMP
static ZCONST char Far TimeStamp[] = "TIMESTAMP";
# endif
# ifdef UNIXBACKUP
static ZCONST char Far UnixBackup[] = "UNIXBACKUP";
# endif
# ifdef USE_EF_UT_TIME
static ZCONST char Far Use_EF_UT_time[] = "USE_EF_UT_TIME";
# endif
# ifndef LZW_CLEAN
static ZCONST char Far Use_Unshrink[] =
"USE_UNSHRINK (PKZIP/Zip 1.x unshrinking method supported)";
# endif
# ifndef COPYRIGHT_CLEAN
static ZCONST char Far Use_Smith_Code[] =
"USE_SMITH_CODE (PKZIP 0.9x unreducing method supported)";
# endif
# ifdef USE_DEFLATE64
static ZCONST char Far Use_Deflate64[] =
"USE_DEFLATE64 (PKZIP 4.x Deflate64(tm) supported)";
# endif
# ifdef MULT_VOLUME
static ZCONST char Far Use_MultiVol[] =
"MULT_VOLUME (multi-volume archives supported)";
# endif
# if (defined(__DJGPP__) && (__DJGPP__ >= 2))
# ifdef USE_DJGPP_ENV
static ZCONST char Far Use_DJGPP_Env[] = "USE_DJGPP_ENV";
# endif
# ifdef USE_DJGPP_GLOB
static ZCONST char Far Use_DJGPP_Glob[] = "USE_DJGPP_GLOB";
# endif
# endif
# ifdef USE_VFAT
static ZCONST char Far Use_VFAT_support[] = "USE_VFAT";
# endif
# ifdef USE_ZLIB
static ZCONST char Far UseZlib[] =
"USE_ZLIB (compiled with version %s; using version %s)";
# endif
# ifdef VMS_TEXT_CONV
static ZCONST char Far VmsTextConv[] = "VMS_TEXT_CONV";
# endif
# ifdef VMSCLI
static ZCONST char Far VmsCLI[] = "VMSCLI";
# endif
# ifdef VMSWILD
static ZCONST char Far VmsWild[] = "VMSWILD";
# endif
# ifdef WILD_STOP_AT_DIR
static ZCONST char Far WildStopAtDir[] = "WILD_STOP_AT_DIR";
# endif
# if CRYPT
# ifdef PASSWD_FROM_STDIN
static ZCONST char Far PasswdStdin[] = "PASSWD_FROM_STDIN";
# endif
static ZCONST char Far Decryption[] =
"\t[decryption, version %d.%d%s of %s]\n";
static ZCONST char Far CryptDate[] = CR_VERSION_DATE;
# endif
# ifndef __RSXNT__
# ifdef __EMX__
static ZCONST char Far EnvEMX[] = "EMX";
static ZCONST char Far EnvEMXOPT[] = "EMXOPT";
# endif
# if (defined(__GO32__) && (!defined(__DJGPP__) || (__DJGPP__ < 2)))
static ZCONST char Far EnvGO32[] = "GO32";
static ZCONST char Far EnvGO32TMP[] = "GO32TMP";
# endif
# endif
#ifdef VMS
ZCONST char Far UnzipUsageLine1[] = "\
UnZip %d.%d%d%s of %s, by Info-ZIP. For more details see: unzip -v.\n\n";
#ifdef COPYRIGHT_CLEAN
static ZCONST char Far UnzipUsageLine1v[] = "\
UnZip %d.%d%d%s of %s, by Info-ZIP. Maintained by C. Spieler. Send\n\
bug reports to the authors at Zip-Bugs@lists.wku.edu; see README for details.\
\n\n";
#else
static ZCONST char Far UnzipUsageLine1v[] = "\
UnZip %d.%d%d%s of %s, by Info-ZIP. UnReduce (c) 1989 by S. H. Smith.\n\
Send bug reports to authors at Zip-Bugs@lists.wku.edu; see README for details.\
\n\n";
#endif
#else
#ifdef COPYRIGHT_CLEAN
static ZCONST char Far UnzipUsageLine1[] = "\
UnZip %d.%d%d%s of %s, by Info-ZIP. Maintained by C. Spieler. Send\n\
bug reports to the authors at Zip-Bugs@lists.wku.edu; see README for details.\
\n\n";
#else
static ZCONST char Far UnzipUsageLine1[] = "\
UnZip %d.%d%d%s of %s, by Info-ZIP. UnReduce (c) 1989 by S. H. Smith.\n\
Send bug reports to authors at Zip-Bugs@lists.wku.edu; see README for details.\
\n\n";
#endif
#define UnzipUsageLine1v UnzipUsageLine1
#endif
static ZCONST char Far UnzipUsageLine2v[] = "\
Latest sources and executables are at ftp://ftp.info-zip.org/pub/infozip/ ;\
\nsee ftp://ftp.info-zip.org/pub/infozip/UnZip.html for other sites.\
\n\n";
#ifdef MACOS
static ZCONST char Far UnzipUsageLine2[] = "\
Usage: unzip %s[-opts[modifiers]] file[.zip] [list] [-d exdir]\n \
Default action is to extract files in list, to exdir;\n\
file[.zip] may be a wildcard. %s\n";
#else
#ifdef VM_CMS
static ZCONST char Far UnzipUsageLine2[] = "\
Usage: unzip %s[-opts[modifiers]] file[.zip] [list] [-x xlist] [-d fm]\n \
Default action is to extract files in list, except those in xlist, to disk fm;\
\n file[.zip] may be a wildcard. %s\n";
#else
static ZCONST char Far UnzipUsageLine2[] = "\
Usage: unzip %s[-opts[modifiers]] file[.zip] [list] [-x xlist] [-d exdir]\n \
Default action is to extract files in list, except those in xlist, to exdir;\n\
file[.zip] may be a wildcard. %s\n";
#endif
#endif
#ifdef NO_ZIPINFO
# define ZIPINFO_MODE_OPTION ""
static ZCONST char Far ZipInfoMode[] =
"(ZipInfo mode is disabled in this version.)";
#else
# define ZIPINFO_MODE_OPTION "[-Z] "
# ifdef VMS
static ZCONST char Far ZipInfoMode[] =
"\"-Z\" => ZipInfo mode (`unzip \"-Z\"' for usage).";
# else
static ZCONST char Far ZipInfoMode[] =
"-Z => ZipInfo mode (\"unzip -Z\" for usage).";
# endif
#endif
#ifdef VMS
static ZCONST char Far VMSusageLine2b[] = "\
=> define foreign command symbol in LOGIN.COM: $ unzip :== $dev:[dir]unzip.exe\
\n";
#endif
#ifdef MACOS
static ZCONST char Far UnzipUsageLine3[] = "\n\
-d extract files into exdir -l list files (short format)\n\
-f freshen existing files, create none -t test compressed archive data\n\
-u update files, create if necessary -z display archive comment\n\
%s\n";
#else
#ifdef VM_CMS
static ZCONST char Far UnzipUsageLine3[] = "\n\
-p extract files to pipe, no messages -l list files (short format)\n\
-f freshen existing files, create none -t test compressed archive data\n\
-u update files, create if necessary -z display archive comment\n\
-x exclude files that follow (in xlist) -d extract files onto disk fm\n\
%s\n";
#else
static ZCONST char Far UnzipUsageLine3[] = "\n\
-p extract files to pipe, no messages -l list files (short format)\n\
-f freshen existing files, create none -t test compressed archive data\n\
-u update files, create if necessary -z display archive comment\n\
-x exclude files that follow (in xlist) -d extract files into exdir\n\
%s\n";
#endif
#endif
static ZCONST char Far UnzipUsageLine4[] = "\
modifiers: -q quiet mode (-qq => quieter)\n\
-n never overwrite existing files -a auto-convert any text files\n\
-o overwrite files WITHOUT prompting -aa treat ALL files as text\n \
-j junk paths (do not make directories) -v be verbose/print version info\n\
%c-C%c match filenames case-insensitively %c-L%c make (some) names \
lowercase\n %-42s %c-V%c retain VMS version numbers\n%s";
static ZCONST char Far UnzipUsageLine5[] = "\
Examples (see unzip.txt for more info):\n\
unzip data1 -x joe => extract all files except joe from zipfile data1.zip\n\
%s\
unzip -fo foo %-6s => quietly replace existing %s if archive file newer\n";
#endif
int MAIN(argc, argv)
int argc;
char *argv[];
{
int r;
CONSTRUCTGLOBALS();
r = unzip(__G__ argc, argv);
DESTROYGLOBALS();
RETURN(r);
}
int unzip(__G__ argc, argv)
__GDEF
int argc;
char *argv[];
{
#ifndef NO_ZIPINFO
char *p;
#endif
#ifdef DOS_FLX_H68_NLM_OS2_W32
int i;
#endif
int retcode, error=FALSE;
#ifdef REENTRANT
savsigs_info *oldsighandlers = NULL;
# define SET_SIGHANDLER(sigtype, newsighandler) \
if ((retcode = setsignalhandler(__G__ &oldsighandlers, (sigtype), \
(newsighandler))) > PK_WARN) \
goto cleanup_and_exit
#else
# define SET_SIGHANDLER(sigtype, newsighandler) \
signal((sigtype), (newsighandler))
#endif
SETLOCALE(LC_CTYPE,"");
#if (defined(__IBMC__) && defined(__DEBUG_ALLOC__))
extern void DebugMalloc(void);
atexit(DebugMalloc);
#endif
#ifdef MALLOC_WORK
# define UZ_SLIDE_CHUNK (sizeof(shrint)+sizeof(uch)+sizeof(uch))
# define UZ_NUMOF_CHUNKS \
(unsigned)(((WSIZE+UZ_SLIDE_CHUNK-1)/UZ_SLIDE_CHUNK > HSIZE) ? \
(WSIZE+UZ_SLIDE_CHUNK-1)/UZ_SLIDE_CHUNK : HSIZE)
G.area.Slide = (uch *)zcalloc(UZ_NUMOF_CHUNKS, UZ_SLIDE_CHUNK);
# undef UZ_SLIDE_CHUNK
# undef UZ_NUMOF_CHUNKS
G.area.shrink.Parent = (shrint *)G.area.Slide;
G.area.shrink.value = G.area.Slide + (sizeof(shrint)*(HSIZE));
G.area.shrink.Stack = G.area.Slide +
(sizeof(shrint) + sizeof(uch))*(HSIZE);
#endif
#ifdef SIGINT
SET_SIGHANDLER(SIGINT, handler);
#endif
#ifdef SIGTERM
SET_SIGHANDLER(SIGTERM, handler);
#endif
#ifdef SIGBUS
SET_SIGHANDLER(SIGBUS, handler);
#endif
#ifdef SIGSEGV
SET_SIGHANDLER(SIGSEGV, handler);
#endif
#if (defined(WIN32) && defined(__RSXNT__))
for (i = 0 ; i < argc; i++) {
_ISO_INTERN(argv[i]);
}
#endif
#ifdef MACOS
{
int a;
for (a = 0; a < 4; ++a)
G.rghCursor[a] = GetCursor(a+128);
G.giCursor = 0;
}
#endif
#ifdef NLM
InitUnZipConsole();
#endif
#ifdef RISCOS
set_prefix();
#endif
#ifdef THEOS
if (! _setargv(&argc, &argv)) {
Info(slide, 0x401, ((char *)slide, "cannot process argv\n"));
retcode = PK_MEM;
goto cleanup_and_exit;
}
#endif
#ifdef SFX
G.argv0 = argv[0];
#if (defined(OS2) || defined(WIN32))
G.zipfn = GetLoadPath(__G);
#else
G.zipfn = G.argv0;
#endif
#ifdef VMSCLI
{
ulg status = vms_unzip_cmdline(&argc, &argv);
if (!(status & 1)) {
retcode = (int)status;
goto cleanup_and_exit;
}
}
#endif
uO.zipinfo_mode = FALSE;
error = uz_opts(__G__ &argc, &argv);
#else
#ifdef RISCOS
getRISCOSexts(ENV_UNZIPEXTS);
#endif
#ifdef MSDOS
mksargs(&argc, &argv);
#endif
#ifdef VMSCLI
{
ulg status = vms_unzip_cmdline(&argc, &argv);
if (!(status & 1)) {
retcode = (int)status;
goto cleanup_and_exit;
}
}
#endif
G.noargs = (argc == 1);
#ifndef NO_ZIPINFO
for (p = argv[0] + strlen(argv[0]); p >= argv[0]; --p) {
if (*p == DIR_END
#ifdef DIR_END2
|| *p == DIR_END2
#endif
)
break;
}
++p;
#ifdef THEOS
if (strncmp(p, "ZIPINFO.",8) == 0 || strstr(p, ".ZIPINFO:") != NULL ||
strncmp(p, "II.",3) == 0 || strstr(p, ".II:") != NULL ||
#else
if (STRNICMP(p, LoadFarStringSmall(Zipnfo), 7) == 0 ||
STRNICMP(p, "ii", 2) == 0 ||
#endif
(argc > 1 && strncmp(argv[1], "-Z", 2) == 0))
{
uO.zipinfo_mode = TRUE;
if ((error = envargs(&argc, &argv, LoadFarStringSmall(EnvZipInfo),
LoadFarStringSmall2(EnvZipInfo2))) != PK_OK)
perror(LoadFarString(NoMemArguments));
else
error = zi_opts(__G__ &argc, &argv);
} else
#endif
{
uO.zipinfo_mode = FALSE;
if ((error = envargs(&argc, &argv, LoadFarStringSmall(EnvUnZip),
LoadFarStringSmall2(EnvUnZip2))) != PK_OK)
perror(LoadFarString(NoMemArguments));
else
error = uz_opts(__G__ &argc, &argv);
}
#endif
if ((argc < 0) || error) {
retcode = error;
goto cleanup_and_exit;
}
#ifdef DOS_FLX_H68_NLM_OS2_W32
#ifdef SFX
for (G.pfnames = argv, i = argc; i > 0; --i) {
#else
for (G.pfnames = argv, i = argc+1; i > 0; --i) {
#endif
#ifdef __human68k__
extern char *_toslash(char *);
_toslash(*G.pfnames);
#else
char *q;
for (q = *G.pfnames; *q; ++q)
if (*q == '\\')
*q = '/';
++G.pfnames;
#endif
}
#endif
#ifndef SFX
G.wildzipfn = *argv++;
#endif
#if (defined(SFX) && !defined(SFX_EXDIR))
G.filespecs = argc;
G.xfilespecs = 0;
if (argc > 0) {
char **pp = argv-1;
G.pfnames = argv;
while (*++pp)
if (strcmp(*pp, "-x") == 0) {
if (pp > argv) {
*pp = 0;
G.filespecs = pp - G.pfnames;
} else {
G.pfnames = (char **)fnames;
G.filespecs = 0;
}
G.pxnames = pp + 1;
G.xfilespecs = argc - G.filespecs - 1;
break;
}
G.process_all_files = FALSE;
} else
G.process_all_files = TRUE;
#else
G.filespecs = argc;
G.xfilespecs = 0;
if (argc > 0) {
int in_files=FALSE, in_xfiles=FALSE;
char **pp = argv-1;
G.process_all_files = FALSE;
G.pfnames = argv;
while (*++pp) {
Trace((stderr, "pp - argv = %d\n", pp-argv));
#ifdef CMS_MVS
if (!uO.exdir && STRNICMP(*pp, "-d", 2) == 0) {
#else
if (!uO.exdir && strncmp(*pp, "-d", 2) == 0) {
#endif
int firstarg = (pp == argv);
uO.exdir = (*pp) + 2;
if (in_files) {
*pp = (char *)NULL;
G.filespecs = pp - G.pfnames;
in_files = FALSE;
} else if (in_xfiles) {
*pp = (char *)NULL;
G.xfilespecs = pp - G.pxnames;
}
if (*uO.exdir == '\0') {
if (*++pp)
uO.exdir = *pp;
else {
Info(slide, 0x401, ((char *)slide,
LoadFarString(MustGiveExdir)));
retcode = PK_PARAM;
goto cleanup_and_exit;
}
}
if (firstarg) {
if (pp[1]) {
G.pfnames = pp + 1;
G.filespecs = argc - (G.pfnames-argv);
} else {
G.process_all_files = TRUE;
G.pfnames = (char **)fnames;
G.filespecs = 0;
break;
}
}
} else if (!in_xfiles) {
if (strcmp(*pp, "-x") == 0) {
in_xfiles = TRUE;
if (pp == G.pfnames) {
G.pfnames = (char **)fnames;
G.filespecs = 0;
} else if (in_files) {
*pp = 0;
G.filespecs = pp - G.pfnames;
in_files = FALSE;
}
G.pxnames = pp + 1;
G.xfilespecs = argc - (G.pxnames-argv);
} else
in_files = TRUE;
}
}
} else
G.process_all_files = TRUE;
if (uO.exdir != (char *)NULL && !G.extract_flag)
Info(slide, 0x401, ((char *)slide, LoadFarString(NotExtracting)));
#endif
retcode = process_zipfiles(__G);
cleanup_and_exit:
#ifdef REENTRANT
while (oldsighandlers != NULL) {
savsigs_info *thissigsav = oldsighandlers;
signal(thissigsav->sigtype, thissigsav->sighandler);
oldsighandlers = thissigsav->previous;
free(thissigsav);
}
#endif
#if (defined(MALLOC_WORK) && !defined(REENTRANT))
if (G.area.Slide != (uch *)NULL) {
free(G.area.Slide);
G.area.Slide = (uch *)NULL;
}
#endif
return(retcode);
}
#ifdef REENTRANT
static int setsignalhandler(__G__ p_savedhandler_chain, signal_type,
newhandler)
__GDEF
savsigs_info **p_savedhandler_chain;
int signal_type;
void (*newhandler)(int);
{
savsigs_info *savsig;
savsig = malloc(sizeof(savsigs_info));
if (savsig == NULL) {
Info(slide, 0x401, ((char *)slide, LoadFarString(CantSaveSigHandler)));
return PK_MEM;
}
savsig->sigtype = signal_type;
savsig->sighandler = signal(SIGINT, newhandler);
if (savsig->sighandler == SIG_ERR) {
free(savsig);
} else {
savsig->previous = *p_savedhandler_chain;
*p_savedhandler_chain = savsig;
}
return PK_OK;
}
#endif
int uz_opts(__G__ pargc, pargv)
__GDEF
int *pargc;
char ***pargv;
{
char **argv, *s;
int argc, c, error=FALSE, negative=0;
argc = *pargc;
argv = *pargv;
while (++argv, (--argc > 0 && *argv != NULL && **argv == '-')) {
s = *argv + 1;
while ((c = *s++) != 0) {
#ifdef CMS_MVS
switch (tolower(c))
#else
switch (c)
#endif
{
case ('-'):
++negative;
break;
#ifdef RISCOS
case ('/'):
if (negative) {
Info(slide, 0x401, ((char *)slide,
"error: must give extensions list"));
return(PK_PARAM);
}
exts2swap = s;
s += strlen(s);
break;
#endif
case ('a'):
if (negative) {
uO.aflag = MAX(uO.aflag-negative,0);
negative = 0;
} else
++uO.aflag;
break;
#if (defined(DLL) && defined(API_DOC))
case ('A'):
APIhelp(__G__ argc, argv);
*pargc = -1;
return 0;
#endif
case ('b'):
if (negative) {
#if (defined(TANDEM) || defined(VMS))
uO.bflag = MAX(uO.bflag-negative,0);
#endif
negative = 0;
} else {
#ifdef VMS
if (uO.aflag == 0)
++uO.bflag;
#endif
#ifdef TANDEM
++uO.bflag;
#endif
uO.aflag = 0;
}
break;
#ifdef UNIXBACKUP
case ('B'):
if (negative)
uO.B_flag = FALSE, negative = 0;
else
uO.B_flag = TRUE;
break;
#endif
case ('c'):
if (negative) {
uO.cflag = FALSE, negative = 0;
#ifdef NATIVE
uO.aflag = 0;
#endif
} else {
uO.cflag = TRUE;
#ifdef NATIVE
uO.aflag = 2;
#endif
#ifdef DLL
if (G.redirect_text)
G.redirect_data = 2;
#endif
}
break;
#ifndef CMS_MVS
case ('C'):
if (negative)
uO.C_flag = FALSE, negative = 0;
else
uO.C_flag = TRUE;
break;
#endif
#if (!defined(SFX) || defined(SFX_EXDIR))
case ('d'):
if (negative) {
Info(slide, 0x401, ((char *)slide,
LoadFarString(MustGiveExdir)));
return(PK_PARAM);
}
if (uO.exdir != (char *)NULL) {
Info(slide, 0x401, ((char *)slide,
LoadFarString(OnlyOneExdir)));
return(PK_PARAM);
} else {
uO.exdir = s;
if (*uO.exdir == '\0') {
if (argc > 1) {
--argc;
uO.exdir = *++argv;
if (*uO.exdir == '-') {
Info(slide, 0x401, ((char *)slide,
LoadFarString(MustGiveExdir)));
return(PK_PARAM);
}
} else {
Info(slide, 0x401, ((char *)slide,
LoadFarString(MustGiveExdir)));
return(PK_PARAM);
}
}
if (*s != 0)
while (*++s != 0)
;
}
break;
#endif
case ('e'):
break;
#ifdef MACOS
case ('E'):
if( negative ) {
uO.E_flag = FALSE, negative = 0;
} else {
uO.E_flag = TRUE;
}
break;
#endif
case ('f'):
if (negative)
uO.fflag = uO.uflag = FALSE, negative = 0;
else
uO.fflag = uO.uflag = TRUE;
break;
#if (defined(RISCOS) || defined(ACORN_FTYPE_NFS))
case ('F'):
if (negative)
uO.acorn_nfs_ext = FALSE, negative = 0;
else
uO.acorn_nfs_ext = TRUE;
break;
#endif
case ('h'):
*pargc = -1;
return USAGE(PK_OK);
#ifdef MACOS
case ('i'):
if( negative ) {
uO.i_flag = FALSE, negative = 0;
} else {
uO.i_flag = TRUE;
}
break;
#endif
case ('j'):
if (negative)
uO.jflag = FALSE, negative = 0;
else
uO.jflag = TRUE;
break;
#if ((defined(__BEOS__) || defined(__HAIKU__)) || defined(MACOS) || defined(HAS_JUNK_EXTRA_FIELD_OPTION))
case ('J'):
if( negative ) {
uO.J_flag = FALSE, negative = 0;
} else {
uO.J_flag = TRUE;
}
break;
#endif
#ifndef SFX
case ('l'):
if (negative) {
uO.vflag = MAX(uO.vflag-negative,0);
negative = 0;
} else
++uO.vflag;
break;
#endif
#ifndef CMS_MVS
case ('L'):
if (negative) {
uO.L_flag = MAX(uO.L_flag-negative,0);
negative = 0;
} else
++uO.L_flag;
break;
#endif
#ifdef MORE
#ifdef CMS_MVS
case ('m'):
#endif
case ('M'):
if (negative)
G.M_flag = FALSE, negative = 0;
else
G.M_flag = TRUE;
break;
#endif
case ('n'):
if (negative)
uO.overwrite_none = FALSE, negative = 0;
else
uO.overwrite_none = TRUE;
break;
#ifdef AMIGA
case ('N'):
if (negative)
uO.N_flag = FALSE, negative = 0;
else
uO.N_flag = TRUE;
break;
#endif
case ('o'):
if (negative) {
uO.overwrite_all = MAX(uO.overwrite_all-negative,0);
negative = 0;
} else
++uO.overwrite_all;
break;
case ('p'):
if (negative) {
uO.cflag = FALSE;
uO.qflag = MAX(uO.qflag-999,0);
negative = 0;
} else {
uO.cflag = TRUE;
uO.qflag += 999;
}
break;
#if CRYPT
case ('P'):
if (negative) {
Info(slide, 0x401, ((char *)slide,
LoadFarString(MustGivePasswd)));
return(PK_PARAM);
}
if (uO.pwdarg != (char *)NULL) {
} else {
uO.pwdarg = s;
if (*uO.pwdarg == '\0') {
if (argc > 1) {
--argc;
uO.pwdarg = *++argv;
if (*uO.pwdarg == '-') {
Info(slide, 0x401, ((char *)slide,
LoadFarString(MustGivePasswd)));
return(PK_PARAM);
}
} else {
Info(slide, 0x401, ((char *)slide,
LoadFarString(MustGivePasswd)));
return(PK_PARAM);
}
}
if (*s != 0)
while (*++s != 0)
;
}
break;
#endif
case ('q'):
if (negative) {
uO.qflag = MAX(uO.qflag-negative,0);
negative = 0;
} else
++uO.qflag;
break;
#ifdef QDOS
case ('Q'):
qlflag ^= strtol(s, &s, 10);
break;
#endif
#ifdef DOS_FLX_NLM_OS2_W32
case ('s'):
if (negative)
uO.sflag = FALSE, negative = 0;
else
uO.sflag = TRUE;
break;
#endif
case ('t'):
if (negative)
uO.tflag = FALSE, negative = 0;
else
uO.tflag = TRUE;
break;
#ifdef TIMESTAMP
case ('T'):
if (negative)
uO.T_flag = FALSE, negative = 0;
else
uO.T_flag = TRUE;
break;
#endif
case ('u'):
if (negative)
uO.uflag = FALSE, negative = 0;
else
uO.uflag = TRUE;
break;
#ifndef CMS_MVS
case ('U'):
if (negative)
uO.L_flag = TRUE, negative = 0;
else
uO.L_flag = FALSE;
break;
#endif
#ifndef SFX
case ('v'):
if (negative) {
uO.vflag = MAX(uO.vflag-negative,0);
negative = 0;
} else if (uO.vflag)
++uO.vflag;
else
uO.vflag = 2;
break;
#endif
#ifndef CMS_MVS
case ('V'):
if (negative)
uO.V_flag = FALSE, negative = 0;
else
uO.V_flag = TRUE;
break;
#endif
case ('x'):
#ifdef SFX
if (s - argv[0] == 2 && *s == '\0' &&
argc > 1 && argv[1][0] != '-') {
goto opts_done;
}
#endif
break;
#if (defined(RESTORE_UIDGID) || defined(RESTORE_ACL))
case ('X'):
if (negative) {
uO.X_flag = MAX(uO.X_flag-negative,0);
negative = 0;
} else
++uO.X_flag;
break;
#endif
case ('z'):
if (negative) {
uO.zflag = MAX(uO.zflag-negative,0);
negative = 0;
} else
++uO.zflag;
break;
#ifndef SFX
case ('Z'):
Info(slide, 0x401, ((char *)slide, LoadFarString(Zfirst)));
error = TRUE;
break;
#endif
#ifdef DOS_H68_OS2_W32
case ('$'):
if (negative) {
uO.volflag = MAX(uO.volflag-negative,0);
negative = 0;
} else
++uO.volflag;
break;
#endif
#if (!defined(RISCOS) && !defined(CMS_MVS) && !defined(TANDEM))
case (':'):
if (negative) {
uO.ddotflag = MAX(uO.ddotflag-negative,0);
negative = 0;
} else
++uO.ddotflag;
break;
#endif
default:
error = TRUE;
break;
}
}
}
#ifdef SFX
opts_done:
#endif
if ((uO.cflag && uO.tflag) || (uO.cflag && uO.uflag) ||
(uO.tflag && uO.uflag) || (uO.fflag && uO.overwrite_none))
{
Info(slide, 0x401, ((char *)slide, LoadFarString(InvalidOptionsMsg)));
error = TRUE;
}
if (uO.aflag > 2)
uO.aflag = 2;
#ifdef VMS
if (uO.bflag > 2)
uO.bflag = 2;
#endif
if (uO.overwrite_all && uO.overwrite_none) {
Info(slide, 0x401, ((char *)slide, LoadFarString(IgnoreOOptionMsg)));
uO.overwrite_all = FALSE;
}
#ifdef MORE
if (G.M_flag && !isatty(1))
G.M_flag = 0;
#endif
#ifdef SFX
if (error)
#else
if ((argc-- == 0) || error)
#endif
{
*pargc = argc;
*pargv = argv;
#ifndef SFX
if (uO.vflag >= 2 && argc == -1) {
show_version_info(__G);
return PK_OK;
}
if (!G.noargs && !error)
error = PK_PARAM;
#endif
return USAGE(error);
}
#ifdef SFX
if (uO.qflag < 2)
Info(slide, error? 1 : 0, ((char *)slide, LoadFarString(UnzipSFXBanner),
UZ_MAJORVER, UZ_MINORVER, UZ_PATCHLEVEL, UZ_BETALEVEL,
LoadFarStringSmall(VersionDate)));
#ifdef BETA
Info(slide, error? 1 : 0, ((char *)slide, LoadFarString(BetaVersion), "\n",
"SFX"));
#endif
#endif
if (uO.cflag || uO.tflag || uO.vflag || uO.zflag
#ifdef TIMESTAMP
|| uO.T_flag
#endif
)
G.extract_flag = FALSE;
else
G.extract_flag = TRUE;
*pargc = argc;
*pargv = argv;
return PK_OK;
}
#ifdef SFX
# ifdef VMS
# define LOCAL "X. Quote uppercase options"
# endif
# ifdef UNIX
# define LOCAL "X"
# endif
# ifdef DOS_OS2_W32
# define LOCAL "s$"
# endif
# if (defined(FLEXOS) || defined(NLM))
# define LOCAL "s"
# endif
# ifdef AMIGA
# define LOCAL "N"
# endif
# ifndef LOCAL
# define LOCAL ""
# endif
# ifdef MORE
# define SFXOPT1 "M"
# else
# define SFXOPT1 ""
# endif
int usage(__G__ error)
__GDEF
int error;
{
Info(slide, error? 1 : 0, ((char *)slide, LoadFarString(UnzipSFXBanner),
UZ_MAJORVER, UZ_MINORVER, UZ_PATCHLEVEL, UZ_BETALEVEL,
LoadFarStringSmall(VersionDate)));
Info(slide, error? 1 : 0, ((char *)slide, LoadFarString(UnzipSFXOpts),
SFXOPT1, LOCAL));
#ifdef BETA
Info(slide, error? 1 : 0, ((char *)slide, LoadFarString(BetaVersion), "\n",
"SFX"));
#endif
if (error)
return PK_PARAM;
else
return PK_COOL;
}
#else
# ifdef VMS
# define QUOT '\"'
# define QUOTS "\""
# else
# define QUOT ' '
# define QUOTS ""
# endif
int usage(__G__ error)
__GDEF
int error;
{
int flag = (error? 1 : 0);
if (uO.zipinfo_mode) {
#ifndef NO_ZIPINFO
Info(slide, flag, ((char *)slide, LoadFarString(ZipInfoUsageLine1),
ZI_MAJORVER, ZI_MINORVER, UZ_PATCHLEVEL, UZ_BETALEVEL,
LoadFarStringSmall(VersionDate),
LoadFarStringSmall2(ZipInfoExample), QUOTS,QUOTS));
Info(slide, flag, ((char *)slide, LoadFarString(ZipInfoUsageLine2)));
Info(slide, flag, ((char *)slide, LoadFarString(ZipInfoUsageLine3),
QUOT,QUOT, QUOT,QUOT, LoadFarStringSmall(ZipInfoUsageLine4)));
#ifdef VMS
Info(slide, flag, ((char *)slide, "\nRemember that non-lowercase\
filespecs must be quoted in VMS (e.g., \"Makefile\").\n"));
#endif
#endif
} else {
Info(slide, flag, ((char *)slide, LoadFarString(UnzipUsageLine1),
UZ_MAJORVER, UZ_MINORVER, UZ_PATCHLEVEL, UZ_BETALEVEL,
LoadFarStringSmall(VersionDate)));
#ifdef BETA
Info(slide, flag, ((char *)slide, LoadFarString(BetaVersion), "", ""));
#endif
Info(slide, flag, ((char *)slide, LoadFarString(UnzipUsageLine2),
ZIPINFO_MODE_OPTION, LoadFarStringSmall(ZipInfoMode)));
#ifdef VMS
if (!error)
Info(slide, flag, ((char *)slide, LoadFarString(VMSusageLine2b)));
#endif
Info(slide, flag, ((char *)slide, LoadFarString(UnzipUsageLine3),
LoadFarStringSmall(local1)));
Info(slide, flag, ((char *)slide, LoadFarString(UnzipUsageLine4),
QUOT,QUOT, QUOT,QUOT, LoadFarStringSmall(local2), QUOT,QUOT,
LoadFarStringSmall2(local3)));
Info(slide, flag, ((char *)slide, LoadFarString(UnzipUsageLine5),
LoadFarStringSmall(Example2), LoadFarStringSmall2(Example3),
LoadFarStringSmall2(Example3)));
}
if (error)
return PK_PARAM;
else
return PK_COOL;
}
#endif
#ifndef SFX
static void show_version_info(__G)
__GDEF
{
if (uO.qflag > 3)
Info(slide, 0, ((char *)slide, "%d\n",
(UZ_MAJORVER*100 + UZ_MINORVER*10 + UZ_PATCHLEVEL)));
else {
char *envptr, *getenv();
int numopts = 0;
Info(slide, 0, ((char *)slide, LoadFarString(UnzipUsageLine1v),
UZ_MAJORVER, UZ_MINORVER, UZ_PATCHLEVEL, UZ_BETALEVEL,
LoadFarStringSmall(VersionDate)));
Info(slide, 0, ((char *)slide,
LoadFarString(UnzipUsageLine2v)));
version(__G);
Info(slide, 0, ((char *)slide, LoadFarString(CompileOptions)));
#ifdef ACORN_FTYPE_NFS
Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat),
LoadFarStringSmall(AcornFtypeNFS)));
++numopts;
#endif
#ifdef ASM_CRC
Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat),
LoadFarStringSmall(AsmCRC)));
++numopts;
#endif
#ifdef ASM_INFLATECODES
Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat),
LoadFarStringSmall(AsmInflateCodes)));
++numopts;
#endif
#ifdef CHECK_VERSIONS
Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat),
LoadFarStringSmall(Check_Versions)));
++numopts;
#endif
#ifdef COPYRIGHT_CLEAN
Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat),
LoadFarStringSmall(Copyright_Clean)));
++numopts;
#endif
#ifdef DEBUG
Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat),
LoadFarStringSmall(UDebug)));
++numopts;
#endif
#ifdef DEBUG_TIME
Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat),
LoadFarStringSmall(DebugTime)));
++numopts;
#endif
#ifdef DLL
Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat),
LoadFarStringSmall(Dll)));
++numopts;
#endif
#ifdef DOSWILD
Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat),
LoadFarStringSmall(DosWild)));
++numopts;
#endif
#ifdef LZW_CLEAN
Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat),
LoadFarStringSmall(LZW_Clean)));
++numopts;
#endif
#ifndef MORE
Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat),
LoadFarStringSmall(No_More)));
++numopts;
#endif
#ifdef NO_ZIPINFO
Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat),
LoadFarStringSmall(No_ZipInfo)));
++numopts;
#endif
#ifdef NTSD_EAS
Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat),
LoadFarStringSmall(NTSDExtAttrib)));
++numopts;
#endif
#ifdef OLD_THEOS_EXTRA
Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat),
LoadFarStringSmall(OldTheosExtra)));
++numopts;
#endif
#ifdef OS2_EAS
Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat),
LoadFarStringSmall(OS2ExtAttrib)));
++numopts;
#endif
#ifdef QLZIP
Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat),
LoadFarStringSmall(SMSExFldOnUnix)));
++numopts;
#endif
#ifdef REENTRANT
Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat),
LoadFarStringSmall(Reentrant)));
++numopts;
#endif
#ifdef REGARGS
Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat),
LoadFarStringSmall(RegArgs)));
++numopts;
#endif
#ifdef RETURN_CODES
Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat),
LoadFarStringSmall(Return_Codes)));
++numopts;
#endif
#ifdef SET_DIR_ATTRIB
Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat),
LoadFarStringSmall(SetDirAttrib)));
++numopts;
#endif
#ifdef TIMESTAMP
Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat),
LoadFarStringSmall(TimeStamp)));
++numopts;
#endif
#ifdef UNIXBACKUP
Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat),
LoadFarStringSmall(UnixBackup)));
++numopts;
#endif
#ifdef USE_EF_UT_TIME
Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat),
LoadFarStringSmall(Use_EF_UT_time)));
++numopts;
#endif
#ifndef COPYRIGHT_CLEAN
Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat),
LoadFarStringSmall(Use_Smith_Code)));
++numopts;
#endif
#ifndef LZW_CLEAN
Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat),
LoadFarStringSmall(Use_Unshrink)));
++numopts;
#endif
#ifdef USE_DEFLATE64
Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat),
LoadFarStringSmall(Use_Deflate64)));
++numopts;
#endif
#ifdef MULT_VOLUME
Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat),
LoadFarStringSmall(Use_MultiVol)));
++numopts;
#endif
# if (defined(__DJGPP__) && (__DJGPP__ >= 2))
# ifdef USE_DJGPP_ENV
Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat),
LoadFarStringSmall(Use_DJGPP_Env)));
++numopts;
# endif
# ifdef USE_DJGPP_GLOB
Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat),
LoadFarStringSmall(Use_DJGPP_Glob)));
++numopts;
# endif
# endif
#ifdef USE_VFAT
Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat),
LoadFarStringSmall(Use_VFAT_support)));
++numopts;
#endif
#ifdef USE_ZLIB
sprintf((char *)(slide+256), LoadFarStringSmall(UseZlib),
ZLIB_VERSION, zlib_version);
Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat),
(char *)(slide+256)));
++numopts;
#endif
#ifdef VMS_TEXT_CONV
Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat),
LoadFarStringSmall(VmsTextConv)));
++numopts;
#endif
#ifdef VMSCLI
Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat),
LoadFarStringSmall(VmsCLI)));
++numopts;
#endif
#ifdef VMSWILD
Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat),
LoadFarStringSmall(VmsWild)));
++numopts;
#endif
#ifdef WILD_STOP_AT_DIR
Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat),
LoadFarStringSmall(WildStopAtDir)));
++numopts;
#endif
#if CRYPT
# ifdef PASSWD_FROM_STDIN
Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat),
LoadFarStringSmall(PasswdStdin)));
# endif
Info(slide, 0, ((char *)slide, LoadFarString(Decryption),
CR_MAJORVER, CR_MINORVER, CR_BETA_VER,
LoadFarStringSmall(CryptDate)));
++numopts;
#endif
if (numopts == 0)
Info(slide, 0, ((char *)slide,
LoadFarString(CompileOptFormat),
LoadFarStringSmall(None)));
Info(slide, 0, ((char *)slide, LoadFarString(EnvOptions)));
envptr = getenv(LoadFarStringSmall(EnvUnZip));
Info(slide, 0, ((char *)slide, LoadFarString(EnvOptFormat),
LoadFarStringSmall(EnvUnZip),
(envptr == (char *)NULL || *envptr == 0)?
LoadFarStringSmall2(None) : envptr));
envptr = getenv(LoadFarStringSmall(EnvUnZip2));
Info(slide, 0, ((char *)slide, LoadFarString(EnvOptFormat),
LoadFarStringSmall(EnvUnZip2),
(envptr == (char *)NULL || *envptr == 0)?
LoadFarStringSmall2(None) : envptr));
envptr = getenv(LoadFarStringSmall(EnvZipInfo));
Info(slide, 0, ((char *)slide, LoadFarString(EnvOptFormat),
LoadFarStringSmall(EnvZipInfo),
(envptr == (char *)NULL || *envptr == 0)?
LoadFarStringSmall2(None) : envptr));
envptr = getenv(LoadFarStringSmall(EnvZipInfo2));
Info(slide, 0, ((char *)slide, LoadFarString(EnvOptFormat),
LoadFarStringSmall(EnvZipInfo2),
(envptr == (char *)NULL || *envptr == 0)?
LoadFarStringSmall2(None) : envptr));
#ifndef __RSXNT__
#ifdef __EMX__
envptr = getenv(LoadFarStringSmall(EnvEMX));
Info(slide, 0, ((char *)slide, LoadFarString(EnvOptFormat),
LoadFarStringSmall(EnvEMX),
(envptr == (char *)NULL || *envptr == 0)?
LoadFarStringSmall2(None) : envptr));
envptr = getenv(LoadFarStringSmall(EnvEMXOPT));
Info(slide, 0, ((char *)slide, LoadFarString(EnvOptFormat),
LoadFarStringSmall(EnvEMXOPT),
(envptr == (char *)NULL || *envptr == 0)?
LoadFarStringSmall2(None) : envptr));
#endif
#if (defined(__GO32__) && (!defined(__DJGPP__) || (__DJGPP__ < 2)))
envptr = getenv(LoadFarStringSmall(EnvGO32));
Info(slide, 0, ((char *)slide, LoadFarString(EnvOptFormat),
LoadFarStringSmall(EnvGO32),
(envptr == (char *)NULL || *envptr == 0)?
LoadFarStringSmall2(None) : envptr));
envptr = getenv(LoadFarStringSmall(EnvGO32TMP));
Info(slide, 0, ((char *)slide, LoadFarString(EnvOptFormat),
LoadFarStringSmall(EnvGO32TMP),
(envptr == (char *)NULL || *envptr == 0)?
LoadFarStringSmall2(None) : envptr));
#endif
#endif
#ifdef RISCOS
envptr = getenv(LoadFarStringSmall(EnvUnZipExts));
Info(slide, 0, ((char *)slide, LoadFarString(EnvOptFormat),
LoadFarStringSmall(EnvUnZipExts),
(envptr == (char *)NULL || *envptr == 0)?
LoadFarStringSmall2(None) : envptr));
#endif
}
}
#endif
#endif