finish today's work
This commit is contained in:
@ -26,7 +26,7 @@ bool already_have[14348907];
|
|||||||
int rid[15] = {0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2};
|
int rid[15] = {0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2};
|
||||||
int cid[15] = {0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4};
|
int cid[15] = {0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4};
|
||||||
class HashTable {
|
class HashTable {
|
||||||
static const int buf_size=44348907;
|
static const int buf_size = 44348907;
|
||||||
struct Node {
|
struct Node {
|
||||||
LL key;
|
LL key;
|
||||||
unsigned char value;
|
unsigned char value;
|
||||||
@ -729,7 +729,8 @@ std::pair<int, int> MakeBestGuess() {
|
|||||||
using namespace Client;
|
using namespace Client;
|
||||||
// just make a total random guess before a better algorithm is designed
|
// just make a total random guess before a better algorithm is designed
|
||||||
// return TotalRandomGuess();
|
// return TotalRandomGuess();
|
||||||
return SimpleGuess();
|
// return SimpleGuess();
|
||||||
|
return GreedyGuess();
|
||||||
return std::make_pair(0, 0);
|
return std::make_pair(0, 0);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
@ -453,8 +453,7 @@ h001 void *f006(const void *pImage, int w, int h, int num_chans,
|
|||||||
h001 void *f007(const void *pImage, int w, int h, int num_chans,
|
h001 void *f007(const void *pImage, int w, int h, int num_chans,
|
||||||
size_t *pLen_out);
|
size_t *pLen_out);
|
||||||
|
|
||||||
typedef t001 (*tdefl_put_buf_func_ptr)(const void *pBuf, int len,
|
typedef t001 (*tdefl_put_buf_func_ptr)(const void *pBuf, int len, void *pUser);
|
||||||
void *pUser);
|
|
||||||
|
|
||||||
h001 t001 tdefl_compress_mem_to_output(const void *pBuf, size_t buf_len,
|
h001 t001 tdefl_compress_mem_to_output(const void *pBuf, size_t buf_len,
|
||||||
tdefl_put_buf_func_ptr pPut_buf_func,
|
tdefl_put_buf_func_ptr pPut_buf_func,
|
||||||
@ -862,8 +861,8 @@ h001 t001 mz_zip_reader_init_mem(mz_zip_archive *pZip, const void *pMem,
|
|||||||
|
|
||||||
#ifndef MINIZ_NO_STDIO
|
#ifndef MINIZ_NO_STDIO
|
||||||
|
|
||||||
h001 t001 mz_zip_reader_init_file(mz_zip_archive *pZip,
|
h001 t001 mz_zip_reader_init_file(mz_zip_archive *pZip, const char *pFilename,
|
||||||
const char *pFilename, mz_uint32 flags);
|
mz_uint32 flags);
|
||||||
h001 t001 mz_zip_reader_init_file_v2(mz_zip_archive *pZip,
|
h001 t001 mz_zip_reader_init_file_v2(mz_zip_archive *pZip,
|
||||||
const char *pFilename, mz_uint flags,
|
const char *pFilename, mz_uint flags,
|
||||||
mz_uint64 file_start_ofs,
|
mz_uint64 file_start_ofs,
|
||||||
@ -911,8 +910,7 @@ h001 mz_uint mz_zip_reader_get_filename(mz_zip_archive *pZip,
|
|||||||
|
|
||||||
h001 int mz_zip_reader_locate_file(mz_zip_archive *pZip, const char *pName,
|
h001 int mz_zip_reader_locate_file(mz_zip_archive *pZip, const char *pName,
|
||||||
const char *pComment, mz_uint flags);
|
const char *pComment, mz_uint flags);
|
||||||
h001 t001 mz_zip_reader_locate_file_v2(mz_zip_archive *pZip,
|
h001 t001 mz_zip_reader_locate_file_v2(mz_zip_archive *pZip, const char *pName,
|
||||||
const char *pName,
|
|
||||||
const char *pComment, mz_uint flags,
|
const char *pComment, mz_uint flags,
|
||||||
mz_uint32 *file_index);
|
mz_uint32 *file_index);
|
||||||
|
|
||||||
@ -923,20 +921,21 @@ h001 t001 mz_zip_is_zip64(mz_zip_archive *pZip);
|
|||||||
|
|
||||||
h001 size_t mz_zip_get_central_dir_size(mz_zip_archive *pZip);
|
h001 size_t mz_zip_get_central_dir_size(mz_zip_archive *pZip);
|
||||||
|
|
||||||
h001 t001 mz_zip_reader_extract_to_mem_no_alloc(
|
h001 t001 mz_zip_reader_extract_to_mem_no_alloc(mz_zip_archive *pZip,
|
||||||
mz_zip_archive *pZip, mz_uint file_index, void *pBuf, size_t buf_size,
|
mz_uint file_index, void *pBuf,
|
||||||
mz_uint flags, void *pUser_read_buf, size_t user_read_buf_size);
|
size_t buf_size, mz_uint flags,
|
||||||
|
void *pUser_read_buf,
|
||||||
|
size_t user_read_buf_size);
|
||||||
h001 t001 mz_zip_reader_extract_file_to_mem_no_alloc(
|
h001 t001 mz_zip_reader_extract_file_to_mem_no_alloc(
|
||||||
mz_zip_archive *pZip, const char *pFilename, void *pBuf, size_t buf_size,
|
mz_zip_archive *pZip, const char *pFilename, void *pBuf, size_t buf_size,
|
||||||
mz_uint flags, void *pUser_read_buf, size_t user_read_buf_size);
|
mz_uint flags, void *pUser_read_buf, size_t user_read_buf_size);
|
||||||
|
|
||||||
h001 t001 mz_zip_reader_extract_to_mem(mz_zip_archive *pZip,
|
h001 t001 mz_zip_reader_extract_to_mem(mz_zip_archive *pZip, mz_uint file_index,
|
||||||
mz_uint file_index, void *pBuf,
|
|
||||||
size_t buf_size, mz_uint flags);
|
|
||||||
h001 t001 mz_zip_reader_extract_file_to_mem(mz_zip_archive *pZip,
|
|
||||||
const char *pFilename,
|
|
||||||
void *pBuf, size_t buf_size,
|
void *pBuf, size_t buf_size,
|
||||||
mz_uint flags);
|
mz_uint flags);
|
||||||
|
h001 t001 mz_zip_reader_extract_file_to_mem(mz_zip_archive *pZip,
|
||||||
|
const char *pFilename, void *pBuf,
|
||||||
|
size_t buf_size, mz_uint flags);
|
||||||
|
|
||||||
h001 void *mz_zip_reader_extract_to_heap(mz_zip_archive *pZip,
|
h001 void *mz_zip_reader_extract_to_heap(mz_zip_archive *pZip,
|
||||||
mz_uint file_index, size_t *pSize,
|
mz_uint file_index, size_t *pSize,
|
||||||
@ -949,8 +948,9 @@ h001 t001 mz_zip_reader_extract_to_callback(mz_zip_archive *pZip,
|
|||||||
mz_uint file_index,
|
mz_uint file_index,
|
||||||
mz_file_write_func pCallback,
|
mz_file_write_func pCallback,
|
||||||
void *pOpaque, mz_uint flags);
|
void *pOpaque, mz_uint flags);
|
||||||
h001 t001 mz_zip_reader_extract_file_to_callback(
|
h001 t001 mz_zip_reader_extract_file_to_callback(mz_zip_archive *pZip,
|
||||||
mz_zip_archive *pZip, const char *pFilename, mz_file_write_func pCallback,
|
const char *pFilename,
|
||||||
|
mz_file_write_func pCallback,
|
||||||
void *pOpaque, mz_uint flags);
|
void *pOpaque, mz_uint flags);
|
||||||
|
|
||||||
h001 mz_zip_reader_extract_iter_state *mz_zip_reader_extract_iter_new(
|
h001 mz_zip_reader_extract_iter_state *mz_zip_reader_extract_iter_new(
|
||||||
@ -1009,8 +1009,8 @@ h001 t001 mz_zip_end(mz_zip_archive *pZip);
|
|||||||
#ifndef MINIZ_NO_ARCHIVE_WRITING_APIS
|
#ifndef MINIZ_NO_ARCHIVE_WRITING_APIS
|
||||||
|
|
||||||
h001 t001 mz_zip_writer_init(mz_zip_archive *pZip, mz_uint64 existing_size);
|
h001 t001 mz_zip_writer_init(mz_zip_archive *pZip, mz_uint64 existing_size);
|
||||||
h001 t001 mz_zip_writer_init_v2(mz_zip_archive *pZip,
|
h001 t001 mz_zip_writer_init_v2(mz_zip_archive *pZip, mz_uint64 existing_size,
|
||||||
mz_uint64 existing_size, mz_uint flags);
|
mz_uint flags);
|
||||||
|
|
||||||
h001 t001 mz_zip_writer_init_heap(mz_zip_archive *pZip,
|
h001 t001 mz_zip_writer_init_heap(mz_zip_archive *pZip,
|
||||||
size_t size_to_reserve_at_beginning,
|
size_t size_to_reserve_at_beginning,
|
||||||
@ -1021,8 +1021,7 @@ h001 t001 mz_zip_writer_init_heap_v2(mz_zip_archive *pZip,
|
|||||||
mz_uint flags);
|
mz_uint flags);
|
||||||
|
|
||||||
#ifndef MINIZ_NO_STDIO
|
#ifndef MINIZ_NO_STDIO
|
||||||
h001 t001 mz_zip_writer_init_file(mz_zip_archive *pZip,
|
h001 t001 mz_zip_writer_init_file(mz_zip_archive *pZip, const char *pFilename,
|
||||||
const char *pFilename,
|
|
||||||
mz_uint64 size_to_reserve_at_beginning);
|
mz_uint64 size_to_reserve_at_beginning);
|
||||||
h001 t001 mz_zip_writer_init_file_v2(mz_zip_archive *pZip,
|
h001 t001 mz_zip_writer_init_file_v2(mz_zip_archive *pZip,
|
||||||
const char *pFilename,
|
const char *pFilename,
|
||||||
@ -1038,9 +1037,9 @@ h001 t001 mz_zip_writer_init_from_reader_v2(mz_zip_archive *pZip,
|
|||||||
const char *pFilename,
|
const char *pFilename,
|
||||||
mz_uint flags);
|
mz_uint flags);
|
||||||
|
|
||||||
h001 t001 mz_zip_writer_add_mem(mz_zip_archive *pZip,
|
h001 t001 mz_zip_writer_add_mem(mz_zip_archive *pZip, const char *pArchive_name,
|
||||||
const char *pArchive_name, const void *pBuf,
|
const void *pBuf, size_t buf_size,
|
||||||
size_t buf_size, mz_uint level_and_flags);
|
mz_uint level_and_flags);
|
||||||
|
|
||||||
h001 t001 mz_zip_writer_add_mem_ex(
|
h001 t001 mz_zip_writer_add_mem_ex(
|
||||||
mz_zip_archive *pZip, const char *pArchive_name, const void *pBuf,
|
mz_zip_archive *pZip, const char *pArchive_name, const void *pBuf,
|
||||||
@ -1065,9 +1064,11 @@ h001 t001 mz_zip_writer_add_read_buf_callback(
|
|||||||
|
|
||||||
#ifndef MINIZ_NO_STDIO
|
#ifndef MINIZ_NO_STDIO
|
||||||
|
|
||||||
h001 t001 mz_zip_writer_add_file(
|
h001 t001 mz_zip_writer_add_file(mz_zip_archive *pZip,
|
||||||
mz_zip_archive *pZip, const char *pArchive_name, const char *pSrc_filename,
|
const char *pArchive_name,
|
||||||
const void *pComment, mz_uint16 comment_size, mz_uint level_and_flags);
|
const char *pSrc_filename,
|
||||||
|
const void *pComment, mz_uint16 comment_size,
|
||||||
|
mz_uint level_and_flags);
|
||||||
|
|
||||||
h001 t001 mz_zip_writer_add_cfile(
|
h001 t001 mz_zip_writer_add_cfile(
|
||||||
mz_zip_archive *pZip, const char *pArchive_name, MZ_FILE *pSrc_file,
|
mz_zip_archive *pZip, const char *pArchive_name, MZ_FILE *pSrc_file,
|
||||||
@ -1117,7 +1118,6 @@ h001 void *mz_zip_extract_archive_file_to_heap_v2(const char *pZip_filename,
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
typedef unsigned char mz_validate_uint16[sizeof(mz_uint16) == 2 ? 1 : -1];
|
typedef unsigned char mz_validate_uint16[sizeof(mz_uint16) == 2 ? 1 : -1];
|
||||||
typedef unsigned char mz_validate_uint32[sizeof(mz_uint32) == 4 ? 1 : -1];
|
typedef unsigned char mz_validate_uint32[sizeof(mz_uint32) == 4 ? 1 : -1];
|
||||||
typedef unsigned char mz_validate_uint64[sizeof(mz_uint64) == 8 ? 1 : -1];
|
typedef unsigned char mz_validate_uint64[sizeof(mz_uint64) == 8 ? 1 : -1];
|
||||||
@ -2293,7 +2293,7 @@ static t001 tdefl_compress_block(tdefl_compressor *d, t001 static_block) {
|
|||||||
return tdefl_compress_lz_codes(d);
|
return tdefl_compress_lz_codes(d);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const mz_uint s_tdefl_num_probes[11]={0, 1, 6, 32, 16, 32,
|
static const mz_uint s_tdefl_num_probes[11] = {0, 1, 6, 32, 16, 32,
|
||||||
128, 256, 512, 768, 1500};
|
128, 256, 512, 768, 1500};
|
||||||
|
|
||||||
static int tdefl_flush_block(tdefl_compressor *d, int flush) {
|
static int tdefl_flush_block(tdefl_compressor *d, int flush) {
|
||||||
@ -3087,8 +3087,7 @@ typedef struct {
|
|||||||
t001 m_expandable;
|
t001 m_expandable;
|
||||||
} tdefl_output_buffer;
|
} tdefl_output_buffer;
|
||||||
|
|
||||||
static t001 tdefl_output_buffer_putter(const void *pBuf, int len,
|
static t001 tdefl_output_buffer_putter(const void *pBuf, int len, void *pUser) {
|
||||||
void *pUser) {
|
|
||||||
tdefl_output_buffer *p = (tdefl_output_buffer *)pUser;
|
tdefl_output_buffer *p = (tdefl_output_buffer *)pUser;
|
||||||
size_t new_size = p->m_size + len;
|
size_t new_size = p->m_size + len;
|
||||||
if (new_size > p->m_capacity) {
|
if (new_size > p->m_capacity) {
|
||||||
@ -4407,8 +4406,7 @@ static t001 mz_zip_get_file_modified_time(const char *pFilename,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static t001 mz_zip_set_file_times(const char *pFilename,
|
static t001 mz_zip_set_file_times(const char *pFilename, MZ_TIME_T access_time,
|
||||||
MZ_TIME_T access_time,
|
|
||||||
MZ_TIME_T modified_time) {
|
MZ_TIME_T modified_time) {
|
||||||
struct utimbuf t;
|
struct utimbuf t;
|
||||||
|
|
||||||
@ -4427,8 +4425,7 @@ static MZ_FORCEINLINE t001 mz_zip_set_error(mz_zip_archive *pZip,
|
|||||||
return MZ_FALSE;
|
return MZ_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static t001 mz_zip_reader_init_internal(mz_zip_archive *pZip,
|
static t001 mz_zip_reader_init_internal(mz_zip_archive *pZip, mz_uint flags) {
|
||||||
mz_uint flags) {
|
|
||||||
(void)flags;
|
(void)flags;
|
||||||
if ((!pZip) || (pZip->m_pState) || (pZip->m_zip_mode != MZ_ZIP_MODE_INVALID))
|
if ((!pZip) || (pZip->m_pState) || (pZip->m_zip_mode != MZ_ZIP_MODE_INVALID))
|
||||||
return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER);
|
return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER);
|
||||||
@ -4923,8 +4920,7 @@ static t001 mz_zip_reader_end_internal(mz_zip_archive *pZip,
|
|||||||
t001 mz_zip_reader_end(mz_zip_archive *pZip) {
|
t001 mz_zip_reader_end(mz_zip_archive *pZip) {
|
||||||
return mz_zip_reader_end_internal(pZip, MZ_TRUE);
|
return mz_zip_reader_end_internal(pZip, MZ_TRUE);
|
||||||
}
|
}
|
||||||
t001 mz_zip_reader_init(mz_zip_archive *pZip, mz_uint64 size,
|
t001 mz_zip_reader_init(mz_zip_archive *pZip, mz_uint64 size, mz_uint flags) {
|
||||||
mz_uint flags) {
|
|
||||||
if ((!pZip) || (!pZip->m_pRead))
|
if ((!pZip) || (!pZip->m_pRead))
|
||||||
return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER);
|
return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER);
|
||||||
|
|
||||||
@ -4951,8 +4947,8 @@ static size_t mz_zip_mem_read_func(void *pOpaque, mz_uint64 file_ofs,
|
|||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
t001 mz_zip_reader_init_mem(mz_zip_archive *pZip, const void *pMem,
|
t001 mz_zip_reader_init_mem(mz_zip_archive *pZip, const void *pMem, size_t size,
|
||||||
size_t size, mz_uint flags) {
|
mz_uint flags) {
|
||||||
if (!pMem) return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER);
|
if (!pMem) return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER);
|
||||||
|
|
||||||
if (size < MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE)
|
if (size < MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE)
|
||||||
@ -5101,8 +5097,7 @@ static MZ_FORCEINLINE const mz_uint8 *mz_zip_get_cdh(mz_zip_archive *pZip,
|
|||||||
file_index));
|
file_index));
|
||||||
}
|
}
|
||||||
|
|
||||||
t001 mz_zip_reader_is_file_encrypted(mz_zip_archive *pZip,
|
t001 mz_zip_reader_is_file_encrypted(mz_zip_archive *pZip, mz_uint file_index) {
|
||||||
mz_uint file_index) {
|
|
||||||
mz_uint m_bit_flag;
|
mz_uint m_bit_flag;
|
||||||
const mz_uint8 *p = mz_zip_get_cdh(pZip, file_index);
|
const mz_uint8 *p = mz_zip_get_cdh(pZip, file_index);
|
||||||
if (!p) {
|
if (!p) {
|
||||||
@ -5116,8 +5111,7 @@ t001 mz_zip_reader_is_file_encrypted(mz_zip_archive *pZip,
|
|||||||
MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_USES_STRONG_ENCRYPTION)) != 0;
|
MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_USES_STRONG_ENCRYPTION)) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
t001 mz_zip_reader_is_file_supported(mz_zip_archive *pZip,
|
t001 mz_zip_reader_is_file_supported(mz_zip_archive *pZip, mz_uint file_index) {
|
||||||
mz_uint file_index) {
|
|
||||||
mz_uint bit_flag;
|
mz_uint bit_flag;
|
||||||
mz_uint method;
|
mz_uint method;
|
||||||
|
|
||||||
@ -5175,8 +5169,7 @@ t001 mz_zip_reader_is_file_a_directory(mz_zip_archive *pZip,
|
|||||||
return MZ_FALSE;
|
return MZ_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static t001 mz_zip_file_stat_internal(mz_zip_archive *pZip,
|
static t001 mz_zip_file_stat_internal(mz_zip_archive *pZip, mz_uint file_index,
|
||||||
mz_uint file_index,
|
|
||||||
const mz_uint8 *pCentral_dir_header,
|
const mz_uint8 *pCentral_dir_header,
|
||||||
mz_zip_archive_file_stat *pStat,
|
mz_zip_archive_file_stat *pStat,
|
||||||
t001 *pFound_zip64_extra_data) {
|
t001 *pFound_zip64_extra_data) {
|
||||||
@ -5293,9 +5286,8 @@ static t001 mz_zip_file_stat_internal(mz_zip_archive *pZip,
|
|||||||
return MZ_TRUE;
|
return MZ_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static MZ_FORCEINLINE t001 mz_zip_string_equal(const char *pA,
|
static MZ_FORCEINLINE t001 mz_zip_string_equal(const char *pA, const char *pB,
|
||||||
const char *pB, mz_uint len,
|
mz_uint len, mz_uint flags) {
|
||||||
mz_uint flags) {
|
|
||||||
mz_uint i;
|
mz_uint i;
|
||||||
if (flags & MZ_ZIP_FLAG_CASE_SENSITIVE) return 0 == memcmp(pA, pB, len);
|
if (flags & MZ_ZIP_FLAG_CASE_SENSITIVE) return 0 == memcmp(pA, pB, len);
|
||||||
for (i = 0; i < len; ++i)
|
for (i = 0; i < len; ++i)
|
||||||
@ -5601,8 +5593,7 @@ t001 mz_zip_reader_extract_file_to_mem_no_alloc(
|
|||||||
}
|
}
|
||||||
|
|
||||||
t001 mz_zip_reader_extract_to_mem(mz_zip_archive *pZip, mz_uint file_index,
|
t001 mz_zip_reader_extract_to_mem(mz_zip_archive *pZip, mz_uint file_index,
|
||||||
void *pBuf, size_t buf_size,
|
void *pBuf, size_t buf_size, mz_uint flags) {
|
||||||
mz_uint flags) {
|
|
||||||
return mz_zip_reader_extract_to_mem_no_alloc1(pZip, file_index, pBuf,
|
return mz_zip_reader_extract_to_mem_no_alloc1(pZip, file_index, pBuf,
|
||||||
buf_size, flags, NULL, 0, NULL);
|
buf_size, flags, NULL, 0, NULL);
|
||||||
}
|
}
|
||||||
@ -5660,8 +5651,7 @@ void *mz_zip_reader_extract_file_to_heap(mz_zip_archive *pZip,
|
|||||||
return mz_zip_reader_extract_to_heap(pZip, file_index, pSize, flags);
|
return mz_zip_reader_extract_to_heap(pZip, file_index, pSize, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
t001 mz_zip_reader_extract_to_callback(mz_zip_archive *pZip,
|
t001 mz_zip_reader_extract_to_callback(mz_zip_archive *pZip, mz_uint file_index,
|
||||||
mz_uint file_index,
|
|
||||||
mz_file_write_func pCallback,
|
mz_file_write_func pCallback,
|
||||||
void *pOpaque, mz_uint flags) {
|
void *pOpaque, mz_uint flags) {
|
||||||
int status = TINFL_STATUS_DONE;
|
int status = TINFL_STATUS_DONE;
|
||||||
@ -6103,8 +6093,7 @@ size_t mz_zip_reader_extract_iter_read(mz_zip_reader_extract_iter_state *pState,
|
|||||||
return copied_to_caller;
|
return copied_to_caller;
|
||||||
}
|
}
|
||||||
|
|
||||||
t001 mz_zip_reader_extract_iter_free(
|
t001 mz_zip_reader_extract_iter_free(mz_zip_reader_extract_iter_state *pState) {
|
||||||
mz_zip_reader_extract_iter_state *pState) {
|
|
||||||
int status;
|
int status;
|
||||||
|
|
||||||
if ((!pState) || (!pState->pZip) || (!pState->pZip->m_pState))
|
if ((!pState) || (!pState->pZip) || (!pState->pZip->m_pState))
|
||||||
@ -6145,8 +6134,7 @@ static size_t mz_zip_file_write_callback(void *pOpaque, mz_uint64 ofs,
|
|||||||
}
|
}
|
||||||
|
|
||||||
t001 mz_zip_reader_extract_to_file(mz_zip_archive *pZip, mz_uint file_index,
|
t001 mz_zip_reader_extract_to_file(mz_zip_archive *pZip, mz_uint file_index,
|
||||||
const char *pDst_filename,
|
const char *pDst_filename, mz_uint flags) {
|
||||||
mz_uint flags) {
|
|
||||||
t001 status;
|
t001 status;
|
||||||
mz_zip_archive_file_stat file_stat;
|
mz_zip_archive_file_stat file_stat;
|
||||||
MZ_FILE *pFile;
|
MZ_FILE *pFile;
|
||||||
@ -6488,8 +6476,8 @@ t001 mz_zip_validate_archive(mz_zip_archive *pZip, mz_uint flags) {
|
|||||||
return MZ_TRUE;
|
return MZ_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
t001 mz_zip_validate_mem_archive(const void *pMem, size_t size,
|
t001 mz_zip_validate_mem_archive(const void *pMem, size_t size, mz_uint flags,
|
||||||
mz_uint flags, mz_zip_error *pErr) {
|
mz_zip_error *pErr) {
|
||||||
t001 success = MZ_TRUE;
|
t001 success = MZ_TRUE;
|
||||||
mz_zip_archive zip;
|
mz_zip_archive zip;
|
||||||
mz_zip_error actual_err = MZ_ZIP_NO_ERROR;
|
mz_zip_error actual_err = MZ_ZIP_NO_ERROR;
|
||||||
@ -6704,8 +6692,7 @@ t001 mz_zip_writer_init(mz_zip_archive *pZip, mz_uint64 existing_size) {
|
|||||||
|
|
||||||
t001 mz_zip_writer_init_heap_v2(mz_zip_archive *pZip,
|
t001 mz_zip_writer_init_heap_v2(mz_zip_archive *pZip,
|
||||||
size_t size_to_reserve_at_beginning,
|
size_t size_to_reserve_at_beginning,
|
||||||
size_t initial_allocation_size,
|
size_t initial_allocation_size, mz_uint flags) {
|
||||||
mz_uint flags) {
|
|
||||||
pZip->m_pWrite = mz_zip_heap_write_func;
|
pZip->m_pWrite = mz_zip_heap_write_func;
|
||||||
pZip->m_pNeeds_keepalive = NULL;
|
pZip->m_pNeeds_keepalive = NULL;
|
||||||
|
|
||||||
@ -6831,8 +6818,7 @@ t001 mz_zip_writer_init_cfile(mz_zip_archive *pZip, MZ_FILE *pFile,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
t001 mz_zip_writer_init_from_reader_v2(mz_zip_archive *pZip,
|
t001 mz_zip_writer_init_from_reader_v2(mz_zip_archive *pZip,
|
||||||
const char *pFilename,
|
const char *pFilename, mz_uint flags) {
|
||||||
mz_uint flags) {
|
|
||||||
mz_zip_internal_state *pState;
|
mz_zip_internal_state *pState;
|
||||||
|
|
||||||
if ((!pZip) || (!pZip->m_pState) || (pZip->m_zip_mode != MZ_ZIP_MODE_READING))
|
if ((!pZip) || (!pZip->m_pState) || (pZip->m_zip_mode != MZ_ZIP_MODE_READING))
|
||||||
@ -7099,10 +7085,9 @@ static t001 mz_zip_writer_write_zeros(mz_zip_archive *pZip,
|
|||||||
return MZ_TRUE;
|
return MZ_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
t001 mz_zip_writer_add_mem_ex(mz_zip_archive *pZip,
|
t001 mz_zip_writer_add_mem_ex(mz_zip_archive *pZip, const char *pArchive_name,
|
||||||
const char *pArchive_name, const void *pBuf,
|
const void *pBuf, size_t buf_size,
|
||||||
size_t buf_size, const void *pComment,
|
const void *pComment, mz_uint16 comment_size,
|
||||||
mz_uint16 comment_size,
|
|
||||||
mz_uint level_and_flags, mz_uint64 uncomp_size,
|
mz_uint level_and_flags, mz_uint64 uncomp_size,
|
||||||
mz_uint32 uncomp_crc32) {
|
mz_uint32 uncomp_crc32) {
|
||||||
return mz_zip_writer_add_mem_ex_v2(
|
return mz_zip_writer_add_mem_ex_v2(
|
||||||
@ -7788,12 +7773,14 @@ static size_t mz_file_read_func_stdio(void *pOpaque, mz_uint64 file_ofs,
|
|||||||
return MZ_FREAD(pBuf, 1, n, pSrc_file);
|
return MZ_FREAD(pBuf, 1, n, pSrc_file);
|
||||||
}
|
}
|
||||||
|
|
||||||
t001 mz_zip_writer_add_cfile(
|
t001 mz_zip_writer_add_cfile(mz_zip_archive *pZip, const char *pArchive_name,
|
||||||
mz_zip_archive *pZip, const char *pArchive_name, MZ_FILE *pSrc_file,
|
MZ_FILE *pSrc_file, mz_uint64 max_size,
|
||||||
mz_uint64 max_size, const MZ_TIME_T *pFile_time, const void *pComment,
|
const MZ_TIME_T *pFile_time, const void *pComment,
|
||||||
mz_uint16 comment_size, mz_uint level_and_flags,
|
mz_uint16 comment_size, mz_uint level_and_flags,
|
||||||
const char *user_extra_data, mz_uint user_extra_data_len,
|
const char *user_extra_data,
|
||||||
const char *user_extra_data_central, mz_uint user_extra_data_central_len) {
|
mz_uint user_extra_data_len,
|
||||||
|
const char *user_extra_data_central,
|
||||||
|
mz_uint user_extra_data_central_len) {
|
||||||
return mz_zip_writer_add_read_buf_callback(
|
return mz_zip_writer_add_read_buf_callback(
|
||||||
pZip, pArchive_name, mz_file_read_func_stdio, pSrc_file, max_size,
|
pZip, pArchive_name, mz_file_read_func_stdio, pSrc_file, max_size,
|
||||||
pFile_time, pComment, comment_size, level_and_flags, user_extra_data,
|
pFile_time, pComment, comment_size, level_and_flags, user_extra_data,
|
||||||
@ -7803,8 +7790,7 @@ t001 mz_zip_writer_add_cfile(
|
|||||||
|
|
||||||
t001 mz_zip_writer_add_file(mz_zip_archive *pZip, const char *pArchive_name,
|
t001 mz_zip_writer_add_file(mz_zip_archive *pZip, const char *pArchive_name,
|
||||||
const char *pSrc_filename, const void *pComment,
|
const char *pSrc_filename, const void *pComment,
|
||||||
mz_uint16 comment_size,
|
mz_uint16 comment_size, mz_uint level_and_flags) {
|
||||||
mz_uint level_and_flags) {
|
|
||||||
MZ_FILE *pSrc_file = NULL;
|
MZ_FILE *pSrc_file = NULL;
|
||||||
mz_uint64 uncomp_size = 0;
|
mz_uint64 uncomp_size = 0;
|
||||||
MZ_TIME_T file_modified_time;
|
MZ_TIME_T file_modified_time;
|
||||||
@ -8418,9 +8404,11 @@ t001 mz_zip_writer_end(mz_zip_archive *pZip) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifndef MINIZ_NO_STDIO
|
#ifndef MINIZ_NO_STDIO
|
||||||
t001 mz_zip_add_mem_to_archive_file_in_place(
|
t001 mz_zip_add_mem_to_archive_file_in_place(const char *pZip_filename,
|
||||||
const char *pZip_filename, const char *pArchive_name, const void *pBuf,
|
const char *pArchive_name,
|
||||||
size_t buf_size, const void *pComment, mz_uint16 comment_size,
|
const void *pBuf, size_t buf_size,
|
||||||
|
const void *pComment,
|
||||||
|
mz_uint16 comment_size,
|
||||||
mz_uint level_and_flags) {
|
mz_uint level_and_flags) {
|
||||||
return mz_zip_add_mem_to_archive_file_in_place_v2(
|
return mz_zip_add_mem_to_archive_file_in_place_v2(
|
||||||
pZip_filename, pArchive_name, pBuf, buf_size, pComment, comment_size,
|
pZip_filename, pArchive_name, pBuf, buf_size, pComment, comment_size,
|
||||||
|
Reference in New Issue
Block a user