|
JubeatPlus 3.9.11
|
IO for reading .zip files, the subset of minizip's unz* API that KUnzip drives.
More...
#include "ioapi.h"
Go to the source code of this file.
Classes | |
| struct | tm_unz_s |
| An entry's last-modified date and time, decoded from the DOS date field. More... | |
| struct | unz_global_info64_s |
| Archive-wide information taken from the end-of-central-directory record. More... | |
| struct | unz_file_info64_s |
| Per-entry information taken from the entry's central-directory header. More... | |
Typedefs | |
| typedef void * | unzFile |
| minizip's opaque unzip archive handle. | |
| typedef unsigned long long | ZPOS64_T |
minizip's 64-bit file-position type (zlib's ZPOS64_T). | |
| typedef struct tm_unz_s | tm_unz |
| An entry's last-modified date and time, decoded from the DOS date field. | |
| typedef struct unz_global_info64_s | unz_global_info64 |
| Archive-wide information taken from the end-of-central-directory record. | |
| typedef struct unz_file_info64_s | unz_file_info64 |
| Per-entry information taken from the entry's central-directory header. | |
Functions | |
| unzFile | unzOpen (const char *path) |
| Opens a .zip archive at a path using the default stdio I/O callbacks. | |
| unzFile | unzOpenInternal (voidpf file, zlib_filefunc_def *pzlib_filefunc_def) |
| Opens a .zip archive using a caller-supplied I/O callback table. | |
| int | unzClose (unzFile file) |
Closes an archive opened with unzOpen or unzOpenInternal. | |
| int | unzGetGlobalInfo64 (unzFile file, unz_global_info64 *pglobal_info) |
Writes the archive-wide information into pglobal_info. | |
| int | unzGoToFirstFile (unzFile file) |
| Makes the first entry the current entry. | |
| int | unzGoToNextFile (unzFile file) |
| Makes the next entry the current entry. | |
| int | unzLocateFile (unzFile file, const char *szFileName, int iCaseSensitivity) |
| Locates an entry by name and makes it the current entry. | |
| int | unzGetCurrentFileInfo64 (unzFile file, unz_file_info64 *pfile_info, char *szFileName, uLong fileNameBufferSize, void *extraField, uLong extraFieldBufferSize, char *szComment, uLong commentBufferSize) |
| Reads the current entry's information and, optionally, its name, extra field, and comment. | |
| int | unzOpenCurrentFile (unzFile file) |
| Opens the current entry for reading its decompressed data. | |
| int | unzReadCurrentFile (unzFile file, void *buf, unsigned len) |
| Reads decompressed bytes from the current entry. | |
| int | unzCloseCurrentFile (unzFile file) |
Closes the current entry opened with unzOpenCurrentFile. | |
IO for reading .zip files, the subset of minizip's unz* API that KUnzip drives.
This is upstream third-party library code, not a routine reconstructed from the binary: it is Gilles Vollant's minizip unzip.c/unzip.h (the version bundled with zlib's contrib/minizip), recovered as the library the way NSData+Base64 and ioapi.c are. The shipped KUnzip was built against a hybrid minizip variant — the classic 1.01e reader with its 32-bit zlib_filefunc_def I/O table (see ioapi.h) and a two-argument internal open, but with the public per-entry and archive-wide info structures widened to the Zip64 *64 names. Only the entry points KUnzip references are declared. The I/O callback table, the voidpf opaque, and uLong come from ioapi.h.
Condition of use and distribution are the same as zlib.
| int unzClose | ( | unzFile | file | ) |
Closes an archive opened with unzOpen or unzOpenInternal.
| file | The archive handle. |
UNZ_OK on success, or UNZ_PARAMERROR when file is nullptr. | int unzCloseCurrentFile | ( | unzFile | file | ) |
Closes the current entry opened with unzOpenCurrentFile.
| file | The archive handle. |
UNZ_OK on success, or UNZ_CRCERROR when the whole entry was read and its CRC did not match. | int unzGetCurrentFileInfo64 | ( | unzFile | file, |
| unz_file_info64 * | pfile_info, | ||
| char * | szFileName, | ||
| uLong | fileNameBufferSize, | ||
| void * | extraField, | ||
| uLong | extraFieldBufferSize, | ||
| char * | szComment, | ||
| uLong | commentBufferSize ) |
Reads the current entry's information and, optionally, its name, extra field, and comment.
| file | The archive handle. |
| pfile_info | The structure to fill, or nullptr. |
| szFileName | A buffer for the entry name, or nullptr. |
| fileNameBufferSize | The size of szFileName. |
| extraField | A buffer for the central-header extra field, or nullptr. |
| extraFieldBufferSize | The size of extraField. |
| szComment | A buffer for the entry comment, or nullptr. |
| commentBufferSize | The size of szComment. |
UNZ_OK on success. | int unzGetGlobalInfo64 | ( | unzFile | file, |
| unz_global_info64 * | pglobal_info ) |
Writes the archive-wide information into pglobal_info.
| file | The archive handle. |
| pglobal_info | The structure to fill; needs no preparation. |
UNZ_OK on success, or UNZ_PARAMERROR when file is nullptr. | int unzGoToFirstFile | ( | unzFile | file | ) |
Makes the first entry the current entry.
| file | The archive handle. |
UNZ_OK on success. | int unzGoToNextFile | ( | unzFile | file | ) |
Makes the next entry the current entry.
| file | The archive handle. |
UNZ_OK on success, or UNZ_END_OF_LIST_OF_FILE past the last entry. | int unzLocateFile | ( | unzFile | file, |
| const char * | szFileName, | ||
| int | iCaseSensitivity ) |
Locates an entry by name and makes it the current entry.
| file | The archive handle. |
| szFileName | The entry name to find. |
| iCaseSensitivity | 1 for a case-sensitive match, 2 for case-insensitive, 0 for the operating system default. |
UNZ_OK when the entry is found, or UNZ_END_OF_LIST_OF_FILE when it is not. | unzFile unzOpen | ( | const char * | path | ) |
Opens a .zip archive at a path using the default stdio I/O callbacks.
| path | The archive's path. |
nullptr when the file does not exist or is not a valid archive. | int unzOpenCurrentFile | ( | unzFile | file | ) |
Opens the current entry for reading its decompressed data.
| file | The archive handle. |
UNZ_OK on success. | unzFile unzOpenInternal | ( | voidpf | file, |
| zlib_filefunc_def * | pzlib_filefunc_def ) |
Opens a .zip archive using a caller-supplied I/O callback table.
| file | The value passed through to the table's zopen_file callback as its filename. |
| pzlib_filefunc_def | The I/O callback table, or nullptr to use the default stdio table. |
nullptr when the archive cannot be opened. | int unzReadCurrentFile | ( | unzFile | file, |
| void * | buf, | ||
| unsigned | len ) |
Reads decompressed bytes from the current entry.
| file | The archive handle. |
| buf | The destination buffer. |
| len | The size of buf. |