📄 unzpriv.h
字号:
/* * ARGH. MSC 7.0 libraries think times are based on 1899 Dec 31 00:00, not * 1970 Jan 1 00:00. So we have to diddle time_t's appropriately: add or * subtract 70 years' worth of seconds; i.e., number of days times 86400; * i.e., (70*365 regular days + 17 leap days + 1 1899 day) * 86400 == * (25550 + 17 + 1) * 86400 == 2209075200 seconds. We know time_t is an * unsigned long (ulg) on the only system with this bug. */# define TIMET_TO_NATIVE(x) (x) += (ulg)2209075200L;# define NATIVE_TO_TIMET(x) (x) -= (ulg)2209075200L;# endif# if (defined(__BORLANDC__) && (__BORLANDC__ >= 0x0450))# define timezone _timezone# endif# if (defined(__GO32__) || defined(FLEXOS))# define DIR_END '/'# else# define DIR_END '\\' /* OS uses '\\' as directory separator */# define DIR_END2 '/' /* also check for '/' (RTL may convert) */# endif# ifndef WIN32# ifdef DATE_FORMAT# undef DATE_FORMAT# endif# define DATE_FORMAT dateformat()# endif# define lenEOL 2# define PutNativeEOL {*q++ = native(CR); *q++ = native(LF);}# define USE_EF_UT_TIME#endif /* MSDOS || OS2 || FLEXOS *//*--------------------------------------------------------------------------- MTS section (piggybacks UNIX, I think): ---------------------------------------------------------------------------*/#ifdef MTS# include <sys/types.h> /* off_t, time_t, dev_t, ... */# include <sys/stat.h># include <sys/file.h> /* MTS uses this instead of fcntl.h */# include <timeb.h># include <time.h># include <unix.h> /* some important non-ANSI routines */# define mkdir(s,n) (-1) /* no "make directory" capability */# define EBCDIC /* set EBCDIC conversion on */# define NO_STRNICMP /* unzip's is as good the one in MTS */# define USE_FWRITE# define close_outfile() fclose(G.outfile) /* can't set time on files */# define umask(n) /* don't have umask() on MTS */# define FOPWT "w" /* open file for writing in TEXT mode */# ifndef DATE_FORMAT# define DATE_FORMAT DF_MDY# endif# define lenEOL 1# define PutNativeEOL *q++ = native(LF);#endif /* MTS */ /*--------------------------------------------------------------------------- QDOS section ---------------------------------------------------------------------------*/#ifdef QDOS# define DIRENT# include <fcntl.h># include <unistd.h># include <sys/stat.h># include <time.h># include "qdos/izqdos.h"# ifndef DATE_FORMAT# define DATE_FORMAT DF_MDY# endif# define lenEOL 1# define PutNativeEOL *q++ = native(LF);# define DIR_END '_'# define RETURN QReturn# undef PATH_MAX# define PATH_MAX 36# if (!defined(NOTIMESTAMP) && !defined(TIMESTAMP))# define TIMESTAMP# endif#endif/*--------------------------------------------------------------------------- Tandem NSK section: ---------------------------------------------------------------------------*/#ifdef TANDEM# include "tandem.h"# include <fcntl.h> /* use a single LF delimiter so that writes to 101 text files work */# define PutNativeEOL *q++ = native(LF);# define lenEOL 1# ifndef DATE_FORMAT# define DATE_FORMAT DF_DMY# endif# define USE_EF_UT_TIME# define RESTORE_UIDGID#endif/*--------------------------------------------------------------------------- TOPS-20 section: ---------------------------------------------------------------------------*/#ifdef TOPS20# include <sys/types.h> /* off_t, time_t, dev_t, ... */# include <sys/stat.h># include <sys/param.h># include <sys/time.h># include <sys/timeb.h># include <sys/file.h># include <timex.h># include <monsym.h> /* get amazing monsym() macro */ extern int open(), close(), read(); extern int stat(), unlink(), jsys(), fcntl(); extern long lseek(), dup(), creat();# define strchr index /* GRR: necessary? */# define strrchr rindex# define REALLY_SHORT_SYMS# define NO_MKDIR# define DIR_BEG '<'# define DIR_END '>'# define DIR_EXT ".directory"# ifndef DATE_FORMAT# define DATE_FORMAT DF_MDY# endif# define EXE_EXTENSION ".exe" /* just a guess... */#endif /* TOPS20 *//*--------------------------------------------------------------------------- Unix section: ---------------------------------------------------------------------------*/#ifdef UNIX# include <sys/types.h> /* off_t, time_t, dev_t, ... */# include <sys/stat.h># ifndef COHERENT# include <fcntl.h> /* O_BINARY for open() w/o CR/LF translation */# else /* COHERENT */# ifdef _I386# include <fcntl.h> /* Coherent 4.0.x, Mark Williams C */# else# include <sys/fcntl.h> /* Coherent 3.10, Mark Williams C */# endif# define SHORT_SYMS# ifndef __COHERENT__ /* Coherent 4.2 has tzset() */# define tzset settz# endif# endif /* ?COHERENT */# ifndef NO_PARAM_H# ifdef NGROUPS_MAX# undef NGROUPS_MAX /* SCO bug: defined again in <sys/param.h> */# endif# ifdef BSD# define TEMP_BSD /* may be defined again in <sys/param.h> */# undef BSD# endif# include <sys/param.h> /* conflict with <sys/types.h>, some systems? */# ifdef TEMP_BSD# undef TEMP_BSD# ifndef BSD# define BSD# endif# endif# endif /* !NO_PARAM_H */# ifdef __osf__# define DIRENT# ifdef BSD# undef BSD# endif# endif /* __osf__ */# ifdef BSD# include <sys/time.h># include <sys/timeb.h># ifdef _AIX# include <time.h># endif# else# include <time.h> struct tm *gmtime(), *localtime();# endif# if (defined(BSD4_4) || (defined(SYSV) && defined(MODERN)))# include <unistd.h> /* this includes utime.h on SGIs */# if (defined(BSD4_4) || defined(linux))# include <utime.h># define GOT_UTIMBUF# endif# endif# if (defined(V7) || defined(pyr_bsd))# define strchr index# define strrchr rindex# endif# ifdef V7# define O_RDONLY 0# define O_WRONLY 1# define O_RDWR 2# endif# ifdef MINIX# include <stdio.h># endif# ifndef DATE_FORMAT# define DATE_FORMAT DF_MDY /* GRR: customize with locale.h somehow? */# endif# define lenEOL 1# ifdef EBCDIC# define PutNativeEOL *q++ = '\n';# else# define PutNativeEOL *q++ = native(LF);# endif# define SCREENLINES screenlines()# define USE_EF_UT_TIME# define SET_DIR_ATTRIB# if (!defined(TIMESTAMP) && !defined(NOTIMESTAMP)) /* GRR 970513 */# define TIMESTAMP# endif# define RESTORE_UIDGID#endif /* UNIX *//*--------------------------------------------------------------------------- VM/CMS and MVS section: ---------------------------------------------------------------------------*/#ifdef CMS_MVS# include "vmmvs.h"# define CLOSE_INFILE() close_infile(__G)#endif/*--------------------------------------------------------------------------- VMS section: ---------------------------------------------------------------------------*/#ifdef VMS# include <types.h> /* GRR: experimenting... */# include <stat.h># include <time.h> /* the usual non-BSD time functions */# include <file.h> /* same things as fcntl.h has */# include <unixio.h># include <rms.h># define _MAX_PATH (NAM$C_MAXRSS+1) /* to define FILNAMSIZ below */# ifdef RETURN_CODES /* VMS interprets standard PK return codes incorrectly */# define RETURN(ret) return_VMS(__G__ (ret)) /* verbose version */# define EXIT(ret) return_VMS(__G__ (ret))# else# define RETURN return_VMS /* quiet version */# define EXIT return_VMS# endif# ifdef VMSCLI# define USAGE(ret) VMSCLI_usage(__G__ (ret))# endif# define DIR_BEG '['# define DIR_END ']'# define DIR_EXT ".dir"# ifndef DATE_FORMAT# define DATE_FORMAT DF_MDY# endif# define lenEOL 1# define PutNativeEOL *q++ = native(LF);# define SCREENLINES screenlines()# if (defined(__VMS_VERSION) && !defined(VMS_VERSION))# define VMS_VERSION __VMS_VERSION# endif# if (defined(__VMS_VER) && !defined(__CRTL_VER))# define __CRTL_VER __VMS_VER# endif# if ((!defined(__CRTL_VER)) || (__CRTL_VER < 70000000))# define NO_GMTIME /* gmtime() of earlier VMS C RTLs is broken */# else# if (!defined(NO_EF_UT_TIME) && !defined(USE_EF_UT_TIME))# define USE_EF_UT_TIME# endif# endif# if (!defined(NOTIMESTAMP) && !defined(TIMESTAMP))# define TIMESTAMP# endif# define RESTORE_UIDGID#endif /* VMS *//*--------------------------------------------------------------------------- Win32 (Windows 95/NT) section: ---------------------------------------------------------------------------*/#if (defined(WIN32) && !defined(POCKET_UNZIP))# include "win32/w32cfg.h"#endif/*************//* Defines *//*************/#define UNZIP_VERSION 20 /* compatible with PKUNZIP 2.0 */#define VMS_UNZIP_VERSION 42 /* if OS-needed-to-extract is VMS: can do */#if (defined(MSDOS) || defined(OS2))# define DOS_OS2#endif#if (defined(OS2) || defined(WIN32))# define OS2_W32#endif#if (defined(DOS_OS2) || defined(WIN32))# define DOS_OS2_W32# define DOS_W32_OS2 /* historical: don't use */#endif#if (defined(DOS_OS2_W32) || defined(__human68k__))# define DOS_H68_OS2_W32#endif#if (defined(DOS_OS2) || defined(FLEXOS))# define DOS_FLX_OS2#endif#if (defined(DOS_OS2_W32) || defined(FLEXOS))# define DOS_FLX_OS2_W32#endif#if (defined(DOS_H68_OS2_W32) || defined(FLEXOS))# define DOS_FLX_H68_OS2_W32#endif#if (defined(TOPS20) || defined(VMS))# define T20_VMS#endif#if (defined(MSDOS) || defined(T20_VMS))# define DOS_T20_VMS#endif/* clean up with a few defaults */#ifndef DIR_END# define DIR_END '/' /* last char before program name or filename */#endif#ifndef DATE_FORMAT# define DATE_FORMAT DF_MDY /* defaults to US convention */#endif#ifndef CLOSE_INFILE# define CLOSE_INFILE() close(G.zipfd)#endif#ifndef RETURN# define RETURN return /* only used in main() */#endif#ifndef EXIT# define EXIT exit#endif#ifndef USAGE# define USAGE(ret) usage(__G__ (ret)) /* used in unzip.c, zipinfo.c */#endif#ifndef TIMET_TO_NATIVE /* everybody but MSC 7.0 and Macintosh */# define TIMET_TO_NATIVE(x)# define NATIVE_TO_TIMET(x)#endif#if (defined(DOS_FLX_OS2_W32) || defined(UNIX) || defined(RISCOS))# ifndef HAVE_UNLINK# define HAVE_UNLINK# endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -