⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 unzip.c

📁 压缩解压,是unzip540的升级,这个外国网站摘来的源码,是evb编写.
💻 C
📖 第 1 页 / 共 5 页
字号:
                        uO.ddotflag = MAX(uO.ddotflag-negative,0);                        negative = 0;                    } else                        ++uO.ddotflag;                    break;#endif /* !RISCOS && !CMS_MVS && !TANDEM */                default:                    error = TRUE;                    break;            } /* end switch */        } /* end while (not end of argument string) */    } /* end while (not done with switches) *//*---------------------------------------------------------------------------    Check for nonsensical combinations of options.  ---------------------------------------------------------------------------*/#ifdef SFXopts_done:  /* yes, very ugly...but only used by UnZipSFX with -x xlist */#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))  /* stdout redirected: "more" func. useless */        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) {              /* "unzip -v" */            show_version_info(__G);            return PK_OK;        }        if (!G.noargs && !error)            error = PK_PARAM;   /* had options (not -h or -v) but no zipfile */#endif /* !SFX */        return USAGE(error);    }#ifdef SFX    /* print our banner unless we're being fairly quiet */    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    /* always print the beta warning:  no unauthorized distribution!! */    Info(slide, error? 1 : 0, ((char *)slide, LoadFarString(BetaVersion), "\n",      "SFX"));#endif#endif /* SFX */    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;} /* end function uz_opts() *//********************//* Function usage() *//********************/#ifdef SFX#  ifdef VMS#    define LOCAL "X.\n\(Must quote upper-case options, like \"-V\", unless SET PROC/PARSE=EXTEND.)"#  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   /* Default for all other systems: */#  ifndef LOCAL#    define LOCAL ""#  endif#  ifdef MORE#    define SFXOPT1 "M"#  else#    define SFXOPT1 ""#  endifint usage(__G__ error)   /* return PK-type error code */    __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;     /* just wanted usage screen: no error */} /* end function usage() */#else /* !SFX */#  ifdef VMS#    define QUOT '\"'#    define QUOTS "\""#  else#    define QUOT ' '#    define QUOTS ""#  endifint usage(__G__ error)   /* return PK-type error code */    __GDEF    int error;{    int flag = (error? 1 : 0);/*---------------------------------------------------------------------------    Print either ZipInfo usage or UnZip usage, depending on incantation.    (Strings must be no longer than 512 bytes for Turbo C, apparently.)  ---------------------------------------------------------------------------*/    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, "\n\You must quote non-lowercase options and filespecs, unless SET PROC/PARSE=EXT.\\n"));#endif#endif /* !NO_ZIPINFO */    } else {   /* UnZip mode */        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)  /* maybe no command-line tail found; show extra help */            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)));        /* This is extra work for SMALL_MEM, but it will work since         * LoadFarStringSmall2 uses the same buffer.  Remember, this         * is a hack. */        Info(slide, flag, ((char *)slide, LoadFarString(UnzipUsageLine5),          LoadFarStringSmall(Example2), LoadFarStringSmall2(Example3),          LoadFarStringSmall2(Example3)));    } /* end if (uO.zipinfo_mode) */    if (error)        return PK_PARAM;    else        return PK_COOL;     /* just wanted usage screen: no error */} /* end function usage() */#endif /* ?SFX */#ifndef SFX#ifndef _WIN32_WCE /* Win CE does not support environment variables */#if (!defined(MODERN) || defined(NO_STDLIB_H))/* Declare getenv() to be sure (might be missing in some environments) */extern char *getenv();#endif#endif/********************************//* Function show_version_info() *//********************************/static void show_version_info(__G)    __GDEF{    if (uO.qflag > 3)                           /* "unzip -vqqqq" */        Info(slide, 0, ((char *)slide, "%d\n",          (UZ_MAJORVER*100 + UZ_MINORVER*10 + UZ_PATCHLEVEL)));    else {#ifndef _WIN32_WCE /* Win CE does not support environment variables */        char *envptr;#endif        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#if defined(WIN32) && defined(NO_W32TIMES_IZFIX)        Info(slide, 0, ((char *)slide, LoadFarString(CompileOptFormat),          LoadFarStringSmall(W32NoIZTimeFix)));        ++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

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -