home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 9 Archive / 09-Archive.zip / unzip531.zip / wince / intrface.h < prev    next >
C/C++ Source or Header  |  1997-03-25  |  5KB  |  141 lines

  1. //******************************************************************************
  2. //
  3. // File:        INTRFACE.H
  4. //
  5. // Description: This module acts as the interface between the Info-ZIP code and
  6. //              our Windows code in WINMAIN.CPP.  See INTRFACE.CPP for a more
  7. //              detailed description and the actual implementation.
  8. //
  9. // Copyright:   All the source files for Pocket UnZip, except for components
  10. //              written by the Info-ZIP group, are copyrighted 1997 by Steve P.
  11. //              Miller.  The product "Pocket UnZip" itself is property of the
  12. //              author and cannot be altered in any way without written consent
  13. //              from Steve P. Miller.
  14. //
  15. // Disclaimer:  All project files are provided "as is" with no guarantee of
  16. //              their correctness.  The authors are not liable for any outcome
  17. //              that is the result of using this source.  The source for Pocket
  18. //              UnZip has been placed in the public domain to help provide an
  19. //              understanding of its implementation.  You are hereby granted
  20. //              full permission to use this source in any way you wish, except
  21. //              to alter Pocket UnZip itself.  For comments, suggestions, and
  22. //              bug reports, please write to stevemil@pobox.com.
  23. //
  24. //
  25. // Date      Name          History
  26. // --------  ------------  -----------------------------------------------------
  27. // 02/01/97  Steve Miller  Created (Version 1.0 using Info-ZIP UnZip 5.30)
  28. //
  29. //******************************************************************************
  30.  
  31. #ifndef __INTRFACE_H__
  32. #define __INTRFACE_H__
  33.  
  34. #ifdef __cplusplus
  35. extern "C" {
  36. #endif
  37.  
  38. //******************************************************************************
  39. //***** Types and Structures
  40. //******************************************************************************
  41.  
  42. typedef void (WINAPI DLLMESSAGE)(ulg, ulg, int, int, int, int, int, int,
  43.                                  int, char*, char*, ulg);
  44.  
  45. typedef struct _USERFUNCTIONS {
  46.    DLLMESSAGE    *SendApplicationMessage;
  47.    WORD           cchComment;
  48.    unsigned long  TotalSizeComp;
  49.    unsigned long  TotalSize;
  50.    int            CompFactor;
  51.    unsigned int   NumMembers;
  52. } USERFUNCTIONS, *LPUSERFUNCTIONS;
  53.  
  54. typedef struct _DCL {
  55.    int PromptToOverwrite;
  56. } DCL, *LPDCL;
  57.  
  58. typedef enum _OVERWRITE_MODE {
  59.    OM_PROMPT = 0,
  60.    OM_NEWER,
  61.    OM_ALWAYS,
  62.    OM_NEVER
  63. } OVERWRITE_MODE, *LPOVERWRITE_MODE;
  64.  
  65. typedef struct _EXTRACT_INFO {
  66.    BOOL            fExtract;      // TRUE for extract, FALSE for test
  67.    DWORD           dwFileCount;   // Number of files to extract/test.
  68.    DWORD           dwByteCount;   // Total bytes to extract/test
  69.    LPSTR          *szFileList;    // ARGV list of files, NULL for all files.
  70.    BOOL            fRestorePaths; // TRUE to restore paths, FALSE to junk them.
  71.    OVERWRITE_MODE  overwriteMode; // How to handle file overwrites.
  72.    LPSTR           szMappedPath;  // Used to store mapped name. May be NULL.
  73.    BOOL            fAbort;        // Set during operation by UI to abort.
  74.    int             result;        // Result code from extraction/test.
  75.  
  76.    // Window handles for the various controls in our progress dialogs.
  77.    HWND            hWndEditFile;
  78.    HWND            hWndProgFile;
  79.    HWND            hWndProgTotal;
  80.    HWND            hWndPercentage;
  81.    HWND            hWndFilesProcessed;
  82.    HWND            hWndBytesProcessed;
  83.  
  84.    // Values used to keep track of our progress.
  85.    DWORD           dwFileOffset;
  86.    DWORD           dwFile;
  87.    DWORD           dwBytesTotalThisFile;
  88.    DWORD           dwBytesWrittenThisFile;
  89.    DWORD           dwBytesWrittenPreviousFiles;
  90.    LPCSTR          szFile;
  91.    BOOL            fNewLineOfText;
  92.  
  93. } EXTRACT_INFO, *LPEXTRACT_INFO;
  94.  
  95. typedef struct _DECRYPT_INFO {
  96.    int    retry;
  97.    LPSTR  szPassword;
  98.    DWORD  nSize;
  99.    LPCSTR szFile;
  100. } DECRYPT_INFO, *LPDECRYPT_INFO;
  101.  
  102. //******************************************************************************
  103. //***** Function Prototypes
  104. //******************************************************************************
  105.  
  106. int  DoListFiles(LPCSTR szZipFile);
  107. BOOL DoExtractOrTestFiles(LPCSTR szZipFile, EXTRACT_INFO *pei);
  108. int  DoGetComment(LPCSTR szZipFile);
  109. BOOL SetExtractToDirectory(LPTSTR szDirectory);
  110.  
  111. int  win_fprintf(FILE *file, unsigned int dwCount, char far *buffer);
  112.  
  113.  
  114. //******************************************************************************
  115. //***** Global Variables
  116. //******************************************************************************
  117.  
  118. #ifdef GLOBAL_DECLARE
  119. #undef GLOBAL_DECLARE
  120. #undef GLOBAL_INIT
  121. #endif
  122.  
  123. #ifdef __INTRFACE_CPP__
  124.    #define GLOBAL_DECLARE
  125.    #define GLOBAL_INIT(value) =value
  126. #else
  127.    #define GLOBAL_DECLARE extern
  128.    #define GLOBAL_INIT(value)
  129. #endif
  130.  
  131. GLOBAL_DECLARE jmp_buf         dll_error_return;
  132. GLOBAL_DECLARE LPDCL           lpDCL           GLOBAL_INIT(NULL);
  133. GLOBAL_DECLARE LPUSERFUNCTIONS lpUserFunctions GLOBAL_INIT(NULL);
  134.  
  135.  
  136. #ifdef __cplusplus
  137. } // extern "C"
  138. #endif
  139.  
  140. #endif // __INTRFACE_H__
  141.