Visualization Library 2.0.0-b5

A lightweight C++ OpenGL middleware for 2D/3D graphics

VL     Star     Watch     Fork     Issue

[Download] [Tutorials] [All Classes] [Grouped Classes]
Macros | Typedefs | Functions | Variables
unzip.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "zlib.h"
#include "unzip.h"
#include <errno.h>

Go to the source code of this file.

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)
 

Typedefs

typedef struct unz_file_info64_internal_s unz_file_info64_internal
 

Functions

local int unz64local_getByte OF ((const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream, int *pi))
 
local int unz64local_getByte (const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream, int *pi)
 
local int unz64local_getShort OF ((const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream, uLong *pX))
 
local int unz64local_getShort (const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream, uLong *pX)
 
local int unz64local_getLong (const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream, uLong *pX)
 
local int unz64local_getLong64 OF ((const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream, ZPOS64_T *pX))
 
local int unz64local_getLong64 (const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream, ZPOS64_T *pX)
 
local int strcmpcasenosensitive_internal (const char *fileName1, const char *fileName2)
 
int ZEXPORT unzStringFileNameCompare (const char *fileName1, const char *fileName2, int iCaseSensitivity)
 
local ZPOS64_T unz64local_SearchCentralDir OF ((const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream))
 
local ZPOS64_T unz64local_SearchCentralDir (const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream)
 
local ZPOS64_T unz64local_SearchCentralDir64 (const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream)
 
local 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)
 
local void unz64local_DosDateToTmuDate (ZPOS64_T ulDosDate, tm_unz *ptm)
 
local 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))
 
local 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)
 
local 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)
 Addition for GDAL : START. More...
 
int ZEXPORT unzReadCurrentFile (unzFile file, voidp buf, unsigned len)
 Addition for GDAL : END. More...
 
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 []
 

Macro Definition Documentation

◆ ALLOC

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

◆ BUFREADCOMMENT

#define BUFREADCOMMENT   (0x400)

Definition at line 405 of file unzip.c.

Referenced by unz64local_SearchCentralDir(), and unz64local_SearchCentralDir64().

◆ CASESENSITIVITYDEFAULT_NO

#define CASESENSITIVITYDEFAULT_NO

Definition at line 98 of file unzip.c.

◆ CASESENSITIVITYDEFAULTVALUE

#define CASESENSITIVITYDEFAULTVALUE   2

Definition at line 372 of file unzip.c.

Referenced by unzStringFileNameCompare().

◆ local

#define local   static

◆ NOUNCRYPT

#define NOUNCRYPT

Definition at line 72 of file unzip.c.

◆ SIZECENTRALDIRITEM

#define SIZECENTRALDIRITEM   (0x2e)

Definition at line 118 of file unzip.c.

Referenced by unzGoToNextFile().

◆ SIZEZIPLOCALHEADER

#define SIZEZIPLOCALHEADER   (0x1e)

Definition at line 119 of file unzip.c.

Referenced by unz64local_CheckCurrentFileCoherencyHeader(), and unzOpenCurrentFile3().

◆ STRCMPCASENOSENTIVEFUNCTION

#define STRCMPCASENOSENTIVEFUNCTION   strcmpcasenosensitive_internal

Definition at line 378 of file unzip.c.

Referenced by unzStringFileNameCompare().

◆ TRYFREE

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

◆ UNZ_BUFSIZE

#define UNZ_BUFSIZE   (16384)

Definition at line 104 of file unzip.c.

Referenced by unzOpenCurrentFile3(), and unzReadCurrentFile().

◆ UNZ_MAXFILENAMEINZIP

#define UNZ_MAXFILENAMEINZIP   (256)

Definition at line 108 of file unzip.c.

Referenced by unzLocateFile().

Typedef Documentation

◆ unz_file_info64_internal

typedef struct unz_file_info64_internal_s unz_file_info64_internal

Function Documentation

◆ OF() [1/5]

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

◆ OF() [2/5]

local int unz64local_getShort OF ( (const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream, uLong *pX)  )

◆ OF() [3/5]

local int unz64local_getLong64 OF ( (const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream, ZPOS64_T *pX)  )

◆ OF() [4/5]

local ZPOS64_T unz64local_SearchCentralDir OF ( (const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream)  )

◆ OF() [5/5]

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

◆ strcmpcasenosensitive_internal()

local int strcmpcasenosensitive_internal ( const char *  fileName1,
const char *  fileName2 
)

Definition at line 349 of file unzip.c.

◆ unz64local_CheckCurrentFileCoherencyHeader()

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

◆ unz64local_DosDateToTmuDate()

local void unz64local_DosDateToTmuDate ( ZPOS64_T  ulDosDate,
tm_unz ptm 
)

◆ unz64local_getByte()

local int unz64local_getByte ( const zlib_filefunc64_32_def pzlib_filefunc_def,
voidpf  filestream,
int pi 
)

◆ unz64local_GetCurrentFileInfoInternal()

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

◆ unz64local_getLong()

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

◆ unz64local_getLong64()

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

◆ unz64local_getShort()

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

◆ unz64local_SearchCentralDir()

local ZPOS64_T unz64local_SearchCentralDir ( const zlib_filefunc64_32_def pzlib_filefunc_def,
voidpf  filestream 
)

◆ unz64local_SearchCentralDir64()

local ZPOS64_T unz64local_SearchCentralDir64 ( const zlib_filefunc64_32_def pzlib_filefunc_def,
voidpf  filestream 
)

◆ unzClose()

int ZEXPORT unzClose ( unzFile  file)

Definition at line 808 of file unzip.c.

References NULL, TRYFREE, UNZ_OK, UNZ_PARAMERROR, unzCloseCurrentFile(), and ZCLOSE64.

Referenced by main().

◆ unzCloseCurrentFile()

int ZEXPORT unzCloseCurrentFile ( unzFile  file)

◆ unzeof()

int ZEXPORT unzeof ( unzFile  file)

Definition at line 1924 of file unzip.c.

References NULL, and UNZ_PARAMERROR.

◆ unzGetCurrentFileInfo()

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

◆ unzGetCurrentFileInfo64()

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.

References NULL, and unz64local_GetCurrentFileInfoInternal().

Referenced by do_extract_currentfile(), do_list(), and unzLocateFile().

◆ unzGetCurrentFileZStreamPos64()

ZPOS64_T ZEXPORT unzGetCurrentFileZStreamPos64 ( unzFile  file)

Addition for GDAL : START.

Definition at line 1658 of file unzip.c.

References NULL.

◆ unzGetFilePos()

int ZEXPORT unzGetFilePos ( unzFile  file,
unz_file_pos file_pos 
)

◆ unzGetFilePos64()

int ZEXPORT unzGetFilePos64 ( unzFile  file,
unz64_file_pos file_pos 
)

◆ unzGetGlobalComment()

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

Definition at line 2051 of file unzip.c.

References NULL, UNZ_ERRNO, UNZ_PARAMERROR, ZLIB_FILEFUNC_SEEK_SET, ZREAD64, and ZSEEK64.

◆ unzGetGlobalInfo()

int ZEXPORT unzGetGlobalInfo ( unzFile  file,
unz_global_info pglobal_info32 
)

◆ unzGetGlobalInfo64()

int ZEXPORT unzGetGlobalInfo64 ( unzFile  file,
unz_global_info64 pglobal_info 
)

Definition at line 828 of file unzip.c.

References NULL, UNZ_OK, and UNZ_PARAMERROR.

Referenced by do_extract(), and do_list().

◆ unzGetLocalExtrafield()

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

Definition at line 1956 of file unzip.c.

References NULL, UNZ_ERRNO, UNZ_PARAMERROR, ZLIB_FILEFUNC_SEEK_SET, ZREAD64, and ZSEEK64.

◆ unzGetOffset()

uLong ZEXPORT unzGetOffset ( unzFile  file)

Definition at line 2094 of file unzip.c.

References NULL, and unzGetOffset64().

◆ unzGetOffset64()

ZPOS64_T ZEXPORT unzGetOffset64 ( unzFile  file)

Definition at line 2079 of file unzip.c.

References NULL.

Referenced by unzGetOffset().

◆ unzGoToFilePos()

int ZEXPORT unzGoToFilePos ( unzFile  file,
unz_file_pos file_pos 
)

◆ unzGoToFilePos64()

int ZEXPORT unzGoToFilePos64 ( unzFile  file,
const unz64_file_pos file_pos 
)

◆ unzGoToFirstFile()

int ZEXPORT unzGoToFirstFile ( unzFile  file)

Definition at line 1178 of file unzip.c.

References NULL, unz64local_GetCurrentFileInfoInternal(), UNZ_OK, and UNZ_PARAMERROR.

Referenced by unzLocateFile(), and unzOpenInternal().

◆ unzGoToNextFile()

int ZEXPORT unzGoToNextFile ( unzFile  file)

◆ unzLocateFile()

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

◆ unzOpen()

unzFile ZEXPORT unzOpen ( const char *  path)

Definition at line 793 of file unzip.c.

References NULL, and unzOpenInternal().

◆ unzOpen2()

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

Definition at line 765 of file unzip.c.

References fill_zlib_filefunc64_32_def_from_filefunc32(), NULL, and unzOpenInternal().

◆ unzOpen2_64()

unzFile ZEXPORT unzOpen2_64 ( const void path,
zlib_filefunc64_def pzlib_filefunc_def 
)

◆ unzOpen64()

unzFile ZEXPORT unzOpen64 ( const void path)

Definition at line 798 of file unzip.c.

References NULL, and unzOpenInternal().

Referenced by main().

◆ unzOpenCurrentFile()

int ZEXPORT unzOpenCurrentFile ( unzFile  file)

Definition at line 1641 of file unzip.c.

References NULL, and unzOpenCurrentFile3().

◆ unzOpenCurrentFile2()

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

Definition at line 1651 of file unzip.c.

References NULL, and unzOpenCurrentFile3().

◆ unzOpenCurrentFile3()

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

◆ unzOpenCurrentFilePassword()

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

Definition at line 1646 of file unzip.c.

References NULL, and unzOpenCurrentFile3().

Referenced by do_extract_currentfile().

◆ unzOpenInternal()

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

◆ unzReadCurrentFile()

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

◆ unzSetOffset()

int ZEXPORT unzSetOffset ( unzFile  file,
uLong  pos 
)

Definition at line 2122 of file unzip.c.

References unzSetOffset64().

◆ unzSetOffset64()

int ZEXPORT unzSetOffset64 ( unzFile  file,
ZPOS64_T  pos 
)

Definition at line 2104 of file unzip.c.

References NULL, unz64local_GetCurrentFileInfoInternal(), UNZ_OK, and UNZ_PARAMERROR.

Referenced by unzSetOffset().

◆ unzStringFileNameCompare()

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

Definition at line 390 of file unzip.c.

References CASESENSITIVITYDEFAULTVALUE, and STRCMPCASENOSENTIVEFUNCTION.

Referenced by unzLocateFile().

◆ unztell()

z_off_t ZEXPORT unztell ( unzFile  file)

Definition at line 1889 of file unzip.c.

References NULL, UNZ_PARAMERROR, and z_off_t.

◆ unztell64()

ZPOS64_T ZEXPORT unztell64 ( unzFile  file)

Definition at line 1904 of file unzip.c.

References NULL.

Variable Documentation

◆ unz_copyright

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.

Referenced by unzOpenInternal().