mirror of
https://github.com/zlib-ng/minizip-ng
synced 2026-08-25 14:26:08 -04:00
Finished implementation for strm_mem; Changed interface accordingly; Changed other funcs to use this signature; Code compiles and passes al the tests
This commit is contained in:
parent
dee016db77
commit
fc7fd63d46
30 changed files with 116 additions and 114 deletions
|
|
@ -15,10 +15,10 @@ typedef struct mz_stream_ioapi_s {
|
|||
|
||||
static int32_t mz_stream_ioapi_open(void *stream, const char *path, int32_t mode);
|
||||
static int32_t mz_stream_ioapi_is_open(void *stream);
|
||||
static int32_t mz_stream_ioapi_read(void *stream, void *buf, int32_t size);
|
||||
static int32_t mz_stream_ioapi_write(void *stream, const void *buf, int32_t size);
|
||||
static int64_t mz_stream_ioapi_read(void *stream, void *buf, int64_t size);
|
||||
static int64_t mz_stream_ioapi_write(void *stream, const void *buf, int64_t size);
|
||||
static int64_t mz_stream_ioapi_tell(void *stream);
|
||||
static int32_t mz_stream_ioapi_seek(void *stream, int64_t offset, int32_t origin);
|
||||
static int64_t mz_stream_ioapi_seek(void *stream, int64_t offset, int32_t origin);
|
||||
static int32_t mz_stream_ioapi_close(void *stream);
|
||||
static int32_t mz_stream_ioapi_error(void *stream);
|
||||
|
||||
|
|
@ -70,7 +70,7 @@ static int32_t mz_stream_ioapi_is_open(void *stream) {
|
|||
return MZ_OK;
|
||||
}
|
||||
|
||||
static int32_t mz_stream_ioapi_read(void *stream, void *buf, int32_t size) {
|
||||
static int64_t mz_stream_ioapi_read(void *stream, void *buf, int64_t size) {
|
||||
mz_stream_ioapi *ioapi = (mz_stream_ioapi *)stream;
|
||||
read_file_func zread = NULL;
|
||||
void *opaque = NULL;
|
||||
|
|
@ -90,7 +90,7 @@ static int32_t mz_stream_ioapi_read(void *stream, void *buf, int32_t size) {
|
|||
return (int32_t)zread(opaque, ioapi->handle, buf, size);
|
||||
}
|
||||
|
||||
static int32_t mz_stream_ioapi_write(void *stream, const void *buf, int32_t size) {
|
||||
static int64_t mz_stream_ioapi_write(void *stream, const void *buf, int64_t size) {
|
||||
mz_stream_ioapi *ioapi = (mz_stream_ioapi *)stream;
|
||||
write_file_func zwrite = NULL;
|
||||
int32_t written = 0;
|
||||
|
|
@ -126,7 +126,7 @@ static int64_t mz_stream_ioapi_tell(void *stream) {
|
|||
return MZ_INTERNAL_ERROR;
|
||||
}
|
||||
|
||||
static int32_t mz_stream_ioapi_seek(void *stream, int64_t offset, int32_t origin) {
|
||||
static int64_t mz_stream_ioapi_seek(void *stream, int64_t offset, int32_t origin) {
|
||||
mz_stream_ioapi *ioapi = (mz_stream_ioapi *)stream;
|
||||
|
||||
if (mz_stream_ioapi_is_open(stream) != MZ_OK)
|
||||
|
|
|
|||
18
mz_strm.c
18
mz_strm.c
|
|
@ -31,7 +31,7 @@ int32_t mz_stream_is_open(void *stream) {
|
|||
return strm->vtbl->is_open(strm);
|
||||
}
|
||||
|
||||
int32_t mz_stream_read(void *stream, void *buf, int32_t size) {
|
||||
int64_t mz_stream_read(void *stream, void *buf, int64_t size) {
|
||||
mz_stream *strm = (mz_stream *)stream;
|
||||
if (!strm || !strm->vtbl || !strm->vtbl->read)
|
||||
return MZ_PARAM_ERROR;
|
||||
|
|
@ -98,7 +98,7 @@ int32_t mz_stream_read_uint64(void *stream, uint64_t *value) {
|
|||
return mz_stream_read_value(stream, value, sizeof(uint64_t));
|
||||
}
|
||||
|
||||
int32_t mz_stream_write(void *stream, const void *buf, int32_t size) {
|
||||
int64_t mz_stream_write(void *stream, const void *buf, int64_t size) {
|
||||
mz_stream *strm = (mz_stream *)stream;
|
||||
if (size == 0)
|
||||
return size;
|
||||
|
|
@ -442,14 +442,14 @@ int32_t mz_stream_raw_is_open(void *stream) {
|
|||
return mz_stream_is_open(raw->stream.base);
|
||||
}
|
||||
|
||||
int32_t mz_stream_raw_read(void *stream, void *buf, int32_t size) {
|
||||
int64_t mz_stream_raw_read(void *stream, void *buf, int64_t size) {
|
||||
mz_stream_raw *raw = (mz_stream_raw *)stream;
|
||||
int32_t bytes_to_read = size;
|
||||
int32_t read = 0;
|
||||
int64_t bytes_to_read = size;
|
||||
int64_t read = 0;
|
||||
|
||||
if (raw->max_total_in > 0) {
|
||||
if ((int64_t)bytes_to_read > (raw->max_total_in - raw->total_in))
|
||||
bytes_to_read = (int32_t)(raw->max_total_in - raw->total_in);
|
||||
bytes_to_read = (int64_t)(raw->max_total_in - raw->total_in);
|
||||
}
|
||||
|
||||
read = mz_stream_read(raw->stream.base, buf, bytes_to_read);
|
||||
|
|
@ -462,9 +462,9 @@ int32_t mz_stream_raw_read(void *stream, void *buf, int32_t size) {
|
|||
return read;
|
||||
}
|
||||
|
||||
int32_t mz_stream_raw_write(void *stream, const void *buf, int32_t size) {
|
||||
int64_t mz_stream_raw_write(void *stream, const void *buf, int64_t size) {
|
||||
mz_stream_raw *raw = (mz_stream_raw *)stream;
|
||||
int32_t written = 0;
|
||||
int64_t written = 0;
|
||||
|
||||
written = mz_stream_write(raw->stream.base, buf, size);
|
||||
|
||||
|
|
@ -481,7 +481,7 @@ int64_t mz_stream_raw_tell(void *stream) {
|
|||
return mz_stream_tell(raw->stream.base);
|
||||
}
|
||||
|
||||
int32_t mz_stream_raw_seek(void *stream, int64_t offset, int32_t origin) {
|
||||
int64_t mz_stream_raw_seek(void *stream, int64_t offset, int32_t origin) {
|
||||
mz_stream_raw *raw = (mz_stream_raw *)stream;
|
||||
return mz_stream_seek(raw->stream.base, offset, origin);
|
||||
}
|
||||
|
|
|
|||
16
mz_strm.h
16
mz_strm.h
|
|
@ -34,10 +34,10 @@ extern "C" {
|
|||
|
||||
typedef int32_t (*mz_stream_open_cb)(void *stream, const char *path, int32_t mode);
|
||||
typedef int32_t (*mz_stream_is_open_cb)(void *stream);
|
||||
typedef int32_t (*mz_stream_read_cb)(void *stream, void *buf, int32_t size);
|
||||
typedef int32_t (*mz_stream_write_cb)(void *stream, const void *buf, int32_t size);
|
||||
typedef int64_t (*mz_stream_read_cb)(void *stream, void *buf, int64_t size);
|
||||
typedef int64_t (*mz_stream_write_cb)(void *stream, const void *buf, int64_t size);
|
||||
typedef int64_t (*mz_stream_tell_cb)(void *stream);
|
||||
typedef int32_t (*mz_stream_seek_cb)(void *stream, int64_t offset, int32_t origin);
|
||||
typedef int64_t (*mz_stream_seek_cb)(void *stream, int64_t offset, int32_t origin);
|
||||
typedef int32_t (*mz_stream_close_cb)(void *stream);
|
||||
typedef int32_t (*mz_stream_error_cb)(void *stream);
|
||||
typedef void *(*mz_stream_create_cb)(void);
|
||||
|
|
@ -76,13 +76,13 @@ typedef struct mz_stream_s {
|
|||
|
||||
int32_t mz_stream_open(void *stream, const char *path, int32_t mode);
|
||||
int32_t mz_stream_is_open(void *stream);
|
||||
int32_t mz_stream_read(void *stream, void *buf, int32_t size);
|
||||
int64_t mz_stream_read(void *stream, void *buf, int64_t size);
|
||||
int32_t mz_stream_read_uint8(void *stream, uint8_t *value);
|
||||
int32_t mz_stream_read_uint16(void *stream, uint16_t *value);
|
||||
int32_t mz_stream_read_uint32(void *stream, uint32_t *value);
|
||||
int32_t mz_stream_read_int64(void *stream, int64_t *value);
|
||||
int32_t mz_stream_read_uint64(void *stream, uint64_t *value);
|
||||
int32_t mz_stream_write(void *stream, const void *buf, int32_t size);
|
||||
int64_t mz_stream_write(void *stream, const void *buf, int64_t size);
|
||||
int32_t mz_stream_write_uint8(void *stream, uint8_t value);
|
||||
int32_t mz_stream_write_uint16(void *stream, uint16_t value);
|
||||
int32_t mz_stream_write_uint32(void *stream, uint32_t value);
|
||||
|
|
@ -113,10 +113,10 @@ void mz_stream_delete(void **stream);
|
|||
|
||||
int32_t mz_stream_raw_open(void *stream, const char *filename, int32_t mode);
|
||||
int32_t mz_stream_raw_is_open(void *stream);
|
||||
int32_t mz_stream_raw_read(void *stream, void *buf, int32_t size);
|
||||
int32_t mz_stream_raw_write(void *stream, const void *buf, int32_t size);
|
||||
int64_t mz_stream_raw_read(void *stream, void *buf, int64_t size);
|
||||
int64_t mz_stream_raw_write(void *stream, const void *buf, int64_t size);
|
||||
int64_t mz_stream_raw_tell(void *stream);
|
||||
int32_t mz_stream_raw_seek(void *stream, int64_t offset, int32_t origin);
|
||||
int64_t mz_stream_raw_seek(void *stream, int64_t offset, int32_t origin);
|
||||
int32_t mz_stream_raw_close(void *stream);
|
||||
int32_t mz_stream_raw_error(void *stream);
|
||||
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ static int32_t mz_stream_buffered_flush(void *stream, int32_t *written) {
|
|||
return MZ_OK;
|
||||
}
|
||||
|
||||
int32_t mz_stream_buffered_read(void *stream, void *buf, int32_t size) {
|
||||
int64_t mz_stream_buffered_read(void *stream, void *buf, int64_t size) {
|
||||
mz_stream_buffered *buffered = (mz_stream_buffered *)stream;
|
||||
int32_t buf_len = 0;
|
||||
int32_t bytes_to_read = 0;
|
||||
|
|
@ -182,7 +182,7 @@ int32_t mz_stream_buffered_read(void *stream, void *buf, int32_t size) {
|
|||
return size - bytes_left_to_read;
|
||||
}
|
||||
|
||||
int32_t mz_stream_buffered_write(void *stream, const void *buf, int32_t size) {
|
||||
int64_t mz_stream_buffered_write(void *stream, const void *buf, int64_t size) {
|
||||
mz_stream_buffered *buffered = (mz_stream_buffered *)stream;
|
||||
int32_t bytes_to_write = size;
|
||||
int32_t bytes_left_to_write = size;
|
||||
|
|
@ -260,7 +260,7 @@ int64_t mz_stream_buffered_tell(void *stream) {
|
|||
return position;
|
||||
}
|
||||
|
||||
int32_t mz_stream_buffered_seek(void *stream, int64_t offset, int32_t origin) {
|
||||
int64_t mz_stream_buffered_seek(void *stream, int64_t offset, int32_t origin) {
|
||||
mz_stream_buffered *buffered = (mz_stream_buffered *)stream;
|
||||
int32_t bytes_flushed = 0;
|
||||
int32_t err = MZ_OK;
|
||||
|
|
|
|||
|
|
@ -21,10 +21,10 @@ extern "C" {
|
|||
|
||||
int32_t mz_stream_buffered_open(void *stream, const char *path, int32_t mode);
|
||||
int32_t mz_stream_buffered_is_open(void *stream);
|
||||
int32_t mz_stream_buffered_read(void *stream, void *buf, int32_t size);
|
||||
int32_t mz_stream_buffered_write(void *stream, const void *buf, int32_t size);
|
||||
int64_t mz_stream_buffered_read(void *stream, void *buf, int64_t size);
|
||||
int64_t mz_stream_buffered_write(void *stream, const void *buf, int64_t size);
|
||||
int64_t mz_stream_buffered_tell(void *stream);
|
||||
int32_t mz_stream_buffered_seek(void *stream, int64_t offset, int32_t origin);
|
||||
int64_t mz_stream_buffered_seek(void *stream, int64_t offset, int32_t origin);
|
||||
int32_t mz_stream_buffered_close(void *stream);
|
||||
int32_t mz_stream_buffered_error(void *stream);
|
||||
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ int32_t mz_stream_bzip_is_open(void *stream) {
|
|||
return MZ_OK;
|
||||
}
|
||||
|
||||
int32_t mz_stream_bzip_read(void *stream, void *buf, int32_t size) {
|
||||
int64_t mz_stream_bzip_read(void *stream, void *buf, int64_t size) {
|
||||
#ifdef MZ_ZIP_NO_DECOMPRESSION
|
||||
MZ_UNUSED(stream);
|
||||
MZ_UNUSED(buf);
|
||||
|
|
@ -216,7 +216,7 @@ static int32_t mz_stream_bzip_compress(void *stream, int flush) {
|
|||
}
|
||||
#endif
|
||||
|
||||
int32_t mz_stream_bzip_write(void *stream, const void *buf, int32_t size) {
|
||||
int64_t mz_stream_bzip_write(void *stream, const void *buf, int64_t size) {
|
||||
#ifdef MZ_ZIP_NO_COMPRESSION
|
||||
MZ_UNUSED(stream);
|
||||
MZ_UNUSED(buf);
|
||||
|
|
@ -245,7 +245,7 @@ int64_t mz_stream_bzip_tell(void *stream) {
|
|||
return MZ_TELL_ERROR;
|
||||
}
|
||||
|
||||
int32_t mz_stream_bzip_seek(void *stream, int64_t offset, int32_t origin) {
|
||||
int64_t mz_stream_bzip_seek(void *stream, int64_t offset, int32_t origin) {
|
||||
MZ_UNUSED(stream);
|
||||
MZ_UNUSED(offset);
|
||||
MZ_UNUSED(origin);
|
||||
|
|
|
|||
|
|
@ -19,10 +19,10 @@ extern "C" {
|
|||
|
||||
int32_t mz_stream_bzip_open(void *stream, const char *filename, int32_t mode);
|
||||
int32_t mz_stream_bzip_is_open(void *stream);
|
||||
int32_t mz_stream_bzip_read(void *stream, void *buf, int32_t size);
|
||||
int32_t mz_stream_bzip_write(void *stream, const void *buf, int32_t size);
|
||||
int64_t mz_stream_bzip_read(void *stream, void *buf, int64_t size);
|
||||
int64_t mz_stream_bzip_write(void *stream, const void *buf, int64_t size);
|
||||
int64_t mz_stream_bzip_tell(void *stream);
|
||||
int32_t mz_stream_bzip_seek(void *stream, int64_t offset, int32_t origin);
|
||||
int64_t mz_stream_bzip_seek(void *stream, int64_t offset, int32_t origin);
|
||||
int32_t mz_stream_bzip_close(void *stream);
|
||||
int32_t mz_stream_bzip_error(void *stream);
|
||||
|
||||
|
|
|
|||
|
|
@ -144,7 +144,7 @@ int32_t mz_stream_lzma_is_open(void *stream) {
|
|||
return MZ_OK;
|
||||
}
|
||||
|
||||
int32_t mz_stream_lzma_read(void *stream, void *buf, int32_t size) {
|
||||
int64_t mz_stream_lzma_read(void *stream, void *buf, int64_t size) {
|
||||
#ifdef MZ_ZIP_NO_DECOMPRESSION
|
||||
MZ_UNUSED(stream);
|
||||
MZ_UNUSED(buf);
|
||||
|
|
@ -308,7 +308,7 @@ static int32_t mz_stream_lzma_code(void *stream, int32_t flush) {
|
|||
}
|
||||
#endif
|
||||
|
||||
int32_t mz_stream_lzma_write(void *stream, const void *buf, int32_t size) {
|
||||
int64_t mz_stream_lzma_write(void *stream, const void *buf, int64_t size) {
|
||||
#ifdef MZ_ZIP_NO_COMPRESSION
|
||||
MZ_UNUSED(stream);
|
||||
MZ_UNUSED(buf);
|
||||
|
|
@ -337,7 +337,7 @@ int64_t mz_stream_lzma_tell(void *stream) {
|
|||
return MZ_TELL_ERROR;
|
||||
}
|
||||
|
||||
int32_t mz_stream_lzma_seek(void *stream, int64_t offset, int32_t origin) {
|
||||
int64_t mz_stream_lzma_seek(void *stream, int64_t offset, int32_t origin) {
|
||||
MZ_UNUSED(stream);
|
||||
MZ_UNUSED(offset);
|
||||
MZ_UNUSED(origin);
|
||||
|
|
|
|||
|
|
@ -19,10 +19,10 @@ extern "C" {
|
|||
|
||||
int32_t mz_stream_lzma_open(void *stream, const char *filename, int32_t mode);
|
||||
int32_t mz_stream_lzma_is_open(void *stream);
|
||||
int32_t mz_stream_lzma_read(void *stream, void *buf, int32_t size);
|
||||
int32_t mz_stream_lzma_write(void *stream, const void *buf, int32_t size);
|
||||
int64_t mz_stream_lzma_read(void *stream, void *buf, int64_t size);
|
||||
int64_t mz_stream_lzma_write(void *stream, const void *buf, int64_t size);
|
||||
int64_t mz_stream_lzma_tell(void *stream);
|
||||
int32_t mz_stream_lzma_seek(void *stream, int64_t offset, int32_t origin);
|
||||
int64_t mz_stream_lzma_seek(void *stream, int64_t offset, int32_t origin);
|
||||
int32_t mz_stream_lzma_close(void *stream);
|
||||
int32_t mz_stream_lzma_error(void *stream);
|
||||
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ int32_t mz_stream_mem_is_open(void *stream) {
|
|||
return MZ_OK;
|
||||
}
|
||||
|
||||
int32_t mz_stream_mem_read(void *stream, void *buf, int64_t size) {
|
||||
int64_t mz_stream_mem_read(void *stream, void *buf, int64_t size) {
|
||||
mz_stream_mem *mem = (mz_stream_mem *)stream;
|
||||
|
||||
if (size > mem->size - mem->position)
|
||||
|
|
@ -125,13 +125,13 @@ int32_t mz_stream_mem_read(void *stream, void *buf, int64_t size) {
|
|||
return size;
|
||||
}
|
||||
|
||||
int32_t mz_stream_mem_write(void *stream, const void *buf, int64_t size) {
|
||||
int64_t mz_stream_mem_write(void *stream, const void *buf, int64_t size) {
|
||||
mz_stream_mem *mem = (mz_stream_mem *)stream;
|
||||
size_t new_size = 0;
|
||||
int64_t new_size = 0;
|
||||
int32_t err = MZ_OK;
|
||||
|
||||
if (!size)
|
||||
return size;
|
||||
if (size <= 0)
|
||||
return 0;
|
||||
|
||||
if (size > mem->size - mem->position) {
|
||||
if (mem->mode & MZ_OPEN_MODE_CREATE) {
|
||||
|
|
@ -149,7 +149,10 @@ int32_t mz_stream_mem_write(void *stream, const void *buf, int64_t size) {
|
|||
}
|
||||
}
|
||||
|
||||
memcpy(mem->buffer + mem->position, buf, size);
|
||||
if (size <= 0)
|
||||
return 0;
|
||||
|
||||
memcpy(mem->buffer + mem->position, buf, (size_t)size);
|
||||
|
||||
mem->position += size;
|
||||
if (mem->position > mem->limit)
|
||||
|
|
@ -163,7 +166,7 @@ int64_t mz_stream_mem_tell(void *stream) {
|
|||
return mem->position;
|
||||
}
|
||||
|
||||
int32_t mz_stream_mem_seek(void *stream, int64_t offset, int32_t origin) {
|
||||
int64_t mz_stream_mem_seek(void *stream, int64_t offset, int32_t origin) {
|
||||
mz_stream_mem *mem = (mz_stream_mem *)stream;
|
||||
int64_t new_pos = 0;
|
||||
int32_t err = MZ_OK;
|
||||
|
|
@ -182,8 +185,7 @@ int32_t mz_stream_mem_seek(void *stream, int64_t offset, int32_t origin) {
|
|||
return MZ_SEEK_ERROR;
|
||||
}
|
||||
|
||||
// While `malloc` accepts a size_t, mz_stream_mem_s.size only supports an int32_t
|
||||
if (new_pos < 0 || new_pos > INT32_MAX) {
|
||||
if (new_pos < 0) {
|
||||
return MZ_SEEK_ERROR;
|
||||
}
|
||||
|
||||
|
|
@ -191,12 +193,12 @@ int32_t mz_stream_mem_seek(void *stream, int64_t offset, int32_t origin) {
|
|||
if ((mem->mode & MZ_OPEN_MODE_CREATE) == 0)
|
||||
return MZ_SEEK_ERROR;
|
||||
|
||||
err = mz_stream_mem_set_size(stream, (int32_t)new_pos);
|
||||
err = mz_stream_mem_set_size(stream, new_pos);
|
||||
if (err != MZ_OK)
|
||||
return err;
|
||||
}
|
||||
|
||||
mem->position = (int32_t)new_pos;
|
||||
mem->position = new_pos;
|
||||
return MZ_OK;
|
||||
}
|
||||
|
||||
|
|
@ -214,7 +216,7 @@ int32_t mz_stream_mem_error(void *stream) {
|
|||
return MZ_OK;
|
||||
}
|
||||
|
||||
void mz_stream_mem_set_buffer(void *stream, void *buf, int32_t size) {
|
||||
void mz_stream_mem_set_buffer(void *stream, void *buf, int64_t size) {
|
||||
mz_stream_mem *mem = (mz_stream_mem *)stream;
|
||||
mem->buffer = (uint8_t *)buf;
|
||||
mem->size = size;
|
||||
|
|
@ -238,12 +240,12 @@ int32_t mz_stream_mem_get_buffer_at_current(void *stream, const void **buf) {
|
|||
return mz_stream_mem_get_buffer_at(stream, mem->position, buf);
|
||||
}
|
||||
|
||||
void mz_stream_mem_get_buffer_length(void *stream, int32_t *length) {
|
||||
void mz_stream_mem_get_buffer_length(void *stream, int64_t *length) {
|
||||
mz_stream_mem *mem = (mz_stream_mem *)stream;
|
||||
*length = mem->limit;
|
||||
}
|
||||
|
||||
void mz_stream_mem_set_buffer_limit(void *stream, int32_t limit) {
|
||||
void mz_stream_mem_set_buffer_limit(void *stream, int64_t limit) {
|
||||
mz_stream_mem *mem = (mz_stream_mem *)stream;
|
||||
mem->limit = limit;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,19 +19,19 @@ extern "C" {
|
|||
|
||||
int32_t mz_stream_mem_open(void *stream, const char *filename, int32_t mode);
|
||||
int32_t mz_stream_mem_is_open(void *stream);
|
||||
int32_t mz_stream_mem_read(void *stream, void *buf, int32_t size);
|
||||
int32_t mz_stream_mem_write(void *stream, const void *buf, int32_t size);
|
||||
int64_t mz_stream_mem_read(void *stream, void *buf, int64_t size);
|
||||
int64_t mz_stream_mem_write(void *stream, const void *buf, int64_t size);
|
||||
int64_t mz_stream_mem_tell(void *stream);
|
||||
int32_t mz_stream_mem_seek(void *stream, int64_t offset, int32_t origin);
|
||||
int64_t mz_stream_mem_seek(void *stream, int64_t offset, int32_t origin);
|
||||
int32_t mz_stream_mem_close(void *stream);
|
||||
int32_t mz_stream_mem_error(void *stream);
|
||||
|
||||
void mz_stream_mem_set_buffer(void *stream, void *buf, int32_t size);
|
||||
void mz_stream_mem_set_buffer(void *stream, void *buf, int64_t size);
|
||||
int32_t mz_stream_mem_get_buffer(void *stream, const void **buf);
|
||||
int32_t mz_stream_mem_get_buffer_at(void *stream, int64_t position, const void **buf);
|
||||
int32_t mz_stream_mem_get_buffer_at_current(void *stream, const void **buf);
|
||||
void mz_stream_mem_get_buffer_length(void *stream, int32_t *length);
|
||||
void mz_stream_mem_set_buffer_limit(void *stream, int32_t limit);
|
||||
void mz_stream_mem_get_buffer_length(void *stream, int64_t *length);
|
||||
void mz_stream_mem_set_buffer_limit(void *stream, int64_t limit);
|
||||
void mz_stream_mem_set_grow_size(void *stream, int32_t grow_size);
|
||||
|
||||
void *mz_stream_mem_create(void);
|
||||
|
|
|
|||
|
|
@ -19,10 +19,10 @@ extern "C" {
|
|||
|
||||
int32_t mz_stream_os_open(void *stream, const char *path, int32_t mode);
|
||||
int32_t mz_stream_os_is_open(void *stream);
|
||||
int32_t mz_stream_os_read(void *stream, void *buf, int32_t size);
|
||||
int32_t mz_stream_os_write(void *stream, const void *buf, int32_t size);
|
||||
int64_t mz_stream_os_read(void *stream, void *buf, int64_t size);
|
||||
int64_t mz_stream_os_write(void *stream, const void *buf, int64_t size);
|
||||
int64_t mz_stream_os_tell(void *stream);
|
||||
int32_t mz_stream_os_seek(void *stream, int64_t offset, int32_t origin);
|
||||
int64_t mz_stream_os_seek(void *stream, int64_t offset, int32_t origin);
|
||||
int32_t mz_stream_os_close(void *stream);
|
||||
int32_t mz_stream_os_error(void *stream);
|
||||
|
||||
|
|
|
|||
|
|
@ -116,7 +116,7 @@ int32_t mz_stream_os_is_open(void *stream) {
|
|||
return MZ_OK;
|
||||
}
|
||||
|
||||
int32_t mz_stream_os_read(void *stream, void *buf, int32_t size) {
|
||||
int64_t mz_stream_os_read(void *stream, void *buf, int64_t size) {
|
||||
mz_stream_posix *posix = (mz_stream_posix *)stream;
|
||||
int32_t read = (int32_t)fread(buf, 1, (size_t)size, posix->handle);
|
||||
if (read < size && ferror(posix->handle)) {
|
||||
|
|
@ -126,7 +126,7 @@ int32_t mz_stream_os_read(void *stream, void *buf, int32_t size) {
|
|||
return read;
|
||||
}
|
||||
|
||||
int32_t mz_stream_os_write(void *stream, const void *buf, int32_t size) {
|
||||
int64_t mz_stream_os_write(void *stream, const void *buf, int64_t size) {
|
||||
mz_stream_posix *posix = (mz_stream_posix *)stream;
|
||||
int32_t written = (int32_t)fwrite(buf, 1, (size_t)size, posix->handle);
|
||||
if (written < size && ferror(posix->handle)) {
|
||||
|
|
@ -146,7 +146,7 @@ int64_t mz_stream_os_tell(void *stream) {
|
|||
return position;
|
||||
}
|
||||
|
||||
int32_t mz_stream_os_seek(void *stream, int64_t offset, int32_t origin) {
|
||||
int64_t mz_stream_os_seek(void *stream, int64_t offset, int32_t origin) {
|
||||
mz_stream_posix *posix = (mz_stream_posix *)stream;
|
||||
int32_t fseek_origin = 0;
|
||||
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@ int32_t mz_stream_os_is_open(void *stream) {
|
|||
return MZ_OK;
|
||||
}
|
||||
|
||||
int32_t mz_stream_os_read(void *stream, void *buf, int32_t size) {
|
||||
int64_t mz_stream_os_read(void *stream, void *buf, int64_t size) {
|
||||
mz_stream_win32 *win32 = (mz_stream_win32 *)stream;
|
||||
uint32_t read = 0;
|
||||
|
||||
|
|
@ -144,7 +144,7 @@ int32_t mz_stream_os_read(void *stream, void *buf, int32_t size) {
|
|||
return read;
|
||||
}
|
||||
|
||||
int32_t mz_stream_os_write(void *stream, const void *buf, int32_t size) {
|
||||
int64_t mz_stream_os_write(void *stream, const void *buf, int64_t size) {
|
||||
mz_stream_win32 *win32 = (mz_stream_win32 *)stream;
|
||||
int32_t written = 0;
|
||||
|
||||
|
|
@ -207,7 +207,7 @@ int64_t mz_stream_os_tell(void *stream) {
|
|||
return large_pos.QuadPart;
|
||||
}
|
||||
|
||||
int32_t mz_stream_os_seek(void *stream, int64_t offset, int32_t origin) {
|
||||
int64_t mz_stream_os_seek(void *stream, int64_t offset, int32_t origin) {
|
||||
mz_stream_win32 *win32 = (mz_stream_win32 *)stream;
|
||||
uint32_t move_method = 0xFFFFFFFF;
|
||||
int32_t err = MZ_OK;
|
||||
|
|
|
|||
|
|
@ -174,7 +174,7 @@ int32_t mz_stream_pkcrypt_is_open(void *stream) {
|
|||
return MZ_OK;
|
||||
}
|
||||
|
||||
int32_t mz_stream_pkcrypt_read(void *stream, void *buf, int32_t size) {
|
||||
int64_t mz_stream_pkcrypt_read(void *stream, void *buf, int64_t size) {
|
||||
mz_stream_pkcrypt *pkcrypt = (mz_stream_pkcrypt *)stream;
|
||||
uint8_t *buf_ptr = (uint8_t *)buf;
|
||||
int32_t bytes_to_read = size;
|
||||
|
|
@ -195,7 +195,7 @@ int32_t mz_stream_pkcrypt_read(void *stream, void *buf, int32_t size) {
|
|||
return read;
|
||||
}
|
||||
|
||||
int32_t mz_stream_pkcrypt_write(void *stream, const void *buf, int32_t size) {
|
||||
int64_t mz_stream_pkcrypt_write(void *stream, const void *buf, int64_t size) {
|
||||
mz_stream_pkcrypt *pkcrypt = (mz_stream_pkcrypt *)stream;
|
||||
const uint8_t *buf_ptr = (const uint8_t *)buf;
|
||||
int32_t bytes_to_write = sizeof(pkcrypt->buffer);
|
||||
|
|
@ -232,7 +232,7 @@ int64_t mz_stream_pkcrypt_tell(void *stream) {
|
|||
return mz_stream_tell(pkcrypt->stream.base);
|
||||
}
|
||||
|
||||
int32_t mz_stream_pkcrypt_seek(void *stream, int64_t offset, int32_t origin) {
|
||||
int64_t mz_stream_pkcrypt_seek(void *stream, int64_t offset, int32_t origin) {
|
||||
mz_stream_pkcrypt *pkcrypt = (mz_stream_pkcrypt *)stream;
|
||||
return mz_stream_seek(pkcrypt->stream.base, offset, origin);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,10 +19,10 @@ extern "C" {
|
|||
|
||||
int32_t mz_stream_pkcrypt_open(void *stream, const char *filename, int32_t mode);
|
||||
int32_t mz_stream_pkcrypt_is_open(void *stream);
|
||||
int32_t mz_stream_pkcrypt_read(void *stream, void *buf, int32_t size);
|
||||
int32_t mz_stream_pkcrypt_write(void *stream, const void *buf, int32_t size);
|
||||
int64_t mz_stream_pkcrypt_read(void *stream, void *buf, int64_t size);
|
||||
int64_t mz_stream_pkcrypt_write(void *stream, const void *buf, int64_t size);
|
||||
int64_t mz_stream_pkcrypt_tell(void *stream);
|
||||
int32_t mz_stream_pkcrypt_seek(void *stream, int64_t offset, int32_t origin);
|
||||
int64_t mz_stream_pkcrypt_seek(void *stream, int64_t offset, int32_t origin);
|
||||
int32_t mz_stream_pkcrypt_close(void *stream);
|
||||
int32_t mz_stream_pkcrypt_error(void *stream);
|
||||
|
||||
|
|
|
|||
|
|
@ -304,7 +304,7 @@ int32_t mz_stream_ppmd_is_open(void *stream) {
|
|||
return MZ_OK;
|
||||
}
|
||||
|
||||
int32_t mz_stream_ppmd_read(void *stream, void *buf, int32_t size) {
|
||||
int64_t mz_stream_ppmd_read(void *stream, void *buf, int64_t size) {
|
||||
#ifdef MZ_ZIP_NO_DECOMPRESSION
|
||||
MZ_UNUSED(stream);
|
||||
MZ_UNUSED(buf);
|
||||
|
|
@ -356,7 +356,7 @@ int32_t mz_stream_ppmd_read(void *stream, void *buf, int32_t size) {
|
|||
#endif
|
||||
}
|
||||
|
||||
int32_t mz_stream_ppmd_write(void *stream, const void *buf, int32_t size) {
|
||||
int64_t mz_stream_ppmd_write(void *stream, const void *buf, int64_t size) {
|
||||
#ifdef MZ_ZIP_NO_COMPRESSION
|
||||
MZ_UNUSED(stream);
|
||||
MZ_UNUSED(buf);
|
||||
|
|
@ -390,7 +390,7 @@ int64_t mz_stream_ppmd_tell(void *stream) {
|
|||
return ppmd->total_in;
|
||||
}
|
||||
|
||||
int32_t mz_stream_ppmd_seek(void *stream, int64_t offset, int32_t origin) {
|
||||
int64_t mz_stream_ppmd_seek(void *stream, int64_t offset, int32_t origin) {
|
||||
MZ_UNUSED(stream);
|
||||
MZ_UNUSED(offset);
|
||||
MZ_UNUSED(origin);
|
||||
|
|
|
|||
|
|
@ -19,10 +19,10 @@ extern "C" {
|
|||
|
||||
int32_t mz_stream_ppmd_open(void *stream, const char *filename, int32_t mode);
|
||||
int32_t mz_stream_ppmd_is_open(void *stream);
|
||||
int32_t mz_stream_ppmd_read(void *stream, void *buf, int32_t size);
|
||||
int32_t mz_stream_ppmd_write(void *stream, const void *buf, int32_t size);
|
||||
int64_t mz_stream_ppmd_read(void *stream, void *buf, int64_t size);
|
||||
int64_t mz_stream_ppmd_write(void *stream, const void *buf, int64_t size);
|
||||
int64_t mz_stream_ppmd_tell(void *stream);
|
||||
int32_t mz_stream_ppmd_seek(void *stream, int64_t offset, int32_t origin);
|
||||
int64_t mz_stream_ppmd_seek(void *stream, int64_t offset, int32_t origin);
|
||||
int32_t mz_stream_ppmd_close(void *stream);
|
||||
int32_t mz_stream_ppmd_error(void *stream);
|
||||
|
||||
|
|
|
|||
|
|
@ -211,7 +211,7 @@ int32_t mz_stream_split_is_open(void *stream) {
|
|||
return MZ_OK;
|
||||
}
|
||||
|
||||
int32_t mz_stream_split_read(void *stream, void *buf, int32_t size) {
|
||||
int64_t mz_stream_split_read(void *stream, void *buf, int64_t size) {
|
||||
mz_stream_split *split = (mz_stream_split *)stream;
|
||||
int32_t bytes_left = size;
|
||||
int32_t read = 0;
|
||||
|
|
@ -249,7 +249,7 @@ int32_t mz_stream_split_read(void *stream, void *buf, int32_t size) {
|
|||
return size - bytes_left;
|
||||
}
|
||||
|
||||
int32_t mz_stream_split_write(void *stream, const void *buf, int32_t size) {
|
||||
int64_t mz_stream_split_write(void *stream, const void *buf, int64_t size) {
|
||||
mz_stream_split *split = (mz_stream_split *)stream;
|
||||
int64_t position = 0;
|
||||
int32_t written = 0;
|
||||
|
|
@ -314,7 +314,7 @@ int64_t mz_stream_split_tell(void *stream) {
|
|||
return mz_stream_tell(split->stream.base);
|
||||
}
|
||||
|
||||
int32_t mz_stream_split_seek(void *stream, int64_t offset, int32_t origin) {
|
||||
int64_t mz_stream_split_seek(void *stream, int64_t offset, int32_t origin) {
|
||||
mz_stream_split *split = (mz_stream_split *)stream;
|
||||
int64_t disk_left = 0;
|
||||
int64_t position = 0;
|
||||
|
|
|
|||
|
|
@ -19,10 +19,10 @@ extern "C" {
|
|||
|
||||
int32_t mz_stream_split_open(void *stream, const char *filename, int32_t mode);
|
||||
int32_t mz_stream_split_is_open(void *stream);
|
||||
int32_t mz_stream_split_read(void *stream, void *buf, int32_t size);
|
||||
int32_t mz_stream_split_write(void *stream, const void *buf, int32_t size);
|
||||
int64_t mz_stream_split_read(void *stream, void *buf, int64_t size);
|
||||
int64_t mz_stream_split_write(void *stream, const void *buf, int64_t size);
|
||||
int64_t mz_stream_split_tell(void *stream);
|
||||
int32_t mz_stream_split_seek(void *stream, int64_t offset, int32_t origin);
|
||||
int64_t mz_stream_split_seek(void *stream, int64_t offset, int32_t origin);
|
||||
int32_t mz_stream_split_close(void *stream);
|
||||
int32_t mz_stream_split_error(void *stream);
|
||||
|
||||
|
|
|
|||
|
|
@ -175,7 +175,7 @@ static int32_t mz_stream_wzaes_ctr_encrypt(void *stream, uint8_t *buf, int32_t s
|
|||
return err;
|
||||
}
|
||||
|
||||
int32_t mz_stream_wzaes_read(void *stream, void *buf, int32_t size) {
|
||||
int64_t mz_stream_wzaes_read(void *stream, void *buf, int64_t size) {
|
||||
mz_stream_wzaes *wzaes = (mz_stream_wzaes *)stream;
|
||||
int64_t max_total_in = 0;
|
||||
int32_t bytes_to_read = size;
|
||||
|
|
@ -197,7 +197,7 @@ int32_t mz_stream_wzaes_read(void *stream, void *buf, int32_t size) {
|
|||
return read;
|
||||
}
|
||||
|
||||
int32_t mz_stream_wzaes_write(void *stream, const void *buf, int32_t size) {
|
||||
int64_t mz_stream_wzaes_write(void *stream, const void *buf, int64_t size) {
|
||||
mz_stream_wzaes *wzaes = (mz_stream_wzaes *)stream;
|
||||
const uint8_t *buf_ptr = (const uint8_t *)buf;
|
||||
int32_t bytes_to_write = sizeof(wzaes->buffer);
|
||||
|
|
@ -233,7 +233,7 @@ int64_t mz_stream_wzaes_tell(void *stream) {
|
|||
return mz_stream_tell(wzaes->stream.base);
|
||||
}
|
||||
|
||||
int32_t mz_stream_wzaes_seek(void *stream, int64_t offset, int32_t origin) {
|
||||
int64_t mz_stream_wzaes_seek(void *stream, int64_t offset, int32_t origin) {
|
||||
mz_stream_wzaes *wzaes = (mz_stream_wzaes *)stream;
|
||||
return mz_stream_seek(wzaes->stream.base, offset, origin);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,10 +19,10 @@ extern "C" {
|
|||
|
||||
int32_t mz_stream_wzaes_open(void *stream, const char *filename, int32_t mode);
|
||||
int32_t mz_stream_wzaes_is_open(void *stream);
|
||||
int32_t mz_stream_wzaes_read(void *stream, void *buf, int32_t size);
|
||||
int32_t mz_stream_wzaes_write(void *stream, const void *buf, int32_t size);
|
||||
int64_t mz_stream_wzaes_read(void *stream, void *buf, int64_t size);
|
||||
int64_t mz_stream_wzaes_write(void *stream, const void *buf, int64_t size);
|
||||
int64_t mz_stream_wzaes_tell(void *stream);
|
||||
int32_t mz_stream_wzaes_seek(void *stream, int64_t offset, int32_t origin);
|
||||
int64_t mz_stream_wzaes_seek(void *stream, int64_t offset, int32_t origin);
|
||||
int32_t mz_stream_wzaes_close(void *stream);
|
||||
int32_t mz_stream_wzaes_error(void *stream);
|
||||
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ int32_t mz_stream_zlib_is_open(void *stream) {
|
|||
return MZ_OK;
|
||||
}
|
||||
|
||||
int32_t mz_stream_zlib_read(void *stream, void *buf, int32_t size) {
|
||||
int64_t mz_stream_zlib_read(void *stream, void *buf, int64_t size) {
|
||||
#ifdef MZ_ZIP_NO_DECOMPRESSION
|
||||
MZ_UNUSED(stream);
|
||||
MZ_UNUSED(buf);
|
||||
|
|
@ -240,7 +240,7 @@ static int32_t mz_stream_zlib_deflate(void *stream, int flush) {
|
|||
}
|
||||
#endif
|
||||
|
||||
int32_t mz_stream_zlib_write(void *stream, const void *buf, int32_t size) {
|
||||
int64_t mz_stream_zlib_write(void *stream, const void *buf, int64_t size) {
|
||||
#ifdef MZ_ZIP_NO_COMPRESSION
|
||||
MZ_UNUSED(stream);
|
||||
MZ_UNUSED(buf);
|
||||
|
|
@ -269,7 +269,7 @@ int64_t mz_stream_zlib_tell(void *stream) {
|
|||
return MZ_TELL_ERROR;
|
||||
}
|
||||
|
||||
int32_t mz_stream_zlib_seek(void *stream, int64_t offset, int32_t origin) {
|
||||
int64_t mz_stream_zlib_seek(void *stream, int64_t offset, int32_t origin) {
|
||||
MZ_UNUSED(stream);
|
||||
MZ_UNUSED(offset);
|
||||
MZ_UNUSED(origin);
|
||||
|
|
|
|||
|
|
@ -19,10 +19,10 @@ extern "C" {
|
|||
|
||||
int32_t mz_stream_zlib_open(void *stream, const char *filename, int32_t mode);
|
||||
int32_t mz_stream_zlib_is_open(void *stream);
|
||||
int32_t mz_stream_zlib_read(void *stream, void *buf, int32_t size);
|
||||
int32_t mz_stream_zlib_write(void *stream, const void *buf, int32_t size);
|
||||
int64_t mz_stream_zlib_read(void *stream, void *buf, int64_t size);
|
||||
int64_t mz_stream_zlib_write(void *stream, const void *buf, int64_t size);
|
||||
int64_t mz_stream_zlib_tell(void *stream);
|
||||
int32_t mz_stream_zlib_seek(void *stream, int64_t offset, int32_t origin);
|
||||
int64_t mz_stream_zlib_seek(void *stream, int64_t offset, int32_t origin);
|
||||
int32_t mz_stream_zlib_close(void *stream);
|
||||
int32_t mz_stream_zlib_error(void *stream);
|
||||
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ int32_t mz_stream_zstd_is_open(void *stream) {
|
|||
return MZ_OK;
|
||||
}
|
||||
|
||||
int32_t mz_stream_zstd_read(void *stream, void *buf, int32_t size) {
|
||||
int64_t mz_stream_zstd_read(void *stream, void *buf, int64_t size) {
|
||||
#ifdef MZ_ZIP_NO_DECOMPRESSION
|
||||
MZ_UNUSED(stream);
|
||||
MZ_UNUSED(buf);
|
||||
|
|
@ -204,7 +204,7 @@ static int32_t mz_stream_zstd_compress(void *stream, ZSTD_EndDirective flush) {
|
|||
}
|
||||
#endif
|
||||
|
||||
int32_t mz_stream_zstd_write(void *stream, const void *buf, int32_t size) {
|
||||
int64_t mz_stream_zstd_write(void *stream, const void *buf, int64_t size) {
|
||||
#ifdef MZ_ZIP_NO_COMPRESSION
|
||||
MZ_UNUSED(stream);
|
||||
MZ_UNUSED(buf);
|
||||
|
|
@ -234,7 +234,7 @@ int64_t mz_stream_zstd_tell(void *stream) {
|
|||
return MZ_TELL_ERROR;
|
||||
}
|
||||
|
||||
int32_t mz_stream_zstd_seek(void *stream, int64_t offset, int32_t origin) {
|
||||
int64_t mz_stream_zstd_seek(void *stream, int64_t offset, int32_t origin) {
|
||||
MZ_UNUSED(stream);
|
||||
MZ_UNUSED(offset);
|
||||
MZ_UNUSED(origin);
|
||||
|
|
|
|||
|
|
@ -20,10 +20,10 @@ extern "C" {
|
|||
|
||||
int32_t mz_stream_zstd_open(void *stream, const char *filename, int32_t mode);
|
||||
int32_t mz_stream_zstd_is_open(void *stream);
|
||||
int32_t mz_stream_zstd_read(void *stream, void *buf, int32_t size);
|
||||
int32_t mz_stream_zstd_write(void *stream, const void *buf, int32_t size);
|
||||
int64_t mz_stream_zstd_read(void *stream, void *buf, int64_t size);
|
||||
int64_t mz_stream_zstd_write(void *stream, const void *buf, int64_t size);
|
||||
int64_t mz_stream_zstd_tell(void *stream);
|
||||
int32_t mz_stream_zstd_seek(void *stream, int64_t offset, int32_t origin);
|
||||
int64_t mz_stream_zstd_seek(void *stream, int64_t offset, int32_t origin);
|
||||
int32_t mz_stream_zstd_close(void *stream);
|
||||
int32_t mz_stream_zstd_error(void *stream);
|
||||
|
||||
|
|
|
|||
2
mz_zip.c
2
mz_zip.c
|
|
@ -2045,7 +2045,7 @@ int32_t mz_zip_entry_write_open(void *handle, const mz_zip_file *file_info, int1
|
|||
return err;
|
||||
}
|
||||
|
||||
int32_t mz_zip_entry_read(void *handle, void *buf, int32_t len) {
|
||||
int64_t mz_zip_entry_read(void *handle, void *buf, int64_t len) {
|
||||
mz_zip *zip = (mz_zip *)handle;
|
||||
int32_t read = 0;
|
||||
|
||||
|
|
|
|||
2
mz_zip.h
2
mz_zip.h
|
|
@ -115,7 +115,7 @@ int32_t mz_zip_entry_is_open(void *handle);
|
|||
int32_t mz_zip_entry_read_open(void *handle, uint8_t raw, const char *password);
|
||||
/* Open for reading the current file in the zip file */
|
||||
|
||||
int32_t mz_zip_entry_read(void *handle, void *buf, int32_t len);
|
||||
int64_t mz_zip_entry_read(void *handle, void *buf, int64_t len);
|
||||
/* Read bytes from the current file in the zip file */
|
||||
|
||||
int32_t mz_zip_entry_read_close(void *handle, uint32_t *crc32, int64_t *compressed_size, int64_t *uncompressed_size);
|
||||
|
|
|
|||
|
|
@ -471,7 +471,7 @@ int32_t mz_zip_reader_entry_close(void *handle) {
|
|||
return err;
|
||||
}
|
||||
|
||||
int32_t mz_zip_reader_entry_read(void *handle, void *buf, int32_t len) {
|
||||
int64_t mz_zip_reader_entry_read(void *handle, void *buf, int64_t len) {
|
||||
mz_zip_reader *reader = (mz_zip_reader *)handle;
|
||||
int32_t read = 0;
|
||||
if (!reader)
|
||||
|
|
@ -1150,7 +1150,7 @@ int32_t mz_zip_writer_zip_cd(void *handle) {
|
|||
mz_stream_write_uint64(file_extra_stream, number_entry);
|
||||
|
||||
mz_stream_mem_get_buffer(file_extra_stream, (const void **)&cd_file.extrafield);
|
||||
mz_stream_mem_get_buffer_length(file_extra_stream, &extrafield_size);
|
||||
mz_stream_mem_get_buffer_length(file_extra_stream, (int64_t *)&extrafield_size);
|
||||
cd_file.extrafield_size = (uint16_t)extrafield_size;
|
||||
|
||||
err = mz_zip_writer_entry_open(writer, &cd_file);
|
||||
|
|
@ -1469,7 +1469,7 @@ int32_t mz_zip_writer_entry_close(void *handle) {
|
|||
|
||||
/* Update extra field for central directory after adding extra fields */
|
||||
mz_stream_mem_get_buffer(writer->file_extra_stream, (const void **)&extrafield);
|
||||
mz_stream_mem_get_buffer_length(writer->file_extra_stream, &extrafield_size);
|
||||
mz_stream_mem_get_buffer_length(writer->file_extra_stream, (int64_t *)&extrafield_size);
|
||||
|
||||
mz_zip_entry_set_extrafield(writer->zip_handle, extrafield, (uint16_t)extrafield_size);
|
||||
}
|
||||
|
|
@ -1489,7 +1489,7 @@ int32_t mz_zip_writer_entry_close(void *handle) {
|
|||
return err;
|
||||
}
|
||||
|
||||
int32_t mz_zip_writer_entry_write(void *handle, const void *buf, int32_t len) {
|
||||
int64_t mz_zip_writer_entry_write(void *handle, const void *buf, int64_t len) {
|
||||
mz_zip_writer *writer = (mz_zip_writer *)handle;
|
||||
int32_t written = 0;
|
||||
if (!writer)
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ int32_t mz_zip_reader_entry_open(void *handle);
|
|||
int32_t mz_zip_reader_entry_close(void *handle);
|
||||
/* Closes an entry */
|
||||
|
||||
int32_t mz_zip_reader_entry_read(void *handle, void *buf, int32_t len);
|
||||
int64_t mz_zip_reader_entry_read(void *handle, void *buf, int64_t len);
|
||||
/* Reads an entry after being opened */
|
||||
|
||||
int32_t mz_zip_reader_entry_get_hash(void *handle, uint16_t algorithm, uint8_t *digest, int32_t digest_size);
|
||||
|
|
@ -183,7 +183,7 @@ int32_t mz_zip_writer_entry_open(void *handle, mz_zip_file *file_info);
|
|||
int32_t mz_zip_writer_entry_close(void *handle);
|
||||
/* Closes entry in zip file */
|
||||
|
||||
int32_t mz_zip_writer_entry_write(void *handle, const void *buf, int32_t len);
|
||||
int64_t mz_zip_writer_entry_write(void *handle, const void *buf, int64_t len);
|
||||
/* Writes data into entry for zip */
|
||||
|
||||
/***************************************************************************/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue