NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
unzip.cpp File Reference
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <tchar.h>
#include "unzip.h"
Include dependency graph for unzip.cpp:

Go to the source code of this file.

Classes

struct  tm_unz_s
 
struct  unz_global_info_s
 
struct  unz_file_info_s
 
struct  z_stream_s
 
struct  inflate_huft_s
 
struct  inflate_blocks_state
 
struct  inflate_codes_state
 
struct  internal_state
 
struct  unz_file_info_internal_s
 
struct  LUFILE
 
struct  file_in_zip_read_info_s
 
struct  unz_s
 
class  TUnzip
 
struct  TUnzipHandleData
 

Macros

#define ZIP_HANDLE   1
 
#define ZIP_FILENAME   2
 
#define ZIP_MEMORY   3
 
#define zmalloc(len)   malloc(len)
 
#define zfree(p)   free(p)
 
#define UNZ_OK   (0)
 
#define UNZ_END_OF_LIST_OF_FILE   (-100)
 
#define UNZ_ERRNO   (Z_ERRNO)
 
#define UNZ_EOF   (0)
 
#define UNZ_PARAMERROR   (-102)
 
#define UNZ_BADZIPFILE   (-103)
 
#define UNZ_INTERNALERROR   (-104)
 
#define UNZ_CRCERROR   (-105)
 
#define UNZ_PASSWORD   (-106)
 
#define ZLIB_VERSION   "1.1.3"
 
#define Z_NO_FLUSH   0
 
#define Z_SYNC_FLUSH   2
 
#define Z_FULL_FLUSH   3
 
#define Z_FINISH   4
 
#define Z_NO_COMPRESSION   0
 
#define Z_BEST_SPEED   1
 
#define Z_BEST_COMPRESSION   9
 
#define Z_DEFAULT_COMPRESSION   (-1)
 
#define Z_FILTERED   1
 
#define Z_HUFFMAN_ONLY   2
 
#define Z_DEFAULT_STRATEGY   0
 
#define Z_BINARY   0
 
#define Z_ASCII   1
 
#define Z_UNKNOWN   2
 
#define Z_DEFLATED   8
 
#define Z_NULL   0
 
#define CASE_SENSITIVE   1
 
#define CASE_INSENSITIVE   2
 
#define Z_OK   0
 
#define Z_STREAM_END   1
 
#define Z_NEED_DICT   2
 
#define Z_ERRNO   (-1)
 
#define Z_STREAM_ERROR   (-2)
 
#define Z_DATA_ERROR   (-3)
 
#define Z_MEM_ERROR   (-4)
 
#define Z_BUF_ERROR   (-5)
 
#define Z_VERSION_ERROR   (-6)
 
#define ERR_MSG(err)   z_errmsg[Z_NEED_DICT-(err)]
 
#define ERR_RETURN(strm, err)    return (strm->msg = (char*)ERR_MSG(err), (err))
 
#define STORED_BLOCK   0
 
#define STATIC_TREES   1
 
#define DYN_TREES   2
 
#define MIN_MATCH   3
 
#define MAX_MATCH   258
 
#define PRESET_DICT   0x20
 
#define OS_CODE   0x0b
 
#define zmemzero(dest, len)   memset(dest, 0, len)
 
#define LuAssert(cond, msg)
 
#define LuTrace(x)
 
#define LuTracev(x)
 
#define LuTracevv(x)
 
#define LuTracec(c, x)
 
#define LuTracecv(c, x)
 
#define ZALLOC(strm, items, size)    (*((strm)->zalloc))((strm)->opaque, (items), (size))
 
#define ZFREE(strm, addr)   (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
 
#define TRY_FREE(s, p)   {if (p) ZFREE(s, p);}
 
#define MANY   1440
 
#define UPDBITS   {s->bitb=b;s->bitk=k;}
 
#define UPDIN   {z->avail_in=n;z->total_in+=(uLong)(p-z->next_in);z->next_in=p;}
 
#define UPDOUT   {s->write=q;}
 
#define UPDATE   {UPDBITS UPDIN UPDOUT}
 
#define LEAVE   {UPDATE return inflate_flush(s,z,r);}
 
#define LOADIN   {p=z->next_in;n=z->avail_in;b=s->bitb;k=s->bitk;}
 
#define NEEDBYTE   {if(n)r=Z_OK;else LEAVE}
 
#define NEXTBYTE   (n--,*p++)
 
#define NEEDBITS(j)   {while(k<(j)){NEEDBYTE;b|=((uLong)NEXTBYTE)<<k;k+=8;}}
 
#define DUMPBITS(j)   {b>>=(j);k-=(j);}
 
#define WAVAIL   (uInt)(q<s->read?s->read-q-1:s->end-q)
 
#define LOADOUT   {q=s->write;m=(uInt)WAVAIL;m;}
 
#define WRAP   {if(q==s->end&&s->read!=s->window){q=s->window;m=(uInt)WAVAIL;}}
 
#define FLUSH   {UPDOUT r=inflate_flush(s,z,r); LOADOUT}
 
#define NEEDOUT   {if(m==0){WRAP if(m==0){FLUSH WRAP if(m==0) LEAVE}}r=Z_OK;}
 
#define OUTBYTE(a)   {*q++=(Byte)(a);m--;}
 
#define LOAD   {LOADIN LOADOUT}
 
#define exop   word.what.Exop
 
#define bits   word.what.Bits
 
#define BMAX   15
 
#define C0   *p++ = 0;
 
#define C2   C0 C0 C0 C0
 
#define C4   C2 C2 C2 C2
 
#define GRABBITS(j)   {while(k<(j)){b|=((uLong)NEXTBYTE)<<k;k+=8;}}
 
#define UNGRAB   {c=z->avail_in-n;c=(k>>3)<c?k>>3:c;n+=c;p-=c;k-=c<<3;}
 
#define CRC_DO1(buf)   crc = crc_table[((int)crc ^ (*buf++)) & 0xff] ^ (crc >> 8);
 
#define CRC_DO2(buf)   CRC_DO1(buf); CRC_DO1(buf);
 
#define CRC_DO4(buf)   CRC_DO2(buf); CRC_DO2(buf);
 
#define CRC_DO8(buf)   CRC_DO4(buf); CRC_DO4(buf);
 
#define CRC32(c, b)   (crc_table[((int)(c)^(b))&0xff]^((c)>>8))
 
#define BASE   65521L
 
#define NMAX   5552
 
#define AD_DO1(buf, i)   {s1 += buf[i]; s2 += s1;}
 
#define AD_DO2(buf, i)   AD_DO1(buf,i); AD_DO1(buf,i+1);
 
#define AD_DO4(buf, i)   AD_DO2(buf,i); AD_DO2(buf,i+2);
 
#define AD_DO8(buf, i)   AD_DO4(buf,i); AD_DO4(buf,i+4);
 
#define AD_DO16(buf)   AD_DO8(buf,0); AD_DO8(buf,8);
 
#define IM_NEEDBYTE   {if(z->avail_in==0)return r;r=f;}
 
#define IM_NEXTBYTE   (z->avail_in--,z->total_in++,*z->next_in++)
 
#define UNZ_BUFSIZE   (16384)
 
#define UNZ_MAXFILENAMEINZIP   (256)
 
#define SIZECENTRALDIRITEM   (0x2e)
 
#define SIZEZIPLOCALHEADER   (0x1e)
 
#define BUFREADCOMMENT   (0x400)
 

Typedefs

typedef struct tm_unz_s tm_unz
 
typedef struct unz_global_info_s unz_global_info
 
typedef struct unz_file_info_s unz_file_info
 
typedef unsigned char Byte
 
typedef unsigned int uInt
 
typedef unsigned long uLong
 
typedef void * voidpf
 
typedef void * voidp
 
typedef long z_off_t
 
typedef voidpf(* alloc_func) (voidpf opaque, uInt items, uInt size)
 
typedef void(* free_func) (voidpf opaque, voidpf address)
 
typedef struct z_stream_s z_stream
 
typedef z_streamz_streamp
 
typedef unsigned char uch
 
typedef uch uchf
 
typedef unsigned short ush
 
typedef ush ushf
 
typedef unsigned long ulg
 
typedef uLong(* check_func) (uLong check, const Byte *buf, uInt len)
 
typedef struct inflate_huft_s inflate_huft
 
typedef struct inflate_blocks_state inflate_blocks_statef
 
typedef struct inflate_codes_state inflate_codes_statef
 
typedef struct unz_file_info_internal_s unz_file_info_internal
 
typedef struct unz_sunzFile
 
typedef unsigned __int32 lutime_t
 

Enumerations

enum  inflate_block_mode {
  IBM_TYPE , IBM_LENS , IBM_STORED , IBM_TABLE ,
  IBM_BTREE , IBM_DTREE , IBM_CODES , IBM_DRY ,
  IBM_DONE , IBM_BAD
}
 
enum  inflate_codes_mode {
  START , LEN , LENEXT , DIST ,
  DISTEXT , COPY , LIT , WASH ,
  END , BADCODE
}
 
enum  inflate_mode {
  IM_METHOD , IM_FLAG , IM_DICT4 , IM_DICT3 ,
  IM_DICT2 , IM_DICT1 , IM_DICT0 , IM_BLOCKS ,
  IM_CHECK4 , IM_CHECK3 , IM_CHECK2 , IM_CHECK1 ,
  IM_DONE , IM_BAD
}
 

Functions

const char * zlibVersion ()
 
int inflate (z_streamp strm, int flush)
 
int inflateEnd (z_streamp strm)
 
int inflateSetDictionary (z_streamp strm, const Byte *dictionary, uInt dictLength)
 
int inflateSync (z_streamp strm)
 
int inflateReset (z_streamp strm)
 
uLong adler32 (uLong adler, const Byte *buf, uInt len)
 
uLong ucrc32 (uLong crc, const Byte *buf, uInt len)
 
const char * zError (int err)
 
int inflateSyncPoint (z_streamp z)
 
const uLongget_crc_table (void)
 
voidpf zcalloc (voidpf opaque, unsigned items, unsigned size)
 
void zcfree (voidpf opaque, voidpf ptr)
 
int inflate_trees_bits (uInt *, uInt *, inflate_huft **, inflate_huft *, z_streamp)
 
int inflate_trees_dynamic (uInt, uInt, uInt *, uInt *, uInt *, inflate_huft **, inflate_huft **, inflate_huft *, z_streamp)
 
int inflate_trees_fixed (uInt *, uInt *, const inflate_huft **, const inflate_huft **, z_streamp)
 
inflate_blocks_statefinflate_blocks_new (z_streamp z, check_func c, uInt w)
 
int inflate_blocks (inflate_blocks_statef *, z_streamp, int)
 
void inflate_blocks_reset (inflate_blocks_statef *, z_streamp, uLong *)
 
int inflate_blocks_free (inflate_blocks_statef *, z_streamp)
 
void inflate_set_dictionary (inflate_blocks_statef *s, const Byte *d, uInt n)
 
int inflate_blocks_sync_point (inflate_blocks_statef *s)
 
inflate_codes_statefinflate_codes_new (uInt, uInt, const inflate_huft *, const inflate_huft *, z_streamp)
 
int inflate_codes (inflate_blocks_statef *, z_streamp, int)
 
void inflate_codes_free (inflate_codes_statef *, z_streamp)
 
int inflate_flush (inflate_blocks_statef *, z_streamp, int)
 
int inflate_fast (uInt, uInt, const inflate_huft *, const inflate_huft *, inflate_blocks_statef *, z_streamp)
 
int huft_build (uInt *, uInt, uInt, const uInt *, const uInt *, inflate_huft **, uInt *, inflate_huft *, uInt *, uInt *)
 
void Uupdate_keys (unsigned long *keys, char c)
 
char Udecrypt_byte (unsigned long *keys)
 
char zdecode (unsigned long *keys, char c)
 
int inflateInit2 (z_streamp z)
 
LUFILElufopen (void *z, unsigned int len, DWORD flags, ZRESULT *err)
 
int lufclose (LUFILE *stream)
 
int luferror (LUFILE *stream)
 
long int luftell (LUFILE *stream)
 
int lufseek (LUFILE *stream, long offset, int whence)
 
size_t lufread (void *ptr, size_t size, size_t n, LUFILE *stream)
 
int unzStringFileNameCompare (const char *fileName1, const char *fileName2, int iCaseSensitivity)
 
z_off_t unztell (unzFile file)
 
int unzeof (unzFile file)
 
int unzGetLocalExtrafield (unzFile file, voidp buf, unsigned len)
 
int unzlocal_getByte (LUFILE *fin, int *pi)
 
int unzlocal_getShort (LUFILE *fin, uLong *pX)
 
int unzlocal_getLong (LUFILE *fin, uLong *pX)
 
int strcmpcasenosensitive_internal (const char *fileName1, const char *fileName2)
 
uLong unzlocal_SearchCentralDir (LUFILE *fin)
 
int unzGoToFirstFile (unzFile file)
 
int unzCloseCurrentFile (unzFile file)
 
unzFile unzOpenInternal (LUFILE *fin)
 
int unzClose (unzFile file)
 
int unzGetGlobalInfo (unzFile file, unz_global_info *pglobal_info)
 
void unzlocal_DosDateToTmuDate (uLong ulDosDate, tm_unz *ptm)
 
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 unzGetCurrentFileInfo (unzFile file, unz_file_info *pfile_info, char *szFileName, uLong fileNameBufferSize, void *extraField, uLong extraFieldBufferSize, char *szComment, uLong commentBufferSize)
 
int unzGoToNextFile (unzFile file)
 
int unzLocateFile (unzFile file, const char *szFileName, int iCaseSensitivity)
 
int unzlocal_CheckCurrentFileCoherencyHeader (unz_s *s, uInt *piSizeVar, uLong *poffset_local_extrafield, uInt *psize_local_extrafield)
 
int unzOpenCurrentFile (unzFile file, const char *password)
 
int unzReadCurrentFile (unzFile file, voidp buf, unsigned len, bool *reached_eof)
 
int unzGetGlobalComment (unzFile file, char *szComment, uLong uSizeBuf)
 
int unzReadCurrentFile (unzFile file, void *buf, unsigned len)
 
FILETIME timet2filetime (const lutime_t t)
 
FILETIME dosdatetime2filetime (WORD dosdate, WORD dostime)
 
void EnsureDirectory (const TCHAR *rootdir, const TCHAR *dir)
 
unsigned int FormatZipMessageU (ZRESULT code, TCHAR *buf, unsigned int len)
 
HZIP OpenZipInternal (void *z, unsigned int len, DWORD flags, const char *password)
 
HZIP OpenZipHandle (HANDLE h, const char *password)
 
HZIP OpenZip (const TCHAR *fn, const char *password)
 
HZIP OpenZip (void *z, unsigned int len, const char *password)
 
ZRESULT GetZipItem (HZIP hz, int index, ZIPENTRY *ze)
 
ZRESULT FindZipItem (HZIP hz, const TCHAR *name, bool ic, int *index, ZIPENTRY *ze)
 
ZRESULT UnzipItemInternal (HZIP hz, int index, void *dst, unsigned int len, DWORD flags)
 
ZRESULT UnzipItemHandle (HZIP hz, int index, HANDLE h)
 
ZRESULT UnzipItem (HZIP hz, int index, const TCHAR *fn)
 
ZRESULT UnzipItem (HZIP hz, int index, void *z, unsigned int len)
 
ZRESULT SetUnzipBaseDir (HZIP hz, const TCHAR *dir)
 
ZRESULT CloseZipU (HZIP hz)
 
bool IsZipHandleU (HZIP hz)
 

Variables

const char *const z_errmsg [10]
 
const uInt inflate_mask [17]
 
const uInt fixed_bl = 9
 
const uInt fixed_bd = 5
 
const inflate_huft fixed_tl []
 
const inflate_huft fixed_td []
 
const uInt border []
 
const char unzip_inflate_copyright []
 
const uInt cplens [31]
 
const uInt cplext [31]
 
const uInt cpdist [30]
 
const uInt cpdext [30]
 
const uLong crc_table [256]
 
const char unz_copyright [] = " unzip 0.15 Copyright 1998 Gilles Vollant "
 
ZRESULT lasterrorU = ZR_OK
 

Macro Definition Documentation

◆ AD_DO1

#define AD_DO1 (   buf,
 
)    {s1 += buf[i]; s2 += s1;}

Definition at line 2336 of file unzip.cpp.

◆ AD_DO16

#define AD_DO16 (   buf)    AD_DO8(buf,0); AD_DO8(buf,8);

Definition at line 2340 of file unzip.cpp.

◆ AD_DO2

#define AD_DO2 (   buf,
 
)    AD_DO1(buf,i); AD_DO1(buf,i+1);

Definition at line 2337 of file unzip.cpp.

◆ AD_DO4

#define AD_DO4 (   buf,
 
)    AD_DO2(buf,i); AD_DO2(buf,i+2);

Definition at line 2338 of file unzip.cpp.

◆ AD_DO8

#define AD_DO8 (   buf,
 
)    AD_DO4(buf,i); AD_DO4(buf,i+4);

Definition at line 2339 of file unzip.cpp.

◆ BASE

#define BASE   65521L

Definition at line 2332 of file unzip.cpp.

◆ bits

#define bits   word.what.Bits

Definition at line 990 of file unzip.cpp.

◆ BMAX

#define BMAX   15

Definition at line 1688 of file unzip.cpp.

◆ BUFREADCOMMENT

#define BUFREADCOMMENT   (0x400)

Definition at line 3066 of file unzip.cpp.

◆ C0

#define C0   *p++ = 0;

◆ C2

#define C2   C0 C0 C0 C0

◆ C4

#define C4   C2 C2 C2 C2

◆ CASE_INSENSITIVE

#define CASE_INSENSITIVE   2

Definition at line 200 of file unzip.cpp.

◆ CASE_SENSITIVE

#define CASE_SENSITIVE   1

Definition at line 199 of file unzip.cpp.

◆ CRC32

#define CRC32 (   c,
 
)    (crc_table[((int)(c)^(b))&0xff]^((c)>>8))

Definition at line 2303 of file unzip.cpp.

◆ CRC_DO1

#define CRC_DO1 (   buf)    crc = crc_table[((int)crc ^ (*buf++)) & 0xff] ^ (crc >> 8);

Definition at line 2276 of file unzip.cpp.

◆ CRC_DO2

#define CRC_DO2 (   buf)    CRC_DO1(buf); CRC_DO1(buf);

Definition at line 2277 of file unzip.cpp.

◆ CRC_DO4

#define CRC_DO4 (   buf)    CRC_DO2(buf); CRC_DO2(buf);

Definition at line 2278 of file unzip.cpp.

◆ CRC_DO8

#define CRC_DO8 (   buf)    CRC_DO4(buf); CRC_DO4(buf);

Definition at line 2279 of file unzip.cpp.

◆ DUMPBITS

#define DUMPBITS (   j)    {b>>=(j);k-=(j);}

Definition at line 731 of file unzip.cpp.

◆ DYN_TREES

#define DYN_TREES   2

Definition at line 509 of file unzip.cpp.

◆ ERR_MSG

#define ERR_MSG (   err)    z_errmsg[Z_NEED_DICT-(err)]

Definition at line 498 of file unzip.cpp.

◆ ERR_RETURN

#define ERR_RETURN (   strm,
  err 
)     return (strm->msg = (char*)ERR_MSG(err), (err))

Definition at line 500 of file unzip.cpp.

◆ exop

#define exop   word.what.Exop

Definition at line 989 of file unzip.cpp.

◆ FLUSH

#define FLUSH   {UPDOUT r=inflate_flush(s,z,r); LOADOUT}

Definition at line 736 of file unzip.cpp.

◆ GRABBITS

#define GRABBITS (   j)    {while(k<(j)){b|=((uLong)NEXTBYTE)<<k;k+=8;}}

Definition at line 2015 of file unzip.cpp.

◆ IM_NEEDBYTE

#define IM_NEEDBYTE   {if(z->avail_in==0)return r;r=f;}

Definition at line 2567 of file unzip.cpp.

◆ IM_NEXTBYTE

#define IM_NEXTBYTE   (z->avail_in--,z->total_in++,*z->next_in++)

Definition at line 2568 of file unzip.cpp.

◆ LEAVE

#define LEAVE   {UPDATE return inflate_flush(s,z,r);}

Definition at line 725 of file unzip.cpp.

◆ LOAD

#define LOAD   {LOADIN LOADOUT}

Definition at line 740 of file unzip.cpp.

◆ LOADIN

#define LOADIN   {p=z->next_in;n=z->avail_in;b=s->bitb;k=s->bitk;}

Definition at line 727 of file unzip.cpp.

◆ LOADOUT

#define LOADOUT   {q=s->write;m=(uInt)WAVAIL;m;}

Definition at line 734 of file unzip.cpp.

◆ LuAssert

#define LuAssert (   cond,
  msg 
)

Definition at line 529 of file unzip.cpp.

◆ LuTrace

#define LuTrace (   x)

Definition at line 530 of file unzip.cpp.

◆ LuTracec

#define LuTracec (   c,
 
)

Definition at line 533 of file unzip.cpp.

◆ LuTracecv

#define LuTracecv (   c,
 
)

Definition at line 534 of file unzip.cpp.

◆ LuTracev

#define LuTracev (   x)

Definition at line 531 of file unzip.cpp.

◆ LuTracevv

#define LuTracevv (   x)

Definition at line 532 of file unzip.cpp.

◆ MANY

#define MANY   1440

Definition at line 579 of file unzip.cpp.

◆ MAX_MATCH

#define MAX_MATCH   258

Definition at line 513 of file unzip.cpp.

◆ MIN_MATCH

#define MIN_MATCH   3

Definition at line 512 of file unzip.cpp.

◆ NEEDBITS

#define NEEDBITS (   j)    {while(k<(j)){NEEDBYTE;b|=((uLong)NEXTBYTE)<<k;k+=8;}}

Definition at line 730 of file unzip.cpp.

◆ NEEDBYTE

#define NEEDBYTE   {if(n)r=Z_OK;else LEAVE}

Definition at line 728 of file unzip.cpp.

◆ NEEDOUT

#define NEEDOUT   {if(m==0){WRAP if(m==0){FLUSH WRAP if(m==0) LEAVE}}r=Z_OK;}

Definition at line 737 of file unzip.cpp.

◆ NEXTBYTE

#define NEXTBYTE   (n--,*p++)

Definition at line 729 of file unzip.cpp.

◆ NMAX

#define NMAX   5552

Definition at line 2333 of file unzip.cpp.

◆ OS_CODE

#define OS_CODE   0x0b

Definition at line 520 of file unzip.cpp.

◆ OUTBYTE

#define OUTBYTE (   a)    {*q++=(Byte)(a);m--;}

Definition at line 738 of file unzip.cpp.

◆ PRESET_DICT

#define PRESET_DICT   0x20

Definition at line 516 of file unzip.cpp.

◆ SIZECENTRALDIRITEM

#define SIZECENTRALDIRITEM   (0x2e)

Definition at line 2709 of file unzip.cpp.

◆ SIZEZIPLOCALHEADER

#define SIZEZIPLOCALHEADER   (0x1e)

Definition at line 2710 of file unzip.cpp.

◆ STATIC_TREES

#define STATIC_TREES   1

Definition at line 508 of file unzip.cpp.

◆ STORED_BLOCK

#define STORED_BLOCK   0

Definition at line 507 of file unzip.cpp.

◆ TRY_FREE

#define TRY_FREE (   s,
 
)    {if (p) ZFREE(s, p);}

Definition at line 549 of file unzip.cpp.

◆ UNGRAB

#define UNGRAB   {c=z->avail_in-n;c=(k>>3)<c?k>>3:c;n+=c;p-=c;k-=c<<3;}

Definition at line 2016 of file unzip.cpp.

◆ UNZ_BADZIPFILE

#define UNZ_BADZIPFILE   (-103)

Definition at line 155 of file unzip.cpp.

◆ UNZ_BUFSIZE

#define UNZ_BUFSIZE   (16384)

Definition at line 2707 of file unzip.cpp.

◆ UNZ_CRCERROR

#define UNZ_CRCERROR   (-105)

Definition at line 157 of file unzip.cpp.

◆ UNZ_END_OF_LIST_OF_FILE

#define UNZ_END_OF_LIST_OF_FILE   (-100)

Definition at line 151 of file unzip.cpp.

◆ UNZ_EOF

#define UNZ_EOF   (0)

Definition at line 153 of file unzip.cpp.

◆ UNZ_ERRNO

#define UNZ_ERRNO   (Z_ERRNO)

Definition at line 152 of file unzip.cpp.

◆ UNZ_INTERNALERROR

#define UNZ_INTERNALERROR   (-104)

Definition at line 156 of file unzip.cpp.

◆ UNZ_MAXFILENAMEINZIP

#define UNZ_MAXFILENAMEINZIP   (256)

Definition at line 2708 of file unzip.cpp.

◆ UNZ_OK

#define UNZ_OK   (0)

Definition at line 150 of file unzip.cpp.

◆ UNZ_PARAMERROR

#define UNZ_PARAMERROR   (-102)

Definition at line 154 of file unzip.cpp.

◆ UNZ_PASSWORD

#define UNZ_PASSWORD   (-106)

Definition at line 158 of file unzip.cpp.

◆ UPDATE

#define UPDATE   {UPDBITS UPDIN UPDOUT}

Definition at line 724 of file unzip.cpp.

◆ UPDBITS

#define UPDBITS   {s->bitb=b;s->bitk=k;}

Definition at line 721 of file unzip.cpp.

◆ UPDIN

#define UPDIN   {z->avail_in=n;z->total_in+=(uLong)(p-z->next_in);z->next_in=p;}

Definition at line 722 of file unzip.cpp.

◆ UPDOUT

#define UPDOUT   {s->write=q;}

Definition at line 723 of file unzip.cpp.

◆ WAVAIL

#define WAVAIL   (uInt)(q<s->read?s->read-q-1:s->end-q)

Definition at line 733 of file unzip.cpp.

◆ WRAP

#define WRAP   {if(q==s->end&&s->read!=s->window){q=s->window;m=(uInt)WAVAIL;}}

Definition at line 735 of file unzip.cpp.

◆ Z_ASCII

#define Z_ASCII   1

Definition at line 189 of file unzip.cpp.

◆ Z_BEST_COMPRESSION

#define Z_BEST_COMPRESSION   9

Definition at line 179 of file unzip.cpp.

◆ Z_BEST_SPEED

#define Z_BEST_SPEED   1

Definition at line 178 of file unzip.cpp.

◆ Z_BINARY

#define Z_BINARY   0

Definition at line 188 of file unzip.cpp.

◆ Z_BUF_ERROR

#define Z_BUF_ERROR   (-5)

Definition at line 212 of file unzip.cpp.

◆ Z_DATA_ERROR

#define Z_DATA_ERROR   (-3)

Definition at line 210 of file unzip.cpp.

◆ Z_DEFAULT_COMPRESSION

#define Z_DEFAULT_COMPRESSION   (-1)

Definition at line 180 of file unzip.cpp.

◆ Z_DEFAULT_STRATEGY

#define Z_DEFAULT_STRATEGY   0

Definition at line 185 of file unzip.cpp.

◆ Z_DEFLATED

#define Z_DEFLATED   8

Definition at line 193 of file unzip.cpp.

◆ Z_ERRNO

#define Z_ERRNO   (-1)

Definition at line 208 of file unzip.cpp.

◆ Z_FILTERED

#define Z_FILTERED   1

Definition at line 183 of file unzip.cpp.

◆ Z_FINISH

#define Z_FINISH   4

Definition at line 173 of file unzip.cpp.

◆ Z_FULL_FLUSH

#define Z_FULL_FLUSH   3

Definition at line 172 of file unzip.cpp.

◆ Z_HUFFMAN_ONLY

#define Z_HUFFMAN_ONLY   2

Definition at line 184 of file unzip.cpp.

◆ Z_MEM_ERROR

#define Z_MEM_ERROR   (-4)

Definition at line 211 of file unzip.cpp.

◆ Z_NEED_DICT

#define Z_NEED_DICT   2

Definition at line 207 of file unzip.cpp.

◆ Z_NO_COMPRESSION

#define Z_NO_COMPRESSION   0

Definition at line 177 of file unzip.cpp.

◆ Z_NO_FLUSH

#define Z_NO_FLUSH   0

Definition at line 170 of file unzip.cpp.

◆ Z_NULL

#define Z_NULL   0

Definition at line 196 of file unzip.cpp.

◆ Z_OK

#define Z_OK   0

Definition at line 205 of file unzip.cpp.

◆ Z_STREAM_END

#define Z_STREAM_END   1

Definition at line 206 of file unzip.cpp.

◆ Z_STREAM_ERROR

#define Z_STREAM_ERROR   (-2)

Definition at line 209 of file unzip.cpp.

◆ Z_SYNC_FLUSH

#define Z_SYNC_FLUSH   2

Definition at line 171 of file unzip.cpp.

◆ Z_UNKNOWN

#define Z_UNKNOWN   2

Definition at line 190 of file unzip.cpp.

◆ Z_VERSION_ERROR

#define Z_VERSION_ERROR   (-6)

Definition at line 213 of file unzip.cpp.

◆ ZALLOC

#define ZALLOC (   strm,
  items,
  size 
)     (*((strm)->zalloc))((strm)->opaque, (items), (size))

Definition at line 541 of file unzip.cpp.

◆ zfree

#define zfree (   p)    free(p)

Definition at line 77 of file unzip.cpp.

◆ ZFREE

#define ZFREE (   strm,
  addr 
)    (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))

Definition at line 543 of file unzip.cpp.

◆ ZIP_FILENAME

#define ZIP_FILENAME   2

Definition at line 71 of file unzip.cpp.

◆ ZIP_HANDLE

#define ZIP_HANDLE   1

Definition at line 70 of file unzip.cpp.

◆ ZIP_MEMORY

#define ZIP_MEMORY   3

Definition at line 72 of file unzip.cpp.

◆ ZLIB_VERSION

#define ZLIB_VERSION   "1.1.3"

Definition at line 166 of file unzip.cpp.

◆ zmalloc

#define zmalloc (   len)    malloc(len)

Definition at line 75 of file unzip.cpp.

◆ zmemzero

#define zmemzero (   dest,
  len 
)    memset(dest, 0, len)

Definition at line 526 of file unzip.cpp.

Typedef Documentation

◆ alloc_func

typedef voidpf(* alloc_func) (voidpf opaque, uInt items, uInt size)

Definition at line 236 of file unzip.cpp.

◆ Byte

typedef unsigned char Byte

Definition at line 218 of file unzip.cpp.

◆ check_func

typedef uLong(* check_func) (uLong check, const Byte *buf, uInt len)

Definition at line 537 of file unzip.cpp.

◆ free_func

typedef void(* free_func) (voidpf opaque, voidpf address)

Definition at line 237 of file unzip.cpp.

◆ inflate_blocks_statef

Definition at line 611 of file unzip.cpp.

◆ inflate_codes_statef

Definition at line 644 of file unzip.cpp.

◆ inflate_huft

typedef struct inflate_huft_s inflate_huft

Definition at line 558 of file unzip.cpp.

◆ lutime_t

typedef unsigned __int32 lutime_t

Definition at line 4001 of file unzip.cpp.

◆ tm_unz

typedef struct tm_unz_s tm_unz

◆ uch

typedef unsigned char uch

Definition at line 475 of file unzip.cpp.

◆ uchf

typedef uch uchf

Definition at line 476 of file unzip.cpp.

◆ uInt

typedef unsigned int uInt

Definition at line 219 of file unzip.cpp.

◆ ulg

typedef unsigned long ulg

Definition at line 479 of file unzip.cpp.

◆ uLong

typedef unsigned long uLong

Definition at line 220 of file unzip.cpp.

◆ unz_file_info

◆ unz_file_info_internal

◆ unz_global_info

◆ unzFile

typedef struct unz_s * unzFile

◆ ush

typedef unsigned short ush

Definition at line 477 of file unzip.cpp.

◆ ushf

typedef ush ushf

Definition at line 478 of file unzip.cpp.

◆ voidp

typedef void* voidp

Definition at line 222 of file unzip.cpp.

◆ voidpf

typedef void* voidpf

Definition at line 221 of file unzip.cpp.

◆ z_off_t

typedef long z_off_t

Definition at line 223 of file unzip.cpp.

◆ z_stream

typedef struct z_stream_s z_stream

◆ z_streamp

typedef z_stream* z_streamp

Definition at line 263 of file unzip.cpp.

Enumeration Type Documentation

◆ inflate_block_mode

Enumerator
IBM_TYPE 
IBM_LENS 
IBM_STORED 
IBM_TABLE 
IBM_BTREE 
IBM_DTREE 
IBM_CODES 
IBM_DRY 
IBM_DONE 
IBM_BAD 

Definition at line 663 of file unzip.cpp.

◆ inflate_codes_mode

Enumerator
START 
LEN 
LENEXT 
DIST 
DISTEXT 
COPY 
LIT 
WASH 
END 
BADCODE 

Definition at line 992 of file unzip.cpp.

◆ inflate_mode

Enumerator
IM_METHOD 
IM_FLAG 
IM_DICT4 
IM_DICT3 
IM_DICT2 
IM_DICT1 
IM_DICT0 
IM_BLOCKS 
IM_CHECK4 
IM_CHECK3 
IM_CHECK2 
IM_CHECK1 
IM_DONE 
IM_BAD 

Definition at line 2426 of file unzip.cpp.

Function Documentation

◆ adler32()

uLong adler32 ( uLong  adler,
const Byte buf,
uInt  len 
)

Definition at line 2343 of file unzip.cpp.

References AD_DO16, BASE, NMAX, and Z_NULL.

Referenced by inflateInit2().

◆ CloseZipU()

ZRESULT CloseZipU ( HZIP  hz)

Definition at line 4752 of file unzip.cpp.

References TUnzip::Close(), TUnzipHandleData::flag, lasterrorU, TUnzipHandleData::unz, ZR_ARGS, and ZR_ZMODE.

Here is the call graph for this function:

◆ dosdatetime2filetime()

FILETIME dosdatetime2filetime ( WORD  dosdate,
WORD  dostime 
)

Definition at line 4012 of file unzip.cpp.

Referenced by TUnzip::Get().

◆ EnsureDirectory()

void EnsureDirectory ( const TCHAR *  rootdir,
const TCHAR *  dir 
)

Definition at line 4343 of file unzip.cpp.

References EnsureDirectory(), and name.

Referenced by EnsureDirectory(), and TUnzip::Unzip().

Here is the call graph for this function:

◆ FindZipItem()

ZRESULT FindZipItem ( HZIP  hz,
const TCHAR *  name,
bool  ic,
int *  index,
ZIPENTRY ze 
)

Definition at line 4685 of file unzip.cpp.

References TUnzip::Find(), TUnzipHandleData::flag, lasterrorU, name, TUnzipHandleData::unz, ZR_ARGS, and ZR_ZMODE.

Referenced by Zipfile::getZipItem().

Here is the call graph for this function:

◆ FormatZipMessageU()

unsigned int FormatZipMessageU ( ZRESULT  code,
TCHAR *  buf,
unsigned int  len 
)

◆ get_crc_table()

const uLong * get_crc_table ( void  )

Definition at line 2271 of file unzip.cpp.

References crc_table.

◆ GetZipItem()

ZRESULT GetZipItem ( HZIP  hz,
int  index,
ZIPENTRY ze 
)

Definition at line 4664 of file unzip.cpp.

References TUnzipHandleData::flag, TUnzip::Get(), ZIPENTRY::index, lasterrorU, ZIPENTRY::name, ZIPENTRY::unc_size, TUnzipHandleData::unz, ZR_ARGS, and ZR_ZMODE.

Referenced by Zipfile::getZipContent().

Here is the call graph for this function:

◆ huft_build()

int huft_build ( uInt b,
uInt  n,
uInt  s,
const uInt d,
const uInt e,
inflate_huft **  t,
uInt m,
inflate_huft hp,
uInt hn,
uInt v 
)

Definition at line 1690 of file unzip.cpp.

References inflate_huft_s::base, BMAX, C4, MANY, Z_BUF_ERROR, Z_DATA_ERROR, Z_NULL, and Z_OK.

Referenced by inflate_trees_bits(), and inflate_trees_dynamic().

◆ inflate()

◆ inflate_blocks()

◆ inflate_blocks_free()

int inflate_blocks_free ( inflate_blocks_statef s,
z_streamp  z 
)

Definition at line 1589 of file unzip.cpp.

References inflate_blocks_state::hufts, inflate_blocks_reset(), LuTracev, inflate_blocks_state::window, Z_NULL, Z_OK, and ZFREE.

Referenced by inflateEnd().

Here is the call graph for this function:

◆ inflate_blocks_new()

inflate_blocks_statef * inflate_blocks_new ( z_streamp  z,
check_func  c,
uInt  w 
)

Definition at line 1305 of file unzip.cpp.

References inflate_blocks_state::checkfn, inflate_blocks_state::end, inflate_blocks_state::hufts, IBM_TYPE, inflate_blocks_reset(), LuTracev, MANY, inflate_blocks_state::mode, inflate_blocks_state::window, Z_NULL, ZALLOC, and ZFREE.

Referenced by inflateInit2().

Here is the call graph for this function:

◆ inflate_blocks_reset()

◆ inflate_blocks_sync_point()

int inflate_blocks_sync_point ( inflate_blocks_statef s)

◆ inflate_codes()

◆ inflate_codes_free()

void inflate_codes_free ( inflate_codes_statef c,
z_streamp  z 
)

Definition at line 1221 of file unzip.cpp.

References LuTracev, and ZFREE.

Referenced by inflate_blocks(), and inflate_blocks_reset().

◆ inflate_codes_new()

◆ inflate_fast()

◆ inflate_flush()

◆ inflate_set_dictionary()

void inflate_set_dictionary ( inflate_blocks_statef s,
const Byte d,
uInt  n 
)

◆ inflate_trees_bits()

int inflate_trees_bits ( uInt c,
uInt bb,
inflate_huft **  tb,
inflate_huft hp,
z_streamp  z 
)

Definition at line 1900 of file unzip.cpp.

References huft_build(), z_stream_s::msg, Z_BUF_ERROR, Z_DATA_ERROR, Z_MEM_ERROR, Z_NULL, ZALLOC, and ZFREE.

Referenced by inflate_blocks().

Here is the call graph for this function:

◆ inflate_trees_dynamic()

int inflate_trees_dynamic ( uInt  nl,
uInt  nd,
uInt c,
uInt bl,
uInt bd,
inflate_huft **  tl,
inflate_huft **  td,
inflate_huft hp,
z_streamp  z 
)

Definition at line 1927 of file unzip.cpp.

References cpdext, cpdist, cplens, cplext, huft_build(), z_stream_s::msg, Z_BUF_ERROR, Z_DATA_ERROR, Z_MEM_ERROR, Z_NULL, Z_OK, ZALLOC, and ZFREE.

Referenced by inflate_blocks().

Here is the call graph for this function:

◆ inflate_trees_fixed()

int inflate_trees_fixed ( uInt bl,
uInt bd,
const inflate_huft **  tl,
const inflate_huft **  td,
z_streamp   
)

Definition at line 1990 of file unzip.cpp.

References fixed_bd, fixed_bl, fixed_td, fixed_tl, and Z_OK.

Referenced by inflate_blocks().

◆ inflateEnd()

int inflateEnd ( z_streamp  strm)

Definition at line 2484 of file unzip.cpp.

References internal_state::blocks, inflate_blocks_free(), LuTracev, z_stream_s::state, Z_NULL, Z_OK, Z_STREAM_ERROR, z_stream_s::zfree, and ZFREE.

Referenced by inflateInit2(), and unzCloseCurrentFile().

Here is the call graph for this function:

◆ inflateInit2()

int inflateInit2 ( z_streamp  z)

Definition at line 2497 of file unzip.cpp.

References adler32(), internal_state::blocks, inflate_blocks_new(), inflateEnd(), inflateReset(), LuTracev, z_stream_s::msg, internal_state::nowrap, z_stream_s::opaque, z_stream_s::state, dtl::version, internal_state::wbits, Z_MEM_ERROR, Z_NULL, Z_OK, Z_STREAM_ERROR, Z_VERSION_ERROR, z_stream_s::zalloc, ZALLOC, zcalloc(), zcfree(), z_stream_s::zfree, and ZLIB_VERSION.

Referenced by unzOpenCurrentFile().

Here is the call graph for this function:

◆ inflateReset()

int inflateReset ( z_streamp  strm)

Definition at line 2472 of file unzip.cpp.

References internal_state::blocks, IM_BLOCKS, IM_METHOD, inflate_blocks_reset(), LuTracev, internal_state::mode, z_stream_s::msg, internal_state::nowrap, z_stream_s::state, z_stream_s::total_in, z_stream_s::total_out, Z_NULL, Z_OK, and Z_STREAM_ERROR.

Referenced by inflateInit2().

Here is the call graph for this function:

◆ inflateSetDictionary()

int inflateSetDictionary ( z_streamp  strm,
const Byte dictionary,
uInt  dictLength 
)

◆ inflateSync()

int inflateSync ( z_streamp  strm)

◆ inflateSyncPoint()

int inflateSyncPoint ( z_streamp  z)

◆ IsZipHandleU()

bool IsZipHandleU ( HZIP  hz)

Definition at line 4772 of file unzip.cpp.

References TUnzipHandleData::flag.

◆ lufclose()

int lufclose ( LUFILE stream)

Definition at line 2804 of file unzip.cpp.

References EOF, LUFILE::h, and LUFILE::mustclosehandle.

Referenced by unzClose(), and unzOpenInternal().

◆ luferror()

int luferror ( LUFILE stream)

Definition at line 2814 of file unzip.cpp.

References LUFILE::herr, and LUFILE::is_handle.

Referenced by unzlocal_getByte().

◆ lufopen()

LUFILE * lufopen ( void *  z,
unsigned int  len,
DWORD  flags,
ZRESULT err 
)

◆ lufread()

◆ lufseek()

◆ luftell()

long int luftell ( LUFILE stream)

◆ OpenZip() [1/2]

HZIP OpenZip ( const TCHAR *  fn,
const char *  password 
)

Definition at line 4654 of file unzip.cpp.

References OpenZipInternal(), and ZIP_FILENAME.

Referenced by Zipfile::open().

Here is the call graph for this function:

◆ OpenZip() [2/2]

HZIP OpenZip ( void *  z,
unsigned int  len,
const char *  password 
)

Definition at line 4658 of file unzip.cpp.

References OpenZipInternal(), and ZIP_MEMORY.

Here is the call graph for this function:

◆ OpenZipHandle()

HZIP OpenZipHandle ( HANDLE  h,
const char *  password 
)

Definition at line 4650 of file unzip.cpp.

References OpenZipInternal(), and ZIP_HANDLE.

Here is the call graph for this function:

◆ OpenZipInternal()

HZIP OpenZipInternal ( void *  z,
unsigned int  len,
DWORD  flags,
const char *  password 
)

Definition at line 4636 of file unzip.cpp.

References TUnzipHandleData::flag, lasterrorU, TUnzip::Open(), TUnzipHandleData::unz, and ZR_OK.

Referenced by OpenZip(), and OpenZipHandle().

Here is the call graph for this function:

◆ SetUnzipBaseDir()

ZRESULT SetUnzipBaseDir ( HZIP  hz,
const TCHAR *  dir 
)

Definition at line 4733 of file unzip.cpp.

References TUnzipHandleData::flag, lasterrorU, TUnzip::SetUnzipBaseDir(), TUnzipHandleData::unz, ZR_ARGS, and ZR_ZMODE.

Here is the call graph for this function:

◆ strcmpcasenosensitive_internal()

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

Definition at line 3029 of file unzip.cpp.

Referenced by unzStringFileNameCompare().

◆ timet2filetime()

FILETIME timet2filetime ( const lutime_t  t)

Definition at line 4003 of file unzip.cpp.

Referenced by TUnzip::Get().

◆ ucrc32()

uLong ucrc32 ( uLong  crc,
const Byte buf,
uInt  len 
)

Definition at line 2281 of file unzip.cpp.

References CRC_DO1, CRC_DO8, and Z_NULL.

Referenced by unzReadCurrentFile().

◆ Udecrypt_byte()

char Udecrypt_byte ( unsigned long *  keys)

Definition at line 2311 of file unzip.cpp.

Referenced by zdecode().

◆ unzClose()

int unzClose ( unzFile  file)

Definition at line 3197 of file unzip.cpp.

References unz_s::file, lufclose(), unz_s::pfile_in_zip_read, UNZ_OK, UNZ_PARAMERROR, unzCloseCurrentFile(), and zfree.

Referenced by TUnzip::Close().

Here is the call graph for this function:

◆ unzCloseCurrentFile()

int unzCloseCurrentFile ( unzFile  file)

◆ unzeof()

int unzeof ( unzFile  file)

◆ unzGetCurrentFileInfo()

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

Definition at line 3414 of file unzip.cpp.

References unzlocal_GetCurrentFileInfoInternal().

Referenced by TUnzip::Get(), and unzLocateFile().

Here is the call graph for this function:

◆ unzGetGlobalComment()

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

Definition at line 3968 of file unzip.cpp.

References unz_s::central_pos, unz_s::file, unz_s::gi, lufread(), lufseek(), unz_global_info_s::size_comment, UNZ_ERRNO, and UNZ_PARAMERROR.

Here is the call graph for this function:

◆ unzGetGlobalInfo()

int unzGetGlobalInfo ( unzFile  file,
unz_global_info pglobal_info 
)

Definition at line 3217 of file unzip.cpp.

References unz_s::gi, UNZ_OK, and UNZ_PARAMERROR.

◆ unzGetLocalExtrafield()

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

Definition at line 3884 of file unzip.cpp.

References file_in_zip_read_info_s::file, lufread(), lufseek(), file_in_zip_read_info_s::offset_local_extrafield, unz_s::pfile_in_zip_read, file_in_zip_read_info_s::pos_local_extrafield, file_in_zip_read_info_s::size_local_extrafield, UNZ_ERRNO, and UNZ_PARAMERROR.

Here is the call graph for this function:

◆ unzGoToFirstFile()

int unzGoToFirstFile ( unzFile  file)

Definition at line 3425 of file unzip.cpp.

References unz_s::cur_file_info, unz_s::cur_file_info_internal, unz_s::current_file_ok, unz_s::num_file, unz_s::offset_central_dir, unz_s::pos_in_central_dir, UNZ_OK, UNZ_PARAMERROR, and unzlocal_GetCurrentFileInfoInternal().

Referenced by TUnzip::Get(), TUnzip::Unzip(), unzLocateFile(), and unzOpenInternal().

Here is the call graph for this function:

◆ unzGoToNextFile()

int unzGoToNextFile ( unzFile  file)

◆ UnzipItem() [1/2]

ZRESULT UnzipItem ( HZIP  hz,
int  index,
const TCHAR *  fn 
)

Definition at line 4724 of file unzip.cpp.

References UnzipItemInternal(), and ZIP_FILENAME.

Referenced by Zipfile::getZipContent(), and Zipfile::getZipItem().

Here is the call graph for this function:

◆ UnzipItem() [2/2]

ZRESULT UnzipItem ( HZIP  hz,
int  index,
void *  z,
unsigned int  len 
)

Definition at line 4728 of file unzip.cpp.

References UnzipItemInternal(), and ZIP_MEMORY.

Here is the call graph for this function:

◆ UnzipItemHandle()

ZRESULT UnzipItemHandle ( HZIP  hz,
int  index,
HANDLE  h 
)

Definition at line 4720 of file unzip.cpp.

References UnzipItemInternal(), and ZIP_HANDLE.

Here is the call graph for this function:

◆ UnzipItemInternal()

ZRESULT UnzipItemInternal ( HZIP  hz,
int  index,
void *  dst,
unsigned int  len,
DWORD  flags 
)

Definition at line 4703 of file unzip.cpp.

References TUnzipHandleData::flag, lasterrorU, TUnzipHandleData::unz, TUnzip::Unzip(), ZR_ARGS, and ZR_ZMODE.

Referenced by UnzipItem(), and UnzipItemHandle().

Here is the call graph for this function:

◆ unzlocal_CheckCurrentFileCoherencyHeader()

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

◆ unzlocal_DosDateToTmuDate()

void unzlocal_DosDateToTmuDate ( uLong  ulDosDate,
tm_unz ptm 
)

◆ unzlocal_getByte()

int unzlocal_getByte ( LUFILE fin,
int *  pi 
)

Definition at line 2958 of file unzip.cpp.

References luferror(), lufread(), UNZ_EOF, UNZ_ERRNO, and UNZ_OK.

Referenced by unzlocal_getLong(), and unzlocal_getShort().

Here is the call graph for this function:

◆ unzlocal_GetCurrentFileInfoInternal()

◆ unzlocal_getLong()

int unzlocal_getLong ( LUFILE fin,
uLong pX 
)

Definition at line 2999 of file unzip.cpp.

References UNZ_OK, and unzlocal_getByte().

Referenced by unzlocal_CheckCurrentFileCoherencyHeader(), unzlocal_GetCurrentFileInfoInternal(), and unzOpenInternal().

Here is the call graph for this function:

◆ unzlocal_getShort()

int unzlocal_getShort ( LUFILE fin,
uLong pX 
)

Definition at line 2979 of file unzip.cpp.

References UNZ_OK, and unzlocal_getByte().

Referenced by unzlocal_CheckCurrentFileCoherencyHeader(), unzlocal_GetCurrentFileInfoInternal(), and unzOpenInternal().

Here is the call graph for this function:

◆ unzlocal_SearchCentralDir()

uLong unzlocal_SearchCentralDir ( LUFILE fin)

Definition at line 3072 of file unzip.cpp.

References BUFREADCOMMENT, lufread(), lufseek(), luftell(), zfree, and zmalloc.

Referenced by unzOpenInternal().

Here is the call graph for this function:

◆ unzLocateFile()

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

Definition at line 3474 of file unzip.cpp.

References unz_s::current_file_ok, unz_s::num_file, unz_s::pos_in_central_dir, UNZ_END_OF_LIST_OF_FILE, UNZ_MAXFILENAMEINZIP, UNZ_OK, UNZ_PARAMERROR, unzGetCurrentFileInfo(), unzGoToFirstFile(), unzGoToNextFile(), and unzStringFileNameCompare().

Referenced by TUnzip::Find().

Here is the call graph for this function:

◆ unzOpenCurrentFile()

int unzOpenCurrentFile ( unzFile  file,
const char *  password 
)

Definition at line 3606 of file unzip.cpp.

References z_stream_s::avail_in, file_in_zip_read_info_s::byte_before_the_zipfile, unz_s::byte_before_the_zipfile, unz_file_info_s::compressed_size, unz_file_info_s::compression_method, file_in_zip_read_info_s::compression_method, unz_file_info_s::crc, file_in_zip_read_info_s::crc32, file_in_zip_read_info_s::crc32_wait, file_in_zip_read_info_s::crcenctest, unz_s::cur_file_info, unz_s::cur_file_info_internal, unz_s::current_file_ok, unz_file_info_s::dosDate, file_in_zip_read_info_s::encheadleft, file_in_zip_read_info_s::encrypted, file_in_zip_read_info_s::file, unz_s::file, unz_file_info_s::flag, inflateInit2(), file_in_zip_read_info_s::keys, unz_file_info_internal_s::offset_curfile, file_in_zip_read_info_s::offset_local_extrafield, z_stream_s::opaque, unz_s::pfile_in_zip_read, file_in_zip_read_info_s::pos_in_zipfile, file_in_zip_read_info_s::pos_local_extrafield, file_in_zip_read_info_s::read_buffer, file_in_zip_read_info_s::rest_read_compressed, file_in_zip_read_info_s::rest_read_uncompressed, file_in_zip_read_info_s::size_local_extrafield, SIZEZIPLOCALHEADER, file_in_zip_read_info_s::stream, file_in_zip_read_info_s::stream_initialised, z_stream_s::total_out, unz_file_info_s::uncompressed_size, UNZ_BADZIPFILE, UNZ_BUFSIZE, UNZ_INTERNALERROR, UNZ_OK, UNZ_PARAMERROR, unzCloseCurrentFile(), unzlocal_CheckCurrentFileCoherencyHeader(), Uupdate_keys(), Z_DEFLATED, Z_OK, z_stream_s::zalloc, zfree, z_stream_s::zfree, and zmalloc.

Referenced by TUnzip::Unzip().

Here is the call graph for this function:

◆ unzOpenInternal()

◆ unzReadCurrentFile() [1/2]

int unzReadCurrentFile ( unzFile  file,
void *  buf,
unsigned  len 
)

◆ unzReadCurrentFile() [2/2]

◆ unzStringFileNameCompare()

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

Definition at line 3058 of file unzip.cpp.

References strcmpcasenosensitive_internal().

Referenced by unzLocateFile().

Here is the call graph for this function:

◆ unztell()

◆ Uupdate_keys()

void Uupdate_keys ( unsigned long *  keys,
char  c 
)

Definition at line 2304 of file unzip.cpp.

References CRC32.

Referenced by unzOpenCurrentFile(), and zdecode().

◆ zcalloc()

voidpf zcalloc ( voidpf  opaque,
unsigned  items,
unsigned  size 
)

Definition at line 2404 of file unzip.cpp.

Referenced by inflateInit2().

◆ zcfree()

void zcfree ( voidpf  opaque,
voidpf  ptr 
)

Definition at line 2411 of file unzip.cpp.

References zfree.

Referenced by inflateInit2().

◆ zdecode()

char zdecode ( unsigned long *  keys,
char  c 
)

Definition at line 2316 of file unzip.cpp.

References Udecrypt_byte(), and Uupdate_keys().

Referenced by unzReadCurrentFile().

Here is the call graph for this function:

◆ zError()

const char * zError ( int  err)

Definition at line 2396 of file unzip.cpp.

References ERR_MSG.

◆ zlibVersion()

const char * zlibVersion ( )

Definition at line 2389 of file unzip.cpp.

References ZLIB_VERSION.

Variable Documentation

◆ border

const uInt border[]
Initial value:
=
{
16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15
}

Definition at line 1238 of file unzip.cpp.

Referenced by inflate_blocks().

◆ cpdext

const uInt cpdext[30]
Initial value:
=
{
0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6,
7, 7, 8, 8, 9, 9, 10, 10, 11, 11,
12, 12, 13, 13
}

Definition at line 1647 of file unzip.cpp.

Referenced by inflate_trees_dynamic().

◆ cpdist

const uInt cpdist[30]
Initial value:
=
{
1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
8193, 12289, 16385, 24577
}

Definition at line 1641 of file unzip.cpp.

Referenced by inflate_trees_dynamic().

◆ cplens

const uInt cplens[31]
Initial value:
=
{
3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,
35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0
}

Definition at line 1630 of file unzip.cpp.

Referenced by inflate_trees_dynamic().

◆ cplext

const uInt cplext[31]
Initial value:
=
{
0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2,
3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 112, 112
}

Definition at line 1636 of file unzip.cpp.

Referenced by inflate_trees_dynamic().

◆ crc_table

const uLong crc_table[256]

Definition at line 2215 of file unzip.cpp.

Referenced by get_crc_table().

◆ fixed_bd

const uInt fixed_bd = 5

Definition at line 759 of file unzip.cpp.

Referenced by inflate_trees_fixed().

◆ fixed_bl

const uInt fixed_bl = 9

Definition at line 758 of file unzip.cpp.

Referenced by inflate_trees_fixed().

◆ fixed_td

const inflate_huft fixed_td[]
Initial value:
=
{
{{{80, 5}}, 1}, {{{87, 5}}, 257}, {{{83, 5}}, 17}, {{{91, 5}}, 4097},
{{{81, 5}}, 5}, {{{89, 5}}, 1025}, {{{85, 5}}, 65}, {{{93, 5}}, 16385},
{{{80, 5}}, 3}, {{{88, 5}}, 513}, {{{84, 5}}, 33}, {{{92, 5}}, 8193},
{{{82, 5}}, 9}, {{{90, 5}}, 2049}, {{{86, 5}}, 129}, {{{192, 5}}, 24577},
{{{80, 5}}, 2}, {{{87, 5}}, 385}, {{{83, 5}}, 25}, {{{91, 5}}, 6145},
{{{81, 5}}, 7}, {{{89, 5}}, 1537}, {{{85, 5}}, 97}, {{{93, 5}}, 24577},
{{{80, 5}}, 4}, {{{88, 5}}, 769}, {{{84, 5}}, 49}, {{{92, 5}}, 12289},
{{{82, 5}}, 13}, {{{90, 5}}, 3073}, {{{86, 5}}, 193}, {{{192, 5}}, 24577}
}

Definition at line 891 of file unzip.cpp.

Referenced by inflate_trees_fixed().

◆ fixed_tl

const inflate_huft fixed_tl[]

Definition at line 760 of file unzip.cpp.

Referenced by inflate_trees_fixed().

◆ inflate_mask

const uInt inflate_mask[17]
Initial value:
=
{
0x0000,
0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, 0x007f, 0x00ff,
0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff
}

Definition at line 744 of file unzip.cpp.

Referenced by inflate_blocks(), inflate_codes(), and inflate_fast().

◆ lasterrorU

◆ unz_copyright

const char unz_copyright[] = " unzip 0.15 Copyright 1998 Gilles Vollant "

Definition at line 2715 of file unzip.cpp.

Referenced by unzOpenInternal().

◆ unzip_inflate_copyright

const char unzip_inflate_copyright[]
extern
Initial value:
=
" inflate 1.1.3 Copyright 1995-1998 Mark Adler "

◆ z_errmsg

const char* const z_errmsg[10]
Initial value:
=
{
"need dictionary",
"stream end",
"",
"file error",
"stream error",
"data error",
"insufficient memory",
"buffer error",
"incompatible version",
""
}

Definition at line 483 of file unzip.cpp.