📄 unzip.h
字号:
# define DATE_FORMAT DF_MDY
# define lenEOL 1
# define PutNativeEOL *q++ = native(CR);
# define MALLOC_WORK
# ifdef THINK_C
# define fgets wfgets
# define fflush(f)
# define fprintf wfprintf
# define fputs(s,f) wfprintf((f), "%s", (s))
# define printf wprintf
# ifdef putc
# undef putc
# endif
# define putc(c,f) wfprintf((f), "%c", (c))
# define getenv macgetenv
# endif
# ifndef isascii
# define isascii(c) ((unsigned char)(c) <= 0x3F)
# endif
# include "macstat.h"
# include "macdir.h"
# ifdef CR
# undef CR
# endif
typedef struct _ZipExtraHdr {
unsigned short header; /* 2 bytes */
unsigned short data; /* 2 bytes */
} ZIP_EXTRA_HEADER;
typedef struct _MacInfoMin {
unsigned short header; /* 2 bytes */
unsigned short data; /* 2 bytes */
unsigned long signature; /* 4 bytes */
FInfo finfo; /* 16 bytes */
unsigned long lCrDat; /* 4 bytes */
unsigned long lMdDat; /* 4 bytes */
unsigned long flags ; /* 4 bytes */
unsigned long lDirID; /* 4 bytes */
/*------------*/
} MACINFOMIN; /* = 40 bytes for size of data */
typedef struct _MacInfo {
unsigned short header; /* 2 bytes */
unsigned short data; /* 2 bytes */
unsigned long signature; /* 4 bytes */
FInfo finfo; /* 16 bytes */
unsigned long lCrDat; /* 4 bytes */
unsigned long lMdDat; /* 4 bytes */
unsigned long flags ; /* 4 bytes */
unsigned long lDirID; /* 4 bytes */
char rguchVolName[28]; /* 28 bytes */
/*------------*/
} MACINFO; /* = 68 bytes for size of data */
#endif /* MACOS */
/*---------------------------------------------------------------------------
MS-DOS and OS/2 section:
---------------------------------------------------------------------------*/
#ifdef MSDOS
# include <dos.h> /* for REGS macro (TC) or _dos_setftime (MSC) */
# ifdef __TURBOC__ /* includes Power C */
# include <sys/timeb.h> /* for structure ftime */
# ifndef __BORLANDC__ /* there appears to be a bug (?) in Borland's */
# include <mem.h> /* MEM.H related to __STDC__ and far poin- */
# endif /* ters. (dpk) [mem.h included for memcpy] */
# endif
#endif /* MSDOS */
#ifdef __IBMC__
# define S_IFMT 0xF000
# define timezone _timezone
# define PIPE_ERROR (errno == EERRSET || errno == EOS2ERR)
#endif
#ifdef __WATCOMC__
# define __32BIT__
# undef far
# define far
# undef near
# define near
# define PIPE_ERROR (errno == -1)
#endif
#ifdef __EMX__
# ifndef __32BIT__
# define __32BIT__
# endif
# define far
#endif
#ifdef __GO32__ /* note: MS-DOS compiler, not OS/2 */
# ifndef __32BIT__
# define __32BIT__
# endif
# include <sys/timeb.h> /* for structure ftime */
int setmode(int, int); /* not in djgpp's include files */
#endif
#if defined(_MSC_VER) && (!defined(MSC))
# define MSC /* for old versions, MSC must be set explicitly */
#endif
#if 0 /* GRR 930907: MSC 5.1 does declare errno but doesn't define _MSC_VER */
#ifdef MSC
# ifndef _MSC_VER /* new with 5.1 or 6.0 ... */
# define DECLARE_ERRNO /* not declared in errno.h in 5.0 or earlier? */
# endif
#endif
#endif /* 0 */
#if defined(MSDOS) || defined(OS2)
# include <sys/types.h> /* off_t, time_t, dev_t, ... */
# include <sys/stat.h>
# include <io.h> /* lseek(), open(), setftime(), dup(), creat() */
# include <time.h> /* localtime() */
# include <fcntl.h> /* O_BINARY for open() w/o CR/LF translation */
# ifdef __GO32__
# define DIR_END '/'
# else
# define DIR_END '\\'
# endif
# if (defined(M_I86CM) || defined(M_I86LM))
# define MED_MEM
# endif
# if (defined(__COMPACT__) || defined(__LARGE__) || defined(__HUGE__))
# define MED_MEM
# endif
# ifndef __32BIT__
# ifndef MED_MEM
# define SMALL_MEM
# endif
/* # define USE_FWRITE write() *can* write up to 65534 bytes after all */
# endif
# define DATE_FORMAT dateformat()
# define lenEOL 2
# define PutNativeEOL {*q++ = native(CR); *q++ = native(LF);}
#endif
#ifdef OS2 /* defined for all OS/2 compilers */
# ifdef MSDOS
# undef MSDOS
# endif
# ifdef isupper
# undef isupper
# endif
# ifdef tolower
# undef tolower
# endif
# define isupper(x) IsUpperNLS((unsigned char)(x))
# define tolower(x) ToLowerNLS((unsigned char)(x))
#endif
#ifdef MSDOS
# define EXE_EXTENSION ".exe" /* OS/2 has GetLoadPath() function instead */
#endif
#if defined(MSWIN) && defined(FILE_IO_C)
# include "wizunzip.h"
#endif
/*---------------------------------------------------------------------------
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(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 */
# define DATE_FORMAT DF_MDY
# define lenEOL 1
# define PutNativeEOL *q++ = native(LF);
#endif
/*---------------------------------------------------------------------------
NT section:
---------------------------------------------------------------------------*/
#ifdef WIN32 /* NT */
# include <sys/types.h> /* off_t, time_t, dev_t, ... */
# include <sys/stat.h>
# include <io.h> /* read(), open(), etc. */
# include <time.h>
# include <memory.h>
# include <direct.h> /* mkdir() */
# include <fcntl.h>
# if defined(FILE_IO_C)
# include <conio.h>
# include <sys\types.h>
# include <sys\utime.h>
# include <windows.h>
# endif
# define DATE_FORMAT DF_MDY
# define lenEOL 2
# define PutNativeEOL {*q++ = native(CR); *q++ = native(LF);}
# define NT
# if (defined(_MSC_VER) && !defined(MSC))
# define MSC
# endif
#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 <utime.h> GRR: not used, I suspect... */
# 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"
# define DATE_FORMAT DF_MDY
# 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(LINUX) || (defined(SYSV) && defined(MODERN))
# include <unistd.h> /* this includes utime.h, at least on SGIs */
# endif
# if defined(BSD4_4) || defined(_POSIX_SOURCE) || defined(sgi) || defined(_AIX)
# include <utime.h> /* NeXT, at least, does NOT define utimbuf in here */
# else
struct utimbuf {
time_t actime; /* new access time */
time_t modtime; /* new modification time */
};
# endif /* ?(BSD4_4 || _POSIX_SOURCE || sgi || _AIX) */
# 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
# define DATE_FORMAT DF_MDY
# define lenEOL 1
# define PutNativeEOL *q++ = native(LF);
#endif /* UNIX */
/*---------------------------------------------------------------------------
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 /* to define FILNAMSIZ below */
# define RETURN return_VMS /* VMS interprets return codes incorrectly */
# define DIR_BEG '['
# define DIR_END ']'
# define DIR_EXT ".dir"
# define DATE_FORMAT DF_MDY
# define lenEOL 1
# define PutNativeEOL *q++ = native(LF);
#endif /* VMS */
/*************/
/* Defines */
/*************/
#define UNZIP
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -