mirror of
https://github.com/zlib-ng/minizip-ng
synced 2026-08-25 14:26:08 -04:00
compat: add unzGetCurrentFileZStreamPos64 (#848)
Returns the absolute offset where the current entry's compressed data begins, matching the original minizip API used by chromium and other consumers. The position is already tracked internally via entry_pos for STORE-method seek support, so this just exposes it.
This commit is contained in:
parent
6b9defc73c
commit
a6300c3b29
2 changed files with 8 additions and 0 deletions
|
|
@ -629,6 +629,13 @@ int unzSetOffset64(unzFile file, int64_t pos) {
|
||||||
return (int)mz_zip_goto_entry(compat->handle, pos);
|
return (int)mz_zip_goto_entry(compat->handle, pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint64_t unzGetCurrentFileZStreamPos64(unzFile file) {
|
||||||
|
mz_unzip_compat *compat = (mz_unzip_compat *)file;
|
||||||
|
if (!compat || mz_zip_entry_is_open(compat->handle) != MZ_OK)
|
||||||
|
return 0;
|
||||||
|
return (uint64_t)compat->entry_pos;
|
||||||
|
}
|
||||||
|
|
||||||
int unzGetLocalExtrafield(unzFile file, void *buf, unsigned int len) {
|
int unzGetLocalExtrafield(unzFile file, void *buf, unsigned int len) {
|
||||||
mz_unzip_compat *compat = (mz_unzip_compat *)file;
|
mz_unzip_compat *compat = (mz_unzip_compat *)file;
|
||||||
mz_zip_file *file_info = NULL;
|
mz_zip_file *file_info = NULL;
|
||||||
|
|
|
||||||
|
|
@ -217,6 +217,7 @@ ZEXPORT int64_t unzGetOffset64(unzFile file);
|
||||||
ZEXPORT unsigned long unzGetOffset(unzFile file);
|
ZEXPORT unsigned long unzGetOffset(unzFile file);
|
||||||
ZEXPORT int unzSetOffset64(unzFile file, int64_t pos);
|
ZEXPORT int unzSetOffset64(unzFile file, int64_t pos);
|
||||||
ZEXPORT int unzSetOffset(unzFile file, unsigned long pos);
|
ZEXPORT int unzSetOffset(unzFile file, unsigned long pos);
|
||||||
|
ZEXPORT uint64_t unzGetCurrentFileZStreamPos64(unzFile file);
|
||||||
ZEXPORT int32_t unztell(unzFile file);
|
ZEXPORT int32_t unztell(unzFile file);
|
||||||
ZEXPORT uint64_t unztell64(unzFile file);
|
ZEXPORT uint64_t unztell64(unzFile file);
|
||||||
ZEXPORT int unzeof(unzFile file);
|
ZEXPORT int unzeof(unzFile file);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue