home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 25 / nopv25.iso / 040A / DELZIP10.ZIP / VCL.ZIP / UNZDLL.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1997-04-07  |  2.9 KB  |  71 lines

  1. { UNZDLL.PAS   - Delphi v2 translation of file "wizunzip.h" by Eric W. Engler }
  2. { Import Unit for UNZDLL - put this into the "uses" clause of any
  3.   other unit that wants to access the UNZDLL. }
  4.  
  5. { Note: Don't use VC++ 4.2 to generate DLLs.  It's DLLEXPORT has a bug
  6.   that causes them to be cdecl instead of stdcall. Also, OCXs generated
  7.   with 4.2 can't fire Delphi events. }
  8.  
  9. unit UNZDLL;
  10.  
  11. interface
  12.  
  13. uses Windows, ZCallBck;
  14.  
  15. { This record is very critical.  Any changes in the order of items, the
  16.   size of items, or modifying the number of items, may have disasterous
  17.   results.  You have been warned! }
  18. Type UnZipParms = packed record
  19.          Handle: THandle;
  20.          Caller: Pointer;    { "self" referance of the Delphi form }
  21.                      { This is passed back to us in the callback function
  22.                      so we can direct the info to the proper form instance
  23.                      - thanks to Dennis Passmore for this idea. }
  24.          Version: LongInt;   { version of DLL we expect to see }
  25.          ZCallbackFunc: ZFunctionPtrType; { typedef in ZIPDLL.PAS }
  26.          fTraceEnabled: LongBool;
  27.  
  28.          {============== Begin UnZip Flag section ============== }
  29.          fPromptToOverwrite: LongBool;  // not used yet
  30.          fDecrypt: LongBool; // not supported yet
  31.          fTest:    LongBool;  // if true, test zipfile (not used yet)
  32.          fComments: LongBool;  // show zip comment (not supported yet)
  33.          fConvert: LongBool;  // if true, do ASCII/EBCDIC or EOL translation
  34.  
  35.          fQuiet:   LongBool;        // DLL be quiet!
  36.          fVerboseEnabled: LongBool; // verbose flag
  37.          fUpdate:  LongBool;  // "update" (extract only newer files & brand new files)
  38.          fFreshen: LongBool;  // "freshen" (extract only newer files that already exist)
  39.          fDirectories: LongBool; // if true, recreate dir structure
  40.          fOverwrite: LongBool;   // if true, overwrite existing (no asking)
  41.  
  42.          { Count of filespecs to extract - don't forget to set this! }
  43.          argc: LongInt;
  44.          { ptr to zipfile name }
  45.          PZipFN: PChar;
  46.          seven: LongInt; { pass a 7 here to validate struct size }
  47.          { Array of filenames contained in the ZIP archive }
  48.          PFileNames: array[0..FilesMax] of PChar;
  49.       end;
  50.  
  51.  type
  52.    PUnZipParms = ^UnZipParms;
  53.  
  54. { Main call to execute a ZIP add or Delete.  This call returns the
  55.   number of files that were sucessfully operated on. }
  56. function DllProcessZipFiles(UnZipRec: PUnZipParms): DWORD; stdcall;
  57.  
  58. procedure GetDllVersionU(VersionHi: PWord;
  59.                         VersionLo: PWord);
  60.                         stdcall;
  61. implementation
  62.  
  63. function DllProcessZipFiles(UnZipRec: PUnZipParms): DWORD;
  64.                        external 'UNZDLL.DLL' index 2;
  65.  
  66. procedure GetDllVersionU(VersionHi: PWord;
  67.                         VersionLo: PWord);
  68.                         external 'UNZDLL.DLL' index 3;
  69.  
  70. end.
  71.