ckb-next  v0.2.8 at branch master
ckb-next driver for corsair devices
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
unzip.h File Reference
#include "zlib.h"
#include "ioapi.h"
+ Include dependency graph for unzip.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  tm_unz_s
 
struct  unz_global_info64_s
 
struct  unz_global_info_s
 
struct  unz_file_info64_s
 
struct  unz_file_info_s
 
struct  unz_file_pos_s
 
struct  unz64_file_pos_s
 

Macros

#define Z_BZIP2ED   12
 
#define UNZ_OK   (0)
 
#define UNZ_END_OF_LIST_OF_FILE   (-100)
 
#define UNZ_ERRNO   (Z_ERRNO)
 
#define UNZ_EOF   (0)
 
#define UNZ_PARAMERROR   (-102)
 
#define UNZ_BADZIPFILE   (-103)
 
#define UNZ_INTERNALERROR   (-104)
 
#define UNZ_CRCERROR   (-105)
 
#define UNZ_AUTO_CLOSE   0x01u
 
#define UNZ_DEFAULT_FLAGS   UNZ_AUTO_CLOSE
 

Typedefs

typedef voidp unzFile
 
typedef struct tm_unz_s tm_unz
 
typedef struct unz_global_info64_s unz_global_info64
 
typedef struct unz_global_info_s unz_global_info
 
typedef struct unz_file_info64_s unz_file_info64
 
typedef struct unz_file_info_s unz_file_info
 
typedef struct unz_file_pos_s unz_file_pos
 
typedef struct unz64_file_pos_s unz64_file_pos
 

Functions

int ZEXPORT
unzStringFileNameCompare 
_Z_OF ((const char *fileName1, const char *fileName2, int iCaseSensitivity))
 
unzFile ZEXPORT unzOpen _Z_OF ((voidpf file))
 
unzFile ZEXPORT unzOpen2 _Z_OF ((voidpf file, zlib_filefunc_def *pzlib_filefunc_def))
 
unzFile ZEXPORT unzOpen2_64 _Z_OF ((voidpf file, zlib_filefunc64_def *pzlib_filefunc_def))
 
unzFile unzOpenInternal (voidpf file, zlib_filefunc64_32_def *pzlib_filefunc64_32_def, int is64bitOpenFunction, unsigned flags)
 
int ZEXPORT unzClose _Z_OF ((unzFile file))
 Addition for GDAL : START. More...
 
int ZEXPORT unzGetGlobalInfo _Z_OF ((unzFile file, unz_global_info *pglobal_info))
 
int ZEXPORT unzGetGlobalInfo64 _Z_OF ((unzFile file, unz_global_info64 *pglobal_info))
 
int ZEXPORT unzGetGlobalComment _Z_OF ((unzFile file, char *szComment, uLong uSizeBuf))
 
int ZEXPORT unzLocateFile _Z_OF ((unzFile file, const char *szFileName, int iCaseSensitivity))
 
int ZEXPORT unzGetFilePos (unzFile file, unz_file_pos *file_pos)
 
int ZEXPORT unzGoToFilePos (unzFile file, unz_file_pos *file_pos)
 
int ZEXPORT unzGetFilePos64 (unzFile file, unz64_file_pos *file_pos)
 
int ZEXPORT unzGoToFilePos64 (unzFile file, const unz64_file_pos *file_pos)
 
int ZEXPORT unzGetCurrentFileInfo64 _Z_OF ((unzFile file, unz_file_info64 *pfile_info, char *szFileName, uLong fileNameBufferSize, void *extraField, uLong extraFieldBufferSize, char *szComment, uLong commentBufferSize))
 
int ZEXPORT unzGetCurrentFileInfo _Z_OF ((unzFile file, unz_file_info *pfile_info, char *szFileName, uLong fileNameBufferSize, void *extraField, uLong extraFieldBufferSize, char *szComment, uLong commentBufferSize))
 
int ZEXPORT
unzOpenCurrentFilePassword 
_Z_OF ((unzFile file, const char *password))
 
int ZEXPORT unzOpenCurrentFile2 _Z_OF ((unzFile file, int *method, int *level, int raw))
 
int ZEXPORT unzOpenCurrentFile3 _Z_OF ((unzFile file, int *method, int *level, int raw, const char *password))
 
int ZEXPORT unzReadCurrentFile _Z_OF ((unzFile file, voidp buf, unsigned len))
 
ZPOS64_T ZEXPORT unzGetOffset64 (unzFile file)
 
uLong ZEXPORT unzGetOffset (unzFile file)
 
int ZEXPORT unzSetOffset64 (unzFile file, ZPOS64_T pos)
 
int ZEXPORT unzSetOffset (unzFile file, uLong pos)
 
int ZEXPORT unzSetFlags (unzFile file, unsigned flags)
 
int ZEXPORT unzClearFlags (unzFile file, unsigned flags)
 

Data Structure Documentation

struct tm_unz_s

Definition at line 92 of file unzip.h.

+ Collaboration diagram for tm_unz_s:
Data Fields
uInt tm_hour
uInt tm_mday
uInt tm_min
uInt tm_mon
uInt tm_sec
uInt tm_year
struct unz_global_info64_s

Definition at line 104 of file unzip.h.

+ Collaboration diagram for unz_global_info64_s:
Data Fields
ZPOS64_T number_entry
uLong size_comment
struct unz_global_info_s

Definition at line 111 of file unzip.h.

+ Collaboration diagram for unz_global_info_s:
Data Fields
uLong number_entry
uLong size_comment
struct unz_file_info64_s

Definition at line 119 of file unzip.h.

+ Collaboration diagram for unz_file_info64_s:
Data Fields
ZPOS64_T compressed_size
uLong compression_method
uLong crc
uLong disk_num_start
uLong dosDate
uLong external_fa
uLong flag
uLong internal_fa
uLong size_file_comment
uLong size_file_extra
uLong size_filename
tm_unz tmu_date
ZPOS64_T uncompressed_size
uLong version
uLong version_needed
struct unz_file_info_s

Definition at line 140 of file unzip.h.

+ Collaboration diagram for unz_file_info_s:
Data Fields
uLong compressed_size
uLong compression_method
uLong crc
uLong disk_num_start
uLong dosDate
uLong external_fa
uLong flag
uLong internal_fa
uLong size_file_comment
uLong size_file_extra
uLong size_filename
tm_unz tmu_date
uLong uncompressed_size
uLong version
uLong version_needed
struct unz_file_pos_s

Definition at line 278 of file unzip.h.

+ Collaboration diagram for unz_file_pos_s:
Data Fields
uLong num_of_file
uLong pos_in_zip_directory
struct unz64_file_pos_s

Definition at line 292 of file unzip.h.

+ Collaboration diagram for unz64_file_pos_s:
Data Fields
ZPOS64_T num_of_file
ZPOS64_T pos_in_zip_directory

Macro Definition Documentation

#define UNZ_AUTO_CLOSE   0x01u

Definition at line 88 of file unzip.h.

Referenced by QuaZip::open(), unzClose(), and unzOpenInternal().

#define UNZ_BADZIPFILE   (-103)
#define UNZ_CRCERROR   (-105)

Definition at line 86 of file unzip.h.

Referenced by unzCloseCurrentFile().

#define UNZ_DEFAULT_FLAGS   UNZ_AUTO_CLOSE

Definition at line 89 of file unzip.h.

Referenced by unzOpen(), unzOpen2(), unzOpen2_64(), and unzOpen64().

#define UNZ_END_OF_LIST_OF_FILE   (-100)
#define UNZ_EOF   (0)

Definition at line 82 of file unzip.h.

Referenced by unz64local_getByte(), and unzReadCurrentFile().

#define UNZ_INTERNALERROR   (-104)

Definition at line 85 of file unzip.h.

Referenced by unzOpenCurrentFile3().

Typedef Documentation

typedef struct tm_unz_s tm_unz
typedef struct unz_file_pos_s unz_file_pos
typedef voidp unzFile

Definition at line 75 of file unzip.h.

Function Documentation

int ZEXPORT unzStringFileNameCompare _Z_OF ( (const char *fileName1, const char *fileName2, int iCaseSensitivity)  )
unzFile ZEXPORT unzOpen _Z_OF ( (voidpf file)  )
unzFile ZEXPORT unzOpen2 _Z_OF ( (voidpf file, zlib_filefunc_def *pzlib_filefunc_def)  )
unzFile ZEXPORT unzOpen2_64 _Z_OF ( (voidpf file, zlib_filefunc64_def *pzlib_filefunc_def)  )
int ZEXPORT unzClose _Z_OF ( (unzFile file)  )

Addition for GDAL : END.

int ZEXPORT unzGetGlobalInfo _Z_OF ( (unzFile file, unz_global_info *pglobal_info)  )
int ZEXPORT unzGetGlobalInfo64 _Z_OF ( (unzFile file, unz_global_info64 *pglobal_info)  )
int ZEXPORT unzGetGlobalComment _Z_OF ( (unzFile file, char *szComment, uLong uSizeBuf)  )
int ZEXPORT unzLocateFile _Z_OF ( (unzFile file, const char *szFileName, int iCaseSensitivity)  )
int ZEXPORT unzGetCurrentFileInfo64 _Z_OF ( (unzFile file, unz_file_info64 *pfile_info, char *szFileName, uLong fileNameBufferSize, void *extraField, uLong extraFieldBufferSize, char *szComment, uLong commentBufferSize)  )
int ZEXPORT unzGetCurrentFileInfo _Z_OF ( (unzFile file, unz_file_info *pfile_info, char *szFileName, uLong fileNameBufferSize, void *extraField, uLong extraFieldBufferSize, char *szComment, uLong commentBufferSize)  )
int ZEXPORT unzOpenCurrentFilePassword _Z_OF ( (unzFile file, const char *password)  )
int ZEXPORT unzOpenCurrentFile2 _Z_OF ( (unzFile file, int *method, int *level, int raw)  )
int ZEXPORT unzOpenCurrentFile3 _Z_OF ( (unzFile file, int *method, int *level, int raw, const char *password)  )
int ZEXPORT unzReadCurrentFile _Z_OF ( (unzFile file, voidp buf, unsigned len)  )
int ZEXPORT unzClearFlags ( unzFile  file,
unsigned  flags 
)

Definition at line 2147 of file unzip.c.

References unz64_s::flags, UNZ_OK, and UNZ_PARAMERROR.

Referenced by QuaZip::open().

2148 {
2149  unz64_s* s;
2150  if (file == NULL)
2151  return UNZ_PARAMERROR;
2152  s = (unz64_s*)file;
2153  s->flags &= ~flags;
2154  return UNZ_OK;
2155 }
#define UNZ_PARAMERROR
Definition: unzip.h:83
#define UNZ_OK
Definition: unzip.h:79
Definition: unzip.c:167
unsigned flags
Definition: unzip.c:190

+ Here is the caller graph for this function:

int ZEXPORT unzGetFilePos ( unzFile  file,
unz_file_pos file_pos 
)

Definition at line 1334 of file unzip.c.

References unz_file_pos_s::num_of_file, unz64_file_pos_s::num_of_file, unz_file_pos_s::pos_in_zip_directory, unz64_file_pos_s::pos_in_zip_directory, UNZ_OK, and unzGetFilePos64().

1337 {
1338  unz64_file_pos file_pos64;
1339  int err = unzGetFilePos64(file,&file_pos64);
1340  if (err==UNZ_OK)
1341  {
1342  file_pos->pos_in_zip_directory = (uLong)file_pos64.pos_in_zip_directory;
1343  file_pos->num_of_file = (uLong)file_pos64.num_of_file;
1344  }
1345  return err;
1346 }
#define UNZ_OK
Definition: unzip.h:79
ZPOS64_T pos_in_zip_directory
Definition: unzip.h:294
uLong num_of_file
Definition: unzip.h:281
int ZEXPORT unzGetFilePos64(unzFile file, unz64_file_pos *file_pos)
Definition: unzip.c:1318
ZPOS64_T num_of_file
Definition: unzip.h:295
uLong pos_in_zip_directory
Definition: unzip.h:280

+ Here is the call graph for this function:

int ZEXPORT unzGetFilePos64 ( unzFile  file,
unz64_file_pos file_pos 
)

Definition at line 1318 of file unzip.c.

References unz64_s::current_file_ok, unz64_s::num_file, unz64_file_pos_s::num_of_file, unz64_s::pos_in_central_dir, unz64_file_pos_s::pos_in_zip_directory, UNZ_END_OF_LIST_OF_FILE, UNZ_OK, and UNZ_PARAMERROR.

Referenced by QuaZipPrivate::addCurrentFileToDirectoryMap(), and unzGetFilePos().

1319 {
1320  unz64_s* s;
1321 
1322  if (file==NULL || file_pos==NULL)
1323  return UNZ_PARAMERROR;
1324  s=(unz64_s*)file;
1325  if (!s->current_file_ok)
1326  return UNZ_END_OF_LIST_OF_FILE;
1327 
1329  file_pos->num_of_file = s->num_file;
1330 
1331  return UNZ_OK;
1332 }
#define UNZ_PARAMERROR
Definition: unzip.h:83
#define UNZ_OK
Definition: unzip.h:79
ZPOS64_T pos_in_zip_directory
Definition: unzip.h:294
ZPOS64_T current_file_ok
Definition: unzip.c:176
ZPOS64_T num_of_file
Definition: unzip.h:295
Definition: unzip.c:167
ZPOS64_T pos_in_central_dir
Definition: unzip.c:175
#define UNZ_END_OF_LIST_OF_FILE
Definition: unzip.h:80
ZPOS64_T num_file
Definition: unzip.c:174

+ Here is the caller graph for this function:

uLong ZEXPORT unzGetOffset ( unzFile  file)

Definition at line 2102 of file unzip.c.

References unzGetOffset64().

2103 {
2104  ZPOS64_T offset64;
2105 
2106  if (file==NULL)
2107  return 0; /*UNZ_PARAMERROR; */
2108  offset64 = unzGetOffset64(file);
2109  return (uLong)offset64;
2110 }
unsigned long long int ZPOS64_T
Definition: ioapi.h:94
ZPOS64_T ZEXPORT unzGetOffset64(unzFile file)
Definition: unzip.c:2087

+ Here is the call graph for this function:

ZPOS64_T ZEXPORT unzGetOffset64 ( unzFile  file)

Definition at line 2087 of file unzip.c.

References unz64_s::current_file_ok, unz64_s::gi, unz64_s::num_file, unz_global_info64_s::number_entry, and unz64_s::pos_in_central_dir.

Referenced by unzGetOffset().

2088 {
2089  unz64_s* s;
2090 
2091  if (file==NULL)
2092  return 0; /*UNZ_PARAMERROR; */
2093  s=(unz64_s*)file;
2094  if (!s->current_file_ok)
2095  return 0;
2096  if (s->gi.number_entry != 0 && s->gi.number_entry != 0xffff)
2097  if (s->num_file==s->gi.number_entry)
2098  return 0;
2099  return s->pos_in_central_dir;
2100 }
ZPOS64_T current_file_ok
Definition: unzip.c:176
unz_global_info64 gi
Definition: unzip.c:172
ZPOS64_T number_entry
Definition: unzip.h:106
Definition: unzip.c:167
ZPOS64_T pos_in_central_dir
Definition: unzip.c:175
ZPOS64_T num_file
Definition: unzip.c:174

+ Here is the caller graph for this function:

int ZEXPORT unzGoToFilePos ( unzFile  file,
unz_file_pos file_pos 
)

Definition at line 1370 of file unzip.c.

References unz_file_pos_s::num_of_file, unz64_file_pos_s::num_of_file, unz_file_pos_s::pos_in_zip_directory, unz64_file_pos_s::pos_in_zip_directory, UNZ_PARAMERROR, and unzGoToFilePos64().

1373 {
1374  unz64_file_pos file_pos64;
1375  if (file_pos == NULL)
1376  return UNZ_PARAMERROR;
1377 
1378  file_pos64.pos_in_zip_directory = file_pos->pos_in_zip_directory;
1379  file_pos64.num_of_file = file_pos->num_of_file;
1380  return unzGoToFilePos64(file,&file_pos64);
1381 }
#define UNZ_PARAMERROR
Definition: unzip.h:83
int ZEXPORT unzGoToFilePos64(unzFile file, const unz64_file_pos *file_pos)
Definition: unzip.c:1348
ZPOS64_T pos_in_zip_directory
Definition: unzip.h:294
uLong num_of_file
Definition: unzip.h:281
ZPOS64_T num_of_file
Definition: unzip.h:295
uLong pos_in_zip_directory
Definition: unzip.h:280

+ Here is the call graph for this function:

int ZEXPORT unzGoToFilePos64 ( unzFile  file,
const unz64_file_pos file_pos 
)

Definition at line 1348 of file unzip.c.

References unz64_s::cur_file_info, unz64_s::cur_file_info_internal, unz64_s::current_file_ok, unz64_s::num_file, unz64_file_pos_s::num_of_file, unz64_s::pos_in_central_dir, unz64_file_pos_s::pos_in_zip_directory, unz64local_GetCurrentFileInfoInternal(), UNZ_OK, and UNZ_PARAMERROR.

Referenced by QuaZipPrivate::goToFirstUnmappedFile(), QuaZip::setCurrentFile(), and unzGoToFilePos().

1349 {
1350  unz64_s* s;
1351  int err;
1352 
1353  if (file==NULL || file_pos==NULL)
1354  return UNZ_PARAMERROR;
1355  s=(unz64_s*)file;
1356 
1357  /* jump to the right spot */
1359  s->num_file = file_pos->num_of_file;
1360 
1361  /* set the current file */
1364  NULL,0,NULL,0,NULL,0);
1365  /* return results */
1366  s->current_file_ok = (err == UNZ_OK);
1367  return err;
1368 }
static int unz64local_GetCurrentFileInfoInternal(unzFile file, unz_file_info64 *pfile_info, unz_file_info64_internal *pfile_info_internal, char *szFileName, uLong fileNameBufferSize, void *extraField, uLong extraFieldBufferSize, char *szComment, uLong commentBufferSize)
Definition: unzip.c:889
unz_file_info64_internal cur_file_info_internal
Definition: unzip.c:184
#define UNZ_PARAMERROR
Definition: unzip.h:83
#define UNZ_OK
Definition: unzip.h:79
ZPOS64_T pos_in_zip_directory
Definition: unzip.h:294
ZPOS64_T current_file_ok
Definition: unzip.c:176
ZPOS64_T num_of_file
Definition: unzip.h:295
Definition: unzip.c:167
unz_file_info64 cur_file_info
Definition: unzip.c:183
ZPOS64_T pos_in_central_dir
Definition: unzip.c:175
ZPOS64_T num_file
Definition: unzip.c:174

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

unzFile unzOpenInternal ( voidpf  file,
zlib_filefunc64_32_def pzlib_filefunc64_32_def,
int  is64bitOpenFunction,
unsigned  flags 
)

Definition at line 587 of file unzip.c.

References ALLOC, unz64_s::byte_before_the_zipfile, unz64_s::central_pos, unz64_s::encrypted, unz64_s::filestream, fill_qiodevice64_filefunc(), unz64_s::flags, unz64_s::gi, unz64_s::is64bitOpenFunction, unz64_s::isZip64, unz_global_info64_s::number_entry, unz64_s::offset_central_dir, unz64_s::pfile_in_zip_read, unz64_s::size_central_dir, unz_global_info64_s::size_comment, unz64local_getLong(), unz64local_getLong64(), unz64local_getShort(), unz64local_SearchCentralDir(), unz64local_SearchCentralDir64(), UNZ_AUTO_CLOSE, UNZ_BADZIPFILE, unz_copyright, UNZ_ERRNO, UNZ_OK, unzGoToFirstFile(), unz64_s::z_filefunc, ZCLOSE64, ZFAKECLOSE64, zlib_filefunc64_32_def_s::zfile_func64, ZLIB_FILEFUNC_MODE_EXISTING, ZLIB_FILEFUNC_MODE_READ, ZLIB_FILEFUNC_SEEK_SET, ZOPEN64, zlib_filefunc64_32_def_s::zseek32_file, ZSEEK64, and zlib_filefunc64_32_def_s::ztell32_file.

Referenced by QuaZip::open(), unzOpen(), unzOpen2(), unzOpen2_64(), and unzOpen64().

590 {
591  unz64_s us;
592  unz64_s *s;
593  ZPOS64_T central_pos;
594  uLong uL;
595 
596  uLong number_disk; /* number of the current dist, used for
597  spaning ZIP, unsupported, always 0*/
598  uLong number_disk_with_CD; /* number the the disk with central dir, used
599  for spaning ZIP, unsupported, always 0*/
600  ZPOS64_T number_entry_CD; /* total number of entries in
601  the central dir
602  (same than number_entry on nospan) */
603 
604  int err=UNZ_OK;
605 
606  if (unz_copyright[0]!=' ')
607  return NULL;
608 
609  us.flags = flags;
610  us.z_filefunc.zseek32_file = NULL;
611  us.z_filefunc.ztell32_file = NULL;
612  if (pzlib_filefunc64_32_def==NULL)
614  else
615  us.z_filefunc = *pzlib_filefunc64_32_def;
616  us.is64bitOpenFunction = is64bitOpenFunction;
617 
618 
619 
620  us.filestream = ZOPEN64(us.z_filefunc,
621  file,
624  if (us.filestream==NULL)
625  return NULL;
626 
628  if (central_pos)
629  {
630  uLong uS;
631  ZPOS64_T uL64;
632 
633  us.isZip64 = 1;
634 
635  if (ZSEEK64(us.z_filefunc, us.filestream,
636  central_pos,ZLIB_FILEFUNC_SEEK_SET)!=0)
637  err=UNZ_ERRNO;
638 
639  /* the signature, already checked */
641  err=UNZ_ERRNO;
642 
643  /* size of zip64 end of central directory record */
644  if (unz64local_getLong64(&us.z_filefunc, us.filestream,&uL64)!=UNZ_OK)
645  err=UNZ_ERRNO;
646 
647  /* version made by */
649  err=UNZ_ERRNO;
650 
651  /* version needed to extract */
653  err=UNZ_ERRNO;
654 
655  /* number of this disk */
656  if (unz64local_getLong(&us.z_filefunc, us.filestream,&number_disk)!=UNZ_OK)
657  err=UNZ_ERRNO;
658 
659  /* number of the disk with the start of the central directory */
660  if (unz64local_getLong(&us.z_filefunc, us.filestream,&number_disk_with_CD)!=UNZ_OK)
661  err=UNZ_ERRNO;
662 
663  /* total number of entries in the central directory on this disk */
665  err=UNZ_ERRNO;
666 
667  /* total number of entries in the central directory */
668  if (unz64local_getLong64(&us.z_filefunc, us.filestream,&number_entry_CD)!=UNZ_OK)
669  err=UNZ_ERRNO;
670 
671  if ((number_entry_CD!=us.gi.number_entry) ||
672  (number_disk_with_CD!=0) ||
673  (number_disk!=0))
674  err=UNZ_BADZIPFILE;
675 
676  /* size of the central directory */
678  err=UNZ_ERRNO;
679 
680  /* offset of start of central directory with respect to the
681  starting disk number */
683  err=UNZ_ERRNO;
684 
685  us.gi.size_comment = 0;
686  }
687  else
688  {
689  central_pos = unz64local_SearchCentralDir(&us.z_filefunc,us.filestream);
690  if (central_pos==0)
691  err=UNZ_ERRNO;
692 
693  us.isZip64 = 0;
694 
695  if (ZSEEK64(us.z_filefunc, us.filestream,
696  central_pos,ZLIB_FILEFUNC_SEEK_SET)!=0)
697  err=UNZ_ERRNO;
698 
699  /* the signature, already checked */
701  err=UNZ_ERRNO;
702 
703  /* number of this disk */
704  if (unz64local_getShort(&us.z_filefunc, us.filestream,&number_disk)!=UNZ_OK)
705  err=UNZ_ERRNO;
706 
707  /* number of the disk with the start of the central directory */
708  if (unz64local_getShort(&us.z_filefunc, us.filestream,&number_disk_with_CD)!=UNZ_OK)
709  err=UNZ_ERRNO;
710 
711  /* total number of entries in the central dir on this disk */
713  err=UNZ_ERRNO;
714  us.gi.number_entry = uL;
715 
716  /* total number of entries in the central dir */
718  err=UNZ_ERRNO;
719  number_entry_CD = uL;
720 
721  if ((number_entry_CD!=us.gi.number_entry) ||
722  (number_disk_with_CD!=0) ||
723  (number_disk!=0))
724  err=UNZ_BADZIPFILE;
725 
726  /* size of the central directory */
728  err=UNZ_ERRNO;
729  us.size_central_dir = uL;
730 
731  /* offset of start of central directory with respect to the
732  starting disk number */
734  err=UNZ_ERRNO;
735  us.offset_central_dir = uL;
736 
737  /* zipfile comment length */
739  err=UNZ_ERRNO;
740  }
741 
742  if ((central_pos<us.offset_central_dir+us.size_central_dir) &&
743  (err==UNZ_OK))
744  err=UNZ_BADZIPFILE;
745 
746  if (err!=UNZ_OK)
747  {
748  if ((us.flags & UNZ_AUTO_CLOSE) != 0)
750  else
752  return NULL;
753  }
754 
755  us.byte_before_the_zipfile = central_pos -
757  us.central_pos = central_pos;
758  us.pfile_in_zip_read = NULL;
759  us.encrypted = 0;
760 
761 
762  s=(unz64_s*)ALLOC(sizeof(unz64_s));
763  if( s != NULL)
764  {
765  *s=us;
767  }
768  return (unzFile)s;
769 }
int encrypted
Definition: unzip.c:187
int ZEXPORT unzGoToFirstFile(unzFile file)
Definition: unzip.c:1188
void fill_qiodevice64_filefunc(zlib_filefunc64_def *pzlib_filefunc_def)
Definition: qioapi.cpp:331
voidp unzFile
Definition: unzip.h:75
#define UNZ_OK
Definition: unzip.h:79
#define UNZ_BADZIPFILE
Definition: unzip.h:84
#define ZLIB_FILEFUNC_MODE_READ
Definition: ioapi.h:113
ZPOS64_T offset_central_dir
Definition: unzip.c:180
zlib_filefunc64_def zfile_func64
Definition: ioapi.h:178
tell_file_func ztell32_file
Definition: ioapi.h:180
static ZPOS64_T unz64local_SearchCentralDir64(const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream)
Definition: unzip.c:481
static int unz64local_getLong64(const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream, ZPOS64_T *pX)
Definition: unzip.c:305
unz_global_info64 gi
Definition: unzip.c:172
#define ZCLOSE64(filefunc, filestream)
Definition: ioapi.h:189
#define ZFAKECLOSE64(filefunc, filestream)
Definition: ioapi.h:190
#define ZOPEN64(filefunc, filename, mode)
Definition: ioapi.h:199
const char unz_copyright[]
Definition: unzip.c:124
zlib_filefunc64_32_def z_filefunc
Definition: unzip.c:169
unsigned long long int ZPOS64_T
Definition: ioapi.h:94
static int unz64local_getLong(const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream, uLong *pX)
Definition: unzip.c:269
#define ZLIB_FILEFUNC_MODE_EXISTING
Definition: ioapi.h:117
static ZPOS64_T unz64local_SearchCentralDir(const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream)
Definition: unzip.c:416
ZPOS64_T number_entry
Definition: unzip.h:106
static int unz64local_getShort(const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream, uLong *pX)
Definition: unzip.c:242
ZPOS64_T size_central_dir
Definition: unzip.c:179
seek_file_func zseek32_file
Definition: ioapi.h:181
file_in_zip64_read_info_s * pfile_in_zip_read
Definition: unzip.c:185
int isZip64
Definition: unzip.c:189
#define UNZ_ERRNO
Definition: unzip.h:81
Definition: unzip.c:167
voidpf filestream
Definition: unzip.c:171
#define ZSEEK64(filefunc, filestream, pos, mode)
Definition: ioapi.h:201
ZPOS64_T byte_before_the_zipfile
Definition: unzip.c:173
int is64bitOpenFunction
Definition: unzip.c:170
#define ZLIB_FILEFUNC_SEEK_SET
Definition: ioapi.h:111
#define UNZ_AUTO_CLOSE
Definition: unzip.h:88
uLong size_comment
Definition: unzip.h:108
unsigned flags
Definition: unzip.c:190
ZPOS64_T central_pos
Definition: unzip.c:177
#define ALLOC(size)
Definition: unzip.c:114

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int ZEXPORT unzSetFlags ( unzFile  file,
unsigned  flags 
)

Definition at line 2136 of file unzip.c.

References unz64_s::flags, UNZ_OK, and UNZ_PARAMERROR.

Referenced by QuaZip::open().

2137 {
2138  unz64_s* s;
2139  if (file == NULL)
2140  return UNZ_PARAMERROR;
2141  s = (unz64_s*)file;
2142  s->flags |= flags;
2143  return UNZ_OK;
2144 }
#define UNZ_PARAMERROR
Definition: unzip.h:83
#define UNZ_OK
Definition: unzip.h:79
Definition: unzip.c:167
unsigned flags
Definition: unzip.c:190

+ Here is the caller graph for this function:

int ZEXPORT unzSetOffset ( unzFile  file,
uLong  pos 
)

Definition at line 2130 of file unzip.c.

References unzSetOffset64().

2131 {
2132  return unzSetOffset64(file,pos);
2133 }
int ZEXPORT unzSetOffset64(unzFile file, ZPOS64_T pos)
Definition: unzip.c:2112

+ Here is the call graph for this function:

int ZEXPORT unzSetOffset64 ( unzFile  file,
ZPOS64_T  pos 
)

Definition at line 2112 of file unzip.c.

References unz64_s::cur_file_info, unz64_s::cur_file_info_internal, unz64_s::current_file_ok, unz64_s::gi, unz64_s::num_file, unz_global_info64_s::number_entry, unz64_s::pos_in_central_dir, unz64local_GetCurrentFileInfoInternal(), UNZ_OK, and UNZ_PARAMERROR.

Referenced by unzSetOffset().

2113 {
2114  unz64_s* s;
2115  int err;
2116 
2117  if (file==NULL)
2118  return UNZ_PARAMERROR;
2119  s=(unz64_s*)file;
2120 
2121  s->pos_in_central_dir = pos;
2122  s->num_file = s->gi.number_entry; /* hack */
2125  NULL,0,NULL,0,NULL,0);
2126  s->current_file_ok = (err == UNZ_OK);
2127  return err;
2128 }
static int unz64local_GetCurrentFileInfoInternal(unzFile file, unz_file_info64 *pfile_info, unz_file_info64_internal *pfile_info_internal, char *szFileName, uLong fileNameBufferSize, void *extraField, uLong extraFieldBufferSize, char *szComment, uLong commentBufferSize)
Definition: unzip.c:889
unz_file_info64_internal cur_file_info_internal
Definition: unzip.c:184
#define UNZ_PARAMERROR
Definition: unzip.h:83
#define UNZ_OK
Definition: unzip.h:79
ZPOS64_T current_file_ok
Definition: unzip.c:176
unz_global_info64 gi
Definition: unzip.c:172
ZPOS64_T number_entry
Definition: unzip.h:106
Definition: unzip.c:167
unz_file_info64 cur_file_info
Definition: unzip.c:183
ZPOS64_T pos_in_central_dir
Definition: unzip.c:175
ZPOS64_T num_file
Definition: unzip.c:174

+ Here is the call graph for this function:

+ Here is the caller graph for this function: