UFO: Alien Invasion
Loading...
Searching...
No Matches
unzip.cpp File Reference
#include "unzip.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
Include dependency graph for unzip.cpp:

Go to the source code of this file.

Data Structures

struct  unz_file_info_internal
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)
#define TRYFREE(p)
#define SIZECENTRALDIRITEM   (0x2e)
#define SIZEZIPLOCALHEADER   (0x1e)
#define CASESENSITIVITYDEFAULTVALUE   2
#define STRCMPCASENOSENTIVEFUNCTION   strcmpcasenosensitive_internal
#define BUFREADCOMMENT   (0x400)

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

◆ ALLOC

#define ALLOC ( size)
Value:
(malloc(size))
voidpf void uLong size
Definition ioapi.h:42

Definition at line 72 of file unzip.cpp.

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

◆ BUFREADCOMMENT

#define BUFREADCOMMENT   (0x400)

Definition at line 281 of file unzip.cpp.

Referenced by unzlocal_SearchCentralDir().

◆ CASESENSITIVITYDEFAULT_NO

#define CASESENSITIVITYDEFAULT_NO

Definition at line 58 of file unzip.cpp.

◆ CASESENSITIVITYDEFAULTVALUE

#define CASESENSITIVITYDEFAULTVALUE   2

Definition at line 251 of file unzip.cpp.

Referenced by unzStringFileNameCompare().

◆ local

◆ SIZECENTRALDIRITEM

#define SIZECENTRALDIRITEM   (0x2e)

Definition at line 78 of file unzip.cpp.

Referenced by unzGoToNextFile().

◆ SIZEZIPLOCALHEADER

#define SIZEZIPLOCALHEADER   (0x1e)

Definition at line 79 of file unzip.cpp.

Referenced by unzlocal_CheckCurrentFileCoherencyHeader(), and unzOpenCurrentFile3().

◆ STRCMPCASENOSENTIVEFUNCTION

#define STRCMPCASENOSENTIVEFUNCTION   strcmpcasenosensitive_internal

Definition at line 257 of file unzip.cpp.

Referenced by unzStringFileNameCompare().

◆ TRYFREE

#define TRYFREE ( p)
Value:
(free(p))

Definition at line 75 of file unzip.cpp.

Referenced by unzClose(), unzCloseCurrentFile(), unzlocal_SearchCentralDir(), and unzOpenCurrentFile3().

◆ UNZ_BUFSIZE

#define UNZ_BUFSIZE   (16384)

Definition at line 64 of file unzip.cpp.

Referenced by unzOpenCurrentFile3(), and unzReadCurrentFile().

◆ UNZ_MAXFILENAMEINZIP

#define UNZ_MAXFILENAMEINZIP   (256)

Definition at line 68 of file unzip.cpp.

Referenced by unzLocateFile().

Function Documentation

◆ OF()

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.

References local, uLong(), and unzlocal_GetCurrentFileInfoInternal().

◆ strcmpcasenosensitive_internal()

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

Definition at line 228 of file unzip.cpp.

References local.

◆ unzClose()

int ZEXPORT unzClose ( unzFile file)

◆ unzCloseCurrentFile()

◆ unzeof()

int ZEXPORT unzeof ( unzFile file)

Definition at line 1258 of file unzip.cpp.

References unz_s::pfile_in_zip_read, file_in_zip_read_info_s::rest_read_uncompressed, and UNZ_PARAMERROR.

Referenced by OF().

◆ unzGetCurrentFileInfo()

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

◆ unzGetCurrentFileInfoPosition()

int ZEXPORT unzGetCurrentFileInfoPosition ( unzFile file,
unsigned long * pos )
extern

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

◆ unzGetFilePos()

◆ unzGetGlobalComment()

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

◆ unzGetGlobalInfo()

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(), and OF().

◆ unzGetLocalExtrafield()

◆ unzGetOffset()

◆ unzGoToFilePos()

◆ unzGoToFirstFile()

◆ unzGoToNextFile()

◆ unzlocal_CheckCurrentFileCoherencyHeader()

◆ unzlocal_DosDateToTmuDate()

local void unzlocal_DosDateToTmuDate ( uLong ulDosDate,
tm_unz * ptm )

◆ unzlocal_getByte()

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(), local, UNZ_EOF, UNZ_ERRNO, UNZ_OK, voidpf(), ZERROR, and ZREAD.

Referenced by unzlocal_getLong(), and unzlocal_getShort().

◆ unzlocal_GetCurrentFileInfoInternal()

◆ unzlocal_getLong()

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

◆ unzlocal_getShort()

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

◆ unzlocal_SearchCentralDir()

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, local, TRYFREE, uLong(), voidpf(), ZLIB_FILEFUNC_SEEK_END, ZLIB_FILEFUNC_SEEK_SET, ZREAD, ZSEEK, and ZTELL.

Referenced by unzOpen2().

◆ unzLocateFile()

◆ unzOpen()

unzFile ZEXPORT unzOpen ( const char * path)

Definition at line 446 of file unzip.cpp.

References unzOpen2().

Referenced by FS_LoadPackFile(), and OF().

◆ unzOpen2()

◆ unzOpenCurrentFile()

int ZEXPORT unzOpenCurrentFile ( unzFile file)

Definition at line 1064 of file unzip.cpp.

References unzOpenCurrentFile3().

Referenced by FS_OpenFile(), FS_Seek(), and OF().

◆ unzOpenCurrentFile2()

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

Definition at line 1074 of file unzip.cpp.

References level, and unzOpenCurrentFile3().

Referenced by OF().

◆ 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 1069 of file unzip.cpp.

References password, and unzOpenCurrentFile3().

Referenced by OF().

◆ unzReadCurrentFile()

◆ unzSetCurrentFileInfoPosition()

int ZEXPORT unzSetCurrentFileInfoPosition ( unzFile file,
unsigned long pos )
extern

◆ unzSetOffset()

◆ unzStringFileNameCompare()

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 OF(), and unzLocateFile().

◆ unztell()

z_off_t ZEXPORT unztell ( unzFile file)

Definition at line 1241 of file unzip.cpp.

References unz_s::pfile_in_zip_read, file_in_zip_read_info_s::stream, and UNZ_PARAMERROR.

Referenced by OF().

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 84 of file unzip.cpp.

Referenced by unzOpen2().