?? unzpriv.h
字號:
#endif#if (defined(AOS_VS) || defined(ATARI)) /* GRR: others? */# ifndef HAVE_UNLINK# define HAVE_UNLINK# endif#endif/* OS-specific exceptions to the "ANSI <--> INT_SPRINTF" rule */#if (!defined(PCHAR_SPRINTF) && !defined(INT_SPRINTF))# if (defined(SYSV) || defined(CONVEX) || defined(NeXT) || defined(BSD4_4))# define INT_SPRINTF /* sprintf() returns int: SysVish/Posix */# endif# if (defined(DOS_FLX_NLM_OS2_W32) || defined(VMS) || defined(AMIGA))# define INT_SPRINTF /* sprintf() returns int: ANSI */# endif# if (defined(ultrix) || defined(__ultrix)) /* Ultrix 4.3 and newer */# if (defined(POSIX) || defined(__POSIX))# define INT_SPRINTF /* sprintf() returns int: ANSI/Posix */# endif# ifdef __GNUC__# define PCHAR_SPRINTF /* undetermined actual return value */# endif# endif# if (defined(__osf__) || defined(_AIX) || defined(CMS_MVS) || defined(THEOS))# define INT_SPRINTF /* sprintf() returns int: ANSI/Posix */# endif# if defined(sun)# define PCHAR_SPRINTF /* sprintf() returns char *: SunOS cc *and* gcc */# endif#endif/* defaults that we hope will take care of most machines in the future */#if (!defined(PCHAR_SPRINTF) && !defined(INT_SPRINTF))# ifdef __STDC__# define INT_SPRINTF /* sprintf() returns int: ANSI */# endif# ifndef INT_SPRINTF# define PCHAR_SPRINTF /* sprintf() returns char *: BSDish */# endif#endif#define MSG_STDERR(f) (f & 1) /* bit 0: 0 = stdout, 1 = stderr */#define MSG_INFO(f) ((f & 6) == 0) /* bits 1 and 2: 0 = info */#define MSG_WARN(f) ((f & 6) == 2) /* bits 1 and 2: 1 = warning */#define MSG_ERROR(f) ((f & 6) == 4) /* bits 1 and 2: 2 = error */#define MSG_FATAL(f) ((f & 6) == 6) /* bits 1 and 2: (3 = fatal error) */#define MSG_ZFN(f) (f & 0x0008) /* bit 3: 1 = print zipfile name */#define MSG_FN(f) (f & 0x0010) /* bit 4: 1 = print filename */#define MSG_LNEWLN(f) (f & 0x0020) /* bit 5: 1 = leading newline if !SOL */#define MSG_TNEWLN(f) (f & 0x0040) /* bit 6: 1 = trailing newline if !SOL */#define MSG_MNEWLN(f) (f & 0x0080) /* bit 7: 1 = trailing NL for prompts *//* the following are subject to change */#define MSG_NO_WGUI(f) (f & 0x0100) /* bit 8: 1 = skip if Windows GUI */#define MSG_NO_AGUI(f) (f & 0x0200) /* bit 9: 1 = skip if Acorn GUI */#define MSG_NO_DLL2(f) (f & 0x0400) /* bit 10: 1 = skip if OS/2 DLL */#define MSG_NO_NDLL(f) (f & 0x0800) /* bit 11: 1 = skip if WIN32 DLL */#define MSG_NO_WDLL(f) (f & 0x1000) /* bit 12: 1 = skip if Windows DLL */#if (defined(MORE) && !defined(SCREENLINES))# ifdef DOS_FLX_NLM_OS2_W32# define SCREENLINES 25 /* can be (should be) a function instead */# else# define SCREENLINES 24 /* VT-100s are assumed to be minimal hardware */# endif#endif#if (defined(MORE) && !defined(SCREENSIZE))# ifndef SCREENWIDTH# define SCREENSIZE(scrrows, scrcols) { \ if ((scrrows) != NULL) *(scrrows) = SCREENLINES; }# else# define SCREENSIZE(scrrows, scrcols) { \ if ((scrrows) != NULL) *(scrrows) = SCREENLINES; \ if ((scrcols) != NULL) *(scrcols) = SCREENWIDTH; }# endif#endif#define DIR_BLKSIZ 64 /* number of directory entries per block * (should fit in 4096 bytes, usually) */#ifndef WSIZE# ifdef USE_DEFLATE64# define WSIZE 65536L /* window size--must be a power of two, and */# else /* at least 64K for PKZip's deflate64 method */# define WSIZE 0x8000 /* window size--must be a power of two, and */# endif /* at least 32K for zip's deflate method */#endif#ifndef INBUFSIZ# if (defined(MED_MEM) || defined(SMALL_MEM))# define INBUFSIZ 2048 /* works for MS-DOS small model */# else# define INBUFSIZ 8192 /* larger buffers for real OSes */# endif#endif#ifdef __16BIT__# ifndef INT_16BIT# define INT_16BIT /* on 16-bit systems int size is 16 bits */# endif#else# define nearmalloc malloc# define nearfree free# if (!defined(__IBMC__) || !defined(OS2))# ifndef near# define near# endif# ifndef far# define far# endif# endif#endif#if (defined(DYNALLOC_CRCTAB) && !defined(DYNAMIC_CRC_TABLE))# undef DYNALLOC_CRCTAB#endif#if (defined(DYNALLOC_CRCTAB) && defined(REENTRANT))# undef DYNALLOC_CRCTAB /* not safe with reentrant code */#endif#if (defined(USE_ZLIB) && !defined(USE_OWN_CRCTAB))# ifdef DYNALLOC_CRCTAB# undef DYNALLOC_CRCTAB# endif#endif#if (defined(USE_ZLIB) && defined(ASM_CRC))# undef ASM_CRC#endif/* Logic for case of small memory, length of EOL > 1: if OUTBUFSIZ == 2048, * OUTBUFSIZ>>1 == 1024 and OUTBUFSIZ>>7 == 16; therefore rawbuf is 1008 bytes * and transbuf 1040 bytes. Have room for 32 extra EOL chars; 1008/32 == 31.5 * chars/line, smaller than estimated 35-70 characters per line for C source * and normal text. Hence difference is sufficient for most "average" files. * (Argument scales for larger OUTBUFSIZ.) */#ifdef SMALL_MEM /* i.e., 16-bit OSes: MS-DOS, OS/2 1.x, etc. */# define LoadFarString(x) fLoadFarString(__G__ (x))# define LoadFarStringSmall(x) fLoadFarStringSmall(__G__ (x))# define LoadFarStringSmall2(x) fLoadFarStringSmall2(__G__ (x))# if (defined(_MSC_VER) && (_MSC_VER >= 600))# define zfstrcpy(dest, src) _fstrcpy((dest), (src))# endif# ifndef Far# define Far far /* __far only works for MSC 6.00, not 6.0a or Borland */# endif# define OUTBUFSIZ INBUFSIZ# if (lenEOL == 1)# define RAWBUFSIZ (OUTBUFSIZ>>1)# else# define RAWBUFSIZ ((OUTBUFSIZ>>1) - (OUTBUFSIZ>>7))# endif# define TRANSBUFSIZ (OUTBUFSIZ-RAWBUFSIZ) typedef short shrint; /* short/int or "shrink int" (unshrink) */#else# define zfstrcpy(dest, src) strcpy((dest), (src))# ifdef QDOS# define LoadFarString(x) Qstrfix(x) /* fix up _ for '.' */# define LoadFarStringSmall(x) Qstrfix(x)# define LoadFarStringSmall2(x) Qstrfix(x)# else# define LoadFarString(x) (char *)(x)# define LoadFarStringSmall(x) (char *)(x)# define LoadFarStringSmall2(x) (char *)(x)# endif# ifdef MED_MEM# define OUTBUFSIZ 0xFF80 /* can't malloc arrays of 0xFFE8 or more */# define TRANSBUFSIZ 0xFF80 typedef short shrint;# else# define OUTBUFSIZ (lenEOL*WSIZE) /* more efficient text conversion */# define TRANSBUFSIZ (lenEOL*OUTBUFSIZ)# ifdef AMIGA typedef short shrint;# else typedef int shrint; /* for efficiency/speed, we hope... */# endif# endif /* ?MED_MEM */# define RAWBUFSIZ OUTBUFSIZ#endif /* ?SMALL_MEM */#ifndef Far# define Far#endif#ifndef MAIN# define MAIN main#endif#ifdef SFX /* disable some unused features for SFX executables */# ifndef NO_ZIPINFO# define NO_ZIPINFO# endif# ifdef TIMESTAMP# undef TIMESTAMP# endif#endif#ifdef SFX# ifdef CHEAP_SFX_AUTORUN# ifndef NO_SFX_EXDIR# define NO_SFX_EXDIR# endif# endif# ifndef NO_SFX_EXDIR# ifndef SFX_EXDIR# define SFX_EXDIR# endif# else# ifdef SFX_EXDIR# undef SFX_EXDIR# endif# endif#endif/* user may have defined both by accident... NOTIMESTAMP takes precedence */#if (defined(TIMESTAMP) && defined(NOTIMESTAMP))# undef TIMESTAMP#endif#if (!defined(COPYRIGHT_CLEAN) && !defined(USE_SMITH_CODE))# define COPYRIGHT_CLEAN#endif#if (!defined(LZW_CLEAN) && !defined(USE_UNSHRINK))# define LZW_CLEAN#endif#ifndef O_BINARY# define O_BINARY 0#endif#ifndef PIPE_ERROR# define PIPE_ERROR (errno == EPIPE)#endif/* File operations--use "b" for binary if allowed or fixed length 512 on VMS */#ifdef VMS# define FOPR "r","ctx=stm"# define FOPM "r+","ctx=stm","rfm=fix","mrs=512"# define FOPW "w","ctx=stm","rfm=fix","mrs=512"#endif /* VMS */#ifdef CMS_MVS/* Binary files must be RECFM=F,LRECL=1 for ftell() to get correct pos *//* ...unless byteseek is used. Let's try that for a while. */# define FOPR "rb,byteseek"# define FOPM "r+b,byteseek"# ifdef MVS# define FOPW "wb,recfm=u,lrecl=32760,byteseek" /* New binary files */# define FOPWE "wb" /* Existing binary files */# define FOPWT "w,lrecl=133" /* New text files */# define FOPWTE "w" /* Existing text files */# else# define FOPW "wb,recfm=v,lrecl=32760"# define FOPWT "w"# endif#endif /* CMS_MVS */#ifdef TOPS20 /* TOPS-20 MODERN? You kidding? */# define FOPW "w8"#endif /* TOPS20 *//* Defaults when nothing special has been defined previously. */#ifdef MODERN# ifndef FOPR# define FOPR "rb"# endif# ifndef FOPM# define FOPM "r+b"# endif# ifndef FOPW# define FOPW "wb"# endif# ifndef FOPWT# define FOPWT "wt"# endif#else /* !MODERN */# ifndef FOPR# define FOPR "r"# endif# ifndef FOPM# define FOPM "r+"# endif# ifndef FOPW# define FOPW "w"# endif# ifndef FOPWT# define FOPWT "w"# endif#endif /* ?MODERN *//* * If <limits.h> exists on most systems, should include that, since it may * define some or all of the following: NAME_MAX, PATH_MAX, _POSIX_NAME_MAX, * _POSIX_PATH_MAX. */#ifdef DOS_FLX_NLM_OS2_W32# include <limits.h>#endif#ifndef PATH_MAX# ifdef MAXPATHLEN# define PATH_MAX MAXPATHLEN /* in <sys/param.h> on some systems */# else# ifdef _MAX_PATH# define PATH_MAX _MAX_PATH# else# if FILENAME_MAX > 255# define PATH_MAX FILENAME_MAX /* used like PATH_MAX on some systems */# else# define PATH_MAX 1024# endif# endif /* ?_MAX_PATH */# endif /* ?MAXPATHLEN */#endif /* !PATH_MAX */#define FILNAMSIZ PATH_MAX/* DBCS support for Info-ZIP (mainly for japanese (-: ) * by Yoshioka Tsuneo (QWF00133@nifty.ne.jp,tsuneo-y@is.aist-nara.ac.jp) */#ifdef _MBCS# include <locale.h> /* Multi Byte Character Set */# define ___MBS_TMP_DEF char *___tmp_ptr;# define ___TMP_PTR ___tmp_ptr# define CLEN(ptr) mblen((ZCONST char *)(ptr), MB_CUR_MAX)# ifndef PREINCSTR# define PREINCSTR(ptr) (ptr += CLEN(ptr))# endif# define POSTINCSTR(ptr) (___TMP_PTR=(char *)(ptr), PREINCSTR(ptr),___TMP_PTR) char *plastchar OF((ZCONST char *ptr, extent len));# define lastchar(ptr, len) ((int)(unsigned)*plastchar(ptr, len))# ifndef MBSCHR# define NEED_UZMBSCHR# define MBSCHR(str,c) (char *)uzmbschr((ZCONST unsigned char *)(str), c)# endif# ifndef MBSRCHR# define NEED_UZMBSRCHR# define MBSRCHR(str,c) (char *)uzmbsrchr((ZCONST unsigned char *)(str), c)# endif# define SETLOCALE(category, locale) setlocale(category, locale)#else /* !_MBCS */# define ___MBS_TMP_DEF# define ___TMP_PTR# define CLEN(ptr) 1# define PREINCSTR(ptr) (++(ptr))# define POSTINCSTR(ptr) ((ptr)++)# define plastchar(ptr, len) (&ptr[(len)-1])# define lastchar(ptr, len) (ptr[(len)-1])# define MBSCHR(str, c) strchr(str, c)# define MBSRCHR(str, c) strrchr(str, c)# define SETLOCALE(category, locale)#endif /* ?_MBCS */#define INCSTR(ptr) PREINCSTR(ptr)#if (defined(MALLOC_WORK) && !defined(MY_ZCALLOC)) /* Any system without a special calloc function */# define zcalloc(items, size) \ (zvoid far *)calloc((unsigned)(items), (unsigned)(size))# define zcfree free#endif /* MALLOC_WORK && !MY_ZCALLOC */#ifdef REGULUS /* returns the inode number on success(!)...argh argh argh */# define stat(p,s) zstat((p),(s))#endif#if (defined(CRAY) && defined(ZMEM))# undef ZMEM#endif
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -