home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 2003 August / VPR0308.ISO / OLS / ZIP3J037 / zip3j037.lzh / zip32j / SRC / ZIP32J / ZIPAPI.H < prev   
C/C++ Source or Header  |  2000-12-16  |  9KB  |  177 lines

  1. /*
  2.     zipapi.h
  3.  
  4.           by Yoshioka Tsuneo(QWF00133@niftyserve.or.jp)
  5.         welcome any e-mail!!
  6.         You can use this file as Public Domain Software.
  7.         Copy,Edit,Re-distibute and for any purpose,you can use this file.
  8.  
  9. */
  10. #ifndef _ZIPAPI_H
  11. #define _ZIPAPI_H
  12.  
  13. typedef unsigned char uch;
  14. typedef unsigned long ulg;
  15. // #define PATH_MAX 260
  16.  
  17. #include <wtypes.h>
  18.  
  19. /* definitions from API.H at zip source */
  20. typedef struct {
  21.     int  argc;              /* Count of files to zip */
  22.     LPSTR lpszZipFN;        /* name of archive to create/update */
  23.     char **FNV;             /* array of file names to zip up */
  24. } ZCL, *LPZCL;
  25. typedef int (WINAPI DLLPRNT) (LPSTR, unsigned long);
  26. typedef int (WINAPI DLLPASSWORD) (LPSTR, int, const LPSTR, const LPSTR);
  27. typedef LPSTR (WINAPI DLLCOMMENT)(LPSTR);
  28. typedef int (WINAPI DLLSERVICE) (LPCSTR, unsigned long);
  29. typedef struct {
  30.     DLLPRNT *print;
  31.     DLLCOMMENT *comment;
  32.     DLLPASSWORD *password;
  33.     DLLSERVICE *ServiceApplication;
  34. } ZIPUSERFUNCTIONS, far * LPZIPUSERFUNCTIONS;
  35. /* intended to be a private struct: */
  36. typedef struct _zip_ver {
  37.     uch major;              /* e.g., integer 5 */
  38.     uch minor;              /* e.g., 2 */
  39.     uch patchlevel;         /* e.g., 0 */
  40.     uch not_used;
  41. } _zip_version_type;
  42. typedef struct _ZpVer {
  43.     ulg structlen;          /* length of the struct being passed */
  44.     ulg flag;               /* bit 0: is_beta   bit 1: uses_zlib */
  45.     char betalevel[10];     /* e.g., "g BETA" or "" */
  46.     char date[20];          /* e.g., "4 Sep 95" (beta) or "4 September 1995" */
  47.     char zlib_version[10];  /* e.g., "0.95" or NULL */
  48.     _zip_version_type zip;
  49.     _zip_version_type os2dll;
  50.     _zip_version_type windll;
  51. } ZpVer;
  52.  
  53. /* struct for zip2.2 */
  54. typedef struct {          /* zip options */
  55.     BOOL fSuffix;             /* include suffixes (not implemented) */
  56.     BOOL fEncrypt;            /* encrypt files */
  57.     BOOL fSystem;             /* include system and hidden files */
  58.     BOOL fVolume;             /* Include volume label */
  59.     BOOL fExtra;              /* Include extra attributes */
  60.     BOOL fNoDirEntries;       /* Do not add directory entries */
  61.     BOOL fExcludeDate;        /* Exclude files earlier than specified date */
  62.     BOOL fIncludeDate;        /* Include only files earlier than specified date */
  63.     BOOL fVerbose;            /* Mention oddities in zip file structure */
  64.     BOOL fQuiet;              /* Quiet operation */
  65.     BOOL fCRLF_LF;            /* Translate CR/LF to LF */
  66.     BOOL fLF_CRLF;            /* Translate LF to CR/LF */
  67.     BOOL fJunkDir;            /* Junk directory names */
  68.     BOOL fRecurse;            /* Recurse into subdirectories */
  69.     BOOL fGrow;               /* Allow appending to a zip file */
  70.     BOOL fForce;              /* Make entries using DOS names (k for Katz) */
  71.     BOOL fMove;               /* Delete files added or updated in zip file */
  72.     BOOL fDeleteEntries;      /* Delete files from zip file */
  73.     BOOL fUpdate;             /* Update zip file--overwrite only if newer */
  74.     BOOL fFreshen;            /* Freshen zip file--overwrite only */
  75.     BOOL fJunkSFX;            /* Junk SFX prefix */
  76.     BOOL fLatestTime;         /* Set zip file time to time of latest file in it */
  77.     BOOL fComment;            /* Put comment in zip file */
  78.     BOOL fOffsets;            /* Update archive offsets for SFX files */
  79.     BOOL fPrivilege;          /* Use privileges (WIN32 only) */
  80.     BOOL fEncryption;         /* TRUE if encryption supported, else FALSE.
  81.                                  this is a read only flag */
  82.     int  fRepair;             /* Repair archive. 1 => -F, 2 => -FF */
  83.     char fLevel;              /* Compression level (0 - 9) */
  84.     char Date[9];             /* Date to include after */
  85. #define ZOPT22_PATH_MAX 128
  86.     char szRootDir[ZOPT22_PATH_MAX]; /* Directory to use as base for zipping */
  87. } ZPOPT22, * LPZPOPT22;
  88.  
  89. #if 0
  90. /* struct for zip2.3 BETA */
  91. typedef struct {          /* zip options */
  92. LPSTR Date;               /* Date to include after */
  93. LPSTR szRootDir;          /* Directory to use as base for zipping */
  94. BOOL fSuffix;             /* include suffixes (not implemented) */
  95. BOOL fEncrypt;            /* encrypt files */
  96. BOOL fSystem;             /* include system and hidden files */
  97. BOOL fVolume;             /* Include volume label */
  98. BOOL fExtra;              /* Include extra attributes */
  99. BOOL fNoDirEntries;       /* Do not add directory entries */
  100. BOOL fExcludeDate;        /* Exclude files earlier than specified date */
  101. BOOL fIncludeDate;        /* Include only files earlier than specified date */
  102. BOOL fVerbose;            /* Mention oddities in zip file structure */
  103. BOOL fQuiet;              /* Quiet operation */
  104. BOOL fCRLF_LF;            /* Translate CR/LF to LF */
  105. BOOL fLF_CRLF;            /* Translate LF to CR/LF */
  106. BOOL fJunkDir;            /* Junk directory names */
  107. BOOL fGrow;               /* Allow appending to a zip file */
  108. BOOL fForce;              /* Make entries using DOS names (k for Katz) */
  109. BOOL fMove;               /* Delete files added or updated in zip file */
  110. BOOL fDeleteEntries;      /* Delete files from zip file */
  111. BOOL fUpdate;             /* Update zip file--overwrite only if newer */
  112. BOOL fFreshen;            /* Freshen zip file--overwrite only */
  113. BOOL fJunkSFX;            /* Junk SFX prefix */
  114. BOOL fLatestTime;         /* Set zip file time to time of latest file in it */
  115. BOOL fComment;            /* Put comment in zip file */
  116. BOOL fOffsets;            /* Update archive offsets for SFX files */
  117. BOOL fPrivilege;          /* Use privileges (WIN32 only) */
  118. BOOL fEncryption;         /* TRUE if encryption supported, else FALSE.
  119.                              this is a read only flag */
  120. int  fRecurse;            /* Recurse into subdirectories. 1 => -R, 2 => -r */
  121. int  fRepair;             /* Repair archive. 1 => -F, 2 => -FF */
  122. char fLevel;              /* Compression level (0 - 9) */
  123. } ZPOPT23, * LPZPOPT23;
  124. #else
  125.     /* zip32 2.3 release */
  126. typedef struct {        /* zip options */
  127. LPSTR Date;             /* Date to include after */
  128. LPSTR szRootDir;        /* Directory to use as base for zipping */
  129. LPSTR szTempDir;        /* Temporary directory used during zipping */
  130. BOOL fTemp;             /* Use temporary directory '-b' during zipping */
  131. BOOL fSuffix;           /* include suffixes (not implemented) */
  132. BOOL fEncrypt;          /* encrypt files */
  133. BOOL fSystem;           /* include system and hidden files */
  134. BOOL fVolume;           /* Include volume label */
  135. BOOL fExtra;            /* Exclude extra attributes */
  136. BOOL fNoDirEntries;     /* Do not add directory entries */
  137. BOOL fExcludeDate;      /* Exclude files newer than specified date */
  138. BOOL fIncludeDate;      /* Include only files newer than specified date */
  139. BOOL fVerbose;          /* Mention oddities in zip file structure */
  140. BOOL fQuiet;            /* Quiet operation */
  141. BOOL fCRLF_LF;          /* Translate CR/LF to LF */
  142. BOOL fLF_CRLF;          /* Translate LF to CR/LF */
  143. BOOL fJunkDir;          /* Junk directory names */
  144. BOOL fGrow;             /* Allow appending to a zip file */
  145. BOOL fForce;            /* Make entries using DOS names (k for Katz) */
  146. BOOL fMove;             /* Delete files added or updated in zip file */
  147. BOOL fDeleteEntries;    /* Delete files from zip file */
  148. BOOL fUpdate;           /* Update zip file--overwrite only if newer */
  149. BOOL fFreshen;          /* Freshen zip file--overwrite only */
  150. BOOL fJunkSFX;          /* Junk SFX prefix */
  151. BOOL fLatestTime;       /* Set zip file time to time of latest file in it */
  152. BOOL fComment;          /* Put comment in zip file */
  153. BOOL fOffsets;          /* Update archive offsets for SFX files */
  154. BOOL fPrivilege;        /* Use privileges (WIN32 only) */
  155. BOOL fEncryption;       /* TRUE if encryption supported, else FALSE.
  156.                            this is a read only flag */
  157. int  fRecurse;          /* Recurse into subdirectories. 1 => -r, 2 => -R */
  158. int  fRepair;           /* Repair archive. 1 => -F, 2 => -FF */
  159. char fLevel;            /* Compression level (0 - 9) */
  160. } ZPOPT23, * LPZPOPT23;
  161. #endif
  162.  
  163. void (WINAPI *ZpVersion)(ZpVer *);
  164. int (WINAPI *ZpInit)(ZIPUSERFUNCTIONS *lpZipUserFunc);
  165. BOOL (WINAPI *ZpSetOptions22)(ZPOPT22 Opts);
  166. BOOL (WINAPI *ZpSetOptions23)(LPZPOPT23 Opts);
  167. ZPOPT22 (WINAPI *ZpGetOptions22)(void);
  168. ZPOPT23 (WINAPI *ZpGetOptions23)(void);
  169. int(WINAPI *ZpArchive)(ZCL C);
  170.  
  171. int ZIP32DLLLoadLibrary(void);
  172. int ZIP32DLLFreeLibrary(void);
  173.  
  174. int ZIP32DLLVersion(void);    /* 256 * major + minor */
  175.  
  176. #endif /* ifdef _ZIPAPI_H */
  177.