summaryrefslogtreecommitdiffstats
path: root/rbutil/rbutilqt/quazip/unzip.h
diff options
context:
space:
mode:
Diffstat (limited to 'rbutil/rbutilqt/quazip/unzip.h')
-rw-r--r--rbutil/rbutilqt/quazip/unzip.h154
1 files changed, 129 insertions, 25 deletions
diff --git a/rbutil/rbutilqt/quazip/unzip.h b/rbutil/rbutilqt/quazip/unzip.h
index b247937c80..da7b062845 100644
--- a/rbutil/rbutilqt/quazip/unzip.h
+++ b/rbutil/rbutilqt/quazip/unzip.h
@@ -1,20 +1,20 @@
/* unzip.h -- IO for uncompress .zip files using zlib
- Version 1.01e, February 12th, 2005
+ 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 extract file from .ZIP file, compatible with PKZip 2.04g
- WinZip, InfoZip tools and compatible.
+ Modifications of Unzip for Zip64
+ Copyright (C) 2007-2008 Even Rouault
- 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 on both zip and unzip
+ Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com )
+ For more info read MiniZip_info.txt
- I WAIT FEEDBACK at mail info@winimage.com
- Visit also http://www.winimage.com/zLibDll/unzip.htm for evolution
+ ---------------------------------------------------------------------------------
- Condition of use and distribution are the same than zlib :
+ Condition of use and distribution are the same than zlib :
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
@@ -32,18 +32,21 @@
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
+ ---------------------------------------------------------------------------------
-*/
+ Changes
+
+ See header of unzip64.c
-/* 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
+ ---------------------------------------------------------------------------
+
+ 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.
*/
-#ifndef _unz_H
-#define _unz_H
+#ifndef _unz64_H
+#define _unz64_H
#ifdef __cplusplus
extern "C" {
@@ -53,10 +56,16 @@ extern "C" {
#include "zlib.h"
#endif
-#ifndef _ZLIBIOAPI_H
+#ifndef _ZLIBIOAPI_H
#include "ioapi.h"
#endif
+#ifdef HAVE_BZIP2
+#include "bzlib.h"
+#endif
+
+#define Z_BZIP2ED 12
+
#if defined(STRICTUNZIP) || defined(STRICTZIPUNZIP)
/* like the STRICT of WIN32, we define a pointer that cannot be converted
from (void*) without cast */
@@ -76,6 +85,9 @@ typedef voidp unzFile;
#define UNZ_INTERNALERROR (-104)
#define UNZ_CRCERROR (-105)
+#define UNZ_AUTO_CLOSE 0x01u
+#define UNZ_DEFAULT_FLAGS UNZ_AUTO_CLOSE
+
/* tm_unz contain date/time info */
typedef struct tm_unz_s
{
@@ -89,15 +101,42 @@ typedef struct tm_unz_s
/* unz_global_info structure contain global data about the ZIPfile
These data comes from the end of central dir */
+typedef struct unz_global_info64_s
+{
+ ZPOS64_T number_entry; /* total number of entries in
+ the central dir on this disk */
+ uLong size_comment; /* size of the global comment of the zipfile */
+} unz_global_info64;
+
typedef struct unz_global_info_s
{
uLong number_entry; /* total number of entries in
- the central dir on this disk */
+ the central dir on this disk */
uLong size_comment; /* size of the global comment of the zipfile */
} unz_global_info;
-
/* unz_file_info contain information about a file in the zipfile */
+typedef struct unz_file_info64_s
+{
+ uLong version; /* version made by 2 bytes */
+ uLong version_needed; /* version needed to extract 2 bytes */
+ uLong flag; /* general purpose bit flag 2 bytes */
+ uLong compression_method; /* compression method 2 bytes */
+ uLong dosDate; /* last mod file date in Dos fmt 4 bytes */
+ uLong crc; /* crc-32 4 bytes */
+ ZPOS64_T compressed_size; /* compressed size 8 bytes */
+ ZPOS64_T uncompressed_size; /* uncompressed size 8 bytes */
+ uLong size_filename; /* filename length 2 bytes */
+ uLong size_file_extra; /* extra field length 2 bytes */
+ uLong size_file_comment; /* file comment length 2 bytes */
+
+ uLong disk_num_start; /* disk number start 2 bytes */
+ uLong internal_fa; /* internal file attributes 2 bytes */
+ uLong external_fa; /* external file attributes 4 bytes */
+
+ tm_unz tmu_date;
+} unz_file_info64;
+
typedef struct unz_file_info_s
{
uLong version; /* version made by 2 bytes */
@@ -132,7 +171,8 @@ extern int ZEXPORT unzStringFileNameCompare OF ((const char* fileName1,
*/
-extern unzFile ZEXPORT unzOpen OF((const char *path));
+extern unzFile ZEXPORT unzOpen OF((voidpf file));
+extern unzFile ZEXPORT unzOpen64 OF((voidpf file));
/*
Open a Zip file. path contain the full pathname (by example,
on a Windows XP computer "c:\\zlib\\zlib113.zip" or on an Unix computer
@@ -141,15 +181,40 @@ extern unzFile ZEXPORT unzOpen OF((const char *path));
return value is NULL.
Else, the return value is a unzFile Handle, usable with other function
of this unzip package.
+ the "64" function take a const void* pointer, because the path is just the
+ value passed to the open64_file_func callback.
+ Under Windows, if UNICODE is defined, using fill_fopen64_filefunc, the path
+ is a pointer to a wide unicode string (LPCTSTR is LPCWSTR), so const char*
+ does not describe the reality
*/
-extern unzFile ZEXPORT unzOpen2 OF((const char *path,
+
+extern unzFile ZEXPORT unzOpen2 OF((voidpf file,
zlib_filefunc_def* pzlib_filefunc_def));
/*
Open a Zip file, like unzOpen, but provide a set of file low level API
for read/write the zip file (see ioapi.h)
*/
+extern unzFile ZEXPORT unzOpen2_64 OF((voidpf file,
+ zlib_filefunc64_def* pzlib_filefunc_def));
+/*
+ Open a Zip file, like unz64Open, but provide a set of file low level API
+ for read/write the zip file (see ioapi.h)
+*/
+
+
+/*
+ * Exported by Sergey A. Tachenov to implement some QuaZIP features. This
+ * function MAY change signature in order to implement even more features.
+ * You have been warned!
+ * */
+extern unzFile unzOpenInternal (voidpf file,
+ zlib_filefunc64_32_def* pzlib_filefunc64_32_def,
+ int is64bitOpenFunction, unsigned flags);
+
+
+
extern int ZEXPORT unzClose OF((unzFile file));
/*
Close a ZipFile opened with unzipOpen.
@@ -159,6 +224,9 @@ extern int ZEXPORT unzClose OF((unzFile file));
extern int ZEXPORT unzGetGlobalInfo OF((unzFile file,
unz_global_info *pglobal_info));
+
+extern int ZEXPORT unzGetGlobalInfo64 OF((unzFile file,
+ unz_global_info64 *pglobal_info));
/*
Write info about the ZipFile in the *pglobal_info structure.
No preparation of the structure is needed
@@ -221,8 +289,31 @@ extern int ZEXPORT unzGoToFilePos(
unzFile file,
unz_file_pos* file_pos);
+typedef struct unz64_file_pos_s
+{
+ ZPOS64_T pos_in_zip_directory; /* offset in zip file directory */
+ ZPOS64_T num_of_file; /* # of file */
+} unz64_file_pos;
+
+extern int ZEXPORT unzGetFilePos64(
+ unzFile file,
+ unz64_file_pos* file_pos);
+
+extern int ZEXPORT unzGoToFilePos64(
+ unzFile file,
+ const unz64_file_pos* file_pos);
+
/* ****************************************** */
+extern int ZEXPORT unzGetCurrentFileInfo64 OF((unzFile file,
+ unz_file_info64 *pfile_info,
+ char *szFileName,
+ uLong fileNameBufferSize,
+ void *extraField,
+ uLong extraFieldBufferSize,
+ char *szComment,
+ uLong commentBufferSize));
+
extern int ZEXPORT unzGetCurrentFileInfo OF((unzFile file,
unz_file_info *pfile_info,
char *szFileName,
@@ -244,6 +335,14 @@ extern int ZEXPORT unzGetCurrentFileInfo OF((unzFile file,
(commentBufferSize is the size of the buffer)
*/
+
+/** Addition for GDAL : START */
+
+extern ZPOS64_T ZEXPORT unzGetCurrentFileZStreamPos64 OF((unzFile file));
+
+/** Addition for GDAL : END */
+
+
/***************************************************************************/
/* for reading the content of the current zipfile, you can open it, read data
from it, and close it (you can close it before reading all the file)
@@ -312,6 +411,8 @@ extern int ZEXPORT unzReadCurrentFile OF((unzFile file,
*/
extern z_off_t ZEXPORT unztell OF((unzFile file));
+
+extern ZPOS64_T ZEXPORT unztell64 OF((unzFile file));
/*
Give the current position in uncompressed data
*/
@@ -340,15 +441,18 @@ extern int ZEXPORT unzGetLocalExtrafield OF((unzFile file,
/***************************************************************************/
/* Get the current file offset */
+extern ZPOS64_T ZEXPORT unzGetOffset64 (unzFile file);
extern uLong ZEXPORT unzGetOffset (unzFile file);
/* Set the current file offset */
+extern int ZEXPORT unzSetOffset64 (unzFile file, ZPOS64_T pos);
extern int ZEXPORT unzSetOffset (unzFile file, uLong pos);
-
+extern int ZEXPORT unzSetFlags(unzFile file, unsigned flags);
+extern int ZEXPORT unzClearFlags(unzFile file, unsigned flags);
#ifdef __cplusplus
}
#endif
-#endif /* _unz_H */
+#endif /* _unz64_H */