vmscfg.h 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. /*
  2. Copyright (c) 1990-2009 Info-ZIP. All rights reserved.
  3. See the accompanying file LICENSE, version 2009-Jan-02 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. OpenVMS specific configuration section (included by unzpriv.h):
  10. ---------------------------------------------------------------------------*/
  11. #ifndef __vmscfg_h /* Prevent (unlikely) multiple inclusions. */
  12. #define __vmscfg_h
  13. /* Workaround for broken header files of older DECC distributions
  14. * that are incompatible with the /NAMES=AS_IS qualifier. */
  15. #define cma$tis_errno_get_addr CMA$TIS_ERRNO_GET_ADDR
  16. /* LARGE FILE SUPPORT - 10/6/04 EG */
  17. /* This needs to be set before the includes so they set the right sizes */
  18. #ifdef NO_LARGE_FILE_SUPPORT
  19. # ifdef LARGE_FILE_SUPPORT
  20. # undef LARGE_FILE_SUPPORT
  21. # endif
  22. #endif
  23. #ifdef LARGE_FILE_SUPPORT
  24. # define _LARGEFILE /* Define the pertinent macro. */
  25. /* LARGE_FILE_SUPPORT implies ZIP64_SUPPORT,
  26. unless explicitly disabled by NO_ZIP64_SUPPORT.
  27. */
  28. # ifdef NO_ZIP64_SUPPORT
  29. # ifdef ZIP64_SUPPORT
  30. # undef ZIP64_SUPPORT
  31. # endif
  32. # else
  33. # ifndef ZIP64_SUPPORT
  34. # define ZIP64_SUPPORT
  35. # endif
  36. # endif
  37. #endif /* def LARGE_FILE_SUPPORT */
  38. /* 2007-02-22 SMS.
  39. * Enable symbolic links according to the available C RTL support,
  40. * unless prohibited by the user defining NO_SYMLINKS.
  41. */
  42. #if !defined(__VAX) && defined(__CRTL_VER) && __CRTL_VER >= 70301000
  43. # ifndef NO_SYMLINKS
  44. # define SYMLINKS
  45. # endif
  46. #endif
  47. #ifdef SYMLINKS
  48. # include <unistd.h>
  49. #endif
  50. # include <types.h> /* GRR: experimenting... */
  51. # include <stat.h>
  52. # include <time.h> /* the usual non-BSD time functions */
  53. # include <file.h> /* same things as fcntl.h has */
  54. # include <unixio.h>
  55. # include <rms.h>
  56. /* Define maximum path length according to NAM[L] member size. */
  57. # ifndef NAM_MAXRSS
  58. # ifdef NAML$C_MAXRSS
  59. # define NAM_MAXRSS NAML$C_MAXRSS
  60. # else
  61. # define NAM_MAXRSS NAM$C_MAXRSS
  62. # endif
  63. # endif
  64. # define _MAX_PATH (NAM_MAXRSS+1) /* to define FILNAMSIZ below */
  65. # ifdef RETURN_CODES /* VMS interprets standard PK return codes incorrectly */
  66. # define RETURN(ret) return_VMS(__G__ (ret)) /* verbose version */
  67. # define EXIT(ret) return_VMS(__G__ (ret))
  68. # else
  69. # define RETURN return_VMS /* quiet version */
  70. # define EXIT return_VMS
  71. # endif
  72. # ifdef VMSCLI
  73. # define USAGE(ret) VMSCLI_usage(__G__ (ret))
  74. # endif
  75. # define DIR_BEG '['
  76. # define DIR_END ']'
  77. # define DIR_EXT ".dir"
  78. # ifndef UZ_FNFILTER_REPLACECHAR
  79. /* We use '?' instead of the single char wildcard '%' as "unprintable
  80. * charcode" placeholder, because '%' is valid for ODS-5 names but '?'
  81. * is invalid. This choice may allow easier detection of "unprintables"
  82. * when reading the fnfilter() output.
  83. */
  84. # define UZ_FNFILTER_REPLACECHAR '?'
  85. # endif
  86. # ifndef DATE_FORMAT
  87. # define DATE_FORMAT DF_MDY
  88. # endif
  89. # define lenEOL 1
  90. # define PutNativeEOL *q++ = native(LF);
  91. # define SCREENSIZE(ttrows, ttcols) screensize(ttrows, ttcols)
  92. # define SCREENWIDTH 80
  93. # define SCREENLWRAP screenlinewrap()
  94. # if (defined(__VMS_VERSION) && !defined(VMS_VERSION))
  95. # define VMS_VERSION __VMS_VERSION
  96. # endif
  97. # if (defined(__VMS_VER) && !defined(__CRTL_VER))
  98. # define __CRTL_VER __VMS_VER
  99. # endif
  100. # if ((!defined(__CRTL_VER)) || (__CRTL_VER < 70000000))
  101. # define NO_GMTIME /* gmtime() of earlier VMS C RTLs is broken */
  102. # else
  103. # if (!defined(NO_EF_UT_TIME) && !defined(USE_EF_UT_TIME))
  104. # define USE_EF_UT_TIME
  105. # endif
  106. # if (!defined(HAVE_STRNICMP) && !defined(NO_STRNICMP))
  107. # define HAVE_STRNICMP
  108. # ifdef STRNICMP
  109. # undef STRNICMP
  110. # endif
  111. # define STRNICMP strncasecmp
  112. # endif
  113. # endif
  114. # ifndef HAVE_STRNICMP /* use our private zstrnicmp() */
  115. # define NO_STRNICMP /* unless explicitly overridden */
  116. # endif
  117. # if (!defined(NOTIMESTAMP) && !defined(TIMESTAMP))
  118. # define TIMESTAMP
  119. # endif
  120. # define SET_DIR_ATTRIB
  121. # define RESTORE_UIDGID
  122. /* VMS is run on little-endian processors with 4-byte ints:
  123. * enable the optimized CRC-32 code */
  124. # ifdef IZ_CRC_BE_OPTIMIZ
  125. # undef IZ_CRC_BE_OPTIMIZ
  126. # endif
  127. # if !defined(IZ_CRC_LE_OPTIMIZ) && !defined(NO_CRC_OPTIMIZ)
  128. # define IZ_CRC_LE_OPTIMIZ
  129. # endif
  130. # if !defined(IZ_CRCOPTIM_UNFOLDTBL) && !defined(NO_CRC_OPTIMIZ)
  131. # define IZ_CRCOPTIM_UNFOLDTBL
  132. # endif
  133. /* Enable "better" unprintable charcodes filtering in fnfilter().
  134. * (On VMS, the isprint() implementation seems to detect 8-bit printable
  135. * characters even for the default "C" locale. A previous localization
  136. * setup by calling setlocale() is not neccessary.) */
  137. # if (!defined(NO_WORKING_ISPRINT) && !defined(HAVE_WORKING_ISPRINT))
  138. # define HAVE_WORKING_ISPRINT
  139. # endif
  140. #ifdef NO_OFF_T
  141. typedef long zoff_t;
  142. #else
  143. typedef off_t zoff_t;
  144. #endif
  145. #define ZOFF_T_DEFINED
  146. typedef struct stat z_stat;
  147. #define Z_STAT_DEFINED
  148. #ifdef __DECC
  149. /* File open callback ID values. */
  150. # define OPENR_ID 1
  151. /* File open callback ID storage. */
  152. extern int openr_id;
  153. /* File open callback function. */
  154. extern int acc_cb();
  155. /* Option macros for open().
  156. * General: Stream access
  157. *
  158. * Callback function (DEC C only) sets deq, mbc, mbf, rah, wbh, ...
  159. */
  160. # define OPNZIP_RMS_ARGS "ctx=stm", "acc", acc_cb, &openr_id
  161. #else /* !__DECC */ /* (So, GNU C, VAX C, ...)*/
  162. # define OPNZIP_RMS_ARGS "ctx=stm"
  163. #endif /* ?__DECC */
  164. #endif /* !__vmscfg_h */