Biomedical Image Analysis Library
The Biomedical Image Analysis Library is a poweful tool for developers, physicians, researchers, engineers, and so on.
unzip.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "zlib.h"
#include "unzip.h"
#include <errno.h>
Include dependency graph for unzip.c:

Go to the source code of this file.

Classes

struct  unz_file_info64_internal
 
struct  file_in_zip64_read_info_s
 
struct  unz64_s
 

Macros

#define NOUNCRYPT
 
#define local   static
 
#define CASESENSITIVITYDEFAULT_NO
 
#define UNZ_BUFSIZE   (16384)
 
#define UNZ_MAXFILENAMEINZIP   (256)
 
#define ALLOC(size)   (malloc(size))
 
#define TRYFREE(p)   {if (p) free(p);}
 
#define SIZECENTRALDIRITEM   (0x2e)
 
#define SIZEZIPLOCALHEADER   (0x1e)
 
#define CASESENSITIVITYDEFAULTVALUE   2
 
#define STRCMPCASENOSENTIVEFUNCTION   strcmpcasenosensitive_internal
 
#define BUFREADCOMMENT   (0x400)
 

Functions

static int unz64local_getByte OF (( const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream, int *pi))
 
static int unz64local_getByte (const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream, int *pi)
 
static int unz64local_getShort OF (( const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream, uLong *pX))
 
static int unz64local_getShort (const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream, uLong *pX)
 
static int unz64local_getLong (const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream, uLong *pX)
 
static int unz64local_getLong64 OF (( const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream, ZPOS64_T *pX))
 
static int unz64local_getLong64 (const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream, ZPOS64_T *pX)
 
static int strcmpcasenosensitive_internal (const char *fileName1, const char *fileName2)
 
int ZEXPORT unzStringFileNameCompare (const char *fileName1, const char *fileName2, int iCaseSensitivity)
 
static ZPOS64_T unz64local_SearchCentralDir OF ((const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream))
 
static ZPOS64_T unz64local_SearchCentralDir (const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream)
 
static ZPOS64_T unz64local_SearchCentralDir64 OF (( const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream))
 
static ZPOS64_T unz64local_SearchCentralDir64 (const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream)
 
static unzFile unzOpenInternal (const void *path, zlib_filefunc64_32_def *pzlib_filefunc64_32_def, int is64bitOpenFunction)
 
unzFile ZEXPORT unzOpen2 (const char *path, zlib_filefunc_def *pzlib_filefunc32_def)
 
unzFile ZEXPORT unzOpen2_64 (const void *path, zlib_filefunc64_def *pzlib_filefunc_def)
 
unzFile ZEXPORT unzOpen (const char *path)
 
unzFile ZEXPORT unzOpen64 (const void *path)
 
int ZEXPORT unzClose (unzFile file)
 
int ZEXPORT unzGetGlobalInfo64 (unzFile file, unz_global_info64 *pglobal_info)
 
int ZEXPORT unzGetGlobalInfo (unzFile file, unz_global_info *pglobal_info32)
 
static void unz64local_DosDateToTmuDate (ZPOS64_T ulDosDate, tm_unz *ptm)
 
static int unz64local_GetCurrentFileInfoInternal OF ((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))
 
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)
 
int ZEXPORT unzGetCurrentFileInfo64 (unzFile file, unz_file_info64 *pfile_info, char *szFileName, uLong fileNameBufferSize, void *extraField, uLong extraFieldBufferSize, char *szComment, uLong commentBufferSize)
 
int ZEXPORT unzGetCurrentFileInfo (unzFile file, unz_file_info *pfile_info, char *szFileName, uLong fileNameBufferSize, void *extraField, uLong extraFieldBufferSize, char *szComment, uLong commentBufferSize)
 
int ZEXPORT unzGoToFirstFile (unzFile file)
 
int ZEXPORT unzGoToNextFile (unzFile file)
 
int ZEXPORT unzLocateFile (unzFile file, const char *szFileName, int iCaseSensitivity)
 
int ZEXPORT unzGetFilePos64 (unzFile file, unz64_file_pos *file_pos)
 
int ZEXPORT unzGetFilePos (unzFile file, unz_file_pos *file_pos)
 
int ZEXPORT unzGoToFilePos64 (unzFile file, const unz64_file_pos *file_pos)
 
int ZEXPORT unzGoToFilePos (unzFile file, unz_file_pos *file_pos)
 
static int unz64local_CheckCurrentFileCoherencyHeader (unz64_s *s, uInt *piSizeVar, ZPOS64_T *poffset_local_extrafield, uInt *psize_local_extrafield)
 
int ZEXPORT unzOpenCurrentFile3 (unzFile file, int *method, int *level, int raw, const char *password)
 
int ZEXPORT unzOpenCurrentFile (unzFile file)
 
int ZEXPORT unzOpenCurrentFilePassword (unzFile file, const char *password)
 
int ZEXPORT unzOpenCurrentFile2 (unzFile file, int *method, int *level, int raw)
 
ZPOS64_T ZEXPORT unzGetCurrentFileZStreamPos64 (unzFile file)
 
int ZEXPORT unzReadCurrentFile (unzFile file, voidp buf, unsigned len)
 
z_off_t ZEXPORT unztell (unzFile file)
 
ZPOS64_T ZEXPORT unztell64 (unzFile file)
 
int ZEXPORT unzeof (unzFile file)
 
int ZEXPORT unzGetLocalExtrafield (unzFile file, voidp buf, unsigned len)
 
int ZEXPORT unzCloseCurrentFile (unzFile file)
 
int ZEXPORT unzGetGlobalComment (unzFile file, char *szComment, uLong uSizeBuf)
 
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)
 

Variables

const char unz_copyright []
 

Class Documentation

struct unz_file_info64_internal

Definition at line 126 of file unzip.c.

Collaboration diagram for unz_file_info64_internal:
Collaboration graph
Class Members
ZPOS64_T offset_curfile
struct file_in_zip64_read_info_s

Definition at line 134 of file unzip.c.

Collaboration diagram for file_in_zip64_read_info_s:
Collaboration graph
Class Members
ZPOS64_T byte_before_the_zipfile
uLong compression_method
uLong crc32
uLong crc32_wait
voidpf filestream
ZPOS64_T offset_local_extrafield
ZPOS64_T pos_in_zipfile
ZPOS64_T pos_local_extrafield
int raw
char * read_buffer
ZPOS64_T rest_read_compressed
ZPOS64_T rest_read_uncompressed
uInt size_local_extrafield
z_stream stream
uLong stream_initialised
ZPOS64_T total_out_64
zlib_filefunc64_32_def z_filefunc
struct unz64_s

Definition at line 165 of file unzip.c.

Collaboration diagram for unz64_s:
Collaboration graph
Class Members
ZPOS64_T byte_before_the_zipfile
ZPOS64_T central_pos
unz_file_info64 cur_file_info
unz_file_info64_internal cur_file_info_internal
ZPOS64_T current_file_ok
int encrypted
voidpf filestream
unz_global_info64 gi
int is64bitOpenFunction
int isZip64
ZPOS64_T num_file
ZPOS64_T offset_central_dir
file_in_zip64_read_info_s * pfile_in_zip_read
ZPOS64_T pos_in_central_dir
ZPOS64_T size_central_dir
zlib_filefunc64_32_def z_filefunc

Macro Definition Documentation

#define ALLOC (   size)    (malloc(size))

Definition at line 112 of file unzip.c.

#define BUFREADCOMMENT   (0x400)

Definition at line 405 of file unzip.c.

#define CASESENSITIVITYDEFAULT_NO

Definition at line 98 of file unzip.c.

#define CASESENSITIVITYDEFAULTVALUE   2

Definition at line 372 of file unzip.c.

#define local   static

Definition at line 91 of file unzip.c.

#define NOUNCRYPT

Definition at line 72 of file unzip.c.

#define SIZECENTRALDIRITEM   (0x2e)

Definition at line 118 of file unzip.c.

#define SIZEZIPLOCALHEADER   (0x1e)

Definition at line 119 of file unzip.c.

#define STRCMPCASENOSENTIVEFUNCTION   strcmpcasenosensitive_internal

Definition at line 378 of file unzip.c.

#define TRYFREE (   p)    {if (p) free(p);}

Definition at line 115 of file unzip.c.

#define UNZ_BUFSIZE   (16384)

Definition at line 104 of file unzip.c.

#define UNZ_MAXFILENAMEINZIP   (256)

Definition at line 108 of file unzip.c.

Function Documentation

static int unz64local_getByte OF ( ( const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream, int *pi)  )
static
static int unz64local_getShort OF ( ( const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream, uLong *pX)  )
static
static int unz64local_getLong64 OF ( ( const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream, ZPOS64_T *pX)  )
static
static ZPOS64_T unz64local_SearchCentralDir OF ( (const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream)  )
static
static ZPOS64_T unz64local_SearchCentralDir64 OF ( ( const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream)  )
static
static int unz64local_GetCurrentFileInfoInternal OF ( (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)  )
static
static int strcmpcasenosensitive_internal ( const char *  fileName1,
const char *  fileName2 
)
static

Definition at line 349 of file unzip.c.

static int unz64local_CheckCurrentFileCoherencyHeader ( unz64_s s,
uInt piSizeVar,
ZPOS64_T poffset_local_extrafield,
uInt psize_local_extrafield 
)
static

Definition at line 1385 of file unzip.c.

static void unz64local_DosDateToTmuDate ( ZPOS64_T  ulDosDate,
tm_unz ptm 
)
static

Definition at line 852 of file unzip.c.

static int unz64local_getByte ( const zlib_filefunc64_32_def pzlib_filefunc_def,
voidpf  filestream,
int *  pi 
)
static

Definition at line 212 of file unzip.c.

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 
)
static

Definition at line 879 of file unzip.c.

static int unz64local_getLong ( const zlib_filefunc64_32_def pzlib_filefunc_def,
voidpf  filestream,
uLong pX 
)
static

Definition at line 266 of file unzip.c.

static int unz64local_getLong64 ( const zlib_filefunc64_32_def pzlib_filefunc_def,
voidpf  filestream,
ZPOS64_T pX 
)
static

Definition at line 302 of file unzip.c.

static int unz64local_getShort ( const zlib_filefunc64_32_def pzlib_filefunc_def,
voidpf  filestream,
uLong pX 
)
static

Definition at line 239 of file unzip.c.

static ZPOS64_T unz64local_SearchCentralDir ( const zlib_filefunc64_32_def pzlib_filefunc_def,
voidpf  filestream 
)
static

Definition at line 413 of file unzip.c.

static ZPOS64_T unz64local_SearchCentralDir64 ( const zlib_filefunc64_32_def pzlib_filefunc_def,
voidpf  filestream 
)
static

Definition at line 478 of file unzip.c.

int ZEXPORT unzClose ( unzFile  file)

Definition at line 808 of file unzip.c.

int ZEXPORT unzCloseCurrentFile ( unzFile  file)

Definition at line 2004 of file unzip.c.

int ZEXPORT unzeof ( unzFile  file)

Definition at line 1924 of file unzip.c.

int ZEXPORT unzGetCurrentFileInfo ( unzFile  file,
unz_file_info pfile_info,
char *  szFileName,
uLong  fileNameBufferSize,
void *  extraField,
uLong  extraFieldBufferSize,
char *  szComment,
uLong  commentBufferSize 
)

Definition at line 1136 of file unzip.c.

int ZEXPORT unzGetCurrentFileInfo64 ( unzFile  file,
unz_file_info64 pfile_info,
char *  szFileName,
uLong  fileNameBufferSize,
void *  extraField,
uLong  extraFieldBufferSize,
char *  szComment,
uLong  commentBufferSize 
)

Definition at line 1124 of file unzip.c.

ZPOS64_T ZEXPORT unzGetCurrentFileZStreamPos64 ( unzFile  file)

Addition for GDAL : START

Definition at line 1658 of file unzip.c.

int ZEXPORT unzGetFilePos ( unzFile  file,
unz_file_pos file_pos 
)

Definition at line 1324 of file unzip.c.

int ZEXPORT unzGetFilePos64 ( unzFile  file,
unz64_file_pos file_pos 
)

Definition at line 1308 of file unzip.c.

int ZEXPORT unzGetGlobalComment ( unzFile  file,
char *  szComment,
uLong  uSizeBuf 
)

Definition at line 2051 of file unzip.c.

int ZEXPORT unzGetGlobalInfo ( unzFile  file,
unz_global_info pglobal_info32 
)

Definition at line 838 of file unzip.c.

int ZEXPORT unzGetGlobalInfo64 ( unzFile  file,
unz_global_info64 pglobal_info 
)

Definition at line 828 of file unzip.c.

int ZEXPORT unzGetLocalExtrafield ( unzFile  file,
voidp  buf,
unsigned  len 
)

Definition at line 1956 of file unzip.c.

uLong ZEXPORT unzGetOffset ( unzFile  file)

Definition at line 2094 of file unzip.c.

ZPOS64_T ZEXPORT unzGetOffset64 ( unzFile  file)

Definition at line 2079 of file unzip.c.

int ZEXPORT unzGoToFilePos ( unzFile  file,
unz_file_pos file_pos 
)

Definition at line 1360 of file unzip.c.

int ZEXPORT unzGoToFilePos64 ( unzFile  file,
const unz64_file_pos file_pos 
)

Definition at line 1338 of file unzip.c.

int ZEXPORT unzGoToFirstFile ( unzFile  file)

Definition at line 1178 of file unzip.c.

int ZEXPORT unzGoToNextFile ( unzFile  file)

Definition at line 1199 of file unzip.c.

int ZEXPORT unzLocateFile ( unzFile  file,
const char *  szFileName,
int  iCaseSensitivity 
)

Definition at line 1232 of file unzip.c.

unzFile ZEXPORT unzOpen ( const char *  path)

Definition at line 793 of file unzip.c.

unzFile ZEXPORT unzOpen2 ( const char *  path,
zlib_filefunc_def pzlib_filefunc32_def 
)

Definition at line 765 of file unzip.c.

unzFile ZEXPORT unzOpen2_64 ( const void *  path,
zlib_filefunc64_def pzlib_filefunc_def 
)

Definition at line 778 of file unzip.c.

unzFile ZEXPORT unzOpen64 ( const void *  path)

Definition at line 798 of file unzip.c.

int ZEXPORT unzOpenCurrentFile ( unzFile  file)

Definition at line 1641 of file unzip.c.

int ZEXPORT unzOpenCurrentFile2 ( unzFile  file,
int *  method,
int *  level,
int  raw 
)

Definition at line 1651 of file unzip.c.

int ZEXPORT unzOpenCurrentFile3 ( unzFile  file,
int *  method,
int *  level,
int  raw,
const char *  password 
)

Definition at line 1472 of file unzip.c.

int ZEXPORT unzOpenCurrentFilePassword ( unzFile  file,
const char *  password 
)

Definition at line 1646 of file unzip.c.

static unzFile unzOpenInternal ( const void *  path,
zlib_filefunc64_32_def pzlib_filefunc64_32_def,
int  is64bitOpenFunction 
)
static

Definition at line 584 of file unzip.c.

int ZEXPORT unzReadCurrentFile ( unzFile  file,
voidp  buf,
unsigned  len 
)

Addition for GDAL : END

Definition at line 1684 of file unzip.c.

int ZEXPORT unzSetOffset ( unzFile  file,
uLong  pos 
)

Definition at line 2122 of file unzip.c.

int ZEXPORT unzSetOffset64 ( unzFile  file,
ZPOS64_T  pos 
)

Definition at line 2104 of file unzip.c.

int ZEXPORT unzStringFileNameCompare ( const char *  fileName1,
const char *  fileName2,
int  iCaseSensitivity 
)

Definition at line 390 of file unzip.c.

z_off_t ZEXPORT unztell ( unzFile  file)

Definition at line 1889 of file unzip.c.

ZPOS64_T ZEXPORT unztell64 ( unzFile  file)

Definition at line 1904 of file unzip.c.

Variable Documentation

const char unz_copyright[]
Initial value:
=
" unzip 1.01 Copyright 1998-2004 Gilles Vollant - http://www.winimage.com/zLibDll"

Definition at line 122 of file unzip.c.