home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 2003 July / VPR0307.ISO / OLS / ZCRYD001 / zcryd001.lzh / SRC / CRYPT.H < prev    next >
C/C++ Source or Header  |  1998-06-02  |  3KB  |  133 lines

  1. /*
  2.    crypt.h (dummy version) by Info-ZIP.      Last revised:  5 Oct 97
  3.  
  4.    This is a non-functional version of Info-ZIP's crypt.h encryption/
  5.    decryption header file for Zip, ZipCloak, UnZip and fUnZip.  This
  6.    file is not copyrighted and may be distributed without restriction.
  7.    See the "WHERE" file for sites from which to obtain the full crypt
  8.    sources (zcrypt27.zip or later).
  9.  */
  10. /*
  11.    crypt.h (full version) by Info-ZIP.   Last revised:  [see CR_VERSION_DATE]
  12.  
  13.    This header file is not copyrighted, and non-beta versions may be
  14.    distributed without restriction.
  15.  */
  16.  
  17. #ifndef __crypt_h   /* don't include more than once */
  18. #define __crypt_h
  19.  
  20.  
  21. #ifdef CRYPT
  22. #  undef CRYPT
  23. #  define CRYPT  1    /* dummy version */
  24. #else
  25. #  define CRYPT  0    /* dummy version */
  26. #endif
  27.  
  28. #if !CRYPT
  29. #    define zencode
  30. #    define zdecode
  31. #    define zfwrite  fwrite
  32. #else    /* !CRYPT */
  33.  
  34. #ifdef WINDLL
  35. #    include <windows.h>
  36. #    define DLLIMPORT(FUNC) (WINAPI *FUNC)
  37. #elif defined(_WIN32)
  38. #    include <windows.h>
  39. #    define DLLIMPORT(FUNC) WINAPI FUNC
  40. #else
  41. #    define DLLIMPORT(FUNC)  FUNC
  42. #endif
  43.  
  44. void DLLIMPORT(zencode_n)(char *ptr,int n);
  45. int DLLIMPORT(zencode)(char c,int *t);
  46.  
  47. #define CR_MAJORVER        2
  48. #define CR_MINORVER        7
  49. #ifdef CR_BETA
  50. #  define CR_BETA_VER      "m BETA"
  51. #  define CR_VERSION_DATE  "13 April 1997"     /* last real code change */
  52. #else
  53. #  define CR_BETA_VER      ""
  54. #  define CR_VERSION_DATE  "22 April 1997"     /* last public release date */
  55. #  define CR_RELEASE
  56. #endif
  57.  
  58. #ifndef __G         /* UnZip only, for now (DLL stuff) */
  59. #  define __G
  60. #  define __G__
  61. #  define __GDEF
  62. #  define __GPRO    void
  63. #  define __GPRO__
  64. #endif
  65.  
  66. #if defined(MSDOS) || defined(OS2) || defined(WIN32)
  67. #  ifndef DOS_OS2_W32
  68. #    define DOS_OS2_W32
  69. #  endif
  70. #endif
  71.  
  72. #if defined(DOS_OS2_W32) || defined(__human68k__)
  73. #  ifndef DOS_H68_OS2_W32
  74. #    define DOS_H68_OS2_W32
  75. #  endif
  76. #endif
  77.  
  78. #if defined(VM_CMS) || defined(MVS)
  79. #  ifndef CMS_MVS
  80. #    define CMS_MVS
  81. #  endif
  82. #endif
  83.  
  84. #ifdef REALLY_SHORT_SYMS
  85. #  define decrypt_byte   dcrbyt
  86. #endif
  87.  
  88. #define PWLEN  80   /* input buffer size for reading encryption key */
  89. #define RAND_HEAD_LEN  12    /* length of encryption random header */
  90.  
  91. /* the crc_32_tab array has to be provided externally for the crypt calculus */
  92. #ifndef UNZIP                   /* UnZip provides this in globals.h */
  93.    extern ulg near *crc_32_tab;
  94. #ifdef WINDLL
  95.    void DLLIMPORT(zcrypt_set_crc_32_tab) OF((ulg near *));
  96. #endif
  97. #endif /* !UNZIP */
  98.  
  99. int  DLLIMPORT(decrypt_byte) OF((__GPRO));
  100. int  DLLIMPORT(update_keys) OF((__GPRO__ int c));
  101. void DLLIMPORT(init_keys) OF((__GPRO__ char *passwd));
  102.  
  103. #ifdef ZIP
  104.    void DLLIMPORT(crypthead) OF((char *, ulg, FILE *));
  105. #  ifdef UTIL
  106.      int DLLIMPORT(zipcloak) OF((struct zlist far *, FILE *, FILE *, char *));
  107.      int DLLIMPORT(zipbare) OF((__GPRO__ struct zlist far *, FILE *, FILE *, char *));
  108. #  else
  109.      unsigned DLLIMPORT(zfwrite) OF((zvoid *, extent, extent, FILE *));
  110.      extern char *key;
  111. #ifdef WINDLL
  112.      void DLLIMPORT(zcrypt_set_key) OF((char *));
  113. #endif
  114. #  endif
  115. #endif /* ZIP */
  116.  
  117. #if (defined(UNZIP) && !defined(FUNZIP))
  118.    int  decrypt OF((__GPRO));
  119. #endif
  120.  
  121. #ifdef FUNZIP
  122.    extern int encrypted;
  123. #ifdef WINDLL
  124.    void DLLIMPORT(zcrypt_set_encrypted) OF((int));
  125. #endif
  126. #  ifdef NEXTBYTE
  127. #    undef NEXTBYTE
  128. #  endif
  129. #endif /* FUNZIP */
  130.  
  131. #endif    /* !CRYPT */
  132. #endif /* !__crypt_h */
  133.