178#include <util/pragma_push.def>
179#pragma warning(disable:4668)
214#if defined(__TINYC__) && (defined(__linux) || defined(__linux__))
219#if !defined(MINIZ_NO_TIME) && !defined(MINIZ_NO_ARCHIVE_APIS)
223#if defined(_M_IX86) || defined(_M_X64) || defined(__i386__) || defined(__i386) || defined(__i486__) || defined(__i486) || defined(i386) || defined(__ia64__) || defined(__x86_64__)
225#define MINIZ_X86_OR_X64_CPU 1
228#if (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__) || MINIZ_X86_OR_X64_CPU
230#define MINIZ_LITTLE_ENDIAN 1
233#if defined(MINIZ_X86_OR_X64_CPU) && !defined(__GNUG__)
235#define MINIZ_USE_UNALIGNED_LOADS_AND_STORES 1
238#if defined(_M_X64) || defined(_WIN64) || defined(__MINGW64__) || defined(_LP64) || defined(__LP64__) || defined(__ia64__) || defined(__x86_64__)
240#define MINIZ_HAS_64BIT_REGISTERS 1
255#define MZ_ADLER32_INIT (1)
259#define MZ_CRC32_INIT (0)
276#ifndef MINIZ_NO_ZLIB_APIS
280typedef void *(*mz_alloc_func)(
void *opaque,
size_t items,
size_t size);
282typedef void *(*mz_realloc_func)(
void *opaque,
void *address,
size_t items,
size_t size);
285#define MZ_VERSION "9.1.15"
286#define MZ_VERNUM 0x91F0
287#define MZ_VER_MAJOR 9
288#define MZ_VER_MINOR 1
289#define MZ_VER_REVISION 15
290#define MZ_VER_SUBREVISION 0
330#define MZ_DEFAULT_WINDOW_BITS 15
332struct mz_internal_state;
449#ifndef MINIZ_NO_ZLIB_COMPATIBLE_NAMES
462#define Z_NO_FLUSH MZ_NO_FLUSH
463#define Z_PARTIAL_FLUSH MZ_PARTIAL_FLUSH
464#define Z_SYNC_FLUSH MZ_SYNC_FLUSH
465#define Z_FULL_FLUSH MZ_FULL_FLUSH
466#define Z_FINISH MZ_FINISH
467#define Z_BLOCK MZ_BLOCK
469#define Z_STREAM_END MZ_STREAM_END
470#define Z_NEED_DICT MZ_NEED_DICT
471#define Z_ERRNO MZ_ERRNO
472#define Z_STREAM_ERROR MZ_STREAM_ERROR
473#define Z_DATA_ERROR MZ_DATA_ERROR
474#define Z_MEM_ERROR MZ_MEM_ERROR
475#define Z_BUF_ERROR MZ_BUF_ERROR
476#define Z_VERSION_ERROR MZ_VERSION_ERROR
477#define Z_PARAM_ERROR MZ_PARAM_ERROR
478#define Z_NO_COMPRESSION MZ_NO_COMPRESSION
479#define Z_BEST_SPEED MZ_BEST_SPEED
480#define Z_BEST_COMPRESSION MZ_BEST_COMPRESSION
481#define Z_DEFAULT_COMPRESSION MZ_DEFAULT_COMPRESSION
482#define Z_DEFAULT_STRATEGY MZ_DEFAULT_STRATEGY
483#define Z_FILTERED MZ_FILTERED
484#define Z_HUFFMAN_ONLY MZ_HUFFMAN_ONLY
486#define Z_FIXED MZ_FIXED
487#define Z_DEFLATED MZ_DEFLATED
488#define Z_DEFAULT_WINDOW_BITS MZ_DEFAULT_WINDOW_BITS
489#define alloc_func mz_alloc_func
490#define free_func mz_free_func
491#define internal_state mz_internal_state
492#define z_stream mz_stream
493#define deflateInit mz_deflateInit
494#define deflateInit2 mz_deflateInit2
495#define deflateReset mz_deflateReset
496#define deflate mz_deflate
497#define deflateEnd mz_deflateEnd
498#define deflateBound mz_deflateBound
499#define compress mz_compress
500#define compress2 mz_compress2
501#define compressBound mz_compressBound
502#define inflateInit mz_inflateInit
503#define inflateInit2 mz_inflateInit2
504#define inflate mz_inflate
505#define inflateEnd mz_inflateEnd
506#define uncompress mz_uncompress
507#define crc32 mz_crc32
508#define adler32 mz_adler32
510#define MAX_MEM_LEVEL 9
511#define zError mz_error
512#define ZLIB_VERSION MZ_VERSION
513#define ZLIB_VERNUM MZ_VERNUM
514#define ZLIB_VER_MAJOR MZ_VER_MAJOR
515#define ZLIB_VER_MINOR MZ_VER_MINOR
516#define ZLIB_VER_REVISION MZ_VER_REVISION
517#define ZLIB_VER_SUBREVISION MZ_VER_SUBREVISION
518#define zlibVersion mz_version
519#define zlib_version mz_version()
534typedef uint8_t mz_uint8;
535typedef int16_t mz_int16;
536typedef uint16_t mz_uint16;
537typedef uint32_t mz_uint32;
538typedef unsigned int mz_uint;
539typedef int64_t mz_int64;
540typedef uint64_t mz_uint64;
543#define MZ_FALSE false
548#define MZ_MACRO_END while(0, 0)
550#define MZ_MACRO_END while(0)
554#define MZ_FILE void *
561typedef struct mz_dummy_time_t_tag
565#define MZ_TIME_T mz_dummy_time_t
567#define MZ_TIME_T time_t
570#define MZ_ASSERT(x) assert(x)
572#ifdef MINIZ_NO_MALLOC
573#define MZ_MALLOC(x) NULL
574#define MZ_FREE(x) (void) x, ((void)0)
575#define MZ_REALLOC(p, x) NULL
577#define MZ_MALLOC(x) malloc(x)
578#define MZ_FREE(x) free(x)
579#define MZ_REALLOC(p, x) realloc(p, x)
582#define MZ_MAX(a, b) (((a) > (b)) ? (a) : (b))
583#define MZ_MIN(a, b) (((a) < (b)) ? (a) : (b))
584#define MZ_CLEAR_OBJ(obj) memset(&(obj), 0, sizeof(obj))
586#if MINIZ_USE_UNALIGNED_LOADS_AND_STORES &&MINIZ_LITTLE_ENDIAN
587#define MZ_READ_LE16(p) *((const mz_uint16 *)(p))
588#define MZ_READ_LE32(p) *((const mz_uint32 *)(p))
590#define MZ_READ_LE16(p) ((mz_uint32)(((const mz_uint8 *)(p))[0]) | ((mz_uint32)(((const mz_uint8 *)(p))[1]) << 8U))
591#define MZ_READ_LE32(p) ((mz_uint32)(((const mz_uint8 *)(p))[0]) | ((mz_uint32)(((const mz_uint8 *)(p))[1]) << 8U) | ((mz_uint32)(((const mz_uint8 *)(p))[2]) << 16U) | ((mz_uint32)(((const mz_uint8 *)(p))[3]) << 24U))
594#define MZ_READ_LE64(p) (((mz_uint64)MZ_READ_LE32(p)) | (((mz_uint64)MZ_READ_LE32((const mz_uint8 *)(p) + sizeof(mz_uint32))) << 32U))
597#define MZ_FORCEINLINE __forceinline
598#elif defined(__GNUC__)
599#define MZ_FORCEINLINE __inline__ __attribute__((__always_inline__))
601#define MZ_FORCEINLINE inline
612#define MZ_UINT16_MAX (0xFFFFU)
613#define MZ_UINT32_MAX (0xFFFFFFFFU)
627#define TDEFL_LESS_MEMORY 0
633 TDEFL_HUFFMAN_ONLY = 0,
634 TDEFL_DEFAULT_MAX_PROBES = 128,
635 TDEFL_MAX_PROBES_MASK = 0xFFF
649 TDEFL_WRITE_ZLIB_HEADER = 0x01000,
650 TDEFL_COMPUTE_ADLER32 = 0x02000,
651 TDEFL_GREEDY_PARSING_FLAG = 0x04000,
652 TDEFL_NONDETERMINISTIC_PARSING_FLAG = 0x08000,
653 TDEFL_RLE_MATCHES = 0x10000,
654 TDEFL_FILTER_MATCHES = 0x20000,
655 TDEFL_FORCE_ALL_STATIC_BLOCKS = 0x40000,
656 TDEFL_FORCE_ALL_RAW_BLOCKS = 0x80000
672size_t tdefl_compress_mem_to_mem(
void *pOut_buf,
size_t out_buf_len,
const void *pSrc_buf,
size_t src_buf_len,
int flags);
688typedef mz_bool (*tdefl_put_buf_func_ptr)(
const void *pBuf,
int len,
void *pUser);
691mz_bool
tdefl_compress_mem_to_output(
const void *pBuf,
size_t buf_len, tdefl_put_buf_func_ptr pPut_buf_func,
void *pPut_buf_user,
int flags);
695 TDEFL_MAX_HUFF_TABLES = 3,
696 TDEFL_MAX_HUFF_SYMBOLS_0 = 288,
697 TDEFL_MAX_HUFF_SYMBOLS_1 = 32,
698 TDEFL_MAX_HUFF_SYMBOLS_2 = 19,
699 TDEFL_LZ_DICT_SIZE = 32768,
700 TDEFL_LZ_DICT_SIZE_MASK = TDEFL_LZ_DICT_SIZE - 1,
701 TDEFL_MIN_MATCH_LEN = 3,
702 TDEFL_MAX_MATCH_LEN = 258
709 TDEFL_LZ_CODE_BUF_SIZE = 24 * 1024,
710 TDEFL_OUT_BUF_SIZE = (TDEFL_LZ_CODE_BUF_SIZE * 13) / 10,
711 TDEFL_MAX_HUFF_SYMBOLS = 288,
712 TDEFL_LZ_HASH_BITS = 12,
713 TDEFL_LEVEL1_HASH_SIZE_MASK = 4095,
714 TDEFL_LZ_HASH_SHIFT = (TDEFL_LZ_HASH_BITS + 2) / 3,
715 TDEFL_LZ_HASH_SIZE = 1 << TDEFL_LZ_HASH_BITS
720 TDEFL_LZ_CODE_BUF_SIZE = 64 * 1024,
721 TDEFL_OUT_BUF_SIZE = (TDEFL_LZ_CODE_BUF_SIZE * 13) / 10,
722 TDEFL_MAX_HUFF_SYMBOLS = 288,
723 TDEFL_LZ_HASH_BITS = 15,
724 TDEFL_LEVEL1_HASH_SIZE_MASK = 4095,
725 TDEFL_LZ_HASH_SHIFT = (TDEFL_LZ_HASH_BITS + 2) / 3,
726 TDEFL_LZ_HASH_SIZE = 1 << TDEFL_LZ_HASH_BITS
733 TDEFL_STATUS_BAD_PARAM = -2,
734 TDEFL_STATUS_PUT_BUF_FAILED = -1,
735 TDEFL_STATUS_OKAY = 0,
736 TDEFL_STATUS_DONE = 1,
743 TDEFL_SYNC_FLUSH = 2,
744 TDEFL_FULL_FLUSH = 3,
751 tdefl_put_buf_func_ptr m_pPut_buf_func;
752 void *m_pPut_buf_user;
753 mz_uint m_flags, m_max_probes[2];
754 int m_greedy_parsing;
755 mz_uint m_adler32, m_lookahead_pos, m_lookahead_size, m_dict_size;
756 mz_uint8 *m_pLZ_code_buf, *m_pLZ_flags, *m_pOutput_buf, *m_pOutput_buf_end;
757 mz_uint m_num_flags_left, m_total_lz_bytes, m_lz_code_buf_dict_pos, m_bits_in, m_bit_buffer;
758 mz_uint m_saved_match_dist, m_saved_match_len, m_saved_lit, m_output_flush_ofs, m_output_flush_remaining, m_finished, m_block_index, m_wants_to_finish;
759 tdefl_status m_prev_return_status;
760 const void *m_pIn_buf;
762 size_t *m_pIn_buf_size, *m_pOut_buf_size;
764 const mz_uint8 *m_pSrc;
765 size_t m_src_buf_left, m_out_buf_ofs;
766 mz_uint8 m_dict[TDEFL_LZ_DICT_SIZE + TDEFL_MAX_MATCH_LEN - 1];
767 mz_uint16 m_huff_count[TDEFL_MAX_HUFF_TABLES][TDEFL_MAX_HUFF_SYMBOLS];
768 mz_uint16 m_huff_codes[TDEFL_MAX_HUFF_TABLES][TDEFL_MAX_HUFF_SYMBOLS];
769 mz_uint8 m_huff_code_sizes[TDEFL_MAX_HUFF_TABLES][TDEFL_MAX_HUFF_SYMBOLS];
770 mz_uint8 m_lz_code_buf[TDEFL_LZ_CODE_BUF_SIZE];
771 mz_uint16 m_next[TDEFL_LZ_DICT_SIZE];
772 mz_uint16 m_hash[TDEFL_LZ_HASH_SIZE];
773 mz_uint8 m_output_buf[TDEFL_OUT_BUF_SIZE];
781tdefl_status
tdefl_init(tdefl_compressor *d, tdefl_put_buf_func_ptr pPut_buf_func,
void *pPut_buf_user,
int flags);
784tdefl_status
tdefl_compress(tdefl_compressor *d,
const void *pIn_buf,
size_t *pIn_buf_size,
void *pOut_buf,
size_t *pOut_buf_size, tdefl_flush flush);
788tdefl_status
tdefl_compress_buffer(tdefl_compressor *d,
const void *pIn_buf,
size_t in_buf_size, tdefl_flush flush);
794#ifndef MINIZ_NO_ZLIB_APIS
825 TINFL_FLAG_PARSE_ZLIB_HEADER = 1,
826 TINFL_FLAG_HAS_MORE_INPUT = 2,
827 TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF = 4,
828 TINFL_FLAG_COMPUTE_ADLER32 = 8
843#define TINFL_DECOMPRESS_MEM_TO_MEM_FAILED ((size_t)(-1))
848typedef int (*tinfl_put_buf_func_ptr)(
const void *pBuf,
int len,
void *pUser);
851struct tinfl_decompressor_tag;
852typedef struct tinfl_decompressor_tag tinfl_decompressor;
862#define TINFL_LZ_DICT_SIZE 32768
870 TINFL_STATUS_FAILED_CANNOT_MAKE_PROGRESS = -4,
873 TINFL_STATUS_BAD_PARAM = -3,
876 TINFL_STATUS_ADLER32_MISMATCH = -2,
879 TINFL_STATUS_FAILED = -1,
885 TINFL_STATUS_DONE = 0,
890 TINFL_STATUS_NEEDS_MORE_INPUT = 1,
896 TINFL_STATUS_HAS_MORE_OUTPUT = 2
900#define tinfl_init(r) \
906#define tinfl_get_adler32(r) (r)->m_check_adler32
910tinfl_status
tinfl_decompress(tinfl_decompressor *
r,
const mz_uint8 *pIn_buf_next,
size_t *pIn_buf_size, mz_uint8 *pOut_buf_start, mz_uint8 *pOut_buf_next,
size_t *pOut_buf_size,
const mz_uint32 decomp_flags);
915 TINFL_MAX_HUFF_TABLES = 3,
916 TINFL_MAX_HUFF_SYMBOLS_0 = 288,
917 TINFL_MAX_HUFF_SYMBOLS_1 = 32,
918 TINFL_MAX_HUFF_SYMBOLS_2 = 19,
919 TINFL_FAST_LOOKUP_BITS = 10,
920 TINFL_FAST_LOOKUP_SIZE = 1 << TINFL_FAST_LOOKUP_BITS
925 mz_uint8 m_code_size[TINFL_MAX_HUFF_SYMBOLS_0];
926 mz_int16 m_look_up[TINFL_FAST_LOOKUP_SIZE], m_tree[TINFL_MAX_HUFF_SYMBOLS_0 * 2];
929#if MINIZ_HAS_64BIT_REGISTERS
930#define TINFL_USE_64BIT_BITBUF 1
933#if TINFL_USE_64BIT_BITBUF
934typedef mz_uint64 tinfl_bit_buf_t;
935#define TINFL_BITBUF_SIZE (64)
937typedef mz_uint32 tinfl_bit_buf_t;
938#define TINFL_BITBUF_SIZE (32)
941struct tinfl_decompressor_tag
943 mz_uint32 m_state, m_num_bits, m_zhdr0, m_zhdr1, m_z_adler32, m_final, m_type, m_check_adler32, m_dist, m_counter, m_num_extra, m_table_sizes[TINFL_MAX_HUFF_TABLES];
944 tinfl_bit_buf_t m_bit_buf;
945 size_t m_dist_from_out_buf_start;
946 tinfl_huff_table m_tables[TINFL_MAX_HUFF_TABLES];
947 mz_uint8 m_raw_header[4], m_len_codes[TINFL_MAX_HUFF_SYMBOLS_0 + TINFL_MAX_HUFF_SYMBOLS_1 + 137];
966 MZ_ZIP_MAX_IO_BUF_SIZE = 64 * 1024,
967 MZ_ZIP_MAX_ARCHIVE_FILENAME_SIZE = 512,
968 MZ_ZIP_MAX_ARCHIVE_FILE_COMMENT_SIZE = 512
974 mz_uint32 m_file_index;
977 mz_uint64 m_central_dir_ofs;
980 mz_uint16 m_version_made_by;
981 mz_uint16 m_version_needed;
982 mz_uint16 m_bit_flag;
993 mz_uint64 m_comp_size;
996 mz_uint64 m_uncomp_size;
999 mz_uint16 m_internal_attr;
1000 mz_uint32 m_external_attr;
1003 mz_uint64 m_local_header_ofs;
1006 mz_uint32 m_comment_size;
1009 mz_bool m_is_directory;
1012 mz_bool m_is_encrypted;
1015 mz_bool m_is_supported;
1019 char m_filename[MZ_ZIP_MAX_ARCHIVE_FILENAME_SIZE];
1023 char m_comment[MZ_ZIP_MAX_ARCHIVE_FILE_COMMENT_SIZE];
1025} mz_zip_archive_file_stat;
1027typedef size_t (*mz_file_read_func)(
void *pOpaque, mz_uint64 file_ofs,
void *pBuf,
size_t n);
1028typedef size_t (*mz_file_write_func)(
void *pOpaque, mz_uint64 file_ofs,
const void *pBuf,
size_t n);
1035 MZ_ZIP_MODE_INVALID = 0,
1036 MZ_ZIP_MODE_READING = 1,
1037 MZ_ZIP_MODE_WRITING = 2,
1038 MZ_ZIP_MODE_WRITING_HAS_BEEN_FINALIZED = 3
1043 MZ_ZIP_FLAG_CASE_SENSITIVE = 0x0100,
1044 MZ_ZIP_FLAG_IGNORE_PATH = 0x0200,
1045 MZ_ZIP_FLAG_COMPRESSED_DATA = 0x0400,
1046 MZ_ZIP_FLAG_DO_NOT_SORT_CENTRAL_DIRECTORY = 0x0800,
1047 MZ_ZIP_FLAG_VALIDATE_LOCATE_FILE_FLAG = 0x1000,
1048 MZ_ZIP_FLAG_VALIDATE_HEADERS_ONLY = 0x2000,
1049 MZ_ZIP_FLAG_WRITE_ZIP64 = 0x4000,
1050 MZ_ZIP_FLAG_WRITE_ALLOW_READING = 0x8000,
1051 MZ_ZIP_FLAG_UTF8_FILENAME = 0x10000
1056 MZ_ZIP_TYPE_INVALID = 0,
1068 MZ_ZIP_NO_ERROR = 0,
1069 MZ_ZIP_UNDEFINED_ERROR,
1070 MZ_ZIP_TOO_MANY_FILES,
1071 MZ_ZIP_FILE_TOO_LARGE,
1072 MZ_ZIP_UNSUPPORTED_METHOD,
1073 MZ_ZIP_UNSUPPORTED_ENCRYPTION,
1074 MZ_ZIP_UNSUPPORTED_FEATURE,
1075 MZ_ZIP_FAILED_FINDING_CENTRAL_DIR,
1076 MZ_ZIP_NOT_AN_ARCHIVE,
1077 MZ_ZIP_INVALID_HEADER_OR_CORRUPTED,
1078 MZ_ZIP_UNSUPPORTED_MULTIDISK,
1079 MZ_ZIP_DECOMPRESSION_FAILED,
1080 MZ_ZIP_COMPRESSION_FAILED,
1081 MZ_ZIP_UNEXPECTED_DECOMPRESSED_SIZE,
1082 MZ_ZIP_CRC_CHECK_FAILED,
1083 MZ_ZIP_UNSUPPORTED_CDIR_SIZE,
1084 MZ_ZIP_ALLOC_FAILED,
1085 MZ_ZIP_FILE_OPEN_FAILED,
1086 MZ_ZIP_FILE_CREATE_FAILED,
1087 MZ_ZIP_FILE_WRITE_FAILED,
1088 MZ_ZIP_FILE_READ_FAILED,
1089 MZ_ZIP_FILE_CLOSE_FAILED,
1090 MZ_ZIP_FILE_SEEK_FAILED,
1091 MZ_ZIP_FILE_STAT_FAILED,
1092 MZ_ZIP_INVALID_PARAMETER,
1093 MZ_ZIP_INVALID_FILENAME,
1094 MZ_ZIP_BUF_TOO_SMALL,
1095 MZ_ZIP_INTERNAL_ERROR,
1096 MZ_ZIP_FILE_NOT_FOUND,
1097 MZ_ZIP_ARCHIVE_TOO_LARGE,
1098 MZ_ZIP_VALIDATION_FAILED,
1099 MZ_ZIP_WRITE_CALLBACK_FAILED,
1105 mz_uint64 m_archive_size;
1106 mz_uint64 m_central_directory_file_ofs;
1109 mz_uint32 m_total_files;
1110 mz_zip_mode m_zip_mode;
1111 mz_zip_type m_zip_type;
1112 mz_zip_error m_last_error;
1114 mz_uint64 m_file_offset_alignment;
1119 void *m_pAlloc_opaque;
1121 mz_file_read_func m_pRead;
1122 mz_file_write_func m_pWrite;
1125 mz_zip_internal_state *m_pState;
1137#ifndef MINIZ_NO_STDIO
1142mz_bool
mz_zip_reader_init_file_v2(mz_zip_archive *pZip,
const char *pFilename, mz_uint flags, mz_uint64 file_start_ofs, mz_uint64 archive_size);
1175int mz_zip_locate_file(mz_zip_archive *pZip,
const char *pName,
const char *pComment, mz_uint flags);
1177mz_bool mz_zip_locate_file_v2(mz_zip_archive *pZip,
const char *pName,
const char *pComment, mz_uint flags, mz_uint32 *pIndex);
1204mz_bool
mz_zip_reader_locate_file_v2(mz_zip_archive *pZip,
const char *pName,
const char *pComment, mz_uint flags, mz_uint32 *file_index);
1219mz_bool
mz_zip_reader_extract_to_mem_no_alloc(mz_zip_archive *pZip, mz_uint file_index,
void *pBuf,
size_t buf_size, mz_uint flags,
void *pUser_read_buf,
size_t user_read_buf_size);
1236#ifndef MINIZ_NO_STDIO
1249 typedef void *mz_zip_streaming_extract_state_ptr;
1250 mz_zip_streaming_extract_state_ptr mz_zip_streaming_extract_begin(mz_zip_archive *pZip, mz_uint file_index, mz_uint flags);
1251 uint64_t mz_zip_streaming_extract_get_size(mz_zip_archive *pZip, mz_zip_streaming_extract_state_ptr pState);
1252 uint64_t mz_zip_streaming_extract_get_cur_ofs(mz_zip_archive *pZip, mz_zip_streaming_extract_state_ptr pState);
1253 mz_bool mz_zip_streaming_extract_seek(mz_zip_archive *pZip, mz_zip_streaming_extract_state_ptr pState, uint64_t new_ofs);
1254 size_t mz_zip_streaming_extract_read(mz_zip_archive *pZip, mz_zip_streaming_extract_state_ptr pState,
void *pBuf,
size_t buf_size);
1255 mz_bool mz_zip_streaming_extract_end(mz_zip_archive *pZip, mz_zip_streaming_extract_state_ptr pState);
1274#ifndef MINIZ_NO_ARCHIVE_WRITING_APIS
1279mz_bool
mz_zip_writer_init_heap(mz_zip_archive *pZip,
size_t size_to_reserve_at_beginning,
size_t initial_allocation_size);
1280mz_bool
mz_zip_writer_init_heap_v2(mz_zip_archive *pZip,
size_t size_to_reserve_at_beginning,
size_t initial_allocation_size, mz_uint flags);
1282#ifndef MINIZ_NO_STDIO
1283mz_bool
mz_zip_writer_init_file(mz_zip_archive *pZip,
const char *pFilename, mz_uint64 size_to_reserve_at_beginning);
1284mz_bool
mz_zip_writer_init_file_v2(mz_zip_archive *pZip,
const char *pFilename, mz_uint64 size_to_reserve_at_beginning, mz_uint flags);
1300mz_bool
mz_zip_writer_add_mem(mz_zip_archive *pZip,
const char *pArchive_name,
const void *pBuf,
size_t buf_size, mz_uint level_and_flags);
1304mz_bool
mz_zip_writer_add_mem_ex(mz_zip_archive *pZip,
const char *pArchive_name,
const void *pBuf,
size_t buf_size,
const void *pComment, mz_uint16 comment_size, mz_uint level_and_flags,
1305 mz_uint64 uncomp_size, mz_uint32 uncomp_crc32);
1307mz_bool
mz_zip_writer_add_mem_ex_v2(mz_zip_archive *pZip,
const char *pArchive_name,
const void *pBuf,
size_t buf_size,
const void *pComment, mz_uint16 comment_size, mz_uint level_and_flags,
1308 mz_uint64 uncomp_size, mz_uint32 uncomp_crc32, MZ_TIME_T *last_modified,
const char *user_extra_data_local, mz_uint user_extra_data_local_len,
1309 const char *user_extra_data_central, mz_uint user_extra_data_central_len);
1311#ifndef MINIZ_NO_STDIO
1314mz_bool
mz_zip_writer_add_file(mz_zip_archive *pZip,
const char *pArchive_name,
const char *pSrc_filename,
const void *pComment, mz_uint16 comment_size, mz_uint level_and_flags);
1317mz_bool
mz_zip_writer_add_cfile(mz_zip_archive *pZip,
const char *pArchive_name, MZ_FILE *pSrc_file, mz_uint64 size_to_add,
1318 const MZ_TIME_T *pFile_time,
const void *pComment, mz_uint16 comment_size, mz_uint level_and_flags,
const char *user_extra_data_local, mz_uint user_extra_data_local_len,
1319 const char *user_extra_data_central, mz_uint user_extra_data_central_len);
1345mz_bool
mz_zip_add_mem_to_archive_file_in_place(
const char *pZip_filename,
const char *pArchive_name,
const void *pBuf,
size_t buf_size,
const void *pComment, mz_uint16 comment_size, mz_uint level_and_flags);
1346mz_bool
mz_zip_add_mem_to_archive_file_in_place_v2(
const char *pZip_filename,
const char *pArchive_name,
const void *pBuf,
size_t buf_size,
const void *pComment, mz_uint16 comment_size, mz_uint level_and_flags, mz_zip_error *pErr);
1361#include <util/pragma_pop.def>
mz_bool mz_zip_is_zip64(mz_zip_archive *pZip)
mz_bool mz_zip_reader_end(mz_zip_archive *pZip)
mz_bool mz_zip_validate_archive(mz_zip_archive *pZip, mz_uint flags)
mz_bool mz_zip_writer_finalize_archive(mz_zip_archive *pZip)
mz_zip_type mz_zip_get_type(mz_zip_archive *pZip)
mz_bool tdefl_compress_mem_to_output(const void *pBuf, size_t buf_len, tdefl_put_buf_func_ptr pPut_buf_func, void *pPut_buf_user, int flags)
void * miniz_def_realloc_func(void *opaque, void *address, size_t items, size_t size)
mz_bool mz_zip_end(mz_zip_archive *pZip)
mz_uint mz_zip_reader_get_num_files(mz_zip_archive *pZip)
void * tdefl_write_image_to_png_file_in_memory_ex(const void *pImage, int w, int h, int num_chans, size_t *pLen_out, mz_uint level, mz_bool flip)
mz_bool mz_zip_writer_init_file(mz_zip_archive *pZip, const char *pFilename, mz_uint64 size_to_reserve_at_beginning)
void * tdefl_compress_mem_to_heap(const void *pSrc_buf, size_t src_buf_len, size_t *pOut_len, int flags)
mz_bool mz_zip_reader_init_file(mz_zip_archive *pZip, const char *pFilename, mz_uint32 flags)
size_t mz_zip_get_central_dir_size(mz_zip_archive *pZip)
mz_uint32 tdefl_get_adler32(tdefl_compressor *d)
mz_bool mz_zip_reader_extract_file_to_callback(mz_zip_archive *pZip, const char *pFilename, mz_file_write_func pCallback, void *pOpaque, mz_uint flags)
mz_bool mz_zip_add_mem_to_archive_file_in_place(const char *pZip_filename, const char *pArchive_name, const void *pBuf, size_t buf_size, const void *pComment, mz_uint16 comment_size, mz_uint level_and_flags)
size_t tdefl_compress_mem_to_mem(void *pOut_buf, size_t out_buf_len, const void *pSrc_buf, size_t src_buf_len, int flags)
mz_zip_mode mz_zip_get_mode(mz_zip_archive *pZip)
tdefl_status tdefl_init(tdefl_compressor *d, tdefl_put_buf_func_ptr pPut_buf_func, void *pPut_buf_user, int flags)
size_t mz_zip_read_archive_data(mz_zip_archive *pZip, mz_uint64 file_ofs, void *pBuf, size_t n)
int tinfl_decompress_mem_to_callback(const void *pIn_buf, size_t *pIn_buf_size, tinfl_put_buf_func_ptr pPut_buf_func, void *pPut_buf_user, int flags)
mz_bool mz_zip_writer_init_file_v2(mz_zip_archive *pZip, const char *pFilename, mz_uint64 size_to_reserve_at_beginning, mz_uint flags)
mz_bool mz_zip_reader_is_file_a_directory(mz_zip_archive *pZip, mz_uint file_index)
void * tinfl_decompress_mem_to_heap(const void *pSrc_buf, size_t src_buf_len, size_t *pOut_len, int flags)
mz_bool mz_zip_add_mem_to_archive_file_in_place_v2(const char *pZip_filename, const char *pArchive_name, const void *pBuf, size_t buf_size, const void *pComment, mz_uint16 comment_size, mz_uint level_and_flags, mz_zip_error *pErr)
mz_bool mz_zip_reader_extract_to_mem_no_alloc(mz_zip_archive *pZip, mz_uint file_index, void *pBuf, size_t buf_size, mz_uint flags, void *pUser_read_buf, size_t user_read_buf_size)
mz_bool mz_zip_writer_add_mem_ex(mz_zip_archive *pZip, const char *pArchive_name, const void *pBuf, size_t buf_size, const void *pComment, mz_uint16 comment_size, mz_uint level_and_flags, mz_uint64 uncomp_size, mz_uint32 uncomp_crc32)
void * miniz_def_alloc_func(void *opaque, size_t items, size_t size)
mz_bool mz_zip_reader_locate_file_v2(mz_zip_archive *pZip, const char *pName, const char *pComment, mz_uint flags, mz_uint32 *pIndex)
tdefl_status tdefl_get_prev_return_status(tdefl_compressor *d)
mz_bool mz_zip_writer_init_heap(mz_zip_archive *pZip, size_t size_to_reserve_at_beginning, size_t initial_allocation_size)
mz_zip_error mz_zip_peek_last_error(mz_zip_archive *pZip)
mz_bool mz_zip_reader_init(mz_zip_archive *pZip, mz_uint64 size, mz_uint flags)
mz_zip_error mz_zip_get_last_error(mz_zip_archive *pZip)
mz_bool mz_zip_reader_extract_file_to_file(mz_zip_archive *pZip, const char *pArchive_filename, const char *pDst_filename, mz_uint flags)
tdefl_status tdefl_compress_buffer(tdefl_compressor *d, const void *pIn_buf, size_t in_buf_size, tdefl_flush flush)
mz_bool mz_zip_reader_extract_to_callback(mz_zip_archive *pZip, mz_uint file_index, mz_file_write_func pCallback, void *pOpaque, mz_uint flags)
mz_bool mz_zip_validate_file_archive(const char *pFilename, mz_uint flags, mz_zip_error *pErr)
mz_bool mz_zip_reader_init_mem(mz_zip_archive *pZip, const void *pMem, size_t size, mz_uint flags)
void * mz_zip_extract_archive_file_to_heap_v2(const char *pZip_filename, const char *pArchive_name, const char *pComment, size_t *pSize, mz_uint flags, mz_zip_error *pErr)
const char * mz_zip_get_error_string(mz_zip_error mz_err)
void * mz_zip_reader_extract_to_heap(mz_zip_archive *pZip, mz_uint file_index, size_t *pSize, mz_uint flags)
void miniz_def_free_func(void *opaque, void *address)
mz_bool mz_zip_writer_end(mz_zip_archive *pZip)
mz_bool mz_zip_writer_init_cfile(mz_zip_archive *pZip, MZ_FILE *pFile, mz_uint flags)
mz_bool mz_zip_writer_add_file(mz_zip_archive *pZip, const char *pArchive_name, const char *pSrc_filename, const void *pComment, mz_uint16 comment_size, mz_uint level_and_flags)
int mz_zip_reader_locate_file(mz_zip_archive *pZip, const char *pName, const char *pComment, mz_uint flags)
mz_bool mz_zip_reader_is_file_encrypted(mz_zip_archive *pZip, mz_uint file_index)
mz_bool mz_zip_writer_init(mz_zip_archive *pZip, mz_uint64 existing_size)
void mz_zip_zero_struct(mz_zip_archive *pZip)
mz_uint64 mz_zip_get_archive_size(mz_zip_archive *pZip)
tdefl_compressor * tdefl_compressor_alloc()
MZ_FILE * mz_zip_get_cfile(mz_zip_archive *pZip)
mz_bool mz_zip_writer_add_from_zip_reader(mz_zip_archive *pZip, mz_zip_archive *pSource_zip, mz_uint src_file_index)
mz_bool mz_zip_reader_is_file_supported(mz_zip_archive *pZip, mz_uint file_index)
mz_bool mz_zip_reader_extract_to_mem(mz_zip_archive *pZip, mz_uint file_index, void *pBuf, size_t buf_size, mz_uint flags)
mz_zip_error mz_zip_set_last_error(mz_zip_archive *pZip, mz_zip_error err_num)
void * mz_zip_extract_archive_file_to_heap(const char *pZip_filename, const char *pArchive_name, size_t *pSize, mz_uint flags)
mz_bool mz_zip_reader_file_stat(mz_zip_archive *pZip, mz_uint file_index, mz_zip_archive_file_stat *pStat)
mz_bool mz_zip_writer_init_from_reader_v2(mz_zip_archive *pZip, const char *pFilename, mz_uint flags)
mz_bool mz_zip_reader_init_file_v2(mz_zip_archive *pZip, const char *pFilename, mz_uint flags, mz_uint64 file_start_ofs, mz_uint64 archive_size)
mz_bool mz_zip_writer_add_cfile(mz_zip_archive *pZip, const char *pArchive_name, MZ_FILE *pSrc_file, mz_uint64 size_to_add, const MZ_TIME_T *pFile_time, const void *pComment, 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_central, mz_uint user_extra_data_central_len)
void tdefl_compressor_free(tdefl_compressor *pComp)
mz_uint64 mz_zip_get_archive_file_start_offset(mz_zip_archive *pZip)
mz_bool mz_zip_writer_add_mem(mz_zip_archive *pZip, const char *pArchive_name, const void *pBuf, size_t buf_size, mz_uint level_and_flags)
void * mz_zip_reader_extract_file_to_heap(mz_zip_archive *pZip, const char *pFilename, size_t *pSize, mz_uint flags)
mz_bool mz_zip_reader_extract_file_to_mem(mz_zip_archive *pZip, const char *pFilename, void *pBuf, size_t buf_size, mz_uint flags)
mz_bool mz_zip_reader_extract_file_to_mem_no_alloc(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)
size_t tinfl_decompress_mem_to_mem(void *pOut_buf, size_t out_buf_len, const void *pSrc_buf, size_t src_buf_len, int flags)
tinfl_status tinfl_decompress(tinfl_decompressor *r, const mz_uint8 *pIn_buf_next, size_t *pIn_buf_size, mz_uint8 *pOut_buf_start, mz_uint8 *pOut_buf_next, size_t *pOut_buf_size, const mz_uint32 decomp_flags)
mz_bool mz_zip_validate_mem_archive(const void *pMem, size_t size, mz_uint flags, mz_zip_error *pErr)
mz_bool mz_zip_validate_file(mz_zip_archive *pZip, mz_uint file_index, mz_uint flags)
void * tdefl_write_image_to_png_file_in_memory(const void *pImage, int w, int h, int num_chans, size_t *pLen_out)
mz_uint tdefl_create_comp_flags_from_zip_params(int level, int window_bits, int strategy)
mz_bool mz_zip_reader_extract_to_cfile(mz_zip_archive *pZip, mz_uint file_index, MZ_FILE *pFile, mz_uint flags)
mz_bool mz_zip_reader_init_cfile(mz_zip_archive *pZip, MZ_FILE *pFile, mz_uint64 archive_size, mz_uint flags)
tinfl_decompressor * tinfl_decompressor_alloc()
mz_bool mz_zip_writer_finalize_heap_archive(mz_zip_archive *pZip, void **ppBuf, size_t *pSize)
mz_bool mz_zip_reader_extract_file_to_cfile(mz_zip_archive *pZip, const char *pArchive_filename, MZ_FILE *pFile, mz_uint flags)
mz_bool mz_zip_writer_init_v2(mz_zip_archive *pZip, mz_uint64 existing_size, mz_uint flags)
tdefl_status tdefl_compress(tdefl_compressor *d, const void *pIn_buf, size_t *pIn_buf_size, void *pOut_buf, size_t *pOut_buf_size, tdefl_flush flush)
mz_bool mz_zip_writer_init_from_reader(mz_zip_archive *pZip, const char *pFilename)
mz_zip_error mz_zip_clear_last_error(mz_zip_archive *pZip)
mz_bool mz_zip_writer_add_mem_ex_v2(mz_zip_archive *pZip, const char *pArchive_name, const void *pBuf, size_t buf_size, const void *pComment, mz_uint16 comment_size, mz_uint level_and_flags, mz_uint64 uncomp_size, mz_uint32 uncomp_crc32, MZ_TIME_T *last_modified, const char *user_extra_data, mz_uint user_extra_data_len, const char *user_extra_data_central, mz_uint user_extra_data_central_len)
mz_bool mz_zip_writer_init_heap_v2(mz_zip_archive *pZip, size_t size_to_reserve_at_beginning, size_t initial_allocation_size, mz_uint flags)
mz_bool mz_zip_reader_extract_to_file(mz_zip_archive *pZip, mz_uint file_index, const char *pDst_filename, mz_uint flags)
mz_uint mz_zip_reader_get_filename(mz_zip_archive *pZip, mz_uint file_index, char *pFilename, mz_uint filename_buf_size)
void tinfl_decompressor_free(tinfl_decompressor *pDecomp)
mz_ulong mz_adler32(mz_ulong adler, const unsigned char *ptr, size_t buf_len)
void *(* mz_alloc_func)(void *opaque, size_t items, size_t size)
struct mz_stream_s mz_stream
int mz_deflateReset(mz_streamp pStream)
int mz_inflateInit(mz_streamp pStream)
int mz_inflate(mz_streamp pStream, int flush)
int mz_compress(unsigned char *pDest, mz_ulong *pDest_len, const unsigned char *pSource, mz_ulong source_len)
mz_ulong mz_compressBound(mz_ulong source_len)
int mz_deflateEnd(mz_streamp pStream)
int mz_deflateInit2(mz_streamp pStream, int level, int method, int window_bits, int mem_level, int strategy)
const char * mz_version(void)
int mz_deflateInit(mz_streamp pStream, int level)
int mz_compress2(unsigned char *pDest, mz_ulong *pDest_len, const unsigned char *pSource, mz_ulong source_len, int level)
const char * mz_error(int err)
int mz_inflateInit2(mz_streamp pStream, int window_bits)
int mz_uncompress(unsigned char *pDest, mz_ulong *pDest_len, const unsigned char *pSource, mz_ulong source_len)
int mz_inflateEnd(mz_streamp pStream)
void *(* mz_realloc_func)(void *opaque, void *address, size_t items, size_t size)
int mz_deflate(mz_streamp pStream, int flush)
void(* mz_free_func)(void *opaque, void *address)
mz_ulong mz_deflateBound(mz_streamp pStream, mz_ulong source_len)
mz_ulong mz_crc32(mz_ulong crc, const unsigned char *ptr, size_t buf_len)
struct mz_internal_state * state
const unsigned char * next_in