mirror of
https://github.com/zlib-ng/minizip-ng
synced 2025-03-28 21:13:18 +00:00
zipClose2_64 function allows to set "version made by".
A couple of ZIP64 versions of zipClose, which allows the user to set the "version made by" field in Zip64 end of central directory record.
This commit is contained in:
parent
ad93fda09c
commit
65a215b5da
12
zip.c
12
zip.c
@ -1862,6 +1862,16 @@ extern int ZEXPORT zipCloseFileInZip(zipFile file)
|
||||
}
|
||||
|
||||
extern int ZEXPORT zipClose(zipFile file, const char* global_comment)
|
||||
{
|
||||
return zipClose_64(file, global_comment);
|
||||
}
|
||||
|
||||
extern int ZEXPORT zipClose_64(zipFile file, const char* global_comment)
|
||||
{
|
||||
return zipClose2_64(file, global_comment, VERSIONMADEBY);
|
||||
}
|
||||
|
||||
extern int ZEXPORT zipClose2_64(zipFile file, const char* global_comment, uLong versionMadeBy)
|
||||
{
|
||||
zip64_internal* zi;
|
||||
int err = 0;
|
||||
@ -1930,7 +1940,7 @@ extern int ZEXPORT zipClose(zipFile file, const char* global_comment)
|
||||
err = zip64local_putValue(&zi->z_filefunc, zi->filestream, (ZPOS64_T)zip64datasize, 8);
|
||||
/* version made by */
|
||||
if (err == ZIP_OK)
|
||||
err = zip64local_putValue(&zi->z_filefunc, zi->filestream, (uLong)45, 2);
|
||||
err = zip64local_putValue(&zi->z_filefunc, zi->filestream, (uLong)versionMadeBy, 2);
|
||||
/* version needed */
|
||||
if (err == ZIP_OK)
|
||||
err = zip64local_putValue(&zi->z_filefunc, zi->filestream, (uLong)45, 2);
|
||||
|
5
zip.h
5
zip.h
@ -191,6 +191,11 @@ extern int ZEXPORT zipCloseFileInZipRaw64 OF((zipFile file, ZPOS64_T uncompresse
|
||||
extern int ZEXPORT zipClose OF((zipFile file, const char* global_comment));
|
||||
/* Close the zipfile */
|
||||
|
||||
extern int ZEXPORT zipClose_64 OF((zipFile file, const char* global_comment));
|
||||
|
||||
extern int ZEXPORT zipClose2_64 OF((zipFile file, const char* global_comment, uLong versionMadeBy));
|
||||
/* Same as zipClose_64 except versionMadeBy field */
|
||||
|
||||
/***************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
Loading…
x
Reference in New Issue
Block a user