Archive-Unzip-Burst
view release on metacpan or search on metacpan
unzip-6.0/windll/windll.txt view on Meta::CPAN
can be NULL if your application doesn't use
sound.
DLLREPLACE *replace = a pointer to the application's replace routine. The
replace routine may modify the content of the efnam
string buffer, but must not write beyond its fixed
size of efbufsiz bytes! (This is a potential security
leak of the windll interface.) When modifying the
efnam buffer, the replace routine should return
the status IDM_REPLACE_RENAME.
DLLPASSWORD *password = a pointer to the application's password routine.
This function should return one of the status values
IZ_PW_ENTERED (0), IZ_PW_CANCEL (-1),
IZ_PW_CANCEL_ALL (-2), IZ_PW_ERROR (5).
DLLMESSAGE *SendApplicationMessage = a pointer to the application's routine
for displaying information about specific files
in the archive. Used for listing the contents of
an archive.
DLLSERVICE *ServCallBk = Callback function designed to be used for
allowing the application to process Windows messages,
or canceling the operation, as well as giving the
option of a progress indicator. If this function
returns a non-zero value, then it will terminate
what it is doing. It provides the application with
the name of the archive member it has just processed,
as well as it's original size.
DLLMESSAGE_I32 *SendApplicationMessage_i32 = variant of SendApplicationMessage
callback, for environments that do not support the
64-bit integer types required to transfer "large"
ZIP64-compatible sizes.
DLLSERVICE_I32 *ServCallBk_i32 = variant of the ServCallBk callback function,
for environments that do not support 64-bit integers.
[NOTE: The _i32 variants of the SendApplicationMessage and ServCallBk callback
functions are only called when the corresponding "regular" callback
function pointers are set to NULL. For the i386 architecture, the
"..._i32" calling interfaces are binary identical with the
corresponding regular __int64-aware interfaces.]
[NOTE: The values below are filled in only when listing the contents of an
archive.]
z_uint8 TotalSizeComp = value to be filled in by the dll for the
compressed total size of the archive. Note this
value does not include the size of the archive
header and central directory list.
z_uint8 TotalSize = value to be filled in by the dll for the total
size of all files in the archive.
z_uint8 NumMembers = total number of files in the archive.
unsigned CompFactor = value to be filled in by the dll for the overall
compression factor. This could actually be computed
from the other values, but it is available.
WORD cchComment = flag to be set if archive has a comment
} USERFUNCTIONS, far * LPUSERFUNCTIONS;
Wiz_SingleEntryUnzip() returns a PKWARE compatible error code (0 if no
error or warning). For an explanation of the supported error codes see
the UnZip user documentation (the UnZip man page).
For examples of how the actual calls to the dll are set up in WiZ, look in
the files action.c and wizmain.c in the WiZ source directory. For a trival
example of how to load and call the dll, look in uzexampl.c and uzexampl.h.
For examples of how the actual loading and unloading of the dll's themselves
was done, look in wizmain.c in the WiZ source directory. Note that WiZ looks
specifically for a particular version number of the dll, and also expects to
find the company name to be Info-ZIP. This is to protect from getting
different versions of the dll loaded, with resulting unknown behavior.
Additional entry points:
const UzpVer * WINAPI UzpVersion(void);
where UzpVer is defined as:
typedef struct _UzpVer {
ulg structlen; /* length of the struct being passed */
ulg flag; /* bit 0: is_beta bit 1: uses_zlib */
LPCSTR betalevel; /* e.g. "g BETA" or "" */
LPCSTR date; /* e.g. "9 Oct 08" (beta) or "9 October 2008" */
LPCSTR zlib_version; /* e.g. "1.2.3" or NULL */
_version_type unzip; /* current UnZip version */
_version_type zipinfo; /* current ZipInfo version */
_version_type os2dll; /* OS2DLL version (retained for compatibility) */
_version_type windll; /* WinDLL version (retained for compatibility) */
_version_type dllapimin; /* last incompatible change of library API */
} UzpVer;
and _version_type is defined as:
typedef struct _ver {
uch major; /* e.g., integer 5 */
uch minor; /* e.g., 2 */
uch patchlevel; /* e.g., 0 */
uch not_used;
} _version_type;
See api.c for exactly what UzpVersion does, but the short description is
"UzpVersion() returns a pointer to a dll-internal static structure
containing the unzip32.dll version information".
For usage with languages that do not support function which return pointers
to structures, the variant UzpVersion2() allows to retrieve the version info
into a memory area supplied by the caller:
unsigned WINAPI UzpVersion2(UzpVer2 far *);
where UzpVer2 is defined as:
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. "9 Oct 08" (beta) or "9 October 2008" */
char zlib_version[10]; /* e.g. "1.2.3" or NULL */
_version_type unzip; /* current UnZip version */
_version_type zipinfo; /* current ZipInfo version */
_version_type os2dll; /* OS2DLL version (retained for compatibility) */
_version_type windll; /* WinDLL version (retained for compatibility) */
_version_type dllapimin; /* last incompatible change of library API */
} UzpVer2;
See api.c for the exact function of UzpVersion2, but the short description
is "fill in the version information in the UzpVer2 structure".
unzip-6.0/windll/windll.txt view on Meta::CPAN
char * strptr; /* pointer to string */
} UzpBuffer
Pass the name of the zip file in zip and the name of the file you wish to
extract in file. UzpUnzipToMemory will create a buffer and return it in
*retstr. 0 on return indicates failure.
void WINAPI UzpFreeMemBuffer(UzpBuffer *retstr)
Use this routine to release the return data space allocated by the function
Wiz_UnzipToMemory().
int WINAPI Wiz_Grep(LPSTR archive, LPSTR file, LPSTR pattern, int cmd,
int SkipBin, LPUSERFUNCTIONS lpUserFunc)
Pass the name of the zip file in "zip", the name of the zip entry you wish
to perform the "grep" on in "file", and the string you wish to look for in
"pattern". There are four possible options for cmd:
0 => case insensitive search
1 => case sensitive search
2 => case insensitive search, whole words only
3 => case sensitive search, whole words only
If SkipBin is TRUE, then any binary (loosely interpreted) files will be
ignored.
lpUserFunc is a pointer to a USERFUNCTION structure as shown above.
UzpGrep returns:
-1 => error such as unable to allocate memory, unable to find file, etc.
0 => match not found, based on the search criteria
1 => match found, based on the search criteria
There is an additional function call that does not specifically deal with
"unzipping", but is a quite useful function that is currently used in Wiz
itself in several places. This call is currently only available in the
static library, not in the DLL.
Match the pattern (wildcard) against the string (fixed):
match(const char *string, const char *pattern, int ignore_case);
or, when UnZips WILD_SEP_AT_DIR compile-time option was set:
match(const char *string, const char *pattern, int ignore_case, int sepc);
returns TRUE if string matches pattern, FALSE otherwise. In the pattern:
`*' matches any sequence of characters (zero or more)
`?' matches any single character
[SET] matches any character in the specified set,
[!SET] or [^SET] matches any character not in the specified set.
In case the code was compiled with WILD_STOP_AT_DIR enabled, the pattern
wildcard functionality is modified as follows:
`*' matches any sequence of characters (zero or more) until the first
occurence of the separating character denoted by `sepc'
`**' matches any sequence of characters (zero or more)
A set is composed of characters or ranges; a range looks like ``character
hyphen character'' (as in 0-9 or A-Z). [0-9a-zA-Z_] is the minimal set of
characters allowed in the [..] pattern construct. Other characters are
allowed (i.e., 8-bit characters) if your system will support them.
To suppress the special syntactic significance of any of ``[]*?!^-\'', in-
side or outside a [..] construct, and match the character exactly, precede
it with a ``\'' (backslash).
The remaining functions are linked together. Their use would be as
follows (explanations for each function are shown further below):
#include "windll.h"
#include "structs.h"
MyApiCallingRoutine()
{
CREATEGLOBALS();
.
.
.
Wiz_Init(pG, lpUserFunctions); /* Set up user functions */
/* zvoid *pG, LPUSERFUNCTIONS lpUserFunctions */
.
.
do {
.
.
Wiz_SetOpts(pG, lpDCL); /* Set up unzipping options */
/* zvoid *pG, LPDCL lpDCL */
.
.
Wiz_Unzip(pG, ifnc, ifnv, xfnc, xfnv); /* Unzip files */
.
.
} while (!finished_condition)
.
.
DESTROYGLOBALS();
}
Each entry point is as defined below:
BOOL WINAPI Wiz_Init(zvoid *, LPUSERFUNCTIONS);
BOOL WINAPI Wiz_SetOpts(zvoid *, LPDCL);
int WINAPI Wiz_Unzip(zvoid *, int, char **, int, char **);
Note that you should use either Wiz_SingleEntryUnzip OR the series of calls
described above. Using both, depending on how you do it, could cause
problems. The series of "lower level" gives you more freedom to add additional
functionalities, whereas the single-entry api is easier to use. When using
the "series" of calls, make sure that Wiz_SetOpts and Wiz_Unzip are always
used together! When successfully called, Wiz_SetOpts has allocated some
internal structures which are in turn free'd by Wiz_Unzip.
Last revised January 18, 2009.
Mike White, Christian Spieler
( run in 1.935 second using v1.01-cache-2.11-cpan-364913b4093 )