home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 9 Archive / 09-Archive.zip / unzip532.zip / win32 / w32cfg.h < prev    next >
C/C++ Source or Header  |  1997-10-21  |  5KB  |  162 lines

  1. /*---------------------------------------------------------------------------
  2.     Win32 specific configuration section:
  3.   ---------------------------------------------------------------------------*/
  4.  
  5. #ifndef __w32cfg_h
  6. #define __w32cfg_h
  7.  
  8. #include <sys/types.h>        /* off_t, time_t, dev_t, ... */
  9. #include <sys/stat.h>
  10. #include <io.h>               /* read(), open(), etc. */
  11. #include <time.h>
  12. #include <memory.h>
  13. #ifndef __EMX__
  14. #  include <direct.h>         /* mkdir() */
  15. #endif
  16. #include <fcntl.h>
  17. #if (defined(MSC) || defined(__WATCOMC__))
  18. #  include <sys/utime.h>
  19. #else
  20. #  include <utime.h>
  21. #endif
  22. #if defined(FILEIO_C)
  23. #  include <conio.h>
  24. #  include <windows.h>
  25. #  ifdef __RSXNT__
  26. #    include "win32/rsxntwin.h"
  27. #  endif
  28. #endif
  29. #if (defined(ENVARGS_C) || defined(EXTRACT_C) || defined(UNZIP_C) || \
  30.      defined(ZCRYPT_INTERNAL))
  31. #  include <windows.h>
  32. #  ifdef __RSXNT__
  33. #    include "win32/rsxntwin.h"
  34. #  endif
  35. #endif
  36.  
  37. #if defined(MSC)
  38. #  define DIR_END     '\\'   /* ZipInfo with VC++ 4.0 requires this */
  39. #endif
  40. #ifndef DATE_FORMAT
  41. #  define DATE_FORMAT DF_MDY
  42. #endif
  43. #define lenEOL        2
  44. #define PutNativeEOL  {*q++ = native(CR); *q++ = native(LF);}
  45.  
  46. #ifndef NT_TZBUG_WORKAROUND
  47. #  define NT_TZBUG_WORKAROUND
  48. #endif
  49. #define USE_EF_UT_TIME
  50. #if (!defined(NOTIMESTAMP) && !defined(TIMESTAMP))
  51. #  define TIMESTAMP
  52. #endif
  53. #ifdef __RSXNT__
  54. #  ifndef NO_NTSD_WITH_RSXNT
  55. #    define NO_NTSD_WITH_RSXNT  /* RSXNT windows.h does not yet support NTSD */
  56. #  endif
  57. #else /* !__RSXNT__ */
  58. #  if (!defined(NO_NTSD_EAS) && !defined(NTSD_EAS))
  59. #    define NTSD_EAS    /* enable NTSD support unless explicitly suppressed */
  60. #  endif
  61. #endif /* ?__RSXNT__ */
  62.  
  63. /* handlers for OEM <--> ANSI string conversions */
  64. #ifdef __RSXNT__
  65.    /* RSXNT uses OEM coded strings in functions supplied by C RTL */
  66. #  ifdef CRTL_CP_IS_ISO
  67. #    undef CRTL_CP_IS_ISO
  68. #  endif
  69. #  ifndef CRTL_CP_IS_OEM
  70. #    define CRTL_CP_IS_OEM
  71. #  endif
  72. #else
  73.    /* "real" native WIN32 compilers use ANSI coded strings in C RTL calls */
  74. #  ifndef CRTL_CP_IS_ISO
  75. #    define CRTL_CP_IS_ISO
  76. #  endif
  77. #  ifdef CRTL_CP_IS_OEM
  78. #    undef CRTL_CP_IS_OEM
  79. #  endif
  80. #endif
  81.  
  82. #ifdef CRTL_CP_IS_ISO
  83.    /* C RTL's file system support assumes ANSI coded strings */
  84. #  define ISO_TO_INTERN(src, dst)  {if ((src) != (dst)) strcpy((dst), (src));}
  85. #  define OEM_TO_INTERN(src, dst)  OemToAnsi(src, dst)
  86. #  define INTERN_TO_ISO(src, dst)  {if ((src) != (dst)) strcpy((dst), (src));}
  87. #  define INTERN_TO_OEM(src, dst)  AnsiToOem(src, dst)
  88. #endif /* CRTL_CP_IS_ISO */
  89. #ifdef CRTL_CP_IS_OEM
  90.    /* C RTL's file system support assumes OEM coded strings */
  91. #  define ISO_TO_INTERN(src, dst)  AnsiToOem(src, dst)
  92. #  define OEM_TO_INTERN(src, dst)  {if ((src) != (dst)) strcpy((dst), (src));}
  93. #  define INTERN_TO_ISO(src, dst)  OemToAnsi(src, dst)
  94. #  define INTERN_TO_OEM(src, dst)  {if ((src) != (dst)) strcpy((dst), (src));}
  95. #endif /* CRTL_CP_IS_OEM */
  96. #define _OEM_INTERN(str1) OEM_TO_INTERN(str1, str1)
  97. #define _ISO_INTERN(str1) ISO_TO_INTERN(str1, str1)
  98. #ifndef WINDLL
  99.    /* Despite best intentions, for the command-line version UzpPassword()
  100.     * could return either character set, depending on whether running under
  101.     * Win95 (DOS-session) or WinNT (native WinNT command interpreter)! */
  102. #  define STR_TO_CP2(dst, src)  (AnsiToOem(src, dst), dst)
  103. #  define STR_TO_CP3(dst, src)  (OemToAnsi(src, dst), dst)
  104. #else
  105.    /* The WINDLL front end is known to supply ISO/ANSI-coded passwords! */
  106. #  define STR_TO_CP2(dst, src)  (AnsiToOem(src, dst), dst)
  107. #endif
  108. /* dummy defines to disable these functions, they are not needed */
  109. #define STR_TO_OEM
  110. #define STR_TO_ISO
  111.  
  112. /* Static variables that we have to add to struct Globals: */
  113. #define SYSTEM_SPECIFIC_GLOBALS \
  114.     int created_dir, renamed_fullpath, fnlen;\
  115.     unsigned nLabelDrive;\
  116.     char *rootpath, *buildpathHPFS, *buildpathFAT, *endHPFS, *endFAT;\
  117.     char *dirname, *wildname, matchname[FILNAMSIZ];\
  118.     int rootlen, have_dirname, dirnamelen, notfirstcall;\
  119.     zvoid *wild_dir;
  120.  
  121. /* created_dir, renamed_fullpath, fnlen, and nLabelDrive are used by   */
  122. /*    both mapname() and checkdir().                                   */
  123. /* rootlen, rootpath, buildpathHPFS, buildpathFAT, endHPFS, and endFAT */
  124. /*    are used by checkdir().                                          */
  125. /* wild_dir, dirname, wildname, matchname[], dirnamelen, have_dirname, */
  126. /*    and notfirstcall are used by do_wild().                          */
  127.  
  128. #if (defined(_MSC_VER) && !defined(MSC))
  129. #  define MSC
  130. #endif
  131.  
  132. #ifdef __WATCOMC__
  133. #  undef SSTAT
  134. #  define SSTAT stat_bandaid
  135.    int stat_bandaid(const char *path, struct stat *buf);
  136.  
  137. #  ifdef __386__
  138. #    ifndef WATCOMC_386
  139. #      define WATCOMC_386
  140. #    endif
  141. #    define __32BIT__
  142. #    undef far
  143. #    define far
  144. #    undef near
  145. #    define near
  146.  
  147. /* Get asm routines to link properly without using "__cdecl": */
  148. #    ifndef USE_ZLIB
  149. #      pragma aux crc32         "_*" parm caller [] value [eax] modify [eax]
  150. #      pragma aux get_crc_table "_*" parm caller [] value [eax] \
  151.                                       modify [eax ecx edx]
  152. #    endif /* !USE_ZLIB */
  153. #  endif /* __386__ */
  154.  
  155. #  ifndef EPIPE
  156. #    define EPIPE -1
  157. #  endif
  158. #  define PIPE_ERROR (errno == EPIPE)
  159. #endif /* __WATCOMC__ */
  160.  
  161. #endif /* !__w32cfg_h */
  162.