summaryrefslogtreecommitdiffstats
path: root/rbutil/rbutilqt/quazip/zip.h
diff options
context:
space:
mode:
Diffstat (limited to 'rbutil/rbutilqt/quazip/zip.h')
-rw-r--r--rbutil/rbutilqt/quazip/zip.h211
1 files changed, 183 insertions, 28 deletions
diff --git a/rbutil/rbutilqt/quazip/zip.h b/rbutil/rbutilqt/quazip/zip.h
index acacce83b9..a6617add0f 100644
--- a/rbutil/rbutilqt/quazip/zip.h
+++ b/rbutil/rbutilqt/quazip/zip.h
@@ -1,19 +1,15 @@
-/* zip.h -- IO for compress .zip files using zlib
- Version 1.01e, February 12th, 2005
+/* zip.h -- IO on .zip files using zlib
+ Version 1.1, February 14h, 2010
+ part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html )
- Copyright (C) 1998-2005 Gilles Vollant
+ Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html )
- This unzip package allow creates .ZIP file, compatible with PKZip 2.04g
- WinZip, InfoZip tools and compatible.
- Multi volume ZipFile (span) are not supported.
- Encryption compatible with pkzip 2.04g only supported
- Old compressions used by old PKZip 1.x are not supported
+ Modifications for Zip64 support
+ Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com )
- For uncompress .zip file, look at unzip.h
+ For more info read MiniZip_info.txt
-
- I WAIT FEEDBACK at mail info@winimage.com
- Visit also http://www.winimage.com/zLibDll/unzip.html for evolution
+ ---------------------------------------------------------------------------
Condition of use and distribution are the same than zlib :
@@ -33,23 +29,29 @@
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
+ ---------------------------------------------------------------------------
-*/
+ Changes
+
+ See header of zip.h
+
+ ---------------------------------------------------------------------------
+
+ As per the requirement above, this file is plainly marked as modified
+ by Sergey A. Tachenov. Most modifications include the I/O API redesign
+ to support QIODevice interface. Some improvements and small fixes were also made.
-/* for more info about .ZIP format, see
- http://www.info-zip.org/pub/infozip/doc/appnote-981119-iz.zip
- http://www.info-zip.org/pub/infozip/doc/
- PkWare has also a specification at :
- ftp://ftp.pkware.com/probdesc.zip
*/
-#ifndef _zip_H
-#define _zip_H
+#ifndef _zip12_H
+#define _zip12_H
#ifdef __cplusplus
extern "C" {
#endif
+//#define HAVE_BZIP2
+
#ifndef _ZLIB_H
#include "zlib.h"
#endif
@@ -58,6 +60,12 @@ extern "C" {
#include "ioapi.h"
#endif
+#ifdef HAVE_BZIP2
+#include "bzlib.h"
+#endif
+
+#define Z_BZIP2ED 12
+
#if defined(STRICTZIP) || defined(STRICTZIPUNZIP)
/* like the STRICT of WIN32, we define a pointer that cannot be converted
from (void*) without cast */
@@ -74,6 +82,11 @@ typedef voidp zipFile;
#define ZIP_BADZIPFILE (-103)
#define ZIP_INTERNALERROR (-104)
+#define ZIP_WRITE_DATA_DESCRIPTOR 0x8u
+#define ZIP_AUTO_CLOSE 0x1u
+#define ZIP_SEQUENTIAL 0x2u
+#define ZIP_DEFAULT_FLAGS (ZIP_AUTO_CLOSE | ZIP_WRITE_DATA_DESCRIPTOR)
+
#ifndef DEF_MEM_LEVEL
# if MAX_MEM_LEVEL >= 8
# define DEF_MEM_LEVEL 8
@@ -111,11 +124,12 @@ typedef const char* zipcharpc;
#define APPEND_STATUS_CREATEAFTER (1)
#define APPEND_STATUS_ADDINZIP (2)
-extern zipFile ZEXPORT zipOpen OF((const char *pathname, int append));
+extern zipFile ZEXPORT zipOpen OF((voidpf file, int append));
+extern zipFile ZEXPORT zipOpen64 OF((voidpf file, int append));
/*
Create a zipfile.
- pathname contain on Windows XP a filename like "c:\\zlib\\zlib113.zip" or on
- an Unix computer "zlib/zlib113.zip".
+ the file argument depends on the API used, for QuaZIP it's a QIODevice
+ pointer.
if the file pathname exist and append==APPEND_STATUS_CREATEAFTER, the zip
will be created at the end of the file.
(useful if the file contain a self extractor code)
@@ -131,11 +145,27 @@ extern zipFile ZEXPORT zipOpen OF((const char *pathname, int append));
Of couse, you can use RAW reading and writing to copy the file you did not want delte
*/
-extern zipFile ZEXPORT zipOpen2 OF((const char *pathname,
+extern zipFile ZEXPORT zipOpen2 OF((voidpf file,
int append,
zipcharpc* globalcomment,
zlib_filefunc_def* pzlib_filefunc_def));
+extern zipFile ZEXPORT zipOpen2_64 OF((voidpf file,
+ int append,
+ zipcharpc* globalcomment,
+ zlib_filefunc64_def* pzlib_filefunc_def));
+
+/*
+ * Exported by Sergey A. Tachenov to suit the needs of QuaZIP.
+ * Note that this function MAY change signature in order to
+ * provide new QuaZIP features. You have been warned!
+ * */
+extern zipFile ZEXPORT zipOpen3 (voidpf file,
+ int append,
+ zipcharpc* globalcomment,
+ zlib_filefunc64_32_def* pzlib_filefunc64_32_def,
+ unsigned flags);
+
extern int ZEXPORT zipOpenNewFileInZip OF((zipFile file,
const char* filename,
const zip_fileinfo* zipfi,
@@ -146,6 +176,19 @@ extern int ZEXPORT zipOpenNewFileInZip OF((zipFile file,
const char* comment,
int method,
int level));
+
+extern int ZEXPORT zipOpenNewFileInZip64 OF((zipFile file,
+ const char* filename,
+ const zip_fileinfo* zipfi,
+ const void* extrafield_local,
+ uInt size_extrafield_local,
+ const void* extrafield_global,
+ uInt size_extrafield_global,
+ const char* comment,
+ int method,
+ int level,
+ int zip64));
+
/*
Open a file in the ZIP for writing.
filename : the filename in zip (if NULL, '-' without quote will be used
@@ -157,6 +200,9 @@ extern int ZEXPORT zipOpenNewFileInZip OF((zipFile file,
if comment != NULL, comment contain the comment string
method contain the compression method (0 for store, Z_DEFLATED for deflate)
level contain the level of compression (can be Z_DEFAULT_COMPRESSION)
+ zip64 is set to 1 if a zip64 extended information block should be added to the local file header.
+ this MUST be '1' if the uncompressed size is >= 0xffffffff.
+
*/
@@ -172,6 +218,19 @@ extern int ZEXPORT zipOpenNewFileInZip2 OF((zipFile file,
int level,
int raw));
+
+extern int ZEXPORT zipOpenNewFileInZip2_64 OF((zipFile file,
+ const char* filename,
+ const zip_fileinfo* zipfi,
+ const void* extrafield_local,
+ uInt size_extrafield_local,
+ const void* extrafield_global,
+ uInt size_extrafield_global,
+ const char* comment,
+ int method,
+ int level,
+ int raw,
+ int zip64));
/*
Same than zipOpenNewFileInZip, except if raw=1, we write raw file
*/
@@ -191,13 +250,79 @@ extern int ZEXPORT zipOpenNewFileInZip3 OF((zipFile file,
int memLevel,
int strategy,
const char* password,
- uLong crcForCtypting));
+ uLong crcForCrypting));
+
+extern int ZEXPORT zipOpenNewFileInZip3_64 OF((zipFile file,
+ const char* filename,
+ const zip_fileinfo* zipfi,
+ const void* extrafield_local,
+ uInt size_extrafield_local,
+ const void* extrafield_global,
+ uInt size_extrafield_global,
+ const char* comment,
+ int method,
+ int level,
+ int raw,
+ int windowBits,
+ int memLevel,
+ int strategy,
+ const char* password,
+ uLong crcForCrypting,
+ int zip64
+ ));
/*
Same than zipOpenNewFileInZip2, except
windowBits,memLevel,,strategy : see parameter strategy in deflateInit2
password : crypting password (NULL for no crypting)
- crcForCtypting : crc of file to compress (needed for crypting)
+ crcForCrypting : crc of file to compress (needed for crypting)
+ */
+
+extern int ZEXPORT zipOpenNewFileInZip4 OF((zipFile file,
+ const char* filename,
+ const zip_fileinfo* zipfi,
+ const void* extrafield_local,
+ uInt size_extrafield_local,
+ const void* extrafield_global,
+ uInt size_extrafield_global,
+ const char* comment,
+ int method,
+ int level,
+ int raw,
+ int windowBits,
+ int memLevel,
+ int strategy,
+ const char* password,
+ uLong crcForCrypting,
+ uLong versionMadeBy,
+ uLong flagBase
+ ));
+
+
+extern int ZEXPORT zipOpenNewFileInZip4_64 OF((zipFile file,
+ const char* filename,
+ const zip_fileinfo* zipfi,
+ const void* extrafield_local,
+ uInt size_extrafield_local,
+ const void* extrafield_global,
+ uInt size_extrafield_global,
+ const char* comment,
+ int method,
+ int level,
+ int raw,
+ int windowBits,
+ int memLevel,
+ int strategy,
+ const char* password,
+ uLong crcForCrypting,
+ uLong versionMadeBy,
+ uLong flagBase,
+ int zip64
+ ));
+/*
+ Same than zipOpenNewFileInZip4, except
+ versionMadeBy : value for Version made by field
+ flag : value for flag field (compression level info will be added)
*/
@@ -216,8 +341,13 @@ extern int ZEXPORT zipCloseFileInZip OF((zipFile file));
extern int ZEXPORT zipCloseFileInZipRaw OF((zipFile file,
uLong uncompressed_size,
uLong crc32));
+
+extern int ZEXPORT zipCloseFileInZipRaw64 OF((zipFile file,
+ ZPOS64_T uncompressed_size,
+ uLong crc32));
+
/*
- Close the current file in the zipfile, for fiel opened with
+ Close the current file in the zipfile, for file opened with
parameter raw=1 in zipOpenNewFileInZip2
uncompressed_size and crc32 are value for the uncompressed size
*/
@@ -228,8 +358,33 @@ extern int ZEXPORT zipClose OF((zipFile file,
Close the zipfile
*/
+
+extern int ZEXPORT zipRemoveExtraInfoBlock OF((char* pData, int* dataLen, short sHeader));
+/*
+ zipRemoveExtraInfoBlock - Added by Mathias Svensson
+
+ Remove extra information block from a extra information data for the local file header or central directory header
+
+ It is needed to remove ZIP64 extra information blocks when before data is written if using RAW mode.
+
+ 0x0001 is the signature header for the ZIP64 extra information blocks
+
+ usage.
+ Remove ZIP64 Extra information from a central director extra field data
+ zipRemoveExtraInfoBlock(pCenDirExtraFieldData, &nCenDirExtraFieldDataLen, 0x0001);
+
+ Remove ZIP64 Extra information from a Local File Header extra field data
+ zipRemoveExtraInfoBlock(pLocalHeaderExtraFieldData, &nLocalHeaderExtraFieldDataLen, 0x0001);
+*/
+
+/*
+ Added by Sergey A. Tachenov to tweak zipping behaviour.
+*/
+extern int ZEXPORT zipSetFlags(zipFile file, unsigned flags);
+extern int ZEXPORT zipClearFlags(zipFile file, unsigned flags);
+
#ifdef __cplusplus
}
#endif
-#endif /* _zip_H */
+#endif /* _zip64_H */