home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 9 Archive / 09-Archive.zip / unzip541.zip / UNZIP541.EXE / 32-dll / unzip.h < prev    next >
C/C++ Source or Header  |  2000-04-14  |  22KB  |  602 lines

  1. /*---------------------------------------------------------------------------
  2.  
  3.   unzip.h (new)
  4.  
  5.   This header file contains the public macros and typedefs required by
  6.   both the UnZip sources and by any application using the UnZip API.  If
  7.   UNZIP_INTERNAL is defined, it includes unzpriv.h (containing includes,
  8.   prototypes and extern variables used by the actual UnZip sources).
  9.  
  10.   ---------------------------------------------------------------------------*/
  11. /*---------------------------------------------------------------------------
  12. This is version 2000-Apr-09 of the Info-ZIP copyright and license.
  13. The definitive version of this document should be available at
  14. ftp://ftp.info-zip.org/pub/infozip/license.html indefinitely.
  15.  
  16.  
  17. Copyright (c) 1990-2000 Info-ZIP.  All rights reserved.
  18.  
  19. For the purposes of this copyright and license, "Info-ZIP" is defined as
  20. the following set of individuals:
  21.  
  22.    Mark Adler, John Bush, Karl Davis, Harald Denker, Jean-Michel Dubois,
  23.    Jean-loup Gailly, Hunter Goatley, Ian Gorman, Chris Herborth, Dirk Haase,
  24.    Greg Hartwig, Robert Heath, Jonathan Hudson, Paul Kienitz, David Kirschbaum,
  25.    Johnny Lee, Onno van der Linden, Igor Mandrichenko, Steve P. Miller,
  26.    Sergio Monesi, Keith Owens, George Petrov, Greg Roelofs, Kai Uwe Rommel,
  27.    Steve Salisbury, Dave Smith, Christian Spieler, Antoine Verheijen,
  28.    Paul von Behren, Rich Wales, Mike White
  29.  
  30. This software is provided "as is," without warranty of any kind, express
  31. or implied.  In no event shall Info-ZIP or its contributors be held liable
  32. for any direct, indirect, incidental, special or consequential damages
  33. arising out of the use of or inability to use this software.
  34.  
  35. Permission is granted to anyone to use this software for any purpose,
  36. including commercial applications, and to alter it and redistribute it
  37. freely, subject to the following restrictions:
  38.  
  39.     1. Redistributions of source code must retain the above copyright notice,
  40.        definition, disclaimer, and this list of conditions.
  41.  
  42.     2. Redistributions in binary form must reproduce the above copyright
  43.        notice, definition, disclaimer, and this list of conditions in
  44.        documentation and/or other materials provided with the distribution.
  45.  
  46.     3. Altered versions--including, but not limited to, ports to new operating
  47.        systems, existing ports with new graphical interfaces, and dynamic,
  48.        shared, or static library versions--must be plainly marked as such
  49.        and must not be misrepresented as being the original source.  Such
  50.        altered versions also must not be misrepresented as being Info-ZIP
  51.        releases--including, but not limited to, labeling of the altered
  52.        versions with the names "Info-ZIP" (or any variation thereof, including,
  53.        but not limited to, different capitalizations), "Pocket UnZip," "WiZ"
  54.        or "MacZip" without the explicit permission of Info-ZIP.  Such altered
  55.        versions are further prohibited from misrepresentative use of the
  56.        Zip-Bugs or Info-ZIP e-mail addresses or of the Info-ZIP URL(s).
  57.  
  58.     4. Info-ZIP retains the right to use the names "Info-ZIP," "Zip," "UnZip,"
  59.        "WiZ," "Pocket UnZip," "Pocket Zip," and "MacZip" for its own source and
  60.        binary releases.
  61.   ---------------------------------------------------------------------------*/
  62.  
  63. #ifndef __unzip_h   /* prevent multiple inclusions */
  64. #define __unzip_h
  65.  
  66. /*---------------------------------------------------------------------------
  67.     Predefined, machine-specific macros.
  68.   ---------------------------------------------------------------------------*/
  69.  
  70. #ifdef __GO32__                 /* MS-DOS extender:  NOT Unix */
  71. #  ifdef unix
  72. #    undef unix
  73. #  endif
  74. #  ifdef __unix
  75. #    undef __unix
  76. #  endif
  77. #  ifdef __unix__
  78. #    undef __unix__
  79. #  endif
  80. #endif
  81.  
  82. #if ((defined(__convex__) || defined(__convexc__)) && !defined(CONVEX))
  83. #  define CONVEX
  84. #endif
  85.  
  86. #if (defined(unix) || defined(__unix) || defined(__unix__))
  87. #  ifndef UNIX
  88. #    define UNIX
  89. #  endif
  90. #endif /* unix || __unix || __unix__ */
  91. #if (defined(M_XENIX) || defined(COHERENT) || defined(__hpux))
  92. #  ifndef UNIX
  93. #    define UNIX
  94. #  endif
  95. #endif /* M_XENIX || COHERENT || __hpux */
  96. #if (defined(CONVEX) || defined(MINIX) || defined(_AIX) || defined(__QNX__))
  97. #  ifndef UNIX
  98. #    define UNIX
  99. #  endif
  100. #endif /* CONVEX || MINIX || _AIX || __QNX__ */
  101.  
  102. #if (defined(VM_CMS) || defined(MVS))
  103. #  define CMS_MVS
  104. #endif
  105.  
  106. #if (defined(__OS2__) && !defined(OS2))
  107. #  define OS2
  108. #endif
  109.  
  110. #if (defined(__TANDEM) && !defined(TANDEM))
  111. #  define TANDEM
  112. #endif
  113.  
  114. #if (defined(__VMS) && !defined(VMS))
  115. #  define VMS
  116. #endif
  117.  
  118. #if ((defined(__WIN32__) || defined(_WIN32)) && !defined(WIN32))
  119. #  define WIN32
  120. #endif
  121. #if ((defined(__WINNT__) || defined(__WINNT)) && !defined(WIN32))
  122. #  define WIN32
  123. #endif
  124.  
  125. #ifdef __COMPILER_KCC__
  126. #  include <c-env.h>
  127. #  ifdef SYS_T20
  128. #    define TOPS20
  129. #  endif
  130. #endif /* __COMPILER_KCC__ */
  131.  
  132. /* Borland C does not define __TURBOC__ if compiling for a 32-bit platform */
  133. #ifdef __BORLANDC__
  134. #  ifndef __TURBOC__
  135. #    define __TURBOC__
  136. #  endif
  137. #  if (!defined(__MSDOS__) && !defined(OS2) && !defined(WIN32))
  138. #    define __MSDOS__
  139. #  endif
  140. #endif
  141.  
  142. /* define MSDOS for Turbo C (unless OS/2) and Power C as well as Microsoft C */
  143. #ifdef __POWERC
  144. #  define __TURBOC__
  145. #  define MSDOS
  146. #endif /* __POWERC */
  147.  
  148. #if (defined(__MSDOS__) && !defined(MSDOS))   /* just to make sure */
  149. #  define MSDOS
  150. #endif
  151.  
  152. /* RSXNTDJ (at least up to v1.3) compiles for WIN32 (RSXNT) using a derivate
  153.    of the EMX environment, but defines MSDOS and __GO32__. ARG !!! */
  154. #if (defined(MSDOS) && defined(WIN32))
  155. #  undef MSDOS                  /* WIN32 is >>>not<<< MSDOS */
  156. #endif
  157. #if (defined(__GO32__) && defined(__EMX__) && defined(__RSXNT__))
  158. #  undef __GO32__
  159. #endif
  160.  
  161. #if (defined(linux) && !defined(LINUX))
  162. #  define LINUX
  163. #endif
  164.  
  165. #ifdef __riscos
  166. #  define RISCOS
  167. #endif
  168.  
  169. #if (defined(THINK_C) || defined(MPW))
  170. #  define MACOS
  171. #endif
  172. #if (defined(__MWERKS__) && defined(macintosh))
  173. #  define MACOS
  174. #endif
  175.  
  176. /* use prototypes and ANSI libraries if __STDC__, or Microsoft or Borland C, or
  177.  * Silicon Graphics, or Convex?, or IBM C Set/2, or GNU gcc/emx, or Watcom C,
  178.  * or Macintosh, or Windows NT, or Sequent, or Atari or IBM RS/6000.
  179.  */
  180. #if (defined(__STDC__) || defined(MSDOS) || defined(WIN32) || defined(__EMX__))
  181. #  ifndef PROTO
  182. #    define PROTO
  183. #  endif
  184. #  ifndef MODERN
  185. #    define MODERN
  186. #  endif
  187. #endif
  188. #if (defined(__IBMC__) || defined(__BORLANDC__) || defined(__WATCOMC__))
  189. #  ifndef PROTO
  190. #    define PROTO
  191. #  endif
  192. #  ifndef MODERN
  193. #    define MODERN
  194. #  endif
  195. #endif
  196. #if (defined(MACOS) || defined(ATARI_ST) || defined(RISCOS) || defined(THEOS))
  197. #  ifndef PROTO
  198. #    define PROTO
  199. #  endif
  200. #  ifndef MODERN
  201. #    define MODERN
  202. #  endif
  203. #endif
  204. /* Sequent running Dynix/ptx:  non-modern compiler */
  205. #if (defined(_AIX) || defined(sgi) || (defined(_SEQUENT_) && !defined(PTX)))
  206. #  ifndef PROTO
  207. #    define PROTO
  208. #  endif
  209. #  ifndef MODERN
  210. #    define MODERN
  211. #  endif
  212. #endif
  213. #if (defined(CMS_MVS) || defined(__BEOS__))  /* || defined(CONVEX) */
  214. #  ifndef PROTO
  215. #    define PROTO
  216. #  endif
  217. #  ifndef MODERN
  218. #    define MODERN
  219. #  endif
  220. #endif
  221.  
  222. /* turn off prototypes if requested */
  223. #if (defined(NOPROTO) && defined(PROTO))
  224. #  undef PROTO
  225. #endif
  226.  
  227. /* used to remove arguments in function prototypes for non-ANSI C */
  228. #ifdef PROTO
  229. #  define OF(a) a
  230. #else
  231. #  define OF(a) ()
  232. #endif
  233.  
  234. /* enable the "const" keyword only if MODERN and if not otherwise instructed */
  235. #ifdef MODERN
  236. #  if (!defined(ZCONST) && (defined(USE_CONST) || !defined(NO_CONST)))
  237. #    define ZCONST const
  238. #  endif
  239. #endif
  240.  
  241. #ifndef ZCONST
  242. #  define ZCONST
  243. #endif
  244.  
  245.  
  246. /*---------------------------------------------------------------------------
  247.     Grab system-specific public include headers.
  248.   ---------------------------------------------------------------------------*/
  249.  
  250. #ifdef POCKET_UNZIP             /* WinCE port */
  251. #  include "wince/punzip.h"     /* must appear before windows.h */
  252. #endif
  253.  
  254. #ifdef WINDLL
  255. #  include <windows.h>
  256. #  include "windll/structs.h"
  257. #endif
  258.  
  259. /*---------------------------------------------------------------------------
  260.     Grab system-dependent definition of EXPENTRY for prototypes below.
  261.   ---------------------------------------------------------------------------*/
  262.  
  263. #if 0
  264. #if (defined(OS2) && !defined(FUNZIP))
  265. #  ifdef UNZIP_INTERNAL
  266. #    define INCL_NOPM
  267. #    define INCL_DOSNLS
  268. #    define INCL_DOSPROCESS
  269. #    define INCL_DOSDEVICES
  270. #    define INCL_DOSDEVIOCTL
  271. #    define INCL_DOSERRORS
  272. #    define INCL_DOSMISC
  273. #    ifdef OS2DLL
  274. #      define INCL_REXXSAA
  275. #      include <rexxsaa.h>
  276. #    endif
  277. #  endif /* UNZIP_INTERNAL */
  278. #  include <os2.h>
  279. #  define UZ_EXP EXPENTRY
  280. #endif /* OS2 && !FUNZIP */
  281. #endif /* 0 */
  282.  
  283. #if (defined(OS2) && !defined(FUNZIP))
  284. #  if (defined(__IBMC__) || defined(__WATCOMC__))
  285. #    define UZ_EXP  _System    /* compiler keyword */
  286. #  else
  287. #    define UZ_EXP
  288. #  endif
  289. #endif /* OS2 && !FUNZIP */
  290.  
  291. #if (defined(WINDLL) || defined(USE_UNZIP_LIB))
  292. #  ifndef EXPENTRY
  293. #    define UZ_EXP WINAPI
  294. #  else
  295. #    define UZ_EXP EXPENTRY
  296. #  endif
  297. #endif
  298.  
  299. #ifndef UZ_EXP
  300. #  define UZ_EXP
  301. #endif
  302.  
  303.  
  304. /*---------------------------------------------------------------------------
  305.     Public typedefs.
  306.   ---------------------------------------------------------------------------*/
  307.  
  308. #ifndef _IZ_TYPES_DEFINED
  309. #ifdef MODERN
  310.    typedef void zvoid;
  311. #else /* !MODERN */
  312. #  ifndef AOS_VS         /* mostly modern? */
  313. #    ifndef VAXC         /* not fully modern, but has knows 'void' */
  314. #      define void int
  315. #    endif /* !VAXC */
  316. #  endif /* !AOS_VS */
  317.    typedef char zvoid;
  318. #endif /* ?MODERN */
  319. typedef unsigned char   uch;    /* code assumes unsigned bytes; these type-  */
  320. typedef unsigned short  ush;    /*  defs replace byte/UWORD/ULONG (which are */
  321. typedef unsigned long   ulg;    /*  predefined on some systems) & match zip  */
  322. #define _IZ_TYPES_DEFINED
  323. #endif /* !_IZ_TYPES_DEFINED */
  324.  
  325. /* InputFn is not yet used and is likely to change: */
  326. #ifdef PROTO
  327.    typedef int   (UZ_EXP MsgFn)     (zvoid *pG, uch *buf, ulg size, int flag);
  328.    typedef int   (UZ_EXP InputFn)   (zvoid *pG, uch *buf, int *size, int flag);
  329.    typedef void  (UZ_EXP PauseFn)   (zvoid *pG, ZCONST char *prompt, int flag);
  330.    typedef int   (UZ_EXP PasswdFn)  (zvoid *pG, int *rcnt, char *pwbuf,
  331.                                      int size, ZCONST char *zfn,
  332.                                      ZCONST char *efn);
  333.    typedef int   (UZ_EXP StatCBFn)  (zvoid *pG, int fnflag, ZCONST char *zfn,
  334.                                      ZCONST char *efn, ZCONST zvoid *details);
  335.    typedef void  (UZ_EXP UsrIniFn)  (void);
  336. #else /* !PROTO */
  337.    typedef int   (UZ_EXP MsgFn)     ();
  338.    typedef int   (UZ_EXP InputFn)   ();
  339.    typedef void  (UZ_EXP PauseFn)   ();
  340.    typedef int   (UZ_EXP PasswdFn)  ();
  341.    typedef int   (UZ_EXP StatCBFn)  ();
  342.    typedef void  (UZ_EXP UsrIniFn)  ();
  343. #endif /* ?PROTO */
  344.  
  345. typedef struct _UzpBuffer {    /* rxstr */
  346.     ulg   strlength;           /* length of string */
  347.     char  *strptr;             /* pointer to string */
  348. } UzpBuffer;
  349.  
  350. typedef struct _UzpInit {
  351.     ulg structlen;             /* length of the struct being passed */
  352.  
  353.     /* GRR: can we assume that each of these is a 32-bit pointer?  if not,
  354.      * does it matter? add "far" keyword to make sure? */
  355.     MsgFn *msgfn;
  356.     InputFn *inputfn;
  357.     PauseFn *pausefn;
  358.     UsrIniFn *userfn;          /* user init function to be called after */
  359.                                /*  globals constructed and initialized */
  360.  
  361.     /* pointer to program's environment area or something? */
  362.     /* hooks for performance testing? */
  363.     /* hooks for extra unzip -v output? (detect CPU or other hardware?) */
  364.     /* anything else?  let me (Greg) know... */
  365. } UzpInit;
  366.  
  367. typedef struct _UzpCB {
  368.     ulg structlen;             /* length of the struct being passed */
  369.     /* GRR: can we assume that each of these is a 32-bit pointer?  if not,
  370.      * does it matter? add "far" keyword to make sure? */
  371.     MsgFn *msgfn;
  372.     InputFn *inputfn;
  373.     PauseFn *pausefn;
  374.     PasswdFn *passwdfn;
  375.     StatCBFn *statrepfn;
  376. } UzpCB;
  377.  
  378. /* the collection of general UnZip option flags and option arguments */
  379. typedef struct _UzpOpts {
  380. #ifndef FUNZIP
  381.     char *exdir;        /* pointer to extraction root directory (-d option) */
  382.     char *pwdarg;       /* pointer to command-line password (-P option) */
  383.     int zipinfo_mode;   /* behave like ZipInfo or like normal UnZip? */
  384.     int aflag;          /* -a: do ASCII-EBCDIC and/or end-of-line translation */
  385. #ifdef VMS
  386.     int bflag;          /* -b: force fixed record format for binary files */
  387. #endif
  388. #ifdef TANDEM
  389.     int bflag;          /* -b: create text files in 'C' format (180)*/
  390. #endif
  391. #ifdef UNIXBACKUP
  392.     int B_flag;         /* -B: back up existing files by renaming to *~ first */
  393. #endif
  394.     int cflag;          /* -c: output to stdout */
  395.     int C_flag;         /* -C: match filenames case-insensitively */
  396. #ifdef MACOS
  397.     int E_flag;         /* -E: [MacOS] show Mac extra field during restoring */
  398. #endif
  399.     int fflag;          /* -f: "freshen" (extract only newer files) */
  400. #if (defined(RISCOS) || defined(ACORN_FTYPE_NFS))
  401.     int acorn_nfs_ext;  /* -F: RISC OS types & NFS filetype extensions */
  402. #endif
  403.     int hflag;          /* -h: header line (zipinfo) */
  404. #ifdef MACOS
  405.     int i_flag;         /* -i: [MacOS] ignore filenames stored in Mac e.f. */
  406. #endif
  407. #ifdef RISCOS
  408.     int scanimage;      /* -I: scan image files */
  409. #endif
  410.     int jflag;          /* -j: junk pathnames (unzip) */
  411. #if (defined(__BEOS__) || defined(MACOS))
  412.     int J_flag;         /* -J: ignore BeOS/MacOS extra field info (unzip) */
  413. #endif
  414.     int lflag;          /* -12slmv: listing format (zipinfo) */
  415.     int L_flag;         /* -L: convert filenames from some OSes to lowercase */
  416.     int overwrite_none; /* -n: never overwrite files (no prompting) */
  417. #ifdef AMIGA
  418.     int N_flag;         /* -N: restore comments as AmigaDOS filenotes */
  419. #endif
  420.     int overwrite_all;  /* -o: OK to overwrite files without prompting */
  421. #endif /* !FUNZIP */
  422.     int qflag;          /* -q: produce a lot less output */
  423. #ifndef FUNZIP
  424. #if (defined(MSDOS) || defined(FLEXOS) || defined(OS2) || defined(WIN32))
  425.     int sflag;          /* -s: convert spaces in filenames to underscores */
  426. #endif
  427. #if (defined(NLM))
  428.     int sflag;          /* -s: convert spaces in filenames to underscores */
  429. #endif
  430. #if (defined(MSDOS) || defined(__human68k__) || defined(OS2) || defined(WIN32))
  431.     int volflag;        /* -$: extract volume labels */
  432. #endif
  433.     int tflag;          /* -t: test (unzip) or totals line (zipinfo) */
  434.     int T_flag;         /* -T: timestamps (unzip) or dec. time fmt (zipinfo) */
  435.     int uflag;          /* -u: "update" (extract only newer/brand-new files) */
  436.     int vflag;          /* -v: (verbosely) list directory */
  437.     int V_flag;         /* -V: don't strip VMS version numbers */
  438. #if (defined(__BEOS__) || defined(TANDEM) || defined(THEOS) || defined(UNIX))
  439.     int X_flag;         /* -X: restore owner/protection or UID/GID or ACLs */
  440. #endif
  441. #if (defined(OS2) || defined(VMS) || defined(WIN32))
  442.     int X_flag;         /* -X: restore owner/protection or UID/GID or ACLs */
  443. #endif
  444.     int zflag;          /* -z: display the zipfile comment (only, for unzip) */
  445. #endif /* !FUNZIP */
  446. } UzpOpts;
  447.  
  448. /* intended to be a private struct: */
  449. typedef struct _ver {
  450.     uch major;              /* e.g., integer 5 */
  451.     uch minor;              /* e.g., 2 */
  452.     uch patchlevel;         /* e.g., 0 */
  453.     uch not_used;
  454. } _version_type;
  455.  
  456. typedef struct _UzpVer {
  457.     ulg structlen;          /* length of the struct being passed */
  458.     ulg flag;               /* bit 0: is_beta   bit 1: uses_zlib */
  459.     char *betalevel;        /* e.g., "g BETA" or "" */
  460.     char *date;             /* e.g., "4 Sep 95" (beta) or "4 September 1995" */
  461.     char *zlib_version;     /* e.g., "0.95" or NULL */
  462.     _version_type unzip;
  463.     _version_type zipinfo;
  464.     _version_type os2dll;
  465.     _version_type windll;
  466. } UzpVer;
  467.  
  468. /* for Visual BASIC access to Windows DLLs: */
  469. typedef struct _UzpVer2 {
  470.     ulg structlen;          /* length of the struct being passed */
  471.     ulg flag;               /* bit 0: is_beta   bit 1: uses_zlib */
  472.     char betalevel[10];     /* e.g., "g BETA" or "" */
  473.     char date[20];          /* e.g., "4 Sep 95" (beta) or "4 September 1995" */
  474.     char zlib_version[10];  /* e.g., "0.95" or NULL */
  475.     _version_type unzip;
  476.     _version_type zipinfo;
  477.     _version_type os2dll;
  478.     _version_type windll;
  479. } UzpVer2;
  480.  
  481. typedef struct central_directory_file_header { /* CENTRAL */
  482.     uch version_made_by[2];
  483.     uch version_needed_to_extract[2];
  484.     ush general_purpose_bit_flag;
  485.     ush compression_method;
  486.     ulg last_mod_dos_datetime;
  487.     ulg crc32;
  488.     ulg csize;
  489.     ulg ucsize;
  490.     ush filename_length;
  491.     ush extra_field_length;
  492.     ush file_comment_length;
  493.     ush disk_number_start;
  494.     ush internal_file_attributes;
  495.     ulg external_file_attributes;
  496.     ulg relative_offset_local_header;
  497. } cdir_file_hdr;
  498.  
  499.  
  500. #define UZPINIT_LEN   sizeof(UzpInit)
  501. #define UZPVER_LEN    sizeof(UzpVer)
  502. #define cbList(func)  int (* UZ_EXP func)(char *filename, cdir_file_hdr *crec)
  503.  
  504.  
  505. /*---------------------------------------------------------------------------
  506.     Return (and exit) values of the public UnZip API functions.
  507.   ---------------------------------------------------------------------------*/
  508.  
  509. /* external return codes */
  510. #define PK_OK              0   /* no error */
  511. #define PK_COOL            0   /* no error */
  512. #define PK_GNARLY          0   /* no error */
  513. #define PK_WARN            1   /* warning error */
  514. #define PK_ERR             2   /* error in zipfile */
  515. #define PK_BADERR          3   /* severe error in zipfile */
  516. #define PK_MEM             4   /* insufficient memory (during initialization) */
  517. #define PK_MEM2            5   /* insufficient memory (password failure) */
  518. #define PK_MEM3            6   /* insufficient memory (file decompression) */
  519. #define PK_MEM4            7   /* insufficient memory (memory decompression) */
  520. #define PK_MEM5            8   /* insufficient memory (not yet used) */
  521. #define PK_NOZIP           9   /* zipfile not found */
  522. #define PK_PARAM          10   /* bad or illegal parameters specified */
  523. #define PK_FIND           11   /* no files found */
  524. #define PK_DISK           50   /* disk full */
  525. #define PK_EOF            51   /* unexpected EOF */
  526.  
  527. #define IZ_CTRLC          80   /* user hit ^C to terminate */
  528. #define IZ_UNSUP          81   /* no files found: all unsup. compr/encrypt. */
  529. #define IZ_BADPWD         82   /* no files found: all had bad password */
  530.  
  531. /* internal and DLL-only return codes */
  532. #define IZ_DIR            76   /* potential zipfile is a directory */
  533. #define IZ_CREATED_DIR    77   /* directory created: set time and permissions */
  534. #define IZ_VOL_LABEL      78   /* volume label, but can't set on hard disk */
  535. #define IZ_EF_TRUNC       79   /* local extra field truncated (PKZIP'd) */
  536.  
  537. /* return codes of password fetches (negative = user abort; positive = error) */
  538. #define IZ_PW_ENTERED      0   /* got some password string; use/try it */
  539. #define IZ_PW_CANCEL      -1   /* no password available (for this entry) */
  540. #define IZ_PW_CANCELALL   -2   /* no password, skip any further pwd. request */
  541. #define IZ_PW_ERROR        5   /* = PK_MEM2 : failure (no mem, no tty, ...) */
  542.  
  543. /* flag values for status callback function */
  544. #define UZ_ST_START_EXTRACT     1       /* no details */
  545. #define UZ_ST_IN_PROGRESS       2       /* no details */
  546. #define UZ_ST_FINISH_MEMBER     3       /* 'details': extracted size */
  547.  
  548. /* return values of status callback function */
  549. #define UZ_ST_CONTINUE          0
  550. #define UZ_ST_BREAK             1
  551.  
  552.  
  553. /*---------------------------------------------------------------------------
  554.     Prototypes for public UnZip API (DLL) functions.
  555.   ---------------------------------------------------------------------------*/
  556.  
  557. #define  UzpMatch match
  558.  
  559. int      UZ_EXP UzpMain            OF((int argc, char **argv));
  560. int      UZ_EXP UzpAltMain         OF((int argc, char **argv, UzpInit *init));
  561. UzpVer * UZ_EXP UzpVersion         OF((void));
  562. void     UZ_EXP UzpFreeMemBuffer   OF((UzpBuffer *retstr));
  563. #ifndef WINDLL
  564. int      UZ_EXP UzpUnzipToMemory   OF((char *zip, char *file, UzpOpts *optflgs,
  565.                                        UzpCB *UsrFunc, UzpBuffer *retstr));
  566. #endif
  567. #ifndef WINDLL
  568.    int   UZ_EXP UzpGrep            OF((char *archive, char *file,
  569.                                        char *pattern, int cmd, int SkipBin,
  570.                                        UzpCB *UsrFunc));
  571. #endif
  572. #ifdef OS2
  573. int      UZ_EXP UzpFileTree        OF((char *name, cbList(callBack),
  574.                                        char *cpInclude[], char *cpExclude[]));
  575. #endif
  576.  
  577. void     UZ_EXP UzpVersion2        OF((UzpVer2 *version));
  578. int      UZ_EXP UzpValidate        OF((char *archive, int AllCodes));
  579.  
  580.  
  581. /* default I/O functions (can be swapped out via UzpAltMain() entry point): */
  582.  
  583. int      UZ_EXP UzpMessagePrnt   OF((zvoid *pG, uch *buf, ulg size, int flag));
  584. int      UZ_EXP UzpMessageNull   OF((zvoid *pG, uch *buf, ulg size, int flag));
  585. int      UZ_EXP UzpInput         OF((zvoid *pG, uch *buf, int *size, int flag));
  586. void     UZ_EXP UzpMorePause     OF((zvoid *pG, ZCONST char *prompt, int flag));
  587. int      UZ_EXP UzpPassword      OF((zvoid *pG, int *rcnt, char *pwbuf,
  588.                                      int size, ZCONST char *zfn,
  589.                                      ZCONST char *efn));
  590.  
  591.  
  592. /*---------------------------------------------------------------------------
  593.     Remaining private stuff for UnZip compilation.
  594.   ---------------------------------------------------------------------------*/
  595.  
  596. #ifdef UNZIP_INTERNAL
  597. #  include "unzpriv.h"
  598. #endif
  599.  
  600.  
  601. #endif /* !__unzip_h */
  602.