Ruby: ext/zlib/zlib-1.2.13/contrib/minizip/unzip.c File Reference

Ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c52d4d35cc6a173c89eda98ceffa2dcf)

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

## Data Structures
struct | unz_file_info64_internal_s
struct | file_in_zip64_read_info_s
struct | unz64_s

## 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) { 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
int unz64local_getByte | OF ((const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream, int *pi))
int | unz64local_getByte (const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream, int *pi)
int unz64local_getShort | OF ((const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream, uLong *pX))
int | unz64local_getShort (const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream, uLong *pX)
int | unz64local_getLong (const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream, uLong *pX)
int unz64local_getLong64 | OF ((const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream, ZPOS64_T *pX))
int | unz64local_getLong64 (const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream, ZPOS64_T *pX)
int | strcmpcasenosensitive_internal (const char *fileName1, const char *fileName2)
int ZEXPORT | unzStringFileNameCompare (const char *fileName1, const char *fileName2, int iCaseSensitivity)
ZPOS64_T unz64local_SearchCentralDir | OF ((const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream))
ZPOS64_T | unz64local_SearchCentralDir (const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream)
ZPOS64_T | unz64local_SearchCentralDir64 (const zlib_filefunc64_32_def *pzlib_filefunc_def, voidpf filestream)
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)
void | unz64local_DosDateToTmuDate (ZPOS64_T ulDosDate, tm_unz *ptm)
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))
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)
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))

Definition at line 112 of file unzip.c.

## ◆ BUFREADCOMMENT

#define BUFREADCOMMENT (0x400)

Definition at line 405 of file unzip.c.

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

## ◆ local

#define local static

Definition at line 91 of file unzip.c.

## ◆ NOUNCRYPT

#define NOUNCRYPT

Definition at line 72 of file unzip.c.

## ◆ SIZECENTRALDIRITEM

#define SIZECENTRALDIRITEM (0x2e)

Definition at line 118 of file unzip.c.

## ◆ SIZEZIPLOCALHEADER

#define SIZEZIPLOCALHEADER (0x1e)

Definition at line 119 of file unzip.c.

## ◆ STRCMPCASENOSENTIVEFUNCTION

#define STRCMPCASENOSENTIVEFUNCTION strcmpcasenosensitive_internal

Definition at line 378 of file unzip.c.

## ◆ TRYFREE

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

Definition at line 115 of file unzip.c.

## ◆ UNZ_BUFSIZE

#define UNZ_BUFSIZE (16384)

Definition at line 104 of file unzip.c.

## ◆ UNZ_MAXFILENAMEINZIP

#define UNZ_MAXFILENAMEINZIP (256)

Definition at line 108 of file unzip.c.

## Typedef Documentation

## ◆ unz_file_info64_internal

typedef struct unz_file_info64_internal_s unz_file_info64_internal

## Function Documentation

## ◆ OF() [1/5]

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

## ◆ OF() [2/5]

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

## ◆ OF() [3/5]

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

## ◆ OF() [4/5]

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

## ◆ OF() [5/5]

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

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

Definition at line 349 of file unzip.c.

## ◆ unz64local_CheckCurrentFileCoherencyHeader()

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

Definition at line 1385 of file unzip.c.

References unz64_s::byte_before_the_zipfile, unz_file_info64_s::compressed_size, unz_file_info64_s::compression_method, unz_file_info64_s::crc, unz64_s::cur_file_info, unz64_s::cur_file_info_internal, err, unz64_s::filestream, unz_file_info64_internal_s::offset_curfile, unz_file_info64_s::size_filename, SIZEZIPLOCALHEADER, unz_file_info64_s::uncompressed_size, unz64local_getLong(), unz64local_getShort(), UNZ_BADZIPFILE, UNZ_ERRNO, UNZ_OK, Z_BZIP2ED, Z_DEFLATED, unz64_s::z_filefunc, ZLIB_FILEFUNC_SEEK_SET, and ZSEEK64.

Referenced by unzOpenCurrentFile3().

## ◆ unz64local_DosDateToTmuDate()

void unz64local_DosDateToTmuDate | ( | ZPOS64_T | ulDosDate,
|  | tm_unz * | ptm
| ) |  |

Definition at line 852 of file unzip.c.

References int(), tm_unz_s::tm_hour, tm_unz_s::tm_mday, tm_unz_s::tm_min, tm_unz_s::tm_mon, tm_unz_s::tm_sec, and tm_unz_s::tm_year.

Referenced by unz64local_GetCurrentFileInfoInternal().

## ◆ unz64local_getByte()

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

Definition at line 212 of file unzip.c.

References err, int(), UNZ_EOF, UNZ_ERRNO, UNZ_OK, ZERROR64, and ZREAD64.

Referenced by unz64local_getLong(), unz64local_getLong64(), and unz64local_getShort().

## ◆ unz64local_GetCurrentFileInfoInternal()

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

Definition at line 879 of file unzip.c.

References unz64_s::byte_before_the_zipfile, unz_file_info64_s::compressed_size, unz_file_info64_s::compression_method, unz_file_info64_s::crc, unz_file_info64_s::disk_num_start, unz_file_info64_s::dosDate, err, unz_file_info64_s::external_fa, unz64_s::filestream, unz_file_info64_s::flag, unz_file_info64_s::internal_fa, MAXU32, NULL, unz_file_info64_internal_s::offset_curfile, unz64_s::pos_in_central_dir, unz_file_info64_s::size_file_comment, unz_file_info64_s::size_file_extra, unz_file_info64_s::size_filename, unz_file_info64_s::tmu_date, unz_file_info64_s::uncompressed_size, unz64local_DosDateToTmuDate(), unz64local_getLong(), unz64local_getLong64(), unz64local_getShort(), UNZ_BADZIPFILE, UNZ_ERRNO, UNZ_OK, UNZ_PARAMERROR, unz_file_info64_s::version, unz_file_info64_s::version_needed, unz64_s::z_filefunc, ZLIB_FILEFUNC_SEEK_CUR, ZLIB_FILEFUNC_SEEK_SET, ZREAD64, and ZSEEK64.

Referenced by unzGetCurrentFileInfo(), unzGetCurrentFileInfo64(), unzGoToFilePos64(), unzGoToFirstFile(), unzGoToNextFile(), and unzSetOffset64().

## ◆ unz64local_getLong()

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

Definition at line 266 of file unzip.c.

References err, unz64local_getByte(), and UNZ_OK.

Referenced by unz64local_CheckCurrentFileCoherencyHeader(), unz64local_GetCurrentFileInfoInternal(), unz64local_SearchCentralDir64(), and unzOpenInternal().

## ◆ unz64local_getLong64()

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

Definition at line 302 of file unzip.c.

References err, unz64local_getByte(), and UNZ_OK.

Referenced by unz64local_GetCurrentFileInfoInternal(), unz64local_SearchCentralDir64(), and unzOpenInternal().

## ◆ unz64local_getShort()

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

Definition at line 239 of file unzip.c.

References err, unz64local_getByte(), and UNZ_OK.

Referenced by unz64local_CheckCurrentFileCoherencyHeader(), unz64local_GetCurrentFileInfoInternal(), and unzOpenInternal().

## ◆ unz64local_SearchCentralDir()

ZPOS64_T unz64local_SearchCentralDir | ( | const zlib_filefunc64_32_def * | pzlib_filefunc_def,
|  | voidpf | filestream
| ) |  |

Definition at line 413 of file unzip.c.

References ALLOC, BUFREADCOMMENT, NULL, TRYFREE, ZLIB_FILEFUNC_SEEK_END, ZLIB_FILEFUNC_SEEK_SET, ZREAD64, ZSEEK64, and ZTELL64.

Referenced by unzOpenInternal().

## ◆ unz64local_SearchCentralDir64()

ZPOS64_T unz64local_SearchCentralDir64 | ( | const zlib_filefunc64_32_def * | pzlib_filefunc_def,
|  | voidpf | filestream
| ) |  |

Definition at line 478 of file unzip.c.

References ALLOC, BUFREADCOMMENT, NULL, TRYFREE, unz64local_getLong(), unz64local_getLong64(), UNZ_OK, ZLIB_FILEFUNC_SEEK_END, ZLIB_FILEFUNC_SEEK_SET, ZREAD64, ZSEEK64, and ZTELL64.

Referenced by unzOpenInternal().

## ◆ unzClose()

int ZEXPORT unzClose | ( | unzFile | file | ) |

Definition at line 808 of file unzip.c.

References unz64_s::filestream, NULL, unz64_s::pfile_in_zip_read, TRYFREE, UNZ_OK, UNZ_PARAMERROR, unzCloseCurrentFile(), unz64_s::z_filefunc, and ZCLOSE64.

Referenced by main().

## ◆ unzCloseCurrentFile()

int ZEXPORT unzCloseCurrentFile | ( | unzFile | file | ) |

Definition at line 2009 of file unzip.c.

References file_in_zip64_read_info_s::crc32, file_in_zip64_read_info_s::crc32_wait, err, inflateEnd(), NULL, unz64_s::pfile_in_zip_read, file_in_zip64_read_info_s::raw, file_in_zip64_read_info_s::read_buffer, file_in_zip64_read_info_s::rest_read_uncompressed, file_in_zip64_read_info_s::stream, file_in_zip64_read_info_s::stream_initialised, TRYFREE, UNZ_CRCERROR, UNZ_OK, UNZ_PARAMERROR, Z_BZIP2ED, and Z_DEFLATED.

Referenced by unzClose(), and unzOpenCurrentFile3().

## ◆ unzeof()

int ZEXPORT unzeof | ( | unzFile | file | ) |

Definition at line 1929 of file unzip.c.

References NULL, unz64_s::pfile_in_zip_read, file_in_zip64_read_info_s::rest_read_uncompressed, 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
| ) |  |

Definition at line 1136 of file unzip.c.

References unz_file_info64_s::compressed_size, unz_file_info_s::compressed_size, unz_file_info64_s::compression_method, unz_file_info_s::compression_method, unz_file_info64_s::crc, unz_file_info_s::crc, unz_file_info64_s::disk_num_start, unz_file_info_s::disk_num_start, unz_file_info64_s::dosDate, unz_file_info_s::dosDate, err, unz_file_info64_s::external_fa, unz_file_info_s::external_fa, unz_file_info64_s::flag, unz_file_info_s::flag, unz_file_info64_s::internal_fa, unz_file_info_s::internal_fa, NULL, unz_file_info64_s::size_file_comment, unz_file_info_s::size_file_comment, unz_file_info64_s::size_file_extra, unz_file_info_s::size_file_extra, unz_file_info64_s::size_filename, unz_file_info_s::size_filename, unz_file_info64_s::tmu_date, unz_file_info_s::tmu_date, unz_file_info64_s::uncompressed_size, unz_file_info_s::uncompressed_size, unz64local_GetCurrentFileInfoInternal(), UNZ_OK, unz_file_info64_s::version, unz_file_info_s::version, unz_file_info64_s::version_needed, and unz_file_info_s::version_needed.

## ◆ 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 unzLocateFile().

## ◆ unzGetCurrentFileZStreamPos64()

ZPOS64_T ZEXPORT unzGetCurrentFileZStreamPos64 | ( | unzFile | file | ) |

Addition for GDAL : START.

Definition at line 1660 of file unzip.c.

References file_in_zip64_read_info_s::byte_before_the_zipfile, NULL, unz64_s::pfile_in_zip_read, and file_in_zip64_read_info_s::pos_in_zipfile.

## ◆ unzGetFilePos()

int ZEXPORT unzGetFilePos | ( | unzFile | file,
|  | unz_file_pos * | file_pos
| ) |  |

Definition at line 1324 of file unzip.c.

References err, unz_file_pos_s::num_of_file, unz64_file_pos_s::num_of_file, unz_file_pos_s::pos_in_zip_directory, unz64_file_pos_s::pos_in_zip_directory, UNZ_OK, and unzGetFilePos64().

## ◆ unzGetFilePos64()

int ZEXPORT unzGetFilePos64 | ( | unzFile | file,
|  | unz64_file_pos * | file_pos
| ) |  |

Definition at line 1308 of file unzip.c.

References unz64_s::current_file_ok, NULL, unz64_s::num_file, unz64_file_pos_s::num_of_file, unz64_s::pos_in_central_dir, unz64_file_pos_s::pos_in_zip_directory, UNZ_END_OF_LIST_OF_FILE, UNZ_OK, and UNZ_PARAMERROR.

Referenced by unzGetFilePos().

## ◆ unzGetGlobalComment()

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

Definition at line 2056 of file unzip.c.

References unz64_s::central_pos, unz64_s::filestream, unz64_s::gi, NULL, unz_global_info64_s::size_comment, UNZ_ERRNO, UNZ_PARAMERROR, unz64_s::z_filefunc, ZLIB_FILEFUNC_SEEK_SET, ZREAD64, and ZSEEK64.

## ◆ unzGetGlobalInfo()

int ZEXPORT unzGetGlobalInfo | ( | unzFile | file,
|  | unz_global_info * | pglobal_info32
| ) |  |

Definition at line 838 of file unzip.c.

References unz64_s::gi, NULL, unz_global_info64_s::number_entry, unz_global_info_s::number_entry, unz_global_info64_s::size_comment, unz_global_info_s::size_comment, UNZ_OK, and UNZ_PARAMERROR.

## ◆ unzGetGlobalInfo64()

int ZEXPORT unzGetGlobalInfo64 | ( | unzFile | file,
|  | unz_global_info64 * | pglobal_info
| ) |  |

Definition at line 828 of file unzip.c.

References unz64_s::gi, NULL, UNZ_OK, and UNZ_PARAMERROR.

## ◆ unzGetLocalExtrafield()

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

Definition at line 1961 of file unzip.c.

References file_in_zip64_read_info_s::filestream, len, NULL, file_in_zip64_read_info_s::offset_local_extrafield, unz64_s::pfile_in_zip_read, file_in_zip64_read_info_s::pos_local_extrafield, file_in_zip64_read_info_s::size_local_extrafield, UNZ_ERRNO, UNZ_PARAMERROR, file_in_zip64_read_info_s::z_filefunc, ZLIB_FILEFUNC_SEEK_SET, ZREAD64, and ZSEEK64.

## ◆ unzGetOffset()

uLong ZEXPORT unzGetOffset | ( | unzFile | file | ) |

Definition at line 2099 of file unzip.c.

References NULL, and unzGetOffset64().

## ◆ unzGetOffset64()

ZPOS64_T ZEXPORT unzGetOffset64 | ( | unzFile | file | ) |

Definition at line 2084 of file unzip.c.

References unz64_s::current_file_ok, unz64_s::gi, NULL, unz64_s::num_file, unz_global_info64_s::number_entry, and unz64_s::pos_in_central_dir.

Referenced by unzGetOffset().

## ◆ unzGoToFilePos()

int ZEXPORT unzGoToFilePos | ( | unzFile | file,
|  | unz_file_pos * | file_pos
| ) |  |

Definition at line 1360 of file unzip.c.

References NULL, unz_file_pos_s::num_of_file, unz64_file_pos_s::num_of_file, unz_file_pos_s::pos_in_zip_directory, unz64_file_pos_s::pos_in_zip_directory, UNZ_PARAMERROR, and unzGoToFilePos64().

## ◆ unzGoToFilePos64()

int ZEXPORT unzGoToFilePos64 | ( | unzFile | file,
|  | const unz64_file_pos * | file_pos
| ) |  |

Definition at line 1338 of file unzip.c.

References unz64_s::cur_file_info, unz64_s::cur_file_info_internal, unz64_s::current_file_ok, err, NULL, unz64_s::num_file, unz64_file_pos_s::num_of_file, unz64_s::pos_in_central_dir, unz64_file_pos_s::pos_in_zip_directory, unz64local_GetCurrentFileInfoInternal(), UNZ_OK, and UNZ_PARAMERROR.

Referenced by unzGoToFilePos().

## ◆ unzGoToFirstFile()

int ZEXPORT unzGoToFirstFile | ( | unzFile | file | ) |

Definition at line 1178 of file unzip.c.

References unz64_s::cur_file_info, unz64_s::cur_file_info_internal, unz64_s::current_file_ok, err, NULL, unz64_s::num_file, unz64_s::offset_central_dir, unz64_s::pos_in_central_dir, unz64local_GetCurrentFileInfoInternal(), UNZ_OK, and UNZ_PARAMERROR.

Referenced by unzLocateFile(), and unzOpenInternal().

## ◆ unzGoToNextFile()

int ZEXPORT unzGoToNextFile | ( | unzFile | file | ) |

Definition at line 1199 of file unzip.c.

References unz64_s::cur_file_info, unz64_s::cur_file_info_internal, unz64_s::current_file_ok, err, unz64_s::gi, NULL, unz64_s::num_file, unz_global_info64_s::number_entry, unz64_s::pos_in_central_dir, unz_file_info64_s::size_file_comment, unz_file_info64_s::size_file_extra, unz_file_info64_s::size_filename, SIZECENTRALDIRITEM, unz64local_GetCurrentFileInfoInternal(), UNZ_END_OF_LIST_OF_FILE, UNZ_OK, and UNZ_PARAMERROR.

Referenced by unzLocateFile().

## ◆ unzLocateFile()

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

Definition at line 1232 of file unzip.c.

References unz64_s::cur_file_info, unz64_s::cur_file_info_internal, unz64_s::current_file_ok, err, NULL, unz64_s::num_file, unz64_s::pos_in_central_dir, strlen(), UNZ_END_OF_LIST_OF_FILE, UNZ_MAXFILENAMEINZIP, UNZ_OK, UNZ_PARAMERROR, unzGetCurrentFileInfo64(), unzGoToFirstFile(), unzGoToNextFile(), and unzStringFileNameCompare().

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

Definition at line 778 of file unzip.c.

References NULL, unzOpenInternal(), zlib_filefunc64_32_def_s::zfile_func64, zlib_filefunc64_32_def_s::zseek32_file, and zlib_filefunc64_32_def_s::ztell32_file.

Referenced by main().

## ◆ 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 1643 of file unzip.c.

References NULL, and unzOpenCurrentFile3().

## ◆ unzOpenCurrentFile2()

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

Definition at line 1653 of file unzip.c.

References NULL, and unzOpenCurrentFile3().

## ◆ unzOpenCurrentFile3()

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

Definition at line 1472 of file unzip.c.

References ALLOC, z_stream_s::avail_in, file_in_zip64_read_info_s::byte_before_the_zipfile, unz64_s::byte_before_the_zipfile, unz_file_info64_s::compressed_size, file_in_zip64_read_info_s::compression_method, unz_file_info64_s::compression_method, unz_file_info64_s::crc, file_in_zip64_read_info_s::crc32, file_in_zip64_read_info_s::crc32_wait, unz64_s::cur_file_info, unz64_s::cur_file_info_internal, unz64_s::current_file_ok, unz64_s::encrypted, err, file_in_zip64_read_info_s::filestream, unz64_s::filestream, unz_file_info64_s::flag, get_crc_table(), if(), inflateInit2, int(), MAX_WBITS, z_stream_s::next_in, NULL, unz_file_info64_internal_s::offset_curfile, file_in_zip64_read_info_s::offset_local_extrafield, z_stream_s::opaque, unz64_s::pfile_in_zip_read, file_in_zip64_read_info_s::pos_in_zipfile, file_in_zip64_read_info_s::pos_local_extrafield, file_in_zip64_read_info_s::raw, file_in_zip64_read_info_s::read_buffer, file_in_zip64_read_info_s::rest_read_compressed, file_in_zip64_read_info_s::rest_read_uncompressed, SEEK_SET, file_in_zip64_read_info_s::size_local_extrafield, SIZEZIPLOCALHEADER, file_in_zip64_read_info_s::stream, file_in_zip64_read_info_s::stream_initialised, z_stream_s::total_out, file_in_zip64_read_info_s::total_out_64, TRYFREE, unz_file_info64_s::uncompressed_size, unz64local_CheckCurrentFileCoherencyHeader(), UNZ_BADZIPFILE, UNZ_BUFSIZE, UNZ_INTERNALERROR, UNZ_OK, UNZ_PARAMERROR, unzCloseCurrentFile(), Z_BZIP2ED, Z_DEFLATED, file_in_zip64_read_info_s::z_filefunc, unz64_s::z_filefunc, Z_OK, z_stream_s::zalloc, zdecode, z_stream_s::zfree, ZREAD64, and ZSEEK64.

Referenced by unzOpenCurrentFile(), unzOpenCurrentFile2(), and unzOpenCurrentFilePassword().

## ◆ unzOpenCurrentFilePassword()

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

Definition at line 1648 of file unzip.c.

References NULL, and unzOpenCurrentFile3().

## ◆ unzOpenInternal()

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

Definition at line 584 of file unzip.c.

References ALLOC, unz64_s::byte_before_the_zipfile, unz64_s::central_pos, unz64_s::encrypted, err, unz64_s::filestream, fill_fopen64_filefunc(), unz64_s::gi, unz64_s::is64bitOpenFunction, unz64_s::isZip64, NULL, unz_global_info64_s::number_entry, unz64_s::offset_central_dir, unz64_s::pfile_in_zip_read, unz64_s::size_central_dir, unz_global_info64_s::size_comment, unz64local_getLong(), unz64local_getLong64(), unz64local_getShort(), unz64local_SearchCentralDir(), unz64local_SearchCentralDir64(), UNZ_BADZIPFILE, unz_copyright, UNZ_ERRNO, UNZ_OK, unzGoToFirstFile(), unz64_s::z_filefunc, ZCLOSE64, zlib_filefunc64_32_def_s::zfile_func64, ZLIB_FILEFUNC_MODE_EXISTING, ZLIB_FILEFUNC_MODE_READ, ZLIB_FILEFUNC_SEEK_SET, ZOPEN64, zlib_filefunc64_32_def_s::zseek32_file, ZSEEK64, and zlib_filefunc64_32_def_s::ztell32_file.

Referenced by unzOpen(), unzOpen2(), unzOpen2_64(), and unzOpen64().

## ◆ unzReadCurrentFile()

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

Addition for GDAL : END.

Definition at line 1686 of file unzip.c.

References z_stream_s::avail_in, z_stream_s::avail_out, file_in_zip64_read_info_s::byte_before_the_zipfile, file_in_zip64_read_info_s::compression_method, file_in_zip64_read_info_s::crc32, crc32(), unz64_s::encrypted, err, file_in_zip64_read_info_s::filestream, if(), inflate(), int(), len, z_stream_s::msg, z_stream_s::next_in, z_stream_s::next_out, NULL, unz64_s::pfile_in_zip_read, file_in_zip64_read_info_s::pos_in_zipfile, file_in_zip64_read_info_s::raw, file_in_zip64_read_info_s::read_buffer, file_in_zip64_read_info_s::rest_read_compressed, file_in_zip64_read_info_s::rest_read_uncompressed, file_in_zip64_read_info_s::stream, z_stream_s::total_in, z_stream_s::total_out, file_in_zip64_read_info_s::total_out_64, UNZ_BUFSIZE, UNZ_END_OF_LIST_OF_FILE, UNZ_EOF, UNZ_ERRNO, UNZ_OK, UNZ_PARAMERROR, Z_BZIP2ED, Z_DATA_ERROR, file_in_zip64_read_info_s::z_filefunc, Z_OK, Z_STREAM_END, Z_SYNC_FLUSH, zdecode, ZLIB_FILEFUNC_SEEK_SET, ZREAD64, and ZSEEK64.

## ◆ unzSetOffset()

int ZEXPORT unzSetOffset | ( | unzFile | file,
|  | uLong | pos
| ) |  |

Definition at line 2127 of file unzip.c.

References unzSetOffset64().

## ◆ unzSetOffset64()

int ZEXPORT unzSetOffset64 | ( | unzFile | file,
|  | ZPOS64_T | pos
| ) |  |

Definition at line 2109 of file unzip.c.

References unz64_s::cur_file_info, unz64_s::cur_file_info_internal, unz64_s::current_file_ok, err, unz64_s::gi, NULL, unz64_s::num_file, unz_global_info64_s::number_entry, unz64_s::pos_in_central_dir, 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 1894 of file unzip.c.

References NULL, unz64_s::pfile_in_zip_read, file_in_zip64_read_info_s::stream, z_stream_s::total_out, UNZ_PARAMERROR, and z_off_t.

## ◆ unztell64()

ZPOS64_T ZEXPORT unztell64 | ( | unzFile | file | ) |

Definition at line 1909 of file unzip.c.

References NULL, unz64_s::pfile_in_zip_read, and file_in_zip64_read_info_s::total_out_64.

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