osdep.h 3.9 KB

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