os2cfg.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. /*
  2. Copyright (c) 1990-2008 Info-ZIP. All rights reserved.
  3. See the accompanying file LICENSE, version 2000-Apr-09 or later
  4. (the contents of which are also included in unzip.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. /*---------------------------------------------------------------------------
  9. OS/2 specific configuration section:
  10. ---------------------------------------------------------------------------*/
  11. #ifndef __os2cfg_h
  12. #define __os2cfg_h
  13. #ifdef MSDOS
  14. # include <dos.h> /* for REGS macro (TC) or _dos_setftime (MSC) */
  15. # ifdef __TURBOC__ /* includes Power C */
  16. # include <sys/timeb.h> /* for structure ftime */
  17. # ifndef __BORLANDC__ /* there appears to be a bug (?) in Borland's */
  18. # include <mem.h> /* MEM.H related to __STDC__ and far poin- */
  19. # endif /* ters. (dpk) [mem.h included for memcpy] */
  20. # endif
  21. #endif /* MSDOS */
  22. #ifdef __IBMC__
  23. # define S_IFMT 0xF000
  24. # define timezone _timezone /* (underscore names work with */
  25. # define tzset _tzset /* all versions of C Set) */
  26. # define PIPE_ERROR (errno == EERRSET || errno == EOS2ERR)
  27. #endif /* __IBMC__ */
  28. #ifdef __WATCOMC__
  29. # ifdef __386__
  30. # ifndef WATCOMC_386
  31. # define WATCOMC_386
  32. # endif
  33. # define __32BIT__
  34. # undef far
  35. # define far
  36. # undef near
  37. # define near
  38. /* Get asm routines to link properly without using "__cdecl": */
  39. # ifndef USE_ZLIB
  40. # pragma aux crc32 "_*" parm caller [] value [eax] modify [eax]
  41. # pragma aux get_crc_table "_*" parm caller [] value [eax] \
  42. modify [eax ecx edx]
  43. # endif /* !USE_ZLIB */
  44. # else /* !__386__ */
  45. # ifndef USE_ZLIB
  46. # pragma aux crc32 "_*" parm caller [] value [ax dx] \
  47. modify [ax cx dx bx]
  48. # pragma aux get_crc_table "_*" parm caller [] value [ax] \
  49. modify [ax cx dx bx]
  50. # endif /* !USE_ZLIB */
  51. # endif /* ?__386__ */
  52. #endif /* __WATCOMC__ */
  53. #ifdef __EMX__
  54. # ifndef __32BIT__
  55. # define __32BIT__
  56. # endif
  57. # define far
  58. #endif
  59. #ifndef __32BIT__
  60. # define __16BIT__
  61. #endif
  62. #ifdef MSDOS
  63. # undef MSDOS
  64. #endif
  65. #if defined(M_I86CM) || defined(M_I86LM)
  66. # define MED_MEM
  67. #endif
  68. #if (defined(__COMPACT__) || defined(__LARGE__) || defined(__HUGE__))
  69. # define MED_MEM
  70. #endif
  71. #ifdef __16BIT__
  72. # ifndef MED_MEM
  73. # define SMALL_MEM
  74. # endif
  75. #endif
  76. #ifdef __16BIT__
  77. # if defined(MSC) || defined(__WATCOMC__)
  78. # include <malloc.h>
  79. # define nearmalloc _nmalloc
  80. # define nearfree _nfree
  81. # endif
  82. # if defined(__TURBOC__) && defined(DYNALLOC_CRCTAB)
  83. # if defined(__COMPACT__) || defined(__LARGE__) || defined(__HUGE__)
  84. # undef DYNALLOC_CRCTAB
  85. # endif
  86. # endif
  87. # ifndef nearmalloc
  88. # define nearmalloc malloc
  89. # define nearfree free
  90. # endif
  91. # ifdef USE_DEFLATE64
  92. # if (defined(M_I86TM) || defined(M_I86SM) || defined(M_I86MM))
  93. # error Deflate64(tm) requires compact or large memory model
  94. # endif
  95. # if (defined(__TINY__) || defined(__SMALL__) || defined(__MEDIUM__))
  96. # error Deflate64(tm) requires compact or large memory model
  97. # endif
  98. /* the 64k history buffer for Deflate64 must be allocated specially */
  99. # define MALLOC_WORK
  100. # define MY_ZCALLOC
  101. # endif
  102. #endif
  103. /* TIMESTAMP is now supported on OS/2, so enable it by default */
  104. #if (!defined(NOTIMESTAMP) && !defined(TIMESTAMP))
  105. # define TIMESTAMP
  106. #endif
  107. /* check that TZ environment variable is defined before using UTC times */
  108. #if (!defined(NO_IZ_CHECK_TZ) && !defined(IZ_CHECK_TZ))
  109. # define IZ_CHECK_TZ
  110. #endif
  111. #ifndef RESTORE_ACL
  112. # define RESTORE_ACL
  113. #endif
  114. #ifndef OS2_EAS
  115. # define OS2_EAS /* for -l and -v listings (list.c) */
  116. #endif
  117. #ifdef isupper
  118. # undef isupper
  119. #endif
  120. #ifdef tolower
  121. # undef tolower
  122. #endif
  123. #define isupper(x) IsUpperNLS((unsigned char)(x))
  124. #define tolower(x) ToLowerNLS((unsigned char)(x))
  125. #ifndef NO_STRNICMP /* use UnZip's zstrnicmp(), because some compilers */
  126. # define NO_STRNICMP /* don't provide a NLS-aware strnicmp() function */
  127. #endif
  128. #define USETHREADID
  129. /* handlers for OEM <--> ANSI string conversions */
  130. #ifndef _OS2_ISO_ANSI
  131. /* use home-brewed conversion functions; internal charset is OEM */
  132. # ifdef CRTL_CP_IS_ISO
  133. # undef CRTL_CP_IS_ISO
  134. # endif
  135. # ifndef CRTL_CP_IS_OEM
  136. # define CRTL_CP_IS_OEM
  137. # endif
  138. #endif
  139. /* screen size detection */
  140. #define SCREENWIDTH 80
  141. #define SCREENSIZE(scrrows, scrcols) screensize(scrrows, scrcols)
  142. int screensize(int *tt_rows, int *tt_cols);
  143. /* on the OS/2 console screen, line-wraps are always enabled */
  144. #define SCREENLWRAP 1
  145. #endif /* !__os2cfg_h */