home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 9 Archive / 09-Archive.zip / unzip531.zip / wince / punzip.h < prev    next >
C/C++ Source or Header  |  1997-04-13  |  6KB  |  220 lines

  1. //******************************************************************************
  2. //
  3. // File:        PUNZIP.H
  4. //
  5. // Description: This is our global header for the entire Pocket UnZip project.
  6. //              This header contains all global project build flags, defines,
  7. //              constants, and macros.  It also includes all other headers that
  8. //              are needed by the project.
  9. //
  10. // Copyright:   All the source files for Pocket UnZip, except for components
  11. //              written by the Info-ZIP group, are copyrighted 1997 by Steve P.
  12. //              Miller.  The product "Pocket UnZip" itself is property of the
  13. //              author and cannot be altered in any way without written consent
  14. //              from Steve P. Miller.
  15. //
  16. // Disclaimer:  All project files are provided "as is" with no guarantee of
  17. //              their correctness.  The authors are not liable for any outcome
  18. //              that is the result of using this source.  The source for Pocket
  19. //              UnZip has been placed in the public domain to help provide an
  20. //              understanding of its implementation.  You are hereby granted
  21. //              full permission to use this source in any way you wish, except
  22. //              to alter Pocket UnZip itself.  For comments, suggestions, and
  23. //              bug reports, please write to stevemil@pobox.com.
  24. //
  25. //
  26. // Date      Name          History
  27. // --------  ------------  -----------------------------------------------------
  28. // 02/01/97  Steve Miller  Created (Version 1.0 using Info-ZIP UnZip 5.30)
  29. //
  30. //******************************************************************************
  31.  
  32. #ifndef __PUNZIP_H__
  33. #define __PUNZIP_H__
  34.  
  35. #ifdef __cplusplus
  36. extern "C" {
  37. #endif
  38.  
  39. //******************************************************************************
  40. //***** Standard Win32 project flags
  41. //******************************************************************************
  42.  
  43. #ifndef WIN32
  44. #define WIN32
  45. #endif
  46.  
  47. #ifndef _WINDOWS
  48. #define _WINDOWS
  49. #endif
  50.  
  51. #ifndef UNICODE
  52. #define UNICODE
  53. #endif
  54.  
  55. #ifndef _UNICODE
  56. #define _UNICODE
  57. #endif
  58.  
  59. #ifndef WIN32_LEAN_AND_MEAN
  60. #define WIN32_LEAN_AND_MEAN
  61. #endif
  62.  
  63. #ifndef STRICT
  64. #define STRICT
  65. #endif
  66.  
  67. #if defined(_DEBUG) && !defined(DEBUG)
  68. #define DEBUG
  69. #endif
  70.  
  71. #if defined(DEBUG) && !defined(_DEBUG)
  72. #define _DEBUG
  73. #endif
  74.  
  75. #if defined(_NDEBUG) && !defined(NDEBUG)
  76. #define NDEBUG
  77. #endif
  78.  
  79. #if defined(NDEBUG) && !defined(_NDEBUG)
  80. #define _NDEBUG
  81. #endif
  82.  
  83.  
  84. //******************************************************************************
  85. //***** Pocket Unzip and Info-ZIP flags
  86. //******************************************************************************
  87.  
  88. #ifndef POCKET_UNZIP
  89. #define POCKET_UNZIP
  90. #endif
  91.  
  92. #ifndef UNZIP_INTERNAL
  93. #define UNZIP_INTERNAL
  94. #endif
  95.  
  96. #ifndef WINDLL
  97. #define WINDLL
  98. #endif
  99.  
  100. #ifndef DLL
  101. #define DLL
  102. #endif
  103.  
  104. #ifndef REENTRANT
  105. #define REENTRANT
  106. #endif
  107.  
  108. #ifndef USE_EF_UT_TIME
  109. #define USE_EF_UT_TIME
  110. #endif
  111.  
  112. #ifndef NO_ZIPINFO
  113. #define NO_ZIPINFO
  114. #endif
  115.  
  116. #ifndef NO_STDDEF_H
  117. #define NO_STDDEF_H
  118. #endif
  119.  
  120. #ifndef NO_NTSD_EAS
  121. #define NO_NTSD_EAS
  122. #endif
  123.  
  124. #ifdef NTSD_EAS
  125. #undef NTSD_EAS
  126. #endif
  127.  
  128. // Read COPYING document before enabling this define.
  129. #if 0
  130. #ifndef USE_SMITH_CODE
  131. #define USE_SMITH_CODE
  132. #endif
  133. #endif
  134.  
  135. // Read COPYING document before enabling this define.
  136. #if 0
  137. #ifndef USE_UNSHRINK
  138. #define USE_UNSHRINK
  139. #endif
  140. #endif
  141.  
  142.  
  143. //******************************************************************************
  144. //***** Global defines, constants, and macros
  145. //******************************************************************************
  146.  
  147. #ifndef PATH_MAX
  148. #define PATH_MAX _MAX_PATH
  149. #endif
  150.  
  151. // WinCE uses ISO 8859-1 as codepage for 8-bit chars
  152. #define CRTL_CP_IS_ISO
  153. // The functionality of ISO <--> OEM conversion IS needed on WinCE, too!!
  154. // (Otherwise, extended ASCII filenames and passwords in archives coming
  155. // from other platforms may not be handled properly.)
  156. // Since WinCE does not supply ISO <--> OEM conversion, we try to fall
  157. // back to the hardcoded tables in the generic UnZip code.
  158.  
  159. #define ASCII2OEM(c) (((c) & 0x80) ? iso2oem[(c) & 0x7f] : (c))
  160. #if !defined(CRYP_USES_ISO2OEM)
  161. #  define CRYP_USES_ISO2OEM
  162. #endif
  163.  
  164. #define INTERN_TO_ISO(src, dst)  {if ((src) != (dst)) strcpy((dst), (src));}
  165. #define INTERN_TO_OEM(src, dst)  {register uch c;\
  166.     register uch *dstp = (uch *)(dst), *srcp = (uch *)(src);\
  167.     do {\
  168.         c = (uch)foreign(*srcp++);\
  169.         *dstp++ = (uch)ASCII2OEM(c);\
  170.     } while (c != '\0');}
  171.  
  172.  
  173. #if (defined(_MSC_VER) && !defined(MSC))
  174. #define MSC
  175. #endif
  176.  
  177. #ifdef MSC
  178. #define DIR_END   '\\' // ZipInfo with VC++ 4.0 requires this
  179. #endif
  180.  
  181. // We are defining a few new error types for our code.
  182. #define PK_EXCEPTION  500
  183. #define PK_ABORTED    501
  184.  
  185. #define DATE_FORMAT   DF_MDY
  186. #define lenEOL        2
  187. #define PutNativeEOL  {*q++ = native(CR); *q++ = native(LF);}
  188.  
  189. #define countof(a) (sizeof(a)/sizeof(*(a)))
  190.  
  191. // The max number of retires (not including the first attempt) for entering
  192. // a password for and encrypted file before giving up on that file.
  193. #define MAX_PASSWORD_RETRIES 2
  194.  
  195. // Variables that we want to add to our Globals struct.
  196. #define SYSTEM_SPECIFIC_GLOBALS  \
  197.    char  matchname[FILNAMSIZ];   \
  198.    int   notfirstcall;           \
  199.    char *zipfnPtr;               \
  200.    char *wildzipfnPtr;
  201.  
  202.  
  203. //******************************************************************************
  204. //***** Global headers
  205. //******************************************************************************
  206.  
  207. #include <windows.h>
  208. #include <setjmp.h>
  209. #include <stdlib.h>
  210. #include <excpt.h>
  211. #include "wince\wince.h"     // Our WinCE specific code and our debug function.
  212. #include "wince\resource.h"  // Our resource constants
  213. #include "wince\punzip.rcv"  // Our version information.
  214.  
  215. #ifdef __cplusplus
  216. } // extern "C"
  217. #endif
  218.  
  219. #endif // __PUNZIP_H__
  220.