123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887 |
- #if (defined(WIN32) && defined(UNIX))
-
- # if (defined(FORCE_WIN32_OVER_UNIX) && defined(FORCE_UNIX_OVER_WIN32))
-
- # undef FORCE_UNIX_OVER_WIN32
- # endif
- # ifdef FORCE_WIN32_OVER_UNIX
-
- # undef UNIX
- # else
-
- # undef WIN32
- # endif
- #endif
- #ifdef NO_UNICODE_SUPPORT
- # ifdef UNICODE_SUPPORT
- # undef UNICODE_SUPPORT
- # endif
- #endif
- #ifdef AMIGA
- #include "amiga/osdep.h"
- #endif
- #ifdef AOSVS
- #include "aosvs/osdep.h"
- #endif
- #ifdef ATARI
- #include "atari/osdep.h"
- #endif
- #ifdef __ATHEOS__
- #include "atheos/osdep.h"
- #endif
- #ifdef __BEOS__
- #include "beos/osdep.h"
- #endif
- #ifdef DOS
- #include "msdos/osdep.h"
- #endif
- #ifdef __human68k__
- #include "human68k/osdep.h"
- #endif
- #if ((defined(__MWERKS__) && defined(macintosh)) || defined(MACOS))
- #include "macos/osdep.h"
- #endif
- #ifdef NLM
- #include "novell/osdep.h"
- #endif
- #ifdef OS2
- #include "os2/osdep.h"
- #endif
- #ifdef __riscos
- #include "acorn/osdep.h"
- #endif
- #ifdef QDOS
- #include "qdos/osdep.h"
- #endif
- #ifdef __TANDEM
- #include "tandem.h"
- #include "tanzip.h"
- #endif
- #ifdef UNIX
- #include "unix/osdep.h"
- #endif
- #if defined(__COMPILER_KCC__) || defined(TOPS20)
- #include "tops20/osdep.h"
- #endif
- #if defined(VMS) || defined(__VMS)
- #include "vms/osdep.h"
- #endif
- #if defined(__VM__) || defined(VM_CMS) || defined(MVS)
- #include "cmsmvs.h"
- #endif
- #ifdef WIN32
- #include "win32/osdep.h"
- #endif
- #ifdef THEOS
- #include "theos/osdep.h"
- #endif
- #ifndef ZOFF_T_FORMAT_SIZE_PREFIX
- # ifdef LARGE_FILE_SUPPORT
-
-
- # define _LARGEFILE_SOURCE
- # define _LARGEFILE64_SOURCE
- # define _FILE_OFFSET_BITS 64
- # define _LARGE_FILES
- typedef off_t zoff_t;
- typedef unsigned long long uzoff_t;
-
- # define ZOFF_T_FORMAT_SIZE_PREFIX "ll"
- # else
-
-
- typedef long zoff_t;
- typedef unsigned long uzoff_t;
- # define ZOFF_T_FORMAT_SIZE_PREFIX "l"
- # endif
- typedef struct stat z_stat;
-
- # define USING_DEFAULT_LARGE_FILE_SUPPORT
- #endif
- #if (defined(USE_ZLIB) && defined(ASM_CRC))
- # undef ASM_CRC
- #endif
- #if (defined(USE_ZLIB) && defined(ASMV))
- # undef ASMV
- #endif
- #if (defined(NO_VOID) && !defined(NO_PROTO))
- # define NO_PROTO
- #endif
- #ifndef NO_PROTO
- # define OF(a) a
- # define OFT(a) a
- #else
- # define OF(a) ()
- # define OFT(a)
- #endif
- #ifndef ZCONST
- # ifdef NO_CONST
- # define ZCONST
- # define const
- # else
- # define ZCONST const
- # endif
- #endif
- #ifndef IZ_IMP
- # define IZ_IMP
- #endif
- #ifdef USE_CASE_MAP
- # define case_map(c) upper[(c) & 0xff]
- # define to_up(c) upper[(c) & 0xff]
- #else
- # define case_map(c) (c)
- # define to_up(c) ((c) >= 'a' && (c) <= 'z' ? (c)-'a'+'A' : (c))
- #endif
- #include <stdio.h>
- #ifndef NO_STDDEF_H
- # include <stddef.h>
- #endif
- #ifndef NO_STDLIB_H
- # include <stdlib.h>
- #endif
- #ifndef NO_UNISTD_H
- # include <unistd.h> /* usually defines _POSIX_VERSION */
- #endif
- #ifndef NO_FCNTL_H
- # include <fcntl.h>
- #endif
- #ifndef NO_STRING_H
- # include <string.h>
- #else
- # include <strings.h>
- #endif
- #ifdef NO_VOID
- # define void int
- typedef char zvoid;
- #else
- # ifdef NO_TYPEDEF_VOID
- # define zvoid void
- # else
- typedef void zvoid;
- # endif
- #endif
- #ifdef NO_STRRCHR
- # define strrchr rindex
- #endif
- #ifdef NO_STRCHR
- # define strchr index
- #endif
- #ifdef NO_PROTO
- IZ_IMP char *strcpy();
- IZ_IMP char *strcat();
- IZ_IMP char *strrchr();
- #if !defined(ZMEM) && defined(NO_STRING_H)
- IZ_IMP char *memset();
- IZ_IMP char *memcpy();
- #endif
- #ifdef NO_STDLIB_H
- IZ_IMP char *calloc();
- IZ_IMP char *malloc();
- IZ_IMP char *getenv();
- IZ_IMP long atol();
- #endif
- #ifndef NO_MKTEMP
- IZ_IMP char *mktemp();
- #endif
- #endif
- #ifndef SEEK_SET
- # define SEEK_SET 0
- #endif
- #ifndef SEEK_CUR
- # define SEEK_CUR 1
- #endif
- #ifndef FALSE
- # define FALSE 0
- #endif
- #ifndef TRUE
- # define TRUE 1
- #endif
- #ifdef NO_SIZE_T
- typedef unsigned int extent;
-
- typedef unsigned int size_t;
- #else
- typedef size_t extent;
- #endif
- #ifdef NO_TIME_T
- typedef long time_t;
- #endif
- #ifdef UNICODE_SUPPORT
- # if defined( UNIX) || defined( VMS)
- # include <locale.h>
- # endif
- # include <wchar.h>
- # include <wctype.h>
- #endif
- #ifdef _MBCS
- # include <locale.h>
-
- extern char *___tmp_ptr;
- unsigned char *zmbschr OF((ZCONST unsigned char *, unsigned int));
- unsigned char *zmbsrchr OF((ZCONST unsigned char *, unsigned int));
- # define CLEN(ptr) mblen((ZCONST char *)ptr, MB_CUR_MAX)
- # define PREINCSTR(ptr) (ptr += CLEN(ptr))
- # define POSTINCSTR(ptr) (___tmp_ptr=(char *)ptr,ptr += CLEN(ptr),___tmp_ptr)
- int lastchar OF((ZCONST char *ptr));
- # define MBSCHR(str,c) (char *)zmbschr((ZCONST unsigned char *)(str), c)
- # define MBSRCHR(str,c) (char *)zmbsrchr((ZCONST unsigned char *)(str), (c))
- # ifndef SETLOCALE
- # define SETLOCALE(category, locale) setlocale(category, locale)
- # endif
- #else
- # define CLEN(ptr) 1
- # define PREINCSTR(ptr) (++(ptr))
- # define POSTINCSTR(ptr) ((ptr)++)
- # define lastchar(ptr) ((*(ptr)=='\0') ? '\0' : ptr[strlen(ptr)-1])
- # define MBSCHR(str, c) strchr(str, c)
- # define MBSRCHR(str, c) strrchr(str, c)
- # ifndef SETLOCALE
- # define SETLOCALE(category, locale)
- # endif
- #endif
- #define INCSTR(ptr) PREINCSTR(ptr)
- typedef struct ztimbuf {
- time_t actime;
- time_t modtime;
- } ztimbuf;
- #ifndef ROUNDED_TIME
- # define ROUNDED_TIME(time) (time)
- #endif
- #if defined (S_IFLNK) && defined(NO_SYMLINKS)
- # undef S_IFLNK
- #endif
- #ifndef Z_UINT4_DEFINED
- # if !defined(NO_LIMITS_H)
- # if (defined(UINT_MAX) && (UINT_MAX == 0xffffffffUL))
- typedef unsigned int z_uint4;
- # define Z_UINT4_DEFINED
- # else
- # if (defined(ULONG_MAX) && (ULONG_MAX == 0xffffffffUL))
- typedef unsigned long z_uint4;
- # define Z_UINT4_DEFINED
- # else
- # if (defined(USHRT_MAX) && (USHRT_MAX == 0xffffffffUL))
- typedef unsigned short z_uint4;
- # define Z_UINT4_DEFINED
- # endif
- # endif
- # endif
- # endif
- #endif
- #ifndef Z_UINT4_DEFINED
- typedef ulg z_uint4;
- # define Z_UINT4_DEFINED
- #endif
- #ifndef FOPR
- # define FOPR "r"
- # define FOPM "r+"
- # define FOPW "w"
- #endif
- #ifndef FOPW_TMP
- # define FOPW_TMP FOPW
- #endif
- #ifdef OS2
- # define FOPR_EX FOPM
- #else
- # define FOPR_EX FOPR
- #endif
- #define MSDOS_HIDDEN_ATTR 0x02
- #define MSDOS_DIR_ATTR 0x10
- #if (defined(MSDOS) && !defined(WIN32)) || defined(i386)
- # define UNALIGNED_OK
- #endif
- #if defined(mc68020) || defined(vax)
- # define UNALIGNED_OK
- #endif
- #if (defined(SMALL_MEM) && !defined(CBSZ))
- # define CBSZ 2048
- # define ZBSZ 2048
- #endif
- #if (defined(MEDIUM_MEM) && !defined(CBSZ))
- # define CBSZ 8192
- # define ZBSZ 8192
- #endif
- #ifndef CBSZ
- # define CBSZ 16384
- # define ZBSZ 16384
- #endif
- #ifndef SBSZ
- # define SBSZ CBSZ
- #endif
- #ifndef MEMORY16
- # ifdef __WATCOMC__
- # undef huge
- # undef far
- # undef near
- # endif
- # ifdef THEOS
- # undef far
- # undef near
- # endif
- # if (!defined(__IBMC__) || !defined(OS2))
- # ifndef huge
- # define huge
- # endif
- # ifndef far
- # define far
- # endif
- # ifndef near
- # define near
- # endif
- # endif
- # define nearmalloc malloc
- # define nearfree free
- # define farmalloc malloc
- # define farfree free
- #endif
- #ifndef Far
- # define Far far
- #endif
- #if (defined(MMAP) && defined(BIG_MEM))
- # undef BIG_MEM
- #endif
- #if (defined(BIG_MEM) || defined(MMAP)) && !defined(DYN_ALLOC)
- # define DYN_ALLOC
- #endif
- #ifdef LARGE_FILE_SUPPORT
-
-
- # ifdef UNIX
-
-
- # define zstat stat
- # define zfstat fstat
- # define zlstat lstat
- # if defined(__alpha) && defined(__osf__)
-
- # define zfseeko fseek
-
- # define zftello ftell
- # else
-
- # define zfseeko fseeko
-
- # define zftello ftello
- # endif
-
- # define zfopen fopen
- # define zfdopen fdopen
- # endif
- # ifdef VMS
-
- # define zstat stat
- # define zfstat fstat
- # define zlstat lstat
-
- # define zfseeko fseeko
-
- # define zftello ftello
-
- # define zfopen fopen
- # define zfdopen fdopen
- # endif
- # ifdef WIN32
- # if defined(__MINGW32__)
-
-
- # define zstat _stati64
- # ifdef UNICODE_SUPPORT
- # define zwfstat _fstati64
- # define zwstat _wstati64
- # define zw_stat struct _stati64
- # endif
- # define zfstat _fstati64
- # define zlstat lstat
-
-
- int zfseeko OF((FILE *, zoff_t, int));
-
-
- zoff_t zftello OF((FILE *));
-
- # define zfopen fopen
- # define zfdopen fdopen
- # endif
- # if defined(__CYGWIN__)
-
-
- # define zstat stat
- # define zfstat fstat
- # define zlstat lstat
-
- # define zfseeko fseeko
-
- # define zftello ftello
-
- # define zfopen fopen
- # define zfdopen fdopen
- # endif
- # ifdef __WATCOMC__
-
-
- # define zstat _stati64
- # ifdef UNICODE_SUPPORT
- # define zwfstat _fstati64
- # define zwstat _wstati64
- # define zw_stat struct _stati64
- # endif
- # define zfstat _fstati64
- # define zlstat lstat
-
-
- int zfseeko OF((FILE *, zoff_t, int));
-
-
- zoff_t zftello OF((FILE *));
-
- # define zfopen fopen
- # define zfdopen fdopen
- # endif
- # ifdef _MSC_VER
-
-
- # define zstat _stati64
- # ifdef UNICODE_SUPPORT
- # define zwfstat _fstati64
- # define zwstat _wstati64
- # define zw_stat struct _stati64
- # endif
- # define zfstat _fstati64
- # define zlstat lstat
-
-
- int zfseeko OF((FILE *, zoff_t, int));
-
-
- zoff_t zftello OF((FILE *));
-
- # define zfopen fopen
- # define zfdopen fdopen
- # endif
- # ifdef __IBMC__
-
-
-
-
- int zfseeko OF((FILE *, zoff_t, int));
-
-
- zoff_t zftello OF((FILE *));
-
- # endif
- # endif
- #else
-
- # define zstat stat
- # define zfstat fstat
- # define zlstat lstat
- # define zfseeko fseek
- # define zftello ftell
- # define zfopen fopen
- # define zfdopen fdopen
- # ifdef UNICODE_SUPPORT
- # define zwfstat _fstat
- # define zwstat _wstat
- # define zw_stat struct _stat
- # endif
- #endif
- #ifdef LARGE_FILE_SUPPORT
- # ifndef SSTAT
- # define SSTAT zstat
- # ifdef UNICODE_SUPPORT
- # define SSTATW zwstat
- # endif
- # endif
- # ifdef S_IFLNK
- # define LSTAT zlstat
- # define LSSTAT(n, s) (linkput ? zlstat((n), (s)) : SSTAT((n), (s)))
- # else
- # define LSTAT SSTAT
- # define LSSTAT SSTAT
- # ifdef UNICODE_SUPPORT
- # define LSSTATW SSTATW
- # endif
- # endif
- #else
- # ifndef SSTAT
- # define SSTAT stat
- # endif
- # ifdef S_IFLNK
- # define LSTAT lstat
- # define LSSTAT(n, s) (linkput ? lstat((n), (s)) : SSTAT((n), (s)))
- # else
- # define LSTAT SSTAT
- # define LSSTAT SSTAT
- # ifdef UNICODE_SUPPORT
- # define LSSTATW SSTATW
- # endif
- # endif
- #endif
- #ifndef FZOFFT_FMT
- # define FZOFFT_FMT ZOFF_T_FORMAT_SIZE_PREFIX
- # ifdef LARGE_FILE_SUPPORT
- # define FZOFFT_HEX_WID_VALUE "16"
- # else
- # define FZOFFT_HEX_WID_VALUE "8"
- # endif
- #endif
- #define FZOFFT_HEX_WID ((char *) -1)
- #define FZOFFT_HEX_DOT_WID ((char *) -2)
- #ifdef ZCRYPT_INTERNAL
- # ifndef ZCR_SEED2
- # define ZCR_SEED2 (unsigned) getpid()
- # endif
- #endif
- #ifdef AMIGA
- # define OS_CODE 0x100
- #endif
- #ifdef VMS
- # define OS_CODE 0x200
- #endif
- #ifdef VM_CMS
- # define OS_CODE 0x400
- #endif
- #ifdef ATARI
- # define OS_CODE 0x500
- #endif
- #ifdef OS2
- # define OS_CODE 0x600
- #endif
- #ifdef MACOS
- # define OS_CODE 0x700
- #endif
- #ifdef TOPS20
- # define OS_CODE 0xa00
- #endif
- #ifdef WIN32
- # define OS_CODE 0xb00
- #endif
- #ifdef QDOS
- # define OS_CODE 0xc00
- #endif
- #ifdef RISCOS
- # define OS_CODE 0xd00
- #endif
- #ifdef VFAT
- # define OS_CODE 0xe00
- #endif
- #ifdef MVS
- # define OS_CODE 0xf00
- #endif
- #ifdef __BEOS__
- # define OS_CODE 0x1000
- #endif
- #ifdef TANDEM
- # define OS_CODE 0x1100
- #endif
- #ifdef THEOS
- # define OS_CODE 0x1200
- #endif
- #ifdef __ATHEOS__
- # define OS_CODE 0x1E00
- #endif
- #define NUM_HOSTS 31
- #if defined(DOS) && !defined(OS_CODE)
- # define OS_CODE 0x000
- #endif
- #ifndef OS_CODE
- # define OS_CODE 0x300
- #endif
- #ifndef EXIT
- # define EXIT exit
- #endif
- #ifndef RETURN
- # define RETURN return
- #endif
- #ifndef ZIPERR
- # define ZIPERR ziperr
- #endif
- #if (defined(USE_ZLIB) && defined(MY_ZCALLOC))
-
- # undef MY_ZCALLOC
- #endif
- #if (!defined(USE_ZLIB) && !defined(MY_ZCALLOC))
-
- # define zcalloc(items,size) \
- (zvoid far *)calloc((unsigned)(items), (unsigned)(size))
- # define zcfree free
- #endif
|