SimCenterCommon
Common functionality used within different SimCenter projects
unzip.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "zlib.h"
#include "unzip.h"
#include <errno.h>
#include "crypt.h"
Include dependency graph for unzip.c:

Go to the source code of this file.

Classes

struct  unz_file_info_internal_s
 
struct  file_in_zip_read_info_s
 
struct  unz_s
 

Macros

#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_info_internal_s unz_file_info_internal
 

Functions

local int unzlocal_getByte OF ((const zlib_filefunc_def *pzlib_filefunc_def, voidpf filestream, int *pi))
 
local int unzlocal_getByte (zlib_filefunc_def *pzlib_filefunc_def, voidpf filestream, int *pi) const
 
local int unzlocal_getShort OF ((const zlib_filefunc_def *pzlib_filefunc_def, voidpf filestream, uLong *pX))
 
local int unzlocal_getShort (zlib_filefunc_def *pzlib_filefunc_def, voidpf filestream, uLong *pX) const
 
local int unzlocal_getLong (zlib_filefunc_def *pzlib_filefunc_def, voidpf filestream, uLong *pX) const
 
local int strcmpcasenosensitive_internal (char *fileName1, const char *fileName2) const
 
int ZEXPORT unzStringFileNameCompare (char *fileName1, const char *fileName2, int iCaseSensitivity) const
 
local uLong unzlocal_SearchCentralDir OF ((const zlib_filefunc_def *pzlib_filefunc_def, voidpf filestream))
 
local uLong unzlocal_SearchCentralDir (zlib_filefunc_def *pzlib_filefunc_def, voidpf filestream) const
 
unzFile ZEXPORT unzOpen2 (char *path, zlib_filefunc_def *pzlib_filefunc_def) const
 
unzFile ZEXPORT unzOpen (char *path) const
 
int ZEXPORT unzClose (unzFile file)
 
int ZEXPORT unzGetGlobalInfo (unzFile file, unz_global_info *pglobal_info)
 
local void unzlocal_DosDateToTmuDate (uLong ulDosDate, tm_unz *ptm)
 
local int unzlocal_GetCurrentFileInfoInternal OF ((unzFile file, unz_file_info *pfile_info, unz_file_info_internal *pfile_info_internal, char *szFileName, uLong fileNameBufferSize, void *extraField, uLong extraFieldBufferSize, char *szComment, uLong commentBufferSize))
 
local int unzlocal_GetCurrentFileInfoInternal (unzFile file, unz_file_info *pfile_info, unz_file_info_internal *pfile_info_internal, 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 unzGetFilePos (unzFile file, unz_file_pos *file_pos)
 
int ZEXPORT unzGoToFilePos (unzFile file, unz_file_pos *file_pos)
 
local int unzlocal_CheckCurrentFileCoherencyHeader (unz_s *s, uInt *piSizeVar, uLong *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)
 
int ZEXPORT unzReadCurrentFile (unzFile file, voidp buf, unsigned len)
 
z_off_t ZEXPORT unztell (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)
 
uLong ZEXPORT unzGetOffset (unzFile file)
 
int ZEXPORT unzSetOffset (unzFile file, uLong pos)
 

Variables

const char unz_copyright []
 

Macro Definition Documentation

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

Definition at line 78 of file unzip.c.

#define BUFREADCOMMENT   (0x400)

Definition at line 320 of file unzip.c.

#define CASESENSITIVITYDEFAULT_NO

Definition at line 64 of file unzip.c.

#define CASESENSITIVITYDEFAULTVALUE   2

Definition at line 287 of file unzip.c.

#define local   static

Definition at line 57 of file unzip.c.

#define SIZECENTRALDIRITEM   (0x2e)

Definition at line 84 of file unzip.c.

#define SIZEZIPLOCALHEADER   (0x1e)

Definition at line 85 of file unzip.c.

#define STRCMPCASENOSENTIVEFUNCTION   strcmpcasenosensitive_internal

Definition at line 293 of file unzip.c.

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

Definition at line 81 of file unzip.c.

#define UNZ_BUFSIZE   (16384)

Definition at line 70 of file unzip.c.

#define UNZ_MAXFILENAMEINZIP   (256)

Definition at line 74 of file unzip.c.

Typedef Documentation

Function Documentation

local int unzlocal_getByte OF ( (const zlib_filefunc_def *pzlib_filefunc_def, voidpf filestream, int *pi)  )
local int ziplocal_getLong OF ( (const zlib_filefunc_def *pzlib_filefunc_def, voidpf filestream, uLong *pX)  )
local uLong unzlocal_SearchCentralDir OF ( (const zlib_filefunc_def *pzlib_filefunc_def, voidpf filestream)  )
local int unzlocal_GetCurrentFileInfoInternal OF ( (unzFile file, unz_file_info *pfile_info, unz_file_info_internal *pfile_info_internal, char *szFileName, uLong fileNameBufferSize, void *extraField, uLong extraFieldBufferSize, char *szComment, uLong commentBufferSize)  )
local int strcmpcasenosensitive_internal ( char*  fileName1,
const char*  fileName2 
) const

Definition at line 262 of file unzip.c.

int ZEXPORT unzClose ( unzFile  file)

Definition at line 511 of file unzip.c.

int ZEXPORT unzCloseCurrentFile ( unzFile  file)

Definition at line 1497 of file unzip.c.

int ZEXPORT unzeof ( unzFile  file)

Definition at line 1413 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 750 of file unzip.c.

int ZEXPORT unzGetFilePos ( unzFile  file,
unz_file_pos file_pos 
)

Definition at line 909 of file unzip.c.

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

Definition at line 1540 of file unzip.c.

int ZEXPORT unzGetGlobalInfo ( unzFile  file,
unz_global_info pglobal_info 
)

Definition at line 532 of file unzip.c.

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

Definition at line 1446 of file unzip.c.

uLong ZEXPORT unzGetOffset ( unzFile  file)

Definition at line 1571 of file unzip.c.

int ZEXPORT unzGoToFilePos ( unzFile  file,
unz_file_pos file_pos 
)

Definition at line 927 of file unzip.c.

int ZEXPORT unzGoToFirstFile ( unzFile  file)

Definition at line 774 of file unzip.c.

int ZEXPORT unzGoToNextFile ( unzFile  file)

Definition at line 796 of file unzip.c.

local int unzlocal_CheckCurrentFileCoherencyHeader ( unz_s s,
uInt*  piSizeVar,
uLong poffset_local_extrafield,
uInt *  psize_local_extrafield 
)

Definition at line 963 of file unzip.c.

local void unzlocal_DosDateToTmuDate ( uLong  ulDosDate,
tm_unz ptm 
)

Definition at line 548 of file unzip.c.

local int unzlocal_getByte ( zlib_filefunc_def pzlib_filefunc_def,
voidpf  filestream,
int pi 
) const

Definition at line 171 of file unzip.c.

local int unzlocal_GetCurrentFileInfoInternal ( unzFile  file,
unz_file_info pfile_info,
unz_file_info_internal pfile_info_internal,
char *  szFileName,
uLong  fileNameBufferSize,
void *  extraField,
uLong  extraFieldBufferSize,
char *  szComment,
uLong  commentBufferSize 
)

Definition at line 577 of file unzip.c.

local int unzlocal_getLong ( zlib_filefunc_def pzlib_filefunc_def,
voidpf  filestream,
uLong pX 
) const

Definition at line 229 of file unzip.c.

local int unzlocal_getShort ( zlib_filefunc_def pzlib_filefunc_def,
voidpf  filestream,
uLong pX 
) const

Definition at line 201 of file unzip.c.

local uLong unzlocal_SearchCentralDir ( zlib_filefunc_def pzlib_filefunc_def,
voidpf  filestream 
) const

Definition at line 331 of file unzip.c.

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

Definition at line 830 of file unzip.c.

unzFile ZEXPORT unzOpen ( char *  path) const

Definition at line 500 of file unzip.c.

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

Definition at line 397 of file unzip.c.

int ZEXPORT unzOpenCurrentFile ( unzFile  file)

Definition at line 1200 of file unzip.c.

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

Definition at line 1213 of file unzip.c.

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

Definition at line 1055 of file unzip.c.

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

Definition at line 1206 of file unzip.c.

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

Definition at line 1232 of file unzip.c.

int ZEXPORT unzSetOffset ( unzFile  file,
uLong  pos 
)

Definition at line 1587 of file unzip.c.

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

Definition at line 305 of file unzip.c.

z_off_t ZEXPORT unztell ( unzFile  file)

Definition at line 1393 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 90 of file unzip.c.