/* * Copyright (c) 2000 S.Noda * * Permission to use, copy, modify, and distribute this software * and its documentation for any purpose is hereby granted provided * that the above copyright notice and this permission notice appear * in all copies of the software and related documentation. * * NO WARRANTY * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY WARRANTIES; * WITHOUT EVEN THE IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS * FOR A PARTICULAR PURPOSE. */ #ifndef _UNZIPDLL_H_ #define _UNZIPDLL_H_ #ifdef __cplusplus extern "C" { #endif #define PATH_MAX 260 #define BUFFSIZE (32 * 1024) /* 32kB */ typedef unsigned char uch; /* unsigned 8-bit value */ typedef unsigned long ulg; /* unsigned 32-bit value */ typedef void zvoid; typedef struct _UzpBuffer { /* rxstr */ ulg strlength; /* length of string */ char *strptr; /* pointer to string */ } UzpBuffer; typedef struct _ver { uch major; /* e.g., integer 5 */ uch minor; /* e.g., 2 */ uch patchlevel; /* e.g., 0 */ uch not_used; } _version_type; typedef struct _UzpVer2 { ulg structlen; /* length of the struct being passed */ ulg flag; /* bit 0: is_beta bit 1: uses_zlib */ char betalevel[10]; /* e.g., "g BETA" or "" */ char date[20]; /* e.g., "4 Sep 95" (beta) or "4 September 1995" */ char zlib_version[10]; /* e.g., "0.95" or NULL */ _version_type unzip; _version_type zipinfo; _version_type os2dll; _version_type windll; } UzpVer2; typedef int (WINAPI DLLPRNT) (LPSTR, unsigned long); typedef int (WINAPI DLLPASSWORD) (LPSTR, int, LPCSTR, LPCSTR); typedef int (WINAPI DLLSERVICE) (LPCSTR, unsigned long); typedef void (WINAPI DLLSND) (void); typedef int (WINAPI DLLREPLACE)(LPSTR); typedef void (WINAPI DLLMESSAGE)(unsigned long, unsigned long, unsigned, unsigned, unsigned, unsigned, unsigned, unsigned, char, LPSTR, LPSTR, unsigned long, char); typedef struct { int ExtractOnlyNewer; int SpaceToUnderscore; int PromptToOverwrite; int fQuiet; int ncflag; int ntflag; int nvflag; int nfflag; int nzflag; int ndflag; int noflag; int naflag; int nZIflag; int C_flag; int fPrivilege; LPSTR lpszZipFN; LPSTR lpszExtractDir; } DCL, far * LPDCL; typedef struct { DLLPRNT *print; DLLSND *sound; DLLREPLACE *replace; DLLPASSWORD *password; DLLMESSAGE *SendApplicationMessage; DLLSERVICE *ServCallBk; unsigned long TotalSizeComp; unsigned long TotalSize; unsigned long CompFactor; /* "long" applied for proper alignment, only */ unsigned long NumMembers; WORD cchComment; } USERFUNCTIONS, far * LPUSERFUNCTIONS; typedef void (WINAPI *UZP_VERSION2)(UzpVer2 far *); /* UzpVersion2 */ typedef void (WINAPI *WIZ_NOPRINTING)(int); /* Wiz_NoPrinting */ typedef int (WINAPI *WIZ_VALIDATE)(LPSTR, int); /* Wiz_Validate */ typedef BOOL (WINAPI *WIZ_INIT)(zvoid *, LPUSERFUNCTIONS); /* Wiz_Init */ typedef BOOL (WINAPI *WIZ_SETOPTS)(zvoid *, LPDCL); /* Wiz_SetOpts */ typedef int (WINAPI *WIZ_UNZIP)(zvoid *, int, char **, int, char **); /* Wiz_Unzip */ typedef int (WINAPI *WIZ_SINGLEENTRYUNZIP)(int, char **, int, char **, LPDCL, LPUSERFUNCTIONS); /* Wiz_SingleEntryUnzip */ typedef int (WINAPI *WIZ_UNZIPTOMEMORY)(LPSTR, LPSTR, LPUSERFUNCTIONS, UzpBuffer); /* Wiz_UnzipToMemory */ typedef int (WINAPI *WIZ_GREP)(LPSTR, LPSTR, LPSTR, int, int, LPUSERFUNCTIONS); /* Wiz_Grep */ #ifdef __cplusplus } #endif #endif /* _UNZIPDLL_H_ */