Archive-Unzip-Burst
view release on metacpan or search on metacpan
unzip-6.0/windll/windll.c view on Meta::CPAN
{
fprintf(stdout, "Unable to allocate memory in unzip dll\n");
return PK_MEM;
}
if (UnzipAllocMemory(i, str2, "Creating file list from string",
pargVee, pargCee) != PK_OK)
{
free(str1);
return PK_MEM;
}
i++;
str3++;
str2 = str3;
}
free(str1);
return PK_OK;
}
/* DLL calls */
BOOL WINAPI Wiz_Init(pG, lpUserFunc)
zvoid *pG;
LPUSERFUNCTIONS lpUserFunc;
{
G.message = DllMessagePrint;
G.statreportcb = Wiz_StatReportCB;
if (lpUserFunc->sound == NULL)
lpUserFunc->sound = DummySound;
G.lpUserFunctions = lpUserFunc;
SETLOCALE(LC_CTYPE, "");
if (!G.lpUserFunctions->print ||
!G.lpUserFunctions->sound ||
!G.lpUserFunctions->replace)
return FALSE;
return TRUE;
}
/*
StructVersID = version of this structure (= UZ_DCL_STRUCTVER)
ExtractOnlyNewer = TRUE for "update" without interaction
(extract only newer/new files, without queries)
SpaceToUnderscore = TRUE if convert space to underscore
PromptToOverwrite = TRUE if prompt to overwrite is wanted
fQuiet = quiet flag:
0 = all messages, 1 = few messages, 2 = no messages
ncflag = write to stdout if TRUE
ntflag = test zip file
nvflag = verbose listing
nfflag = "freshen" (replace existing files by newer versions)
nzflag = display zip file comment
ndflag = controls (sub)directory recreation during extraction
0 = junk paths from filenames
1 = "safe" usage of paths in filenames (skip "../")
2 = allow also unsafe path components (dir traversal)
noflag = always overwriting existing files if TRUE
naflag = do end-of-line translation
nZIflag = get ZipInfo if TRUE
B_flag = backup existing files if TRUE
C_flag = be case insensitive if TRUE
D_flag = controls restoration of timestamps
0 = restore all timestamps (default)
1 = skip restoration of timestamps for folders
created on behalf of directory entries in the
Zip archive
2 = do not restore any timestamps; extracted files
and directories get stamped with the current time
U_flag = controls UTF-8 filename coding support
0 = automatic UTF-8 translation enabled (default)
1 = recognize UTF-8 coded names, but all non-ASCII
characters are "escaped" into "#Uxxxx"
2 = UTF-8 support is disabled, filename handling
works exactly as in previous UnZip versions
fPrivilege = 1 => restore ACLs in user mode,
2 => try to use privileges for restoring ACLs
lpszZipFN = zip file name
lpszExtractDir = directory to extract to. This should be NULL if you
are extracting to the current directory.
*/
BOOL WINAPI Wiz_SetOpts(pG, lpDCL)
zvoid *pG;
LPDCL lpDCL;
{
if (lpDCL->StructVersID != UZ_DCL_STRUCTVER)
return FALSE;
uO.qflag = lpDCL->fQuiet; /* Quiet flag */
G.pfnames = (char **)&fnames[0]; /* assign default file name vector */
G.pxnames = (char **)&fnames[1];
uO.jflag = (lpDCL->ndflag == 0);
uO.ddotflag = (lpDCL->ndflag >= 2);
uO.cflag = lpDCL->ncflag;
uO.tflag = lpDCL->ntflag;
uO.vflag = lpDCL->nvflag;
uO.zflag = lpDCL->nzflag;
uO.aflag = lpDCL->naflag;
#ifdef UNIXBACKUP
uO.B_flag = lpDCL->B_flag;
#endif
uO.C_flag = lpDCL->C_flag;
uO.D_flag = lpDCL->D_flag;
uO.U_flag = lpDCL->U_flag;
uO.overwrite_all = lpDCL->noflag;
uO.overwrite_none = !(lpDCL->noflag || lpDCL->PromptToOverwrite);
uO.uflag = lpDCL->ExtractOnlyNewer || lpDCL->nfflag;
uO.fflag = lpDCL->nfflag;
#ifdef WIN32
uO.X_flag = lpDCL->fPrivilege;
#endif
uO.sflag = lpDCL->SpaceToUnderscore; /* Translate spaces to underscores? */
if (lpDCL->nZIflag)
{
uO.zipinfo_mode = TRUE;
uO.hflag = TRUE;
uO.lflag = 10;
uO.qflag = 2;
}
( run in 0.928 second using v1.01-cache-2.11-cpan-98e64b0badf )