00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifdef AMIGA
00010 #include "amiga/osdep.h"
00011 #endif
00012
00013 #ifdef AOSVS
00014 #include "aosvs/osdep.h"
00015 #endif
00016
00017 #ifdef ATARI
00018 #include "atari/osdep.h"
00019 #endif
00020
00021 #ifdef __BEOS__
00022 #include "beos/osdep.h"
00023 #endif
00024
00025 #ifdef DOS
00026 #include "msdos/osdep.h"
00027 #endif
00028
00029 #ifdef __human68k__
00030 #include "human68k/osdep.h"
00031 #endif
00032
00033 #if ((defined(__MWERKS__) && defined(macintosh)) || defined(MACOS))
00034 #include "macos/osdep.h"
00035 #endif
00036
00037 #ifdef OS2
00038 #include "os2/osdep.h"
00039 #endif
00040
00041 #ifdef __riscos
00042 #include "acorn/osdep.h"
00043 #endif
00044
00045 #ifdef QDOS
00046 #include "qdos/osdep.h"
00047 #endif
00048
00049 #ifdef __TANDEM
00050 #include "tandem.h"
00051 #include "tanzip.h"
00052 #endif
00053
00054 #ifdef UNIX
00055 #include "unix/osdep.h"
00056 #endif
00057
00058 #if defined(__COMPILER_KCC__) || defined(TOPS20)
00059 #include "tops20/osdep.h"
00060 #endif
00061
00062 #if defined(VMS) || defined(__VMS)
00063 #include "vms/osdep.h"
00064 #endif
00065
00066 #if defined(__VM__) || defined(VM_CMS) || defined(MVS)
00067 #include "cmsmvs.h"
00068 #endif
00069
00070 #ifdef WIN32
00071 #include "win32/osdep.h"
00072 #endif
00073
00074 #ifdef THEOS
00075 #include "theos/osdep.h"
00076 #endif
00077
00078 #if (defined(USE_ZLIB) && defined(ASM_CRC))
00079 # undef ASM_CRC
00080 #endif
00081
00082 #if (defined(USE_ZLIB) && defined(ASMV))
00083 # undef ASMV
00084 #endif
00085
00086
00087 #if (defined(NO_VOID) && !defined(NO_PROTO))
00088 # define NO_PROTO
00089 #endif
00090
00091
00092 #ifndef NO_PROTO
00093 # define OF(a) a
00094 #else
00095 # define OF(a) ()
00096 #endif
00097
00098
00099
00100 #ifndef ZCONST
00101 # ifdef NO_CONST
00102 # define ZCONST
00103 # define const
00104 # else
00105 # define ZCONST const
00106 # endif
00107 #endif
00108
00109
00110
00111
00112
00113 #ifdef USE_CASE_MAP
00114 # define case_map(c) upper[(c) & 0xff]
00115 # define to_up(c) upper[(c) & 0xff]
00116 #else
00117 # define case_map(c) (c)
00118 # define to_up(c) ((c) >= 'a' && (c) <= 'z' ? (c)-'a'+'A' : (c))
00119 #endif
00120
00121
00122 #include <stdio.h>
00123
00124 #ifndef NO_STDDEF_H
00125 # include <stddef.h>
00126 #endif
00127
00128 #ifndef NO_STDLIB_H
00129 # include <stdlib.h>
00130 #endif
00131
00132 #ifndef NO_UNISTD_H
00133 # include <unistd.h>
00134 #endif
00135
00136 #ifndef NO_FCNTL_H
00137 # include <fcntl.h>
00138 #endif
00139
00140 #ifndef NO_STRING_H
00141 # include <string.h>
00142 #else
00143 # include <strings.h>
00144 #endif
00145
00146 #ifdef NO_VOID
00147 # define void int
00148 typedef char zvoid;
00149 #else
00150 # ifdef NO_TYPEDEF_VOID
00151 # define zvoid void
00152 # else
00153 typedef void zvoid;
00154 # endif
00155 #endif
00156
00157 #ifdef NO_STRRCHR
00158 # define strrchr rindex
00159 #endif
00160
00161 #ifdef NO_STRCHR
00162 # define strchr index
00163 #endif
00164
00165
00166
00167
00168
00169 #ifdef NO_PROTO
00170 char *strcpy();
00171 char *strcat();
00172 char *strrchr();
00173
00174 #if !defined(ZMEM) && defined(NO_STRING_H)
00175 char *memset();
00176 char *memcpy();
00177 #endif
00178
00179
00180 #ifdef NO_STDLIB_H
00181 char *calloc();
00182 char *malloc();
00183 char *getenv();
00184 long atol();
00185 #endif
00186
00187 #endif
00188
00189 #ifndef NO_MKTEMP
00190 char *mktemp();
00191 #endif
00192
00193
00194
00195
00196
00197 #ifndef SEEK_SET
00198 # define SEEK_SET 0
00199 #endif
00200
00201 #ifndef SEEK_CUR
00202 # define SEEK_CUR 1
00203 #endif
00204
00205 #ifndef FALSE
00206 # define FALSE 0
00207 #endif
00208
00209 #ifndef TRUE
00210 # define TRUE 1
00211 #endif
00212
00213 #ifdef NO_SIZE_T
00214 typedef unsigned int extent;
00215 #else
00216 typedef size_t extent;
00217 #endif
00218
00219 #ifdef NO_TIME_T
00220 typedef long time_t;
00221 #endif
00222
00223
00224
00225
00226
00227 #ifdef _MBCS
00228 # include <locale.h>
00229
00230
00231 extern char *___tmp_ptr;
00232 unsigned char *zmbschr OF((ZCONST unsigned char *, unsigned int));
00233 unsigned char *zmbsrchr OF((ZCONST unsigned char *, unsigned int));
00234 # define CLEN(ptr) mblen(ptr, MB_CUR_MAX)
00235 # define PREINCSTR(ptr) (ptr += CLEN(ptr))
00236 # define POSTINCSTR(ptr) (___tmp_ptr=(char *)ptr,ptr += CLEN(ptr),___tmp_ptr)
00237 int lastchar OF((ZCONST char *ptr));
00238 # define MBSCHR(str,c) (char *)zmbschr((ZCONST unsigned char *)(str), c)
00239 # define MBSRCHR(str,c) (char *)zmbsrchr((ZCONST unsigned char *)(str), (c))
00240 # define SETLOCALE(category, locale) setlocale(category, locale)
00241 #else
00242 # define CLEN(ptr) 1
00243 # define PREINCSTR(ptr) (++(ptr))
00244 # define POSTINCSTR(ptr) ((ptr)++)
00245 # define lastchar(ptr) ((*(ptr)=='\0') ? '\0' : ptr[strlen(ptr)-1])
00246 # define MBSCHR(str, c) strchr(str, c)
00247 # define MBSRCHR(str, c) strrchr(str, c)
00248 # define SETLOCALE(category, locale)
00249 #endif
00250 #define INCSTR(ptr) PREINCSTR(ptr)
00251
00252
00253
00254
00255
00256 typedef struct ztimbuf {
00257 time_t actime;
00258 time_t modtime;
00259 } ztimbuf;
00260
00261
00262 #ifndef ROUNDED_TIME
00263 # define ROUNDED_TIME(time) (time)
00264 #endif
00265
00266
00267 #if defined (S_IFLNK) && defined(NO_SYMLINK)
00268 # undef S_IFLNK
00269 #endif
00270
00271 #ifndef FOPR
00272 # define FOPR "r"
00273 # define FOPM "r+"
00274 # define FOPW "w"
00275 #endif
00276
00277 #ifndef FOPW_TMP
00278 # define FOPW_TMP FOPW
00279 #endif
00280
00281
00282
00283
00284 #ifdef OS2
00285 # define FOPR_EX FOPM
00286 #else
00287 # define FOPR_EX FOPR
00288 #endif
00289
00290
00291
00292 #define MSDOS_HIDDEN_ATTR 0x02
00293 #define MSDOS_DIR_ATTR 0x10
00294
00295
00296
00297
00298
00299
00300 #if (defined(MSDOS) && !defined(WIN32)) || defined(i386)
00301 # define UNALIGNED_OK
00302 #endif
00303 #if defined(mc68020) || defined(vax)
00304 # define UNALIGNED_OK
00305 #endif
00306
00307 #if (defined(SMALL_MEM) && !defined(CBSZ))
00308 # define CBSZ 2048
00309 # define ZBSZ 2048
00310 #endif
00311
00312 #if (defined(MEDIUM_MEM) && !defined(CBSZ))
00313 # define CBSZ 8192
00314 # define ZBSZ 8192
00315 #endif
00316
00317 #ifndef CBSZ
00318 # define CBSZ 16384
00319 # define ZBSZ 16384
00320 #endif
00321
00322 #ifndef SBSZ
00323 # define SBSZ CBSZ
00324 #endif
00325
00326 #ifndef MEMORY16
00327 # ifdef __WATCOMC__
00328 # undef huge
00329 # undef far
00330 # undef near
00331 # endif
00332 # ifdef THEOS
00333 # undef far
00334 # undef near
00335 # endif
00336 # if (!defined(__IBMC__) || !defined(OS2))
00337 # ifndef huge
00338 # define huge
00339 # endif
00340 # ifndef far
00341 # define far
00342 # endif
00343 # ifndef near
00344 # define near
00345 # endif
00346 # endif
00347 # define nearmalloc malloc
00348 # define nearfree free
00349 # define farmalloc malloc
00350 # define farfree free
00351 #endif
00352
00353 #ifndef Far
00354 # define Far far
00355 #endif
00356
00357 #if (defined(BIG_MEM) || defined(MMAP)) && !defined(DYN_ALLOC)
00358 # define DYN_ALLOC
00359 #endif
00360
00361 #ifndef SSTAT
00362 # define SSTAT stat
00363 #endif
00364 #ifdef S_IFLNK
00365 # define LSTAT lstat
00366 # define LSSTAT(n, s) (linkput ? lstat((n), (s)) : SSTAT((n), (s)))
00367 #else
00368 # define LSTAT SSTAT
00369 # define LSSTAT SSTAT
00370 #endif
00371
00372
00373
00374
00375
00376 #ifdef ZCRYPT_INTERNAL
00377 # ifndef ZCR_SEED2
00378 # define ZCR_SEED2 (unsigned) getpid()
00379 # endif
00380 #endif
00381
00382
00383 #ifdef AMIGA
00384 # define OS_CODE 0x100
00385 #endif
00386 #ifdef VMS
00387 # define OS_CODE 0x200
00388 #endif
00389
00390 #ifdef VM_CMS
00391 # define OS_CODE 0x400
00392 #endif
00393 #ifdef ATARI
00394 # define OS_CODE 0x500
00395 #endif
00396 #ifdef OS2
00397 # define OS_CODE 0x600
00398 #endif
00399 #ifdef MACOS
00400 # define OS_CODE 0x700
00401 #endif
00402
00403
00404 #ifdef TOPS20
00405 # define OS_CODE 0xa00
00406 #endif
00407 #ifdef WIN32
00408 # define OS_CODE 0xb00
00409 #endif
00410 #ifdef QDOS
00411 # define OS_CODE 0xc00
00412 #endif
00413 #ifdef RISCOS
00414 # define OS_CODE 0xd00
00415 #endif
00416 #ifdef VFAT
00417 # define OS_CODE 0xe00
00418 #endif
00419 #ifdef MVS
00420 # define OS_CODE 0xf00
00421 #endif
00422 #ifdef __BEOS__
00423 # define OS_CODE 0x1000
00424 #endif
00425 #ifdef TANDEM
00426 # define OS_CODE 0x1100
00427 #endif
00428 #ifdef THEOS
00429 # define OS_CODE 0x1200
00430 #endif
00431
00432 #define NUM_HOSTS 19
00433
00434
00435 #if defined(DOS) && !defined(OS_CODE)
00436 # define OS_CODE 0x000
00437 #endif
00438
00439 #ifndef OS_CODE
00440 # define OS_CODE 0x300
00441 #endif
00442
00443
00444 #ifndef EXIT
00445 # define EXIT exit
00446 #endif
00447 #ifndef RETURN
00448 # define RETURN return
00449 #endif
00450
00451 #ifndef ZIPERR
00452 # define ZIPERR ziperr
00453 #endif
00454
00455 #if (defined(USE_ZLIB) && defined(MY_ZCALLOC))
00456
00457 # undef MY_ZCALLOC
00458 #endif
00459
00460 #if (!defined(USE_ZLIB) && !defined(MY_ZCALLOC))
00461
00462 # define zcalloc(items,size) \
00463 (zvoid far *)calloc((unsigned)(items), (unsigned)(size))
00464 # define zcfree free
00465 #endif
00466
00467