UFO: Alien Invasion
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
unzip.cpp File Reference
#include "unzip.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>

Go to the source code of this file.

Data Structures

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)   (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 (const zlib_filefunc_def *pzlib_filefunc_def, voidpf filestream, int *pi)
 
local int unzlocal_getShort (const zlib_filefunc_def *pzlib_filefunc_def, voidpf filestream, uLong *pX)
 
local int unzlocal_getLong (const zlib_filefunc_def *pzlib_filefunc_def, voidpf filestream, uLong *pX)
 
local int strcmpcasenosensitive_internal (const char *fileName1, const char *fileName2)
 
int ZEXPORT unzStringFileNameCompare (const char *fileName1, const char *fileName2, int iCaseSensitivity)
 
local uLong unzlocal_SearchCentralDir (const zlib_filefunc_def *pzlib_filefunc_def, voidpf filestream)
 
unzFile ZEXPORT unzOpen2 (const char *path, zlib_filefunc_def *pzlib_filefunc_def)
 
unzFile ZEXPORT unzOpen (const char *path)
 
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))
 Get info about the current file in the zipfile, with internal only info. More...
 
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)
 
int ZEXPORT unzSetCurrentFileInfoPosition (unzFile file, unsigned long pos)
 
int ZEXPORT unzGetCurrentFileInfoPosition (unzFile file, unsigned long *pos)
 

Variables

const char unz_copyright []
 

Macro Definition Documentation

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

Definition at line 72 of file unzip.cpp.

Referenced by unzlocal_SearchCentralDir(), unzOpen2(), and unzOpenCurrentFile3().

#define BUFREADCOMMENT   (0x400)

Definition at line 281 of file unzip.cpp.

Referenced by unzlocal_SearchCentralDir().

#define CASESENSITIVITYDEFAULT_NO

Definition at line 58 of file unzip.cpp.

#define CASESENSITIVITYDEFAULTVALUE   2

Definition at line 251 of file unzip.cpp.

Referenced by unzStringFileNameCompare().

#define local   static

Definition at line 51 of file unzip.cpp.

#define SIZECENTRALDIRITEM   (0x2e)

Definition at line 78 of file unzip.cpp.

Referenced by unzGoToNextFile().

#define SIZEZIPLOCALHEADER   (0x1e)

Definition at line 79 of file unzip.cpp.

Referenced by unzlocal_CheckCurrentFileCoherencyHeader(), and unzOpenCurrentFile3().

#define STRCMPCASENOSENTIVEFUNCTION   strcmpcasenosensitive_internal

Definition at line 257 of file unzip.cpp.

Referenced by unzStringFileNameCompare().

#define TRYFREE (   p)    (free(p))
#define UNZ_BUFSIZE   (16384)

Definition at line 64 of file unzip.cpp.

Referenced by unzOpenCurrentFile3(), and unzReadCurrentFile().

#define UNZ_MAXFILENAMEINZIP   (256)

Definition at line 68 of file unzip.cpp.

Referenced by unzLocateFile().

Typedef Documentation

Function Documentation

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

Get info about the current file in the zipfile, with internal only info.

Todo:
Describe parameters and the two headers.
local int strcmpcasenosensitive_internal ( const char *  fileName1,
const char *  fileName2 
)

Definition at line 228 of file unzip.cpp.

int ZEXPORT unzClose ( unzFile  file)
int ZEXPORT unzeof ( unzFile  file)
int ZEXPORT unzGetCurrentFileInfo ( unzFile  file,
unz_file_info pfile_info,
char *  szFileName,
uLong  fileNameBufferSize,
void extraField,
uLong  extraFieldBufferSize,
char *  szComment,
uLong  commentBufferSize 
)
int ZEXPORT unzGetCurrentFileInfoPosition ( unzFile  file,
unsigned long pos 
)

Definition at line 1450 of file unzip.cpp.

References unz_s::pos_in_central_dir, UNZ_OK, and UNZ_PARAMERROR.

Referenced by FS_LoadPackFile(), and FS_OpenFile().

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

Definition at line 475 of file unzip.cpp.

References unz_s::gi, UNZ_OK, and UNZ_PARAMERROR.

Referenced by FS_LoadPackFile().

local void unzlocal_DosDateToTmuDate ( uLong  ulDosDate,
tm_unz ptm 
)
local int unzlocal_getByte ( const zlib_filefunc_def pzlib_filefunc_def,
voidpf  filestream,
int pi 
)

Definition at line 160 of file unzip.cpp.

References int(), UNZ_EOF, UNZ_ERRNO, UNZ_OK, ZERROR, and ZREAD.

Referenced by unzlocal_getLong(), and unzlocal_getShort().

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

Definition at line 288 of file unzip.cpp.

References ALLOC, BUFREADCOMMENT, i, TRYFREE, uLong(), ZLIB_FILEFUNC_SEEK_END, ZLIB_FILEFUNC_SEEK_SET, ZREAD, ZSEEK, and ZTELL.

Referenced by unzOpen2().

unzFile ZEXPORT unzOpen ( const char *  path)

Definition at line 446 of file unzip.cpp.

References unzOpen2().

Referenced by FS_LoadPackFile().

int ZEXPORT unzOpenCurrentFile ( unzFile  file)

Definition at line 1064 of file unzip.cpp.

References unzOpenCurrentFile3().

Referenced by FS_OpenFile(), and FS_Seek().

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

Definition at line 1074 of file unzip.cpp.

References unzOpenCurrentFile3().

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

Definition at line 1069 of file unzip.cpp.

References unzOpenCurrentFile3().

int ZEXPORT unzSetCurrentFileInfoPosition ( unzFile  file,
unsigned long  pos 
)
int ZEXPORT unzStringFileNameCompare ( const char *  fileName1,
const char *  fileName2,
int  iCaseSensitivity 
)

Definition at line 269 of file unzip.cpp.

References CASESENSITIVITYDEFAULTVALUE, and STRCMPCASENOSENTIVEFUNCTION.

Referenced by unzLocateFile().

z_off_t ZEXPORT unztell ( unzFile  file)

Variable Documentation

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

Definition at line 84 of file unzip.cpp.

Referenced by unzOpen2().