api.h 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. /*
  2. api.h - Zip 3
  3. Copyright (c) 1990-2007 Info-ZIP. All rights reserved.
  4. See the accompanying file LICENSE, version 2007-Mar-4 or later
  5. (the contents of which are also included in zip.h) for terms of use.
  6. If, for some reason, all these files are missing, the Info-ZIP license
  7. also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html
  8. */
  9. /* Only the Windows DLL is currently supported */
  10. #ifndef _ZIPAPI_H
  11. #define _ZIPAPI_H
  12. #include "zip.h"
  13. #ifdef WIN32
  14. # ifndef PATH_MAX
  15. # define PATH_MAX 260
  16. # endif
  17. #else
  18. # ifndef PATH_MAX
  19. # define PATH_MAX 128
  20. # endif
  21. #endif
  22. #if defined(WINDLL) || defined(API)
  23. #include <windows.h>
  24. /* Porting definations between Win 3.1x and Win32 */
  25. #ifdef WIN32
  26. # define far
  27. # define _far
  28. # define __far
  29. # define near
  30. # define _near
  31. # define __near
  32. #endif
  33. /*---------------------------------------------------------------------------
  34. Prototypes for public Zip API (DLL) functions.
  35. ---------------------------------------------------------------------------*/
  36. #define ZPVER_LEN sizeof(ZpVer)
  37. /* These defines are set to zero for now, until OS/2 comes out
  38. with a dll.
  39. */
  40. #define D2_MAJORVER 0
  41. #define D2_MINORVER 0
  42. #define D2_PATCHLEVEL 0
  43. /* intended to be a private struct: */
  44. typedef struct _zip_ver {
  45. uch major; /* e.g., integer 5 */
  46. uch minor; /* e.g., 2 */
  47. uch patchlevel; /* e.g., 0 */
  48. uch not_used;
  49. } _zip_version_type;
  50. typedef struct _ZpVer {
  51. ulg structlen; /* length of the struct being passed */
  52. ulg flag; /* bit 0: is_beta bit 1: uses_zlib */
  53. char betalevel[10]; /* e.g., "g BETA" or "" */
  54. char date[20]; /* e.g., "4 Sep 95" (beta) or "4 September 1995" */
  55. char zlib_version[10]; /* e.g., "0.95" or NULL */
  56. BOOL fEncryption; /* TRUE if encryption enabled, FALSE otherwise */
  57. _zip_version_type zip;
  58. _zip_version_type os2dll;
  59. _zip_version_type windll;
  60. } ZpVer;
  61. # ifndef EXPENTRY
  62. # define EXPENTRY WINAPI
  63. # endif
  64. #ifndef DEFINED_ONCE
  65. #define DEFINED_ONCE
  66. typedef int (WINAPI DLLPRNT) (LPSTR, unsigned long);
  67. typedef int (WINAPI DLLPASSWORD) (LPSTR, int, LPCSTR, LPCSTR);
  68. #endif
  69. #ifdef ZIP64_SUPPORT
  70. typedef int (WINAPI DLLSERVICE) (LPCSTR, unsigned __int64);
  71. typedef int (WINAPI DLLSERVICE_NO_INT64) (LPCSTR, unsigned long, unsigned long);
  72. #else
  73. typedef int (WINAPI DLLSERVICE) (LPCSTR, unsigned long);
  74. #endif
  75. typedef int (WINAPI DLLSPLIT) (LPSTR);
  76. typedef int (WINAPI DLLCOMMENT)(LPSTR);
  77. /* Structures */
  78. typedef struct { /* zip options */
  79. LPSTR Date; /* Date to include after */
  80. LPSTR szRootDir; /* Directory to use as base for zipping */
  81. LPSTR szTempDir; /* Temporary directory used during zipping */
  82. BOOL fTemp; /* Use temporary directory '-b' during zipping */
  83. BOOL fSuffix; /* include suffixes (not implemented) */
  84. BOOL fEncrypt; /* encrypt files */
  85. BOOL fSystem; /* include system and hidden files */
  86. BOOL fVolume; /* Include volume label */
  87. BOOL fExtra; /* Exclude extra attributes */
  88. BOOL fNoDirEntries; /* Do not add directory entries */
  89. BOOL fExcludeDate; /* Exclude files newer than specified date */
  90. BOOL fIncludeDate; /* Include only files newer than specified date */
  91. BOOL fVerbose; /* Mention oddities in zip file structure */
  92. BOOL fQuiet; /* Quiet operation */
  93. BOOL fCRLF_LF; /* Translate CR/LF to LF */
  94. BOOL fLF_CRLF; /* Translate LF to CR/LF */
  95. BOOL fJunkDir; /* Junk directory names */
  96. BOOL fGrow; /* Allow appending to a zip file */
  97. BOOL fForce; /* Make entries using DOS names (k for Katz) */
  98. BOOL fMove; /* Delete files added or updated in zip file */
  99. BOOL fDeleteEntries; /* Delete files from zip file */
  100. BOOL fUpdate; /* Update zip file--overwrite only if newer */
  101. BOOL fFreshen; /* Freshen zip file--overwrite only */
  102. BOOL fJunkSFX; /* Junk SFX prefix */
  103. BOOL fLatestTime; /* Set zip file time to time of latest file in it */
  104. BOOL fComment; /* Put comment in zip file */
  105. BOOL fOffsets; /* Update archive offsets for SFX files */
  106. BOOL fPrivilege; /* Use privileges (WIN32 only) */
  107. BOOL fEncryption; /* TRUE if encryption supported, else FALSE.
  108. this is a read only flag */
  109. LPSTR szSplitSize; /* This string contains the size that you want to
  110. split the archive into. i.e. 100 for 100 bytes,
  111. 2K for 2 k bytes, where K is 1024, m for meg
  112. and g for gig. If this string is not NULL it
  113. will automatically be assumed that you wish to
  114. split an archive. */
  115. LPSTR szIncludeList; /* Pointer to include file list string (for VB) */
  116. long IncludeListCount; /* Count of file names in the include list array */
  117. char **IncludeList; /* Pointer to include file list array. Note that the last
  118. entry in the array must be NULL */
  119. LPSTR szExcludeList; /* Pointer to exclude file list (for VB) */
  120. long ExcludeListCount; /* Count of file names in the include list array */
  121. char **ExcludeList; /* Pointer to exclude file list array. Note that the last
  122. entry in the array must be NULL */
  123. int fRecurse; /* Recurse into subdirectories. 1 => -r, 2 => -R */
  124. int fRepair; /* Repair archive. 1 => -F, 2 => -FF */
  125. char fLevel; /* Compression level (0 - 9) */
  126. } ZPOPT, _far *LPZPOPT;
  127. typedef struct {
  128. int argc; /* Count of files to zip */
  129. LPSTR lpszZipFN; /* name of archive to create/update */
  130. char **FNV; /* array of file names to zip up */
  131. LPSTR lpszAltFNL; /* pointer to a string containing a list of file
  132. names to zip up, separated by whitespace. Intended
  133. for use only by VB users, all others should set this
  134. to NULL. */
  135. } ZCL, _far *LPZCL;
  136. typedef struct {
  137. DLLPRNT *print;
  138. DLLCOMMENT *comment;
  139. DLLPASSWORD *password;
  140. DLLSPLIT *split; /* This MUST be set to NULL unless you want to be queried
  141. for a destination for each split archive. */
  142. #ifdef ZIP64_SUPPORT
  143. DLLSERVICE *ServiceApplication64;
  144. DLLSERVICE_NO_INT64 *ServiceApplication64_No_Int64;
  145. #else
  146. DLLSERVICE *ServiceApplication;
  147. #endif
  148. } ZIPUSERFUNCTIONS, far * LPZIPUSERFUNCTIONS;
  149. extern LPZIPUSERFUNCTIONS lpZipUserFunctions;
  150. void EXPENTRY ZpVersion(ZpVer far *);
  151. int EXPENTRY ZpInit(LPZIPUSERFUNCTIONS lpZipUserFunc);
  152. int EXPENTRY ZpArchive(ZCL C, LPZPOPT Opts);
  153. #if defined(ZIPLIB) || defined(COM_OBJECT)
  154. # define ydays zp_ydays
  155. #endif
  156. /* Functions not yet supported */
  157. #if 0
  158. int EXPENTRY ZpMain (int argc, char **argv);
  159. int EXPENTRY ZpAltMain (int argc, char **argv, ZpInit *init);
  160. #endif
  161. #endif /* WINDLL? || API? */
  162. #endif /* _ZIPAPI_H */