home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 9 Archive / 09-Archive.zip / zip22.zip / api.h < prev    next >
C/C++ Source or Header  |  1997-08-17  |  5KB  |  128 lines

  1. /* Only the Windows DLL is currently supported */
  2. #ifndef _ZIPAPI_H
  3. #define _ZIPAPI_H
  4.  
  5. #include "zip.h"
  6.  
  7. #ifndef PATH_MAX
  8. # define PATH_MAX 128
  9. #endif
  10.  
  11. #if defined(WINDLL) || defined(API)
  12. #include <windows.h>
  13. /* Porting definations between Win 3.1x and Win32 */
  14. #ifdef WIN32
  15. #  define far
  16. #  define _far
  17. #  define __far
  18. #  define near
  19. #  define _near
  20. #  define __near
  21. #endif
  22.  
  23. /*---------------------------------------------------------------------------
  24.     Prototypes for public Zip API (DLL) functions.
  25.   ---------------------------------------------------------------------------*/
  26.  
  27. #define ZPVER_LEN    sizeof(ZpVer)
  28. /* These defines are set to zero for now, until OS/2 comes out
  29.    with a dll.
  30.  */  
  31. #define D2_MAJORVER 0
  32. #define D2_MINORVER 0
  33. #define D2_PATCHLEVEL 0
  34.  
  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.  
  43. typedef struct _ZpVer {
  44.     ulg structlen;          /* length of the struct being passed */
  45.     ulg flag;               /* bit 0: is_beta   bit 1: uses_zlib */
  46.     char betalevel[10];     /* e.g., "g BETA" or "" */
  47.     char date[20];          /* e.g., "4 Sep 95" (beta) or "4 September 1995" */
  48.     char zlib_version[10];  /* e.g., "0.95" or NULL */
  49.     _zip_version_type zip;
  50.     _zip_version_type os2dll;
  51.     _zip_version_type windll;
  52. } ZpVer;
  53.  
  54. #  ifndef EXPENTRY
  55. #    define EXPENTRY WINAPI
  56. #  endif
  57.  
  58. #ifndef DEFINED_ONCE
  59. #define DEFINED_ONCE
  60. typedef int (WINAPI DLLPRNT) (LPSTR, unsigned long);
  61. typedef int (WINAPI DLLPASSWORD) (LPSTR, int, const LPSTR, const LPSTR);
  62. #endif
  63. typedef LPSTR (WINAPI DLLCOMMENT)(LPSTR);
  64.  
  65. /* Structures */
  66.  
  67. typedef struct {          /* zip options */
  68. BOOL fSuffix;             /* include suffixes (not implemented) */
  69. BOOL fEncrypt;            /* encrypt files */
  70. BOOL fSystem;             /* include system and hidden files */
  71. BOOL fVolume;             /* Include volume label */
  72. BOOL fExtra;              /* Include extra attributes */
  73. BOOL fNoDirEntries;       /* Do not add directory entries */
  74. BOOL fExcludeDate;        /* Exclude files earlier than specified date */
  75. BOOL fIncludeDate;        /* Include only files earlier than specified date */
  76. BOOL fVerbose;            /* Mention oddities in zip file structure */
  77. BOOL fQuiet;              /* Quiet operation */
  78. BOOL fCRLF_LF;            /* Translate CR/LF to LF */
  79. BOOL fLF_CRLF;            /* Translate LF to CR/LF */
  80. BOOL fJunkDir;            /* Junk directory names */
  81. BOOL fRecurse;            /* Recurse into subdirectories */
  82. BOOL fGrow;               /* Allow appending to a zip file */
  83. BOOL fForce;              /* Make entries using DOS names (k for Katz) */
  84. BOOL fMove;               /* Delete files added or updated in zip file */
  85. BOOL fDeleteEntries;      /* Delete files from zip file */
  86. BOOL fUpdate;             /* Update zip file--overwrite only if newer */
  87. BOOL fFreshen;            /* Freshen zip file--overwrite only */
  88. BOOL fJunkSFX;            /* Junk SFX prefix */
  89. BOOL fLatestTime;         /* Set zip file time to time of latest file in it */
  90. BOOL fComment;            /* Put comment in zip file */
  91. BOOL fOffsets;            /* Update archive offsets for SFX files */
  92. BOOL fPrivilege;          /* Use privileges (WIN32 only) */
  93. BOOL fEncryption;         /* TRUE if encryption supported, else FALSE.
  94.                              this is a read only flag */
  95. int  fRepair;             /* Repair archive. 1 => -F, 2 => -FF */
  96. char fLevel;              /* Compression level (0 - 9) */
  97. char Date[9];             /* Date to include after */
  98. char szRootDir[PATH_MAX]; /* Directory to use as base for zipping */
  99. } ZPOPT, _far * LPZPOPT;
  100.  
  101. typedef struct {
  102. int  argc;              /* Count of files to zip */
  103. LPSTR lpszZipFN;        /* name of archive to create/update */
  104. char **FNV;             /* array of file names to zip up */
  105. } ZCL, _far *LPZCL;
  106.  
  107. typedef struct {
  108. DLLPRNT *print;
  109. DLLCOMMENT *comment;
  110. DLLPASSWORD *password;
  111. } ZIPUSERFUNCTIONS, far * LPZIPUSERFUNCTIONS;
  112.  
  113. void  EXPENTRY ZpVersion(ZpVer far *);
  114. int   EXPENTRY ZpInit(ZIPUSERFUNCTIONS far * lpZipUserFunc);
  115. BOOL  EXPENTRY ZpSetOptions(ZPOPT Opts);
  116. ZPOPT EXPENTRY ZpGetOptions(void);
  117. int   EXPENTRY ZpArchive(ZCL C);
  118.  
  119. /* Functions not yet supported */
  120. #if 0
  121. int      EXPENTRY ZpMain            (int argc, char **argv);
  122. int      EXPENTRY ZpAltMain         (int argc, char **argv, ZpInit *init);
  123. #endif
  124. #endif /* WINDLL? || API? */
  125.  
  126. #endif _ZIPAPI_H
  127.  
  128.