1 /* 2 Copyright (c) 1990-2005 Info-ZIP. All rights reserved. 3 4 See the accompanying file LICENSE, version 2005-Feb-10 or later 5 (the contents of which are also included in zip.h) for terms of use. 6 If, for some reason, all these files are missing, the Info-ZIP license 7 also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html 8 */ 9 #ifndef __amiga_osdep_h 10 #define __amiga_osdep_h 11 12 /* default to MEDIUM_MEM, but allow makefile override */ 13 #if ( (!defined(BIG_MEM)) && (!defined(SMALL_MEM))) 14 # define MEDIUM_MEM 15 #endif 16 17 /* check that TZ environment variable is defined before using UTC times */ 18 #if (!defined(NO_IZ_CHECK_TZ) && !defined(IZ_CHECK_TZ)) 19 # define IZ_CHECK_TZ 20 #endif 21 22 #ifndef IZTZ_GETLOCALETZINFO 23 # define IZTZ_GETLOCALETZINFO GetPlatformLocalTimezone 24 #endif 25 26 /* AmigaDOS can't even support disk partitions over 4GB, let alone files */ 27 #define NO_LARGE_FILE_SUPPORT 28 #ifdef LARGE_FILE_SUPPORT 29 # undef LARGE_FILE_SUPPORT 30 #endif 31 32 #define USE_CASE_MAP 33 #define USE_EF_UT_TIME 34 #define HANDLE_AMIGA_SFX 35 #define PROCNAME(n) (action == ADD || action == UPDATE ? wild(n) : \ 36 procname(n, 1)) 37 #define EXIT(e) ClearIOErr_exit(e) 38 void ClearIOErr_exit(int e); 39 40 #include "amiga/z-stat.h" 41 42 #ifdef __SASC 43 # include <sys/types.h> 44 # include <exec/execbase.h> 45 # if (defined(_M68020) && (!defined(__USE_SYSBASE))) 46 /* on 68020 or higher processors it is faster */ 47 # define __USE_SYSBASE /* to use the pragma libcall instead of syscall */ 48 # endif /* to access functions of the exec.library */ 49 # include <proto/exec.h> /* see SAS/C manual:part 2,chapter 2,pages 6-7 */ 50 # include <proto/dos.h> 51 # if (defined(_M68020) && !defined(UNALIGNED_OK)) 52 # define UNALIGNED_OK 53 # endif 54 # ifndef REENTRANT 55 # define REENTRANT 56 # endif 57 # if (defined(_NEAR_DATA) && !defined(DYN_ALLOC)) 58 # define DYN_ALLOC 59 # endif 60 # ifdef DEBUG 61 # include <sprof.h> /* profiler header file */ 62 # endif 63 # ifndef IZTZ_SETLOCALTZINFO 64 /* XXX !! We have really got to find a way to operate without these. */ 65 # define IZTZ_SETLOCALTZINFO 66 # endif 67 68 /* 69 A word on short-integers and SAS/C (a bug of [mc]alloc?) 70 Using short integers (i.e. compiling with option SHORT-INTEGERS) is 71 *not* recommended. To get maximum compression ratio the window size stored 72 in WSIZE should be 32k (0x8000). However, since the size of the window[] 73 array is 2*WSIZE, 65536 bytes must be allocated. The calloc function can 74 only allocate UINT_MAX (defined in limits.h) bytes which is one byte short 75 (65535) of the maximum window size if you are compiling with short-ints. 76 You'll get an error message "Out of memory (window allocation)" whenever 77 you try to deflate. Note that the compiler won't produce any warning. 78 The maximum window size with short-integers is therefore 32768 bytes. 79 The following is only implemented to allow the use of short-integers but 80 it is once again not recommended because of a loss in compression ratio. 81 */ 82 # if (defined(_SHORTINT) && !defined(WSIZE)) 83 # define WSIZE 0x4000 /* only half of maximum window size */ 84 # endif /* possible with short-integers */ 85 #endif /* __SASC */ 86 /* 87 With Aztec C, using short integers imposes no size limits and makes 88 the program run faster, even with 32 bit CPUs, so it's recommended. 89 */ 90 #ifdef AZTEC_C 91 # define NO_UNISTD_H 92 # define NO_RMDIR 93 # define BROKEN_FSEEK 94 # ifndef IZTZ_DEFINESTDGLOBALS 95 # define IZTZ_DEFINESTDGLOBALS 96 # endif 97 #endif 98 99 extern int real_timezone_is_set; 100 void tzset(void); 101 #define VALID_TIMEZONE(tempvar) (tzset(), real_timezone_is_set) 102 103 #ifdef ZCRYPT_INTERNAL 104 # ifndef CLIB_EXEC_PROTOS_H 105 void *FindTask(void *); 106 # endif 107 # define ZCR_SEED2 (unsigned)(ulg)FindTask(NULL) 108 #endif 109 110 int Agetch(void); /* getch() like function, in amiga/filedate.c */ 111 char *GetComment(char *); 112 113 #define FOPR "rb" 114 #define FOPM "rb+" 115 #define FOPW "wb" 116 /* prototype for ctrl-C trap function */ 117 void _abort(void); 118 119 #endif /* !__amiga_osdep_h */ 120