CBMC
miniz.h
Go to the documentation of this file.
1 /* miniz.c v1.16 beta r1 - public domain deflate/inflate, zlib-subset, ZIP reading/writing/appending, PNG writing
2  See "unlicense" statement at the end of this file.
3  Rich Geldreich <richgel99@gmail.com>, last updated Oct. 13, 2013
4  Implements RFC 1950: http://www.ietf.org/rfc/rfc1950.txt and RFC 1951: http://www.ietf.org/rfc/rfc1951.txt
5 
6  Most API's defined in miniz.c are optional. For example, to disable the archive related functions just define
7  MINIZ_NO_ARCHIVE_APIS, or to get rid of all stdio usage define MINIZ_NO_STDIO (see the list below for more macros).
8 
9  * Change History
10  10/19/13 v1.16 beta r1 - Two key inflator-only robustness and streaming related changes. Also merged in tdefl_compressor_alloc(), tdefl_compressor_free() helpers to make script bindings easier for rustyzip.
11  - The inflator coroutine func. is subtle and complex so I'm being cautious about this release. I would greatly appreciate any help with testing or any feedback.
12  I feel good about these changes, and they've been through several hours of automated testing, but they will probably not fix anything for the majority of prev. users so I'm
13  going to mark this release as beta for a few weeks and continue testing it at work/home on various things.
14  - The inflator in raw (non-zlib) mode is now usable on gzip or similiar data streams that have a bunch of bytes following the raw deflate data (problem discovered by rustyzip author williamw520).
15  This version should *never* read beyond the last byte of the raw deflate data independent of how many bytes you pass into the input buffer. This issue was caused by the various Huffman bitbuffer lookahead optimizations, and
16  would not be an issue if the caller knew and enforced the precise size of the raw compressed data *or* if the compressed data was in zlib format (i.e. always followed by the byte aligned zlib adler32).
17  So in other words, you can now call the inflator on deflate streams that are followed by arbitrary amounts of data and it's guaranteed that decompression will stop exactly on the last byte.
18  - The inflator now has a new failure status: TINFL_STATUS_FAILED_CANNOT_MAKE_PROGRESS (-4). Previously, if the inflator was starved of bytes and could not make progress (because the input buffer was empty and the
19  caller did not set the TINFL_FLAG_HAS_MORE_INPUT flag - say on truncated or corrupted compressed data stream) it would append all 0's to the input and try to soldier on.
20  This is scary, because in the worst case, I believe it was possible for the prev. inflator to start outputting large amounts of literal data. If the caller didn't know when to stop accepting output
21  (because it didn't know how much uncompressed data was expected, or didn't enforce a sane maximum) it could continue forever. v1.16 cannot fall into this failure mode, instead it'll return
22  TINFL_STATUS_FAILED_CANNOT_MAKE_PROGRESS immediately if it needs 1 or more bytes to make progress, the input buf is empty, and the caller has indicated that no more input is available. This is a "soft"
23  failure, so you can call the inflator again with more input and it will try to continue, or you can give up and fail. This could be very useful in network streaming scenarios.
24  - Added documentation to all the tinfl return status codes, fixed miniz_tester so it accepts double minus params for Linux, tweaked example1.c, added a simple "follower bytes" test to miniz_tester.cpp.
25  10/13/13 v1.15 r4 - Interim bugfix release while I work on the next major release with Zip64 support (almost there!):
26  - Critical fix for the MZ_ZIP_FLAG_DO_NOT_SORT_CENTRAL_DIRECTORY bug (thanks kahmyong.moon@hp.com) which could cause locate files to not find files. This bug
27  would only have occured in earlier versions if you explicitly used this flag, OR if you used mz_zip_extract_archive_file_to_heap() or mz_zip_add_mem_to_archive_file_in_place()
28  (which used this flag). If you can't switch to v1.15 but want to fix this bug, just remove the uses of this flag from both helper funcs (and of course don't use the flag).
29  - Bugfix in mz_zip_reader_extract_to_mem_no_alloc() from kymoon when pUser_read_buf is not NULL and compressed size is > uncompressed size
30  - Fixing mz_zip_reader_extract_*() funcs so they don't try to extract compressed data from directory entries, to account for weird zipfiles which contain zero-size compressed data on dir entries.
31  Hopefully this fix won't cause any issues on weird zip archives, because it assumes the low 16-bits of zip external attributes are DOS attributes (which I believe they always are in practice).
32  - Fixing mz_zip_reader_is_file_a_directory() so it doesn't check the internal attributes, just the filename and external attributes
33  - mz_zip_reader_init_file() - missing MZ_FCLOSE() call if the seek failed
34  - Added cmake support for Linux builds which builds all the examples, tested with clang v3.3 and gcc v4.6.
35  - Clang fix for tdefl_write_image_to_png_file_in_memory() from toffaletti
36  - Merged MZ_FORCEINLINE fix from hdeanclark
37  - Fix <time.h> include before config #ifdef, thanks emil.brink
38  - Added tdefl_write_image_to_png_file_in_memory_ex(): supports Y flipping (super useful for OpenGL apps), and explicit control over the compression level (so you can
39  set it to 1 for real-time compression).
40  - Merged in some compiler fixes from paulharris's github repro.
41  - Retested this build under Windows (VS 2010, including static analysis), tcc 0.9.26, gcc v4.6 and clang v3.3.
42  - Added example6.c, which dumps an image of the mandelbrot set to a PNG file.
43  - Modified example2 to help test the MZ_ZIP_FLAG_DO_NOT_SORT_CENTRAL_DIRECTORY flag more.
44  - In r3: Bugfix to mz_zip_writer_add_file() found during merge: Fix possible src file fclose() leak if alignment bytes+local header file write faiiled
45  - In r4: Minor bugfix to mz_zip_writer_add_from_zip_reader(): Was pushing the wrong central dir header offset, appears harmless in this release, but it became a problem in the zip64 branch
46  5/20/12 v1.14 - MinGW32/64 GCC 4.6.1 compiler fixes: added MZ_FORCEINLINE, #include <time.h> (thanks fermtect).
47  5/19/12 v1.13 - From jason@cornsyrup.org and kelwert@mtu.edu - Fix mz_crc32() so it doesn't compute the wrong CRC-32's when mz_ulong is 64-bit.
48  - Temporarily/locally slammed in "typedef unsigned long mz_ulong" and re-ran a randomized regression test on ~500k files.
49  - Eliminated a bunch of warnings when compiling with GCC 32-bit/64.
50  - Ran all examples, miniz.c, and tinfl.c through MSVC 2008's /analyze (static analysis) option and fixed all warnings (except for the silly
51  "Use of the comma-operator in a tested expression.." analysis warning, which I purposely use to work around a MSVC compiler warning).
52  - Created 32-bit and 64-bit Codeblocks projects/workspace. Built and tested Linux executables. The codeblocks workspace is compatible with Linux+Win32/x64.
53  - Added miniz_tester solution/project, which is a useful little app derived from LZHAM's tester app that I use as part of the regression test.
54  - Ran miniz.c and tinfl.c through another series of regression testing on ~500,000 files and archives.
55  - Modified example5.c so it purposely disables a bunch of high-level functionality (MINIZ_NO_STDIO, etc.). (Thanks to corysama for the MINIZ_NO_STDIO bug report.)
56  - Fix ftell() usage in examples so they exit with an error on files which are too large (a limitation of the examples, not miniz itself).
57  4/12/12 v1.12 - More comments, added low-level example5.c, fixed a couple minor level_and_flags issues in the archive API's.
58  level_and_flags can now be set to MZ_DEFAULT_COMPRESSION. Thanks to Bruce Dawson <bruced@valvesoftware.com> for the feedback/bug report.
59  5/28/11 v1.11 - Added statement from unlicense.org
60  5/27/11 v1.10 - Substantial compressor optimizations:
61  - Level 1 is now ~4x faster than before. The L1 compressor's throughput now varies between 70-110MB/sec. on a
62  - Core i7 (actual throughput varies depending on the type of data, and x64 vs. x86).
63  - Improved baseline L2-L9 compression perf. Also, greatly improved compression perf. issues on some file types.
64  - Refactored the compression code for better readability and maintainability.
65  - Added level 10 compression level (L10 has slightly better ratio than level 9, but could have a potentially large
66  drop in throughput on some files).
67  5/15/11 v1.09 - Initial stable release.
68 
69  * Low-level Deflate/Inflate implementation notes:
70 
71  Compression: Use the "tdefl" API's. The compressor supports raw, static, and dynamic blocks, lazy or
72  greedy parsing, match length filtering, RLE-only, and Huffman-only streams. It performs and compresses
73  approximately as well as zlib.
74 
75  Decompression: Use the "tinfl" API's. The entire decompressor is implemented as a single function
76  coroutine: see tinfl_decompress(). It supports decompression into a 32KB (or larger power of 2) wrapping buffer, or into a memory
77  block large enough to hold the entire file.
78 
79  The low-level tdefl/tinfl API's do not make any use of dynamic memory allocation.
80 
81  * zlib-style API notes:
82 
83  miniz.c implements a fairly large subset of zlib. There's enough functionality present for it to be a drop-in
84  zlib replacement in many apps:
85  The z_stream struct, optional memory allocation callbacks
86  deflateInit/deflateInit2/deflate/deflateReset/deflateEnd/deflateBound
87  inflateInit/inflateInit2/inflate/inflateEnd
88  compress, compress2, compressBound, uncompress
89  CRC-32, Adler-32 - Using modern, minimal code size, CPU cache friendly routines.
90  Supports raw deflate streams or standard zlib streams with adler-32 checking.
91 
92  Limitations:
93  The callback API's are not implemented yet. No support for gzip headers or zlib static dictionaries.
94  I've tried to closely emulate zlib's various flavors of stream flushing and return status codes, but
95  there are no guarantees that miniz.c pulls this off perfectly.
96 
97  * PNG writing: See the tdefl_write_image_to_png_file_in_memory() function, originally written by
98  Alex Evans. Supports 1-4 bytes/pixel images.
99 
100  * ZIP archive API notes:
101 
102  The ZIP archive API's where designed with simplicity and efficiency in mind, with just enough abstraction to
103  get the job done with minimal fuss. There are simple API's to retrieve file information, read files from
104  existing archives, create new archives, append new files to existing archives, or clone archive data from
105  one archive to another. It supports archives located in memory or the heap, on disk (using stdio.h),
106  or you can specify custom file read/write callbacks.
107 
108  - Archive reading: Just call this function to read a single file from a disk archive:
109 
110  void *mz_zip_extract_archive_file_to_heap(const char *pZip_filename, const char *pArchive_name,
111  size_t *pSize, mz_uint zip_flags);
112 
113  For more complex cases, use the "mz_zip_reader" functions. Upon opening an archive, the entire central
114  directory is located and read as-is into memory, and subsequent file access only occurs when reading individual files.
115 
116  - Archives file scanning: The simple way is to use this function to scan a loaded archive for a specific file:
117 
118  int mz_zip_reader_locate_file(mz_zip_archive *pZip, const char *pName, const char *pComment, mz_uint flags);
119 
120  The locate operation can optionally check file comments too, which (as one example) can be used to identify
121  multiple versions of the same file in an archive. This function uses a simple linear search through the central
122  directory, so it's not very fast.
123 
124  Alternately, you can iterate through all the files in an archive (using mz_zip_reader_get_num_files()) and
125  retrieve detailed info on each file by calling mz_zip_reader_file_stat().
126 
127  - Archive creation: Use the "mz_zip_writer" functions. The ZIP writer immediately writes compressed file data
128  to disk and builds an exact image of the central directory in memory. The central directory image is written
129  all at once at the end of the archive file when the archive is finalized.
130 
131  The archive writer can optionally align each file's local header and file data to any power of 2 alignment,
132  which can be useful when the archive will be read from optical media. Also, the writer supports placing
133  arbitrary data blobs at the very beginning of ZIP archives. Archives written using either feature are still
134  readable by any ZIP tool.
135 
136  - Archive appending: The simple way to add a single file to an archive is to call this function:
137 
138  mz_bool mz_zip_add_mem_to_archive_file_in_place(const char *pZip_filename, const char *pArchive_name,
139  const void *pBuf, size_t buf_size, const void *pComment, mz_uint16 comment_size, mz_uint level_and_flags);
140 
141  The archive will be created if it doesn't already exist, otherwise it'll be appended to.
142  Note the appending is done in-place and is not an atomic operation, so if something goes wrong
143  during the operation it's possible the archive could be left without a central directory (although the local
144  file headers and file data will be fine, so the archive will be recoverable).
145 
146  For more complex archive modification scenarios:
147  1. The safest way is to use a mz_zip_reader to read the existing archive, cloning only those bits you want to
148  preserve into a new archive using using the mz_zip_writer_add_from_zip_reader() function (which compiles the
149  compressed file data as-is). When you're done, delete the old archive and rename the newly written archive, and
150  you're done. This is safe but requires a bunch of temporary disk space or heap memory.
151 
152  2. Or, you can convert an mz_zip_reader in-place to an mz_zip_writer using mz_zip_writer_init_from_reader(),
153  append new files as needed, then finalize the archive which will write an updated central directory to the
154  original archive. (This is basically what mz_zip_add_mem_to_archive_file_in_place() does.) There's a
155  possibility that the archive's central directory could be lost with this method if anything goes wrong, though.
156 
157  - ZIP archive support limitations:
158  No zip64 or spanning support. Extraction functions can only handle unencrypted, stored or deflated files.
159  Requires streams capable of seeking.
160 
161  * This is a header file library, like stb_image.c. To get only a header file, either cut and paste the
162  below header, or create miniz.h, #define MINIZ_HEADER_FILE_ONLY, and then include miniz.c from it.
163 
164  * Important: For best perf. be sure to customize the below macros for your target platform:
165  #define MINIZ_USE_UNALIGNED_LOADS_AND_STORES 1
166  #define MINIZ_LITTLE_ENDIAN 1
167  #define MINIZ_HAS_64BIT_REGISTERS 1
168 
169  * On platforms using glibc, Be sure to "#define _LARGEFILE64_SOURCE 1" before including miniz.c to ensure miniz
170  uses the 64-bit variants: fopen64(), stat64(), etc. Otherwise you won't be able to process large files
171  (i.e. 32-bit stat() fails for me on files > 0x7FFFFFFF bytes).
172 */
173 #pragma once
174 
175 
176 #ifdef _MSC_VER
177 #include <util/pragma_push.def>
178 #pragma warning(disable:4668)
179  // using #if/#elif on undefined macro
180 #endif
181 
182 
183 
184 /* Defines to completely disable specific portions of miniz.c:
185  If all macros here are defined the only functionality remaining will be CRC-32, adler-32, tinfl, and tdefl. */
186 
187 /* Define MINIZ_NO_STDIO to disable all usage and any functions which rely on stdio for file I/O. */
188 /*#define MINIZ_NO_STDIO */
189 
190 /* If MINIZ_NO_TIME is specified then the ZIP archive functions will not be able to get the current time, or */
191 /* get/set file times, and the C run-time funcs that get/set times won't be called. */
192 /* The current downside is the times written to your archives will be from 1979. */
193 /*#define MINIZ_NO_TIME */
194 
195 /* Define MINIZ_NO_ARCHIVE_APIS to disable all ZIP archive API's. */
196 /*#define MINIZ_NO_ARCHIVE_APIS */
197 
198 /* Define MINIZ_NO_ARCHIVE_APIS to disable all writing related ZIP archive API's. */
199 /*#define MINIZ_NO_ARCHIVE_WRITING_APIS */
200 
201 /* Define MINIZ_NO_ZLIB_APIS to remove all ZLIB-style compression/decompression API's. */
202 /*#define MINIZ_NO_ZLIB_APIS */
203 
204 /* Define MINIZ_NO_ZLIB_COMPATIBLE_NAME to disable zlib names, to prevent conflicts against stock zlib. */
205 /*#define MINIZ_NO_ZLIB_COMPATIBLE_NAMES */
206 
207 /* Define MINIZ_NO_MALLOC to disable all calls to malloc, free, and realloc.
208  Note if MINIZ_NO_MALLOC is defined then the user must always provide custom user alloc/free/realloc
209  callbacks to the zlib and archive API's, and a few stand-alone helper API's which don't provide custom user
210  functions (such as tdefl_compress_mem_to_heap() and tinfl_decompress_mem_to_heap()) won't work. */
211 /*#define MINIZ_NO_MALLOC */
212 
213 #if defined(__TINYC__) && (defined(__linux) || defined(__linux__))
214 /* TODO: Work around "error: include file 'sys\utime.h' when compiling with tcc on Linux */
215 #define MINIZ_NO_TIME
216 #endif
217 
218 #if !defined(MINIZ_NO_TIME) && !defined(MINIZ_NO_ARCHIVE_APIS)
219 #include <time.h>
220 #endif
221 
222 #if defined(_M_IX86) || defined(_M_X64) || defined(__i386__) || defined(__i386) || defined(__i486__) || defined(__i486) || defined(i386) || defined(__ia64__) || defined(__x86_64__)
223 /* MINIZ_X86_OR_X64_CPU is only used to help set the below macros. */
224 #define MINIZ_X86_OR_X64_CPU 1
225 #endif
226 
227 #if (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__) || MINIZ_X86_OR_X64_CPU
228 /* Set MINIZ_LITTLE_ENDIAN to 1 if the processor is little endian. */
229 #define MINIZ_LITTLE_ENDIAN 1
230 #endif
231 
232 #if defined(MINIZ_X86_OR_X64_CPU) && !defined(__GNUG__)
233 /* Set MINIZ_USE_UNALIGNED_LOADS_AND_STORES to 1 on CPU's that permit efficient integer loads and stores from unaligned addresses. */
234 #define MINIZ_USE_UNALIGNED_LOADS_AND_STORES 1
235 #endif
236 
237 #if defined(_M_X64) || defined(_WIN64) || defined(__MINGW64__) || defined(_LP64) || defined(__LP64__) || defined(__ia64__) || defined(__x86_64__)
238 /* Set MINIZ_HAS_64BIT_REGISTERS to 1 if operations on 64-bit integers are reasonably fast (and don't involve compiler generated calls to helper functions). */
239 #define MINIZ_HAS_64BIT_REGISTERS 1
240 #endif
241 
242 #ifdef __cplusplus
243 extern "C" {
244 #endif
245 
246 /* ------------------- zlib-style API Definitions. */
247 
248 /* For more compatibility with zlib, miniz.c uses unsigned long for some parameters/struct members. Beware: mz_ulong can be either 32 or 64-bits! */
249 typedef unsigned long mz_ulong;
250 
251 /* mz_free() internally uses the MZ_FREE() macro (which by default calls free() unless you've modified the MZ_MALLOC macro) to release a block allocated from the heap. */
252 void mz_free(void *p);
253 
254 #define MZ_ADLER32_INIT (1)
255 /* mz_adler32() returns the initial adler-32 value to use when called with ptr==NULL. */
256 mz_ulong mz_adler32(mz_ulong adler, const unsigned char *ptr, size_t buf_len);
257 
258 #define MZ_CRC32_INIT (0)
259 /* mz_crc32() returns the initial CRC-32 value to use when called with ptr==NULL. */
260 mz_ulong mz_crc32(mz_ulong crc, const unsigned char *ptr, size_t buf_len);
261 
262 /* Compression strategies. */
263 enum
264 {
268  MZ_RLE = 3,
270 };
271 
272 /* Method */
273 #define MZ_DEFLATED 8
274 
275 #ifndef MINIZ_NO_ZLIB_APIS
276 
277 /* Heap allocation callbacks.
278  Note that mz_alloc_func parameter types purpsosely differ from zlib's: items/size is size_t, not unsigned long. */
279 typedef void *(*mz_alloc_func)(void *opaque, size_t items, size_t size);
280 typedef void (*mz_free_func)(void *opaque, void *address);
281 typedef void *(*mz_realloc_func)(void *opaque, void *address, size_t items, size_t size);
282 
283 /* TODO: I can't encode "1.16" here, argh */
284 #define MZ_VERSION "9.1.15"
285 #define MZ_VERNUM 0x91F0
286 #define MZ_VER_MAJOR 9
287 #define MZ_VER_MINOR 1
288 #define MZ_VER_REVISION 15
289 #define MZ_VER_SUBREVISION 0
290 
291 /* Flush values. For typical usage you only need MZ_NO_FLUSH and MZ_FINISH. The other values are for advanced use (refer to the zlib docs). */
292 enum
293 {
300 };
301 
302 /* Return status codes. MZ_PARAM_ERROR is non-standard. */
303 enum
304 {
305  MZ_OK = 0,
308  MZ_ERRNO = -1,
314  MZ_PARAM_ERROR = -10000
315 };
316 
317 /* Compression levels: 0-9 are the standard zlib-style levels, 10 is best possible compression (not zlib compatible, and may be very slow), MZ_DEFAULT_COMPRESSION=MZ_DEFAULT_LEVEL. */
318 enum
319 {
326 };
327 
328 /* Window bits */
329 #define MZ_DEFAULT_WINDOW_BITS 15
330 
331 struct mz_internal_state;
332 
333 /* Compression/decompression stream struct. */
334 typedef struct mz_stream_s
335 {
336  const unsigned char *next_in; /* pointer to next byte to read */
337  unsigned int avail_in; /* number of bytes available at next_in */
338  mz_ulong total_in; /* total number of bytes consumed so far */
339 
340  unsigned char *next_out; /* pointer to next byte to write */
341  unsigned int avail_out; /* number of bytes that can be written to next_out */
342  mz_ulong total_out; /* total number of bytes produced so far */
343 
344  char *msg; /* error msg (unused) */
345  struct mz_internal_state *state; /* internal state, allocated by zalloc/zfree */
346 
347  mz_alloc_func zalloc; /* optional heap allocation function (defaults to malloc) */
348  mz_free_func zfree; /* optional heap free function (defaults to free) */
349  void *opaque; /* heap alloc function user pointer */
350 
351  int data_type; /* data_type (unused) */
352  mz_ulong adler; /* adler32 of the source or uncompressed data */
353  mz_ulong reserved; /* not used */
354 } mz_stream;
355 
357 
358 /* Returns the version string of miniz.c. */
359 const char *mz_version(void);
360 
361 /* mz_deflateInit() initializes a compressor with default options: */
362 /* Parameters: */
363 /* pStream must point to an initialized mz_stream struct. */
364 /* level must be between [MZ_NO_COMPRESSION, MZ_BEST_COMPRESSION]. */
365 /* level 1 enables a specially optimized compression function that's been optimized purely for performance, not ratio. */
366 /* (This special func. is currently only enabled when MINIZ_USE_UNALIGNED_LOADS_AND_STORES and MINIZ_LITTLE_ENDIAN are defined.) */
367 /* Return values: */
368 /* MZ_OK on success. */
369 /* MZ_STREAM_ERROR if the stream is bogus. */
370 /* MZ_PARAM_ERROR if the input parameters are bogus. */
371 /* MZ_MEM_ERROR on out of memory. */
372 int mz_deflateInit(mz_streamp pStream, int level);
373 
374 /* mz_deflateInit2() is like mz_deflate(), except with more control: */
375 /* Additional parameters: */
376 /* method must be MZ_DEFLATED */
377 /* window_bits must be MZ_DEFAULT_WINDOW_BITS (to wrap the deflate stream with zlib header/adler-32 footer) or -MZ_DEFAULT_WINDOW_BITS (raw deflate/no header or footer) */
378 /* mem_level must be between [1, 9] (it's checked but ignored by miniz.c) */
379 int mz_deflateInit2(mz_streamp pStream, int level, int method, int window_bits, int mem_level, int strategy);
380 
381 /* Quickly resets a compressor without having to reallocate anything. Same as calling mz_deflateEnd() followed by mz_deflateInit()/mz_deflateInit2(). */
382 int mz_deflateReset(mz_streamp pStream);
383 
384 /* mz_deflate() compresses the input to output, consuming as much of the input and producing as much output as possible. */
385 /* Parameters: */
386 /* pStream is the stream to read from and write to. You must initialize/update the next_in, avail_in, next_out, and avail_out members. */
387 /* flush may be MZ_NO_FLUSH, MZ_PARTIAL_FLUSH/MZ_SYNC_FLUSH, MZ_FULL_FLUSH, or MZ_FINISH. */
388 /* Return values: */
389 /* MZ_OK on success (when flushing, or if more input is needed but not available, and/or there's more output to be written but the output buffer is full). */
390 /* MZ_STREAM_END if all input has been consumed and all output bytes have been written. Don't call mz_deflate() on the stream anymore. */
391 /* MZ_STREAM_ERROR if the stream is bogus. */
392 /* MZ_PARAM_ERROR if one of the parameters is invalid. */
393 /* MZ_BUF_ERROR if no forward progress is possible because the input and/or output buffers are empty. (Fill up the input buffer or free up some output space and try again.) */
394 int mz_deflate(mz_streamp pStream, int flush);
395 
396 /* mz_deflateEnd() deinitializes a compressor: */
397 /* Return values: */
398 /* MZ_OK on success. */
399 /* MZ_STREAM_ERROR if the stream is bogus. */
400 int mz_deflateEnd(mz_streamp pStream);
401 
402 /* mz_deflateBound() returns a (very) conservative upper bound on the amount of data that could be generated by deflate(), assuming flush is set to only MZ_NO_FLUSH or MZ_FINISH. */
403 mz_ulong mz_deflateBound(mz_streamp pStream, mz_ulong source_len);
404 
405 /* Single-call compression functions mz_compress() and mz_compress2(): */
406 /* Returns MZ_OK on success, or one of the error codes from mz_deflate() on failure. */
407 int mz_compress(unsigned char *pDest, mz_ulong *pDest_len, const unsigned char *pSource, mz_ulong source_len);
408 int mz_compress2(unsigned char *pDest, mz_ulong *pDest_len, const unsigned char *pSource, mz_ulong source_len, int level);
409 
410 /* mz_compressBound() returns a (very) conservative upper bound on the amount of data that could be generated by calling mz_compress(). */
412 
413 /* Initializes a decompressor. */
414 int mz_inflateInit(mz_streamp pStream);
415 
416 /* mz_inflateInit2() is like mz_inflateInit() with an additional option that controls the window size and whether or not the stream has been wrapped with a zlib header/footer: */
417 /* window_bits must be MZ_DEFAULT_WINDOW_BITS (to parse zlib header/footer) or -MZ_DEFAULT_WINDOW_BITS (raw deflate). */
418 int mz_inflateInit2(mz_streamp pStream, int window_bits);
419 
420 /* Decompresses the input stream to the output, consuming only as much of the input as needed, and writing as much to the output as possible. */
421 /* Parameters: */
422 /* pStream is the stream to read from and write to. You must initialize/update the next_in, avail_in, next_out, and avail_out members. */
423 /* flush may be MZ_NO_FLUSH, MZ_SYNC_FLUSH, or MZ_FINISH. */
424 /* On the first call, if flush is MZ_FINISH it's assumed the input and output buffers are both sized large enough to decompress the entire stream in a single call (this is slightly faster). */
425 /* MZ_FINISH implies that there are no more source bytes available beside what's already in the input buffer, and that the output buffer is large enough to hold the rest of the decompressed data. */
426 /* Return values: */
427 /* MZ_OK on success. Either more input is needed but not available, and/or there's more output to be written but the output buffer is full. */
428 /* MZ_STREAM_END if all needed input has been consumed and all output bytes have been written. For zlib streams, the adler-32 of the decompressed data has also been verified. */
429 /* MZ_STREAM_ERROR if the stream is bogus. */
430 /* MZ_DATA_ERROR if the deflate stream is invalid. */
431 /* MZ_PARAM_ERROR if one of the parameters is invalid. */
432 /* MZ_BUF_ERROR if no forward progress is possible because the input buffer is empty but the inflater needs more input to continue, or if the output buffer is not large enough. Call mz_inflate() again */
433 /* with more input data, or with more room in the output buffer (except when using single call decompression, described above). */
434 int mz_inflate(mz_streamp pStream, int flush);
435 
436 /* Deinitializes a decompressor. */
437 int mz_inflateEnd(mz_streamp pStream);
438 
439 /* Single-call decompression. */
440 /* Returns MZ_OK on success, or one of the error codes from mz_inflate() on failure. */
441 int mz_uncompress(unsigned char *pDest, mz_ulong *pDest_len, const unsigned char *pSource, mz_ulong source_len);
442 
443 /* Returns a string description of the specified error code, or NULL if the error code is invalid. */
444 const char *mz_error(int err);
445 
446 /* Redefine zlib-compatible names to miniz equivalents, so miniz.c can be used as a drop-in replacement for the subset of zlib that miniz.c supports. */
447 /* Define MINIZ_NO_ZLIB_COMPATIBLE_NAMES to disable zlib-compatibility if you use zlib in the same project. */
448 #ifndef MINIZ_NO_ZLIB_COMPATIBLE_NAMES
449 typedef unsigned char Byte;
450 typedef unsigned int uInt;
451 typedef mz_ulong uLong;
452 typedef Byte Bytef;
453 typedef uInt uIntf;
454 typedef char charf;
455 typedef int intf;
456 typedef void *voidpf;
457 typedef uLong uLongf;
458 typedef void *voidp;
459 typedef void *const voidpc;
460 #define Z_NULL 0
461 #define Z_NO_FLUSH MZ_NO_FLUSH
462 #define Z_PARTIAL_FLUSH MZ_PARTIAL_FLUSH
463 #define Z_SYNC_FLUSH MZ_SYNC_FLUSH
464 #define Z_FULL_FLUSH MZ_FULL_FLUSH
465 #define Z_FINISH MZ_FINISH
466 #define Z_BLOCK MZ_BLOCK
467 #define Z_OK MZ_OK
468 #define Z_STREAM_END MZ_STREAM_END
469 #define Z_NEED_DICT MZ_NEED_DICT
470 #define Z_ERRNO MZ_ERRNO
471 #define Z_STREAM_ERROR MZ_STREAM_ERROR
472 #define Z_DATA_ERROR MZ_DATA_ERROR
473 #define Z_MEM_ERROR MZ_MEM_ERROR
474 #define Z_BUF_ERROR MZ_BUF_ERROR
475 #define Z_VERSION_ERROR MZ_VERSION_ERROR
476 #define Z_PARAM_ERROR MZ_PARAM_ERROR
477 #define Z_NO_COMPRESSION MZ_NO_COMPRESSION
478 #define Z_BEST_SPEED MZ_BEST_SPEED
479 #define Z_BEST_COMPRESSION MZ_BEST_COMPRESSION
480 #define Z_DEFAULT_COMPRESSION MZ_DEFAULT_COMPRESSION
481 #define Z_DEFAULT_STRATEGY MZ_DEFAULT_STRATEGY
482 #define Z_FILTERED MZ_FILTERED
483 #define Z_HUFFMAN_ONLY MZ_HUFFMAN_ONLY
484 #define Z_RLE MZ_RLE
485 #define Z_FIXED MZ_FIXED
486 #define Z_DEFLATED MZ_DEFLATED
487 #define Z_DEFAULT_WINDOW_BITS MZ_DEFAULT_WINDOW_BITS
488 #define alloc_func mz_alloc_func
489 #define free_func mz_free_func
490 #define internal_state mz_internal_state
491 #define z_stream mz_stream
492 #define deflateInit mz_deflateInit
493 #define deflateInit2 mz_deflateInit2
494 #define deflateReset mz_deflateReset
495 #define deflate mz_deflate
496 #define deflateEnd mz_deflateEnd
497 #define deflateBound mz_deflateBound
498 #define compress mz_compress
499 #define compress2 mz_compress2
500 #define compressBound mz_compressBound
501 #define inflateInit mz_inflateInit
502 #define inflateInit2 mz_inflateInit2
503 #define inflate mz_inflate
504 #define inflateEnd mz_inflateEnd
505 #define uncompress mz_uncompress
506 #define crc32 mz_crc32
507 #define adler32 mz_adler32
508 #define MAX_WBITS 15
509 #define MAX_MEM_LEVEL 9
510 #define zError mz_error
511 #define ZLIB_VERSION MZ_VERSION
512 #define ZLIB_VERNUM MZ_VERNUM
513 #define ZLIB_VER_MAJOR MZ_VER_MAJOR
514 #define ZLIB_VER_MINOR MZ_VER_MINOR
515 #define ZLIB_VER_REVISION MZ_VER_REVISION
516 #define ZLIB_VER_SUBREVISION MZ_VER_SUBREVISION
517 #define zlibVersion mz_version
518 #define zlib_version mz_version()
519 #endif /* #ifndef MINIZ_NO_ZLIB_COMPATIBLE_NAMES */
520 
521 #endif /* MINIZ_NO_ZLIB_APIS */
522 
523 #ifdef __cplusplus
524 }
525 #endif
526 #pragma once
527 #include <assert.h>
528 #include <stdlib.h>
529 #include <string.h>
530 #include <stdint.h>
531 #include <stdbool.h>
532 
533 /* ------------------- Types and macros */
534 typedef uint8_t mz_uint8;
535 typedef int16_t mz_int16;
536 typedef uint16_t mz_uint16;
537 typedef uint32_t mz_uint32;
538 typedef unsigned int mz_uint;
539 typedef int64_t mz_int64;
540 typedef uint64_t mz_uint64;
541 typedef bool mz_bool;
542 
543 #define MZ_FALSE false
544 #define MZ_TRUE true
545 
546 /* Works around MSVC's spammy "warning C4127: conditional expression is constant" message. */
547 #ifdef _MSC_VER
548 #define MZ_MACRO_END while(0, 0)
549 #else
550 #define MZ_MACRO_END while(0)
551 #endif
552 
553 #ifdef MINIZ_NO_STDIO
554 #define MZ_FILE void *
555 #else
556 #include <stdio.h>
557 #define MZ_FILE FILE
558 #endif /* #ifdef MINIZ_NO_STDIO */
559 
560 #ifdef MINIZ_NO_TIME
561 typedef struct mz_dummy_time_t_tag
562 {
563  int m_dummy;
564 } mz_dummy_time_t;
565 #define MZ_TIME_T mz_dummy_time_t
566 #else
567 #define MZ_TIME_T time_t
568 #endif
569 
570 #define MZ_ASSERT(x) assert(x)
571 
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
576 #else
577 #define MZ_MALLOC(x) malloc(x)
578 #define MZ_FREE(x) free(x)
579 #define MZ_REALLOC(p, x) realloc(p, x)
580 #endif
581 
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))
585 
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))
589 #else
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))
592 #endif
593 
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))
595 
596 #ifdef _MSC_VER
597 #define MZ_FORCEINLINE __forceinline
598 #elif defined(__GNUC__)
599 #define MZ_FORCEINLINE __inline__ __attribute__((__always_inline__))
600 #else
601 #define MZ_FORCEINLINE inline
602 #endif
603 
604 #ifdef __cplusplus
605 extern "C" {
606 #endif
607 
608 extern void *miniz_def_alloc_func(void *opaque, size_t items, size_t size);
609 extern void miniz_def_free_func(void *opaque, void *address);
610 extern void *miniz_def_realloc_func(void *opaque, void *address, size_t items, size_t size);
611 
612 #define MZ_UINT16_MAX (0xFFFFU)
613 #define MZ_UINT32_MAX (0xFFFFFFFFU)
614 
615 #ifdef __cplusplus
616 }
617 #endif
618 #pragma once
619 
620 
621 #ifdef __cplusplus
622 extern "C" {
623 #endif
624 /* ------------------- Low-level Compression API Definitions */
625 
626 /* Set TDEFL_LESS_MEMORY to 1 to use less memory (compression will be slightly slower, and raw/dynamic blocks will be output more frequently). */
627 #define TDEFL_LESS_MEMORY 0
628 
629 /* tdefl_init() compression flags logically OR'd together (low 12 bits contain the max. number of probes per dictionary search): */
630 /* TDEFL_DEFAULT_MAX_PROBES: The compressor defaults to 128 dictionary probes per dictionary search. 0=Huffman only, 1=Huffman+LZ (fastest/crap compression), 4095=Huffman+LZ (slowest/best compression). */
631 enum
632 {
636 };
637 
638 /* TDEFL_WRITE_ZLIB_HEADER: If set, the compressor outputs a zlib header before the deflate data, and the Adler-32 of the source data at the end. Otherwise, you'll get raw deflate data. */
639 /* TDEFL_COMPUTE_ADLER32: Always compute the adler-32 of the input data (even when not writing zlib headers). */
640 /* TDEFL_GREEDY_PARSING_FLAG: Set to use faster greedy parsing, instead of more efficient lazy parsing. */
641 /* TDEFL_NONDETERMINISTIC_PARSING_FLAG: Enable to decrease the compressor's initialization time to the minimum, but the output may vary from run to run given the same input (depending on the contents of memory). */
642 /* TDEFL_RLE_MATCHES: Only look for RLE matches (matches with a distance of 1) */
643 /* TDEFL_FILTER_MATCHES: Discards matches <= 5 chars if enabled. */
644 /* TDEFL_FORCE_ALL_STATIC_BLOCKS: Disable usage of optimized Huffman tables. */
645 /* TDEFL_FORCE_ALL_RAW_BLOCKS: Only use raw (uncompressed) deflate blocks. */
646 /* The low 12 bits are reserved to control the max # of hash probes per dictionary lookup (see TDEFL_MAX_PROBES_MASK). */
647 enum
648 {
653  TDEFL_RLE_MATCHES = 0x10000,
657 };
658 
659 /* High level compression functions: */
660 /* tdefl_compress_mem_to_heap() compresses a block in memory to a heap block allocated via malloc(). */
661 /* On entry: */
662 /* pSrc_buf, src_buf_len: Pointer and size of source block to compress. */
663 /* flags: The max match finder probes (default is 128) logically OR'd against the above flags. Higher probes are slower but improve compression. */
664 /* On return: */
665 /* Function returns a pointer to the compressed data, or NULL on failure. */
666 /* *pOut_len will be set to the compressed data's size, which could be larger than src_buf_len on uncompressible data. */
667 /* The caller must free() the returned block when it's no longer needed. */
668 void *tdefl_compress_mem_to_heap(const void *pSrc_buf, size_t src_buf_len, size_t *pOut_len, int flags);
669 
670 /* tdefl_compress_mem_to_mem() compresses a block in memory to another block in memory. */
671 /* Returns 0 on failure. */
672 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);
673 
674 /* Compresses an image to a compressed PNG file in memory. */
675 /* On entry: */
676 /* pImage, w, h, and num_chans describe the image to compress. num_chans may be 1, 2, 3, or 4. */
677 /* The image pitch in bytes per scanline will be w*num_chans. The leftmost pixel on the top scanline is stored first in memory. */
678 /* level may range from [0,10], use MZ_NO_COMPRESSION, MZ_BEST_SPEED, MZ_BEST_COMPRESSION, etc. or a decent default is MZ_DEFAULT_LEVEL */
679 /* If flip is true, the image will be flipped on the Y axis (useful for OpenGL apps). */
680 /* On return: */
681 /* Function returns a pointer to the compressed data, or NULL on failure. */
682 /* *pLen_out will be set to the size of the PNG image file. */
683 /* The caller must mz_free() the returned heap block (which will typically be larger than *pLen_out) when it's no longer needed. */
684 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);
685 void *tdefl_write_image_to_png_file_in_memory(const void *pImage, int w, int h, int num_chans, size_t *pLen_out);
686 
687 /* Output stream interface. The compressor uses this interface to write compressed data. It'll typically be called TDEFL_OUT_BUF_SIZE at a time. */
688 typedef mz_bool (*tdefl_put_buf_func_ptr)(const void *pBuf, int len, void *pUser);
689 
690 /* tdefl_compress_mem_to_output() compresses a block to an output stream. The above helpers use this function internally. */
691 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);
692 
693 enum
694 {
703 };
704 
705 /* TDEFL_OUT_BUF_SIZE MUST be large enough to hold a single entire compressed output block (using static/fixed Huffman codes). */
706 #if TDEFL_LESS_MEMORY
707 enum
708 {
709  TDEFL_LZ_CODE_BUF_SIZE = 24 * 1024,
712  TDEFL_LZ_HASH_BITS = 12,
716 };
717 #else
718 enum
719 {
727 };
728 #endif
729 
730 /* The low-level tdefl functions below may be used directly if the above helper functions aren't flexible enough. The low-level functions don't make any heap allocations, unlike the above helper functions. */
731 typedef enum
732 {
737 } tdefl_status;
738 
739 /* Must map to MZ_NO_FLUSH, MZ_SYNC_FLUSH, etc. enums */
740 typedef enum
741 {
746 } tdefl_flush;
747 
748 /* tdefl's compression state structure. */
749 typedef struct
750 {
753  mz_uint m_flags, m_max_probes[2];
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;
760  const void *m_pIn_buf;
761  void *m_pOut_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;
775 
776 /* Initializes the compressor. */
777 /* There is no corresponding deinit() function because the tdefl API's do not dynamically allocate memory. */
778 /* pBut_buf_func: If NULL, output data will be supplied to the specified callback. In this case, the user should call the tdefl_compress_buffer() API for compression. */
779 /* If pBut_buf_func is NULL the user should always call the tdefl_compress() API. */
780 /* flags: See the above enums (TDEFL_HUFFMAN_ONLY, TDEFL_WRITE_ZLIB_HEADER, etc.) */
781 tdefl_status tdefl_init(tdefl_compressor *d, tdefl_put_buf_func_ptr pPut_buf_func, void *pPut_buf_user, int flags);
782 
783 /* Compresses a block of data, consuming as much of the specified input buffer as possible, and writing as much compressed data to the specified output buffer as possible. */
784 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);
785 
786 /* tdefl_compress_buffer() is only usable when the tdefl_init() is called with a non-NULL tdefl_put_buf_func_ptr. */
787 /* tdefl_compress_buffer() always consumes the entire input buffer. */
788 tdefl_status tdefl_compress_buffer(tdefl_compressor *d, const void *pIn_buf, size_t in_buf_size, tdefl_flush flush);
789 
792 
793 /* Can't use tdefl_create_comp_flags_from_zip_params if MINIZ_NO_ZLIB_APIS isn't defined, because it uses some of its macros. */
794 #ifndef MINIZ_NO_ZLIB_APIS
795 /* Create tdefl_compress() flags given zlib-style compression parameters. */
796 /* level may range from [0,10] (where 10 is absolute max compression, but may be much slower on some files) */
797 /* window_bits may be -15 (raw deflate) or 15 (zlib) */
798 /* strategy may be either MZ_DEFAULT_STRATEGY, MZ_FILTERED, MZ_HUFFMAN_ONLY, MZ_RLE, or MZ_FIXED */
799 mz_uint tdefl_create_comp_flags_from_zip_params(int level, int window_bits, int strategy);
800 #endif /* #ifndef MINIZ_NO_ZLIB_APIS */
801 
802 /* Allocate the tdefl_compressor structure in C so that */
803 /* non-C language bindings to tdefl_ API don't need to worry about */
804 /* structure size and allocation mechanism. */
807 
808 #ifdef __cplusplus
809 }
810 #endif
811 #pragma once
812 
813 /* ------------------- Low-level Decompression API Definitions */
814 
815 #ifdef __cplusplus
816 extern "C" {
817 #endif
818 /* Decompression flags used by tinfl_decompress(). */
819 /* TINFL_FLAG_PARSE_ZLIB_HEADER: If set, the input has a valid zlib header and ends with an adler32 checksum (it's a valid zlib stream). Otherwise, the input is a raw deflate stream. */
820 /* TINFL_FLAG_HAS_MORE_INPUT: If set, there are more input bytes available beyond the end of the supplied input buffer. If clear, the input buffer contains all remaining input. */
821 /* TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF: If set, the output buffer is large enough to hold the entire decompressed stream. If clear, the output buffer is at least the size of the dictionary (typically 32KB). */
822 /* TINFL_FLAG_COMPUTE_ADLER32: Force adler-32 checksum computation of the decompressed bytes. */
823 enum
824 {
829 };
830 
831 /* High level decompression functions: */
832 /* tinfl_decompress_mem_to_heap() decompresses a block in memory to a heap block allocated via malloc(). */
833 /* On entry: */
834 /* pSrc_buf, src_buf_len: Pointer and size of the Deflate or zlib source data to decompress. */
835 /* On return: */
836 /* Function returns a pointer to the decompressed data, or NULL on failure. */
837 /* *pOut_len will be set to the decompressed data's size, which could be larger than src_buf_len on uncompressible data. */
838 /* The caller must call mz_free() on the returned block when it's no longer needed. */
839 void *tinfl_decompress_mem_to_heap(const void *pSrc_buf, size_t src_buf_len, size_t *pOut_len, int flags);
840 
841 /* tinfl_decompress_mem_to_mem() decompresses a block in memory to another block in memory. */
842 /* Returns TINFL_DECOMPRESS_MEM_TO_MEM_FAILED on failure, or the number of bytes written on success. */
843 #define TINFL_DECOMPRESS_MEM_TO_MEM_FAILED ((size_t)(-1))
844 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);
845 
846 /* tinfl_decompress_mem_to_callback() decompresses a block in memory to an internal 32KB buffer, and a user provided callback function will be called to flush the buffer. */
847 /* Returns 1 on success or 0 on failure. */
848 typedef int (*tinfl_put_buf_func_ptr)(const void *pBuf, int len, void *pUser);
849 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);
850 
853 
854 /* Allocate the tinfl_decompressor structure in C so that */
855 /* non-C language bindings to tinfl_ API don't need to worry about */
856 /* structure size and allocation mechanism. */
857 
860 
861 /* Max size of LZ dictionary. */
862 #define TINFL_LZ_DICT_SIZE 32768
863 
864 /* Return status. */
865 typedef enum
866 {
867  /* This flags indicates the inflator needs 1 or more input bytes to make forward progress, but the caller is indicating that no more are available. The compressed data */
868  /* is probably corrupted. If you call the inflator again with more bytes it'll try to continue processing the input but this is a BAD sign (either the data is corrupted or you called it incorrectly). */
869  /* If you call it again with no input you'll just get TINFL_STATUS_FAILED_CANNOT_MAKE_PROGRESS again. */
871 
872  /* This flag indicates that one or more of the input parameters was obviously bogus. (You can try calling it again, but if you get this error the calling code is wrong.) */
874 
875  /* This flags indicate the inflator is finished but the adler32 check of the uncompressed data didn't match. If you call it again it'll return TINFL_STATUS_DONE. */
877 
878  /* This flags indicate the inflator has somehow failed (bad code, corrupted input, etc.). If you call it again without resetting via tinfl_init() it it'll just keep on returning the same status failure code. */
880 
881  /* Any status code less than TINFL_STATUS_DONE must indicate a failure. */
882 
883  /* This flag indicates the inflator has returned every byte of uncompressed data that it can, has consumed every byte that it needed, has successfully reached the end of the deflate stream, and */
884  /* if zlib headers and adler32 checking enabled that it has successfully checked the uncompressed data's adler32. If you call it again you'll just get TINFL_STATUS_DONE over and over again. */
886 
887  /* This flag indicates the inflator MUST have more input data (even 1 byte) before it can make any more forward progress, or you need to clear the TINFL_FLAG_HAS_MORE_INPUT */
888  /* flag on the next call if you don't have any more source data. If the source data was somehow corrupted it's also possible (but unlikely) for the inflator to keep on demanding input to */
889  /* proceed, so be sure to properly set the TINFL_FLAG_HAS_MORE_INPUT flag. */
891 
892  /* This flag indicates the inflator definitely has 1 or more bytes of uncompressed data available, but it cannot write this data into the output buffer. */
893  /* Note if the source compressed data was corrupted it's possible for the inflator to return a lot of uncompressed data to the caller. I've been assuming you know how much uncompressed data to expect */
894  /* (either exact or worst case) and will stop calling the inflator and fail after receiving too much. In pure streaming scenarios where you have no idea how many bytes to expect this may not be possible */
895  /* so I may need to add some code to address this. */
897 } tinfl_status;
898 
899 /* Initializes the decompressor to its initial state. */
900 #define tinfl_init(r) \
901  do \
902  { \
903  (r)->m_state = 0; \
904  } \
905  MZ_MACRO_END
906 #define tinfl_get_adler32(r) (r)->m_check_adler32
907 
908 /* Main low-level decompressor coroutine function. This is the only function actually needed for decompression. All the other functions are just high-level helpers for improved usability. */
909 /* This is a universal API, i.e. it can be used as a building block to build any desired higher level decompression API. In the limit case, it can be called once per every byte input or output. */
910 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);
911 
912 /* Internal/private bits follow. */
913 enum
914 {
921 };
922 
923 typedef struct
924 {
928 
929 #if MINIZ_HAS_64BIT_REGISTERS
930 #define TINFL_USE_64BIT_BITBUF 1
931 #endif
932 
933 #if TINFL_USE_64BIT_BITBUF
934 typedef mz_uint64 tinfl_bit_buf_t;
935 #define TINFL_BITBUF_SIZE (64)
936 #else
938 #define TINFL_BITBUF_SIZE (32)
939 #endif
940 
942 {
948 };
949 
950 #ifdef __cplusplus
951 }
952 #endif
953 
954 #pragma once
955 
956 
957 /* ------------------- ZIP archive reading/writing */
958 
959 #ifdef __cplusplus
960 extern "C" {
961 #endif
962 
963 enum
964 {
965  /* Note: These enums can be reduced as needed to save memory or stack space - they are pretty conservative. */
969 };
970 
971 typedef struct
972 {
973  /* Central directory file index. */
975 
976  /* Byte offset of this entry in the archive's central directory. Note we currently only support up to UINT_MAX or less bytes in the central dir. */
978 
979  /* These fields are copied directly from the zip's central dir. */
984 
985 #ifndef MINIZ_NO_TIME
987 #endif
988 
989  /* CRC-32 of uncompressed data. */
991 
992  /* File's compressed size. */
994 
995  /* File's uncompressed size. Note, I've seen some old archives where directory entries had 512 bytes for their uncompressed sizes, but when you try to unpack them you actually get 0 bytes. */
997 
998  /* Zip internal and external file attributes. */
1001 
1002  /* Entry's local header file offset in bytes. */
1004 
1005  /* Size of comment in bytes. */
1007 
1008  /* MZ_TRUE if the entry appears to be a directory. */
1010 
1011  /* MZ_TRUE if the entry uses encryption/strong encryption (which miniz_zip doesn't support) */
1013 
1014  /* MZ_TRUE if the file is not encrypted, a patch file, and if it uses a compression method we support. */
1016 
1017  /* Filename. If string ends in '/' it's a subdirectory entry. */
1018  /* Guaranteed to be zero terminated, may be truncated to fit. */
1020 
1021  /* Comment field. */
1022  /* Guaranteed to be zero terminated, may be truncated to fit. */
1024 
1026 
1027 typedef size_t (*mz_file_read_func)(void *pOpaque, mz_uint64 file_ofs, void *pBuf, size_t n);
1028 typedef size_t (*mz_file_write_func)(void *pOpaque, mz_uint64 file_ofs, const void *pBuf, size_t n);
1029 
1032 
1033 typedef enum
1034 {
1039 } mz_zip_mode;
1040 
1041 typedef enum
1042 {
1047  MZ_ZIP_FLAG_VALIDATE_LOCATE_FILE_FLAG = 0x1000, /* if enabled, mz_zip_reader_locate_file() will be called on each file as its validated to ensure the func finds the file in the central dir (intended for testing) */
1048  MZ_ZIP_FLAG_VALIDATE_HEADERS_ONLY = 0x2000, /* validate the local headers, but don't decompress the entire file and check the crc32 */
1049  MZ_ZIP_FLAG_WRITE_ZIP64 = 0x4000, /* use the zip64 file format, instead of the original zip file format */
1052 } mz_zip_flags;
1053 
1054 typedef enum
1055 {
1063 } mz_zip_type;
1064 
1065 /* miniz error codes. Be sure to update mz_zip_get_error_string() if you add or modify this enum. */
1066 typedef enum
1067 {
1101 } mz_zip_error;
1102 
1103 typedef struct
1104 {
1107 
1108  /* We only support up to UINT32_MAX files in zip64 mode. */
1113 
1115 
1120 
1124 
1126 
1127 } mz_zip_archive;
1128 
1129 /* -------- ZIP reading */
1130 
1131 /* Inits a ZIP archive reader. */
1132 /* These functions read and validate the archive's central directory. */
1134 
1135 mz_bool mz_zip_reader_init_mem(mz_zip_archive *pZip, const void *pMem, size_t size, mz_uint flags);
1136 
1137 #ifndef MINIZ_NO_STDIO
1138 /* Read a archive from a disk file. */
1139 /* file_start_ofs is the file offset where the archive actually begins, or 0. */
1140 /* actual_archive_size is the true total size of the archive, which may be smaller than the file's actual size on disk. If zero the entire file is treated as the archive. */
1141 mz_bool mz_zip_reader_init_file(mz_zip_archive *pZip, const char *pFilename, mz_uint32 flags);
1142 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);
1143 
1144 /* Read an archive from an already opened FILE, beginning at the current file position. */
1145 /* The archive is assumed to be archive_size bytes long. If archive_size is < 0, then the entire rest of the file is assumed to contain the archive. */
1146 /* The FILE will NOT be closed when mz_zip_reader_end() is called. */
1147 mz_bool mz_zip_reader_init_cfile(mz_zip_archive *pZip, MZ_FILE *pFile, mz_uint64 archive_size, mz_uint flags);
1148 #endif
1149 
1150 /* Ends archive reading, freeing all allocations, and closing the input archive file if mz_zip_reader_init_file() was used. */
1152 
1153 /* -------- ZIP reading or writing */
1154 
1155 /* Clears a mz_zip_archive struct to all zeros. */
1156 /* Important: This must be done before passing the struct to any mz_zip functions. */
1158 
1161 
1162 /* Returns the total number of files in the archive. */
1164 
1168 
1169 /* Reads n bytes of raw archive data, starting at file offset file_ofs, to pBuf. */
1170 size_t mz_zip_read_archive_data(mz_zip_archive *pZip, mz_uint64 file_ofs, void *pBuf, size_t n);
1171 
1172 /* Attempts to locates a file in the archive's central directory. */
1173 /* Valid flags: MZ_ZIP_FLAG_CASE_SENSITIVE, MZ_ZIP_FLAG_IGNORE_PATH */
1174 /* Returns -1 if the file cannot be found. */
1175 int mz_zip_locate_file(mz_zip_archive *pZip, const char *pName, const char *pComment, mz_uint flags);
1176 /* Returns MZ_FALSE if the file cannot be found. */
1177 mz_bool mz_zip_locate_file_v2(mz_zip_archive *pZip, const char *pName, const char *pComment, mz_uint flags, mz_uint32 *pIndex);
1178 
1179 /* All mz_zip funcs set the m_last_error field in the mz_zip_archive struct. These functions retrieve/manipulate this field. */
1180 /* Note that the m_last_error functionality is not thread safe. */
1185 const char *mz_zip_get_error_string(mz_zip_error mz_err);
1186 
1187 /* MZ_TRUE if the archive file entry is a directory entry. */
1189 
1190 /* MZ_TRUE if the file is encrypted/strong encrypted. */
1192 
1193 /* MZ_TRUE if the compression method is supported, and the file is not encrypted, and the file is not a compressed patch file. */
1195 
1196 /* Retrieves the filename of an archive file entry. */
1197 /* Returns the number of bytes written to pFilename, or if filename_buf_size is 0 this function returns the number of bytes needed to fully store the filename. */
1198 mz_uint mz_zip_reader_get_filename(mz_zip_archive *pZip, mz_uint file_index, char *pFilename, mz_uint filename_buf_size);
1199 
1200 /* Attempts to locates a file in the archive's central directory. */
1201 /* Valid flags: MZ_ZIP_FLAG_CASE_SENSITIVE, MZ_ZIP_FLAG_IGNORE_PATH */
1202 /* Returns -1 if the file cannot be found. */
1203 int mz_zip_reader_locate_file(mz_zip_archive *pZip, const char *pName, const char *pComment, mz_uint flags);
1204 mz_bool mz_zip_reader_locate_file_v2(mz_zip_archive *pZip, const char *pName, const char *pComment, mz_uint flags, mz_uint32 *file_index);
1205 
1206 /* Returns detailed information about an archive file entry. */
1208 
1209 /* MZ_TRUE if the file is in zip64 format. */
1210 /* A file is considered zip64 if it contained a zip64 end of central directory marker, or if it contained any zip64 extended file information fields in the central directory. */
1212 
1213 /* Returns the total central directory size in bytes. */
1214 /* The current max supported size is <= MZ_UINT32_MAX. */
1216 
1217 /* Extracts a archive file to a memory buffer using no memory allocation. */
1218 /* There must be at least enough room on the stack to store the inflator's state (~34KB or so). */
1219 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);
1220 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);
1221 
1222 /* Extracts a archive file to a memory buffer. */
1223 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);
1224 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);
1225 
1226 /* Extracts a archive file to a dynamically allocated heap buffer. */
1227 /* The memory will be allocated via the mz_zip_archive's alloc/realloc functions. */
1228 /* Returns NULL and sets the last error on failure. */
1229 void *mz_zip_reader_extract_to_heap(mz_zip_archive *pZip, mz_uint file_index, size_t *pSize, mz_uint flags);
1230 void *mz_zip_reader_extract_file_to_heap(mz_zip_archive *pZip, const char *pFilename, size_t *pSize, mz_uint flags);
1231 
1232 /* Extracts a archive file using a callback function to output the file's data. */
1233 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);
1234 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);
1235 
1236 #ifndef MINIZ_NO_STDIO
1237 /* Extracts a archive file to a disk file and sets its last accessed and modified times. */
1238 /* This function only extracts files, not archive directory records. */
1239 mz_bool mz_zip_reader_extract_to_file(mz_zip_archive *pZip, mz_uint file_index, const char *pDst_filename, mz_uint flags);
1240 mz_bool mz_zip_reader_extract_file_to_file(mz_zip_archive *pZip, const char *pArchive_filename, const char *pDst_filename, mz_uint flags);
1241 
1242 /* Extracts a archive file starting at the current position in the destination FILE stream. */
1244 mz_bool mz_zip_reader_extract_file_to_cfile(mz_zip_archive *pZip, const char *pArchive_filename, MZ_FILE *pFile, mz_uint flags);
1245 #endif
1246 
1247 #if 0
1248 /* TODO */
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);
1256 #endif
1257 
1258 /* This function compares the archive's local headers, the optional local zip64 extended information block, and the optional descriptor following the compressed data vs. the data in the central directory. */
1259 /* It also validates that each file can be successfully uncompressed unless the MZ_ZIP_FLAG_VALIDATE_HEADERS_ONLY is specified. */
1260 mz_bool mz_zip_validate_file(mz_zip_archive *pZip, mz_uint file_index, mz_uint flags);
1261 
1262 /* Validates an entire archive by calling mz_zip_validate_file() on each file. */
1264 
1265 /* Misc utils/helpers, valid for ZIP reading or writing */
1266 mz_bool mz_zip_validate_mem_archive(const void *pMem, size_t size, mz_uint flags, mz_zip_error *pErr);
1267 mz_bool mz_zip_validate_file_archive(const char *pFilename, mz_uint flags, mz_zip_error *pErr);
1268 
1269 /* Universal end function - calls either mz_zip_reader_end() or mz_zip_writer_end(). */
1271 
1272 /* -------- ZIP writing */
1273 
1274 #ifndef MINIZ_NO_ARCHIVE_WRITING_APIS
1275 
1276 /* Inits a ZIP archive writer. */
1277 mz_bool mz_zip_writer_init(mz_zip_archive *pZip, mz_uint64 existing_size);
1278 mz_bool mz_zip_writer_init_v2(mz_zip_archive *pZip, mz_uint64 existing_size, mz_uint flags);
1279 mz_bool mz_zip_writer_init_heap(mz_zip_archive *pZip, size_t size_to_reserve_at_beginning, size_t initial_allocation_size);
1280 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);
1281 
1282 #ifndef MINIZ_NO_STDIO
1283 mz_bool mz_zip_writer_init_file(mz_zip_archive *pZip, const char *pFilename, mz_uint64 size_to_reserve_at_beginning);
1284 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);
1286 #endif
1287 
1288 /* Converts a ZIP archive reader object into a writer object, to allow efficient in-place file appends to occur on an existing archive. */
1289 /* For archives opened using mz_zip_reader_init_file, pFilename must be the archive's filename so it can be reopened for writing. If the file can't be reopened, mz_zip_reader_end() will be called. */
1290 /* For archives opened using mz_zip_reader_init_mem, the memory block must be growable using the realloc callback (which defaults to realloc unless you've overridden it). */
1291 /* Finally, for archives opened using mz_zip_reader_init, the mz_zip_archive's user provided m_pWrite function cannot be NULL. */
1292 /* Note: In-place archive modification is not recommended unless you know what you're doing, because if execution stops or something goes wrong before */
1293 /* the archive is finalized the file's central directory will be hosed. */
1294 mz_bool mz_zip_writer_init_from_reader(mz_zip_archive *pZip, const char *pFilename);
1295 mz_bool mz_zip_writer_init_from_reader_v2(mz_zip_archive *pZip, const char *pFilename, mz_uint flags);
1296 
1297 /* Adds the contents of a memory buffer to an archive. These functions record the current local time into the archive. */
1298 /* To add a directory entry, call this method with an archive name ending in a forwardslash with an empty buffer. */
1299 /* level_and_flags - compression level (0-10, see MZ_BEST_SPEED, MZ_BEST_COMPRESSION, etc.) logically OR'd with zero or more mz_zip_flags, or just set to MZ_DEFAULT_COMPRESSION. */
1300 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);
1301 
1302 /* Like mz_zip_writer_add_mem(), except you can specify a file comment field, and optionally supply the function with already compressed data. */
1303 /* uncomp_size/uncomp_crc32 are only used if the MZ_ZIP_FLAG_COMPRESSED_DATA flag is specified. */
1304 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,
1305  mz_uint64 uncomp_size, mz_uint32 uncomp_crc32);
1306 
1307 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,
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);
1310 
1311 #ifndef MINIZ_NO_STDIO
1312 /* Adds the contents of a disk file to an archive. This function also records the disk file's modified time into the archive. */
1313 /* level_and_flags - compression level (0-10, see MZ_BEST_SPEED, MZ_BEST_COMPRESSION, etc.) logically OR'd with zero or more mz_zip_flags, or just set to MZ_DEFAULT_COMPRESSION. */
1314 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);
1315 
1316 /* Like mz_zip_writer_add_file(), except the file data is read from the specified FILE stream. */
1317 mz_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);
1320 #endif
1321 
1322 /* Adds a file to an archive by fully cloning the data from another archive. */
1323 /* This function fully clones the source file's compressed data (no recompression), along with its full filename, extra data (it may add or modify the zip64 local header extra data field), and the optional descriptor following the compressed data. */
1325 
1326 /* Finalizes the archive by writing the central directory records followed by the end of central directory record. */
1327 /* After an archive is finalized, the only valid call on the mz_zip_archive struct is mz_zip_writer_end(). */
1328 /* An archive must be manually finalized by calling this function for it to be valid. */
1330 
1331 /* Finalizes a heap archive, returning a poiner to the heap block and its size. */
1332 /* The heap block will be allocated using the mz_zip_archive's alloc/realloc callbacks. */
1333 mz_bool mz_zip_writer_finalize_heap_archive(mz_zip_archive *pZip, void **ppBuf, size_t *pSize);
1334 
1335 /* Ends archive writing, freeing all allocations, and closing the output file if mz_zip_writer_init_file() was used. */
1336 /* Note for the archive to be valid, it *must* have been finalized before ending (this function will not do it for you). */
1338 
1339 /* -------- Misc. high-level helper functions: */
1340 
1341 /* mz_zip_add_mem_to_archive_file_in_place() efficiently (but not atomically) appends a memory blob to a ZIP archive. */
1342 /* Note this is NOT a fully safe operation. If it crashes or dies in some way your archive can be left in a screwed up state (without a central directory). */
1343 /* level_and_flags - compression level (0-10, see MZ_BEST_SPEED, MZ_BEST_COMPRESSION, etc.) logically OR'd with zero or more mz_zip_flags, or just set to MZ_DEFAULT_COMPRESSION. */
1344 /* TODO: Perhaps add an option to leave the existing central dir in place in case the add dies? We could then truncate the file (so the old central dir would be at the end) if something goes wrong. */
1345 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);
1346 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);
1347 
1348 /* Reads a single file from an archive into a heap block. */
1349 /* If pComment is not NULL, only the file with the specified comment will be extracted. */
1350 /* Returns NULL on failure. */
1351 void *mz_zip_extract_archive_file_to_heap(const char *pZip_filename, const char *pArchive_name, size_t *pSize, mz_uint flags);
1352 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);
1353 
1354 #endif /* #ifndef MINIZ_NO_ARCHIVE_WRITING_APIS */
1355 
1356 #ifdef __cplusplus
1357 }
1358 #endif
1359 
1360 #ifdef _MSC_VER
1361 #include <util/pragma_pop.def>
1362 #endif
mz_zip_reader_init_file
mz_bool mz_zip_reader_init_file(mz_zip_archive *pZip, const char *pFilename, mz_uint32 flags)
Definition: miniz.cpp:3821
mz_zip_reader_extract_to_heap
void * mz_zip_reader_extract_to_heap(mz_zip_archive *pZip, mz_uint file_index, size_t *pSize, mz_uint flags)
Definition: miniz.cpp:4426
charf
char charf
Definition: miniz.h:454
mz_file_write_func
size_t(* mz_file_write_func)(void *pOpaque, mz_uint64 file_ofs, const void *pBuf, size_t n)
Definition: miniz.h:1028
mz_zip_writer_init_v2
mz_bool mz_zip_writer_init_v2(mz_zip_archive *pZip, mz_uint64 existing_size, mz_uint flags)
Definition: miniz.cpp:5219
mz_zip_archive_file_stat::m_local_header_ofs
mz_uint64 m_local_header_ofs
Definition: miniz.h:1003
mz_zip_archive::m_zip_type
mz_zip_type m_zip_type
Definition: miniz.h:1111
MZ_ZIP_MODE_INVALID
@ MZ_ZIP_MODE_INVALID
Definition: miniz.h:1035
mz_compressBound
mz_ulong mz_compressBound(mz_ulong source_len)
Definition: miniz.cpp:363
mz_alloc_func
void *(* mz_alloc_func)(void *opaque, size_t items, size_t size)
Definition: miniz.h:279
mz_zip_get_cfile
FILE * mz_zip_get_cfile(mz_zip_archive *pZip)
Definition: miniz.cpp:7152
tdefl_compressor::m_pIn_buf
const void * m_pIn_buf
Definition: miniz.h:760
MZ_ZIP_BUF_TOO_SMALL
@ MZ_ZIP_BUF_TOO_SMALL
Definition: miniz.h:1094
mz_zip_archive_file_stat::m_internal_attr
mz_uint16 m_internal_attr
Definition: miniz.h:999
MZ_ZIP_FLAG_COMPRESSED_DATA
@ MZ_ZIP_FLAG_COMPRESSED_DATA
Definition: miniz.h:1045
MZ_RLE
@ MZ_RLE
Definition: miniz.h:268
mz_zip_archive::m_total_files
mz_uint32 m_total_files
Definition: miniz.h:1109
mz_stream_s::zalloc
mz_alloc_func zalloc
Definition: miniz.h:347
mz_zip_archive_file_stat::m_external_attr
mz_uint32 m_external_attr
Definition: miniz.h:1000
TDEFL_LEVEL1_HASH_SIZE_MASK
@ TDEFL_LEVEL1_HASH_SIZE_MASK
Definition: miniz.h:724
mz_zip_flags
mz_zip_flags
Definition: miniz.h:1041
TINFL_STATUS_ADLER32_MISMATCH
@ TINFL_STATUS_ADLER32_MISMATCH
Definition: miniz.h:876
MZ_STREAM_END
@ MZ_STREAM_END
Definition: miniz.h:306
mz_zip_writer_add_mem_ex_v2
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, time_t *last_modified, const char *user_extra_data_local, mz_uint user_extra_data_local_len, const char *user_extra_data_central, mz_uint user_extra_data_central_len)
Definition: miniz.cpp:5676
mz_zip_locate_file
int mz_zip_locate_file(mz_zip_archive *pZip, const char *pName, const char *pComment, mz_uint flags)
mz_zip_archive_file_stat::m_version_made_by
mz_uint16 m_version_made_by
Definition: miniz.h:980
MZ_ZIP_UNSUPPORTED_METHOD
@ MZ_ZIP_UNSUPPORTED_METHOD
Definition: miniz.h:1072
mz_deflate
int mz_deflate(mz_streamp pStream, int flush)
Definition: miniz.cpp:251
mz_int16
int16_t mz_int16
Definition: miniz.h:535
TINFL_MAX_HUFF_SYMBOLS_0
@ TINFL_MAX_HUFF_SYMBOLS_0
Definition: miniz.h:916
mz_zip_reader_end
mz_bool mz_zip_reader_end(mz_zip_archive *pZip)
Definition: miniz.cpp:3742
MZ_ZIP_TYPE_MEMORY
@ MZ_ZIP_TYPE_MEMORY
Definition: miniz.h:1058
tinfl_decompressor_tag::m_num_extra
mz_uint32 m_num_extra
Definition: miniz.h:943
mz_zip_writer_init_heap_v2
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)
Definition: miniz.cpp:5273
TINFL_STATUS_DONE
@ TINFL_STATUS_DONE
Definition: miniz.h:885
MZ_FILE
#define MZ_FILE
Definition: miniz.h:557
MZ_UBER_COMPRESSION
@ MZ_UBER_COMPRESSION
Definition: miniz.h:323
mz_zip_writer_init_from_reader
mz_bool mz_zip_writer_init_from_reader(mz_zip_archive *pZip, const char *pFilename)
Definition: miniz.cpp:5478
mz_zip_reader_extract_to_mem_no_alloc
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)
Definition: miniz.cpp:4265
mz_inflateInit2
int mz_inflateInit2(mz_streamp pStream, int window_bits)
Definition: miniz.cpp:377
MZ_ZIP_FLAG_DO_NOT_SORT_CENTRAL_DIRECTORY
@ MZ_ZIP_FLAG_DO_NOT_SORT_CENTRAL_DIRECTORY
Definition: miniz.h:1046
voidpc
void *const voidpc
Definition: miniz.h:459
MZ_ZIP_NO_ERROR
@ MZ_ZIP_NO_ERROR
Definition: miniz.h:1068
tdefl_compressor::m_lookahead_size
mz_uint m_lookahead_size
Definition: miniz.h:755
mz_zip_archive_file_stat::m_file_index
mz_uint32 m_file_index
Definition: miniz.h:974
MZ_FULL_FLUSH
@ MZ_FULL_FLUSH
Definition: miniz.h:297
uInt
unsigned int uInt
Definition: miniz.h:450
TDEFL_FINISH
@ TDEFL_FINISH
Definition: miniz.h:745
mz_zip_locate_file_v2
mz_bool mz_zip_locate_file_v2(mz_zip_archive *pZip, const char *pName, const char *pComment, mz_uint flags, mz_uint32 *pIndex)
mz_zip_type
mz_zip_type
Definition: miniz.h:1054
TDEFL_LZ_CODE_BUF_SIZE
@ TDEFL_LZ_CODE_BUF_SIZE
Definition: miniz.h:720
mz_zip_reader_is_file_supported
mz_bool mz_zip_reader_is_file_supported(mz_zip_archive *pZip, mz_uint file_index)
Definition: miniz.cpp:3938
mz_bool
bool mz_bool
Definition: miniz.h:541
voidpf
void * voidpf
Definition: miniz.h:456
tdefl_write_image_to_png_file_in_memory_ex
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)
Definition: miniz.cpp:2065
mz_version
const char * mz_version(void)
Definition: miniz.cpp:196
mz_realloc_func
void *(* mz_realloc_func)(void *opaque, void *address, size_t items, size_t size)
Definition: miniz.h:281
tinfl_decompressor_tag::m_dist_from_out_buf_start
size_t m_dist_from_out_buf_start
Definition: miniz.h:945
MZ_ZIP_MAX_ARCHIVE_FILE_COMMENT_SIZE
@ MZ_ZIP_MAX_ARCHIVE_FILE_COMMENT_SIZE
Definition: miniz.h:968
tdefl_compressor::m_pOutput_buf_end
mz_uint8 * m_pOutput_buf_end
Definition: miniz.h:756
TDEFL_HUFFMAN_ONLY
@ TDEFL_HUFFMAN_ONLY
Definition: miniz.h:633
mz_zip_writer_init_from_reader_v2
mz_bool mz_zip_writer_init_from_reader_v2(mz_zip_archive *pZip, const char *pFilename, mz_uint flags)
Definition: miniz.cpp:5393
mz_inflateEnd
int mz_inflateEnd(mz_streamp pStream)
Definition: miniz.cpp:530
mz_zip_archive_file_stat::m_version_needed
mz_uint16 m_version_needed
Definition: miniz.h:981
mz_zip_writer_add_mem
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)
Definition: miniz.cpp:5484
MZ_ZIP_FILE_CLOSE_FAILED
@ MZ_ZIP_FILE_CLOSE_FAILED
Definition: miniz.h:1089
tdefl_flush
tdefl_flush
Definition: miniz.h:740
Byte
unsigned char Byte
Definition: miniz.h:449
mz_zip_end
mz_bool mz_zip_end(mz_zip_archive *pZip)
Definition: miniz.cpp:7193
mz_error
const char * mz_error(int err)
Definition: miniz.cpp:572
mz_deflateEnd
int mz_deflateEnd(mz_streamp pStream)
Definition: miniz.cpp:309
tdefl_create_comp_flags_from_zip_params
mz_uint tdefl_create_comp_flags_from_zip_params(int level, int window_bits, int strategy)
Definition: miniz.cpp:2036
MZ_ZIP_TOTAL_TYPES
@ MZ_ZIP_TOTAL_TYPES
Definition: miniz.h:1062
mz_uint64
uint64_t mz_uint64
Definition: miniz.h:540
TINFL_STATUS_HAS_MORE_OUTPUT
@ TINFL_STATUS_HAS_MORE_OUTPUT
Definition: miniz.h:896
MZ_ZIP_CRC_CHECK_FAILED
@ MZ_ZIP_CRC_CHECK_FAILED
Definition: miniz.h:1082
tdefl_compressor::m_pPut_buf_func
tdefl_put_buf_func_ptr m_pPut_buf_func
Definition: miniz.h:751
mz_streamp
mz_stream * mz_streamp
Definition: miniz.h:356
tinfl_huff_table
Definition: miniz.h:923
MZ_ZIP_UNDEFINED_ERROR
@ MZ_ZIP_UNDEFINED_ERROR
Definition: miniz.h:1069
tdefl_compressor_alloc
tdefl_compressor * tdefl_compressor_alloc()
Definition: miniz.cpp:2137
mz_zip_get_last_error
mz_zip_error mz_zip_get_last_error(mz_zip_archive *pZip)
Definition: miniz.cpp:7027
MZ_ZIP_TOO_MANY_FILES
@ MZ_ZIP_TOO_MANY_FILES
Definition: miniz.h:1070
TDEFL_LZ_HASH_BITS
@ TDEFL_LZ_HASH_BITS
Definition: miniz.h:723
mz_zip_validate_mem_archive
mz_bool mz_zip_validate_mem_archive(const void *pMem, size_t size, mz_uint flags, mz_zip_error *pErr)
Definition: miniz.cpp:5025
MZ_ZIP_FILE_SEEK_FAILED
@ MZ_ZIP_FILE_SEEK_FAILED
Definition: miniz.h:1090
mz_zip_writer_init_file_v2
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)
Definition: miniz.cpp:5327
uLongf
uLong uLongf
Definition: miniz.h:457
tinfl_decompress
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)
Definition: miniz.cpp:2328
miniz_def_realloc_func
void * miniz_def_realloc_func(void *opaque, void *address, size_t items, size_t size)
Definition: miniz.cpp:190
MZ_ZIP_TYPE_INVALID
@ MZ_ZIP_TYPE_INVALID
Definition: miniz.h:1056
TDEFL_FILTER_MATCHES
@ TDEFL_FILTER_MATCHES
Definition: miniz.h:654
mz_zip_reader_extract_to_cfile
mz_bool mz_zip_reader_extract_to_cfile(mz_zip_archive *pZip, mz_uint file_index, FILE *File, mz_uint flags)
Definition: miniz.cpp:4738
mz_zip_archive_file_stat::m_crc32
mz_uint32 m_crc32
Definition: miniz.h:990
MZ_ZIP_MAX_IO_BUF_SIZE
@ MZ_ZIP_MAX_IO_BUF_SIZE
Definition: miniz.h:966
mz_zip_add_mem_to_archive_file_in_place
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)
Definition: miniz.cpp:6843
mz_stream_s::data_type
int data_type
Definition: miniz.h:351
mz_stream_s::state
struct mz_internal_state * state
Definition: miniz.h:345
tdefl_compressor::m_total_lz_bytes
mz_uint m_total_lz_bytes
Definition: miniz.h:757
tdefl_compressor::m_pPut_buf_user
void * m_pPut_buf_user
Definition: miniz.h:752
tdefl_compressor::m_src_buf_left
size_t m_src_buf_left
Definition: miniz.h:765
tdefl_compressor::m_greedy_parsing
int m_greedy_parsing
Definition: miniz.h:754
mz_zip_writer_init_file
mz_bool mz_zip_writer_init_file(mz_zip_archive *pZip, const char *pFilename, mz_uint64 size_to_reserve_at_beginning)
Definition: miniz.cpp:5322
MZ_STREAM_ERROR
@ MZ_STREAM_ERROR
Definition: miniz.h:309
MZ_ZIP_MODE_READING
@ MZ_ZIP_MODE_READING
Definition: miniz.h:1036
mz_zip_archive::m_archive_size
mz_uint64 m_archive_size
Definition: miniz.h:1105
MZ_ZIP_TYPE_FILE
@ MZ_ZIP_TYPE_FILE
Definition: miniz.h:1060
TDEFL_MAX_HUFF_SYMBOLS_0
@ TDEFL_MAX_HUFF_SYMBOLS_0
Definition: miniz.h:696
TDEFL_STATUS_DONE
@ TDEFL_STATUS_DONE
Definition: miniz.h:736
TINFL_STATUS_BAD_PARAM
@ TINFL_STATUS_BAD_PARAM
Definition: miniz.h:873
mz_uncompress
int mz_uncompress(unsigned char *pDest, mz_ulong *pDest_len, const unsigned char *pSource, mz_ulong source_len)
Definition: miniz.cpp:542
mz_inflate
int mz_inflate(mz_streamp pStream, int flush)
Definition: miniz.cpp:418
mz_free_func
void(* mz_free_func)(void *opaque, void *address)
Definition: miniz.h:280
tinfl_decompressor_tag::m_z_adler32
mz_uint32 m_z_adler32
Definition: miniz.h:943
MZ_BUF_ERROR
@ MZ_BUF_ERROR
Definition: miniz.h:312
mz_zip_reader_get_num_files
mz_uint mz_zip_reader_get_num_files(mz_zip_archive *pZip)
Definition: miniz.cpp:7133
mz_zip_get_central_dir_size
size_t mz_zip_get_central_dir_size(mz_zip_archive *pZip)
Definition: miniz.cpp:7125
mz_zip_archive
Definition: miniz.h:1103
mz_file_read_func
size_t(* mz_file_read_func)(void *pOpaque, mz_uint64 file_ofs, void *pBuf, size_t n)
Definition: miniz.h:1027
TINFL_STATUS_FAILED
@ TINFL_STATUS_FAILED
Definition: miniz.h:879
MZ_ERRNO
@ MZ_ERRNO
Definition: miniz.h:308
MZ_ZIP_UNSUPPORTED_FEATURE
@ MZ_ZIP_UNSUPPORTED_FEATURE
Definition: miniz.h:1074
mz_zip_get_archive_file_start_offset
mz_uint64 mz_zip_get_archive_file_start_offset(mz_zip_archive *pZip)
Definition: miniz.cpp:7145
mz_zip_read_archive_data
size_t mz_zip_read_archive_data(mz_zip_archive *pZip, mz_uint64 file_ofs, void *pBuf, size_t n)
Definition: miniz.cpp:7159
mz_zip_archive_file_stat::m_is_directory
mz_bool m_is_directory
Definition: miniz.h:1009
TDEFL_GREEDY_PARSING_FLAG
@ TDEFL_GREEDY_PARSING_FLAG
Definition: miniz.h:651
mz_zip_archive_file_stat::m_is_supported
mz_bool m_is_supported
Definition: miniz.h:1015
TINFL_STATUS_NEEDS_MORE_INPUT
@ TINFL_STATUS_NEEDS_MORE_INPUT
Definition: miniz.h:890
MZ_BLOCK
@ MZ_BLOCK
Definition: miniz.h:299
TDEFL_MAX_HUFF_SYMBOLS
@ TDEFL_MAX_HUFF_SYMBOLS
Definition: miniz.h:722
mz_zip_peek_last_error
mz_zip_error mz_zip_peek_last_error(mz_zip_archive *pZip)
Definition: miniz.cpp:7014
tinfl_decompressor_tag
Definition: miniz.h:941
mz_zip_reader_is_file_a_directory
mz_bool mz_zip_reader_is_file_a_directory(mz_zip_archive *pZip, mz_uint file_index)
Definition: miniz.cpp:3974
MZ_FINISH
@ MZ_FINISH
Definition: miniz.h:298
mz_zip_reader_extract_to_file
mz_bool mz_zip_reader_extract_to_file(mz_zip_archive *pZip, mz_uint file_index, const char *pDst_filename, mz_uint flags)
Definition: miniz.cpp:4695
tinfl_decompressor_tag::m_check_adler32
mz_uint32 m_check_adler32
Definition: miniz.h:943
tdefl_get_adler32
mz_uint32 tdefl_get_adler32(tdefl_compressor *d)
Definition: miniz.cpp:1952
MZ_ZIP_FAILED_FINDING_CENTRAL_DIR
@ MZ_ZIP_FAILED_FINDING_CENTRAL_DIR
Definition: miniz.h:1075
tdefl_init
tdefl_status tdefl_init(tdefl_compressor *d, tdefl_put_buf_func_ptr pPut_buf_func, void *pPut_buf_user, int flags)
Definition: miniz.cpp:1914
MZ_ZIP_INVALID_PARAMETER
@ MZ_ZIP_INVALID_PARAMETER
Definition: miniz.h:1092
mz_zip_reader_extract_file_to_callback
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)
Definition: miniz.cpp:4678
mz_stream_s
Definition: miniz.h:334
MZ_ZIP_INVALID_FILENAME
@ MZ_ZIP_INVALID_FILENAME
Definition: miniz.h:1093
mz_zip_reader_init
mz_bool mz_zip_reader_init(mz_zip_archive *pZip, mz_uint64 size, mz_uint flags)
Definition: miniz.cpp:3746
TINFL_FAST_LOOKUP_SIZE
@ TINFL_FAST_LOOKUP_SIZE
Definition: miniz.h:920
TDEFL_LZ_HASH_SIZE
@ TDEFL_LZ_HASH_SIZE
Definition: miniz.h:726
MZ_ZIP_FLAG_WRITE_ALLOW_READING
@ MZ_ZIP_FLAG_WRITE_ALLOW_READING
Definition: miniz.h:1050
MZ_ZIP_TYPE_HEAP
@ MZ_ZIP_TYPE_HEAP
Definition: miniz.h:1059
mz_zip_add_mem_to_archive_file_in_place_v2
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)
Definition: miniz.cpp:6848
MZ_ZIP_UNSUPPORTED_CDIR_SIZE
@ MZ_ZIP_UNSUPPORTED_CDIR_SIZE
Definition: miniz.h:1083
mz_zip_internal_state_tag
Definition: miniz.cpp:3134
MZ_DEFAULT_COMPRESSION
@ MZ_DEFAULT_COMPRESSION
Definition: miniz.h:325
mz_zip_clear_last_error
mz_zip_error mz_zip_clear_last_error(mz_zip_archive *pZip)
Definition: miniz.cpp:7022
uLong
mz_ulong uLong
Definition: miniz.h:451
tdefl_compress_mem_to_output
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)
Definition: miniz.cpp:1957
TDEFL_MIN_MATCH_LEN
@ TDEFL_MIN_MATCH_LEN
Definition: miniz.h:701
mz_deflateInit2
int mz_deflateInit2(mz_streamp pStream, int level, int method, int window_bits, int mem_level, int strategy)
Definition: miniz.cpp:206
mz_stream_s::next_out
unsigned char * next_out
Definition: miniz.h:340
mz_stream_s::opaque
void * opaque
Definition: miniz.h:349
Bytef
Byte Bytef
Definition: miniz.h:452
mz_zip_archive::m_pState
mz_zip_internal_state * m_pState
Definition: miniz.h:1125
MZ_ZIP_TYPE_USER
@ MZ_ZIP_TYPE_USER
Definition: miniz.h:1057
TDEFL_RLE_MATCHES
@ TDEFL_RLE_MATCHES
Definition: miniz.h:653
MZ_ZIP_FILE_STAT_FAILED
@ MZ_ZIP_FILE_STAT_FAILED
Definition: miniz.h:1091
MZ_ZIP_FILE_READ_FAILED
@ MZ_ZIP_FILE_READ_FAILED
Definition: miniz.h:1088
mz_uint
unsigned int mz_uint
Definition: miniz.h:538
tdefl_compressor::m_prev_return_status
tdefl_status m_prev_return_status
Definition: miniz.h:759
tinfl_decompressor_tag::m_len_codes
mz_uint8 m_len_codes[TINFL_MAX_HUFF_SYMBOLS_0+TINFL_MAX_HUFF_SYMBOLS_1+137]
Definition: miniz.h:947
tdefl_write_image_to_png_file_in_memory
void * tdefl_write_image_to_png_file_in_memory(const void *pImage, int w, int h, int num_chans, size_t *pLen_out)
Definition: miniz.cpp:2128
TDEFL_NO_FLUSH
@ TDEFL_NO_FLUSH
Definition: miniz.h:742
tinfl_decompressor_tag::m_tables
tinfl_huff_table m_tables[TINFL_MAX_HUFF_TABLES]
Definition: miniz.h:946
mz_ulong
unsigned long mz_ulong
Definition: miniz.h:249
mz_inflateInit
int mz_inflateInit(mz_streamp pStream)
Definition: miniz.cpp:413
tinfl_decompressor_tag::m_bit_buf
tinfl_bit_buf_t m_bit_buf
Definition: miniz.h:944
tinfl_decompressor_tag::m_final
mz_uint32 m_final
Definition: miniz.h:943
tdefl_get_prev_return_status
tdefl_status tdefl_get_prev_return_status(tdefl_compressor *d)
Definition: miniz.cpp:1947
TINFL_FAST_LOOKUP_BITS
@ TINFL_FAST_LOOKUP_BITS
Definition: miniz.h:919
mz_stream_s::next_in
const unsigned char * next_in
Definition: miniz.h:336
MZ_ZIP_UNSUPPORTED_ENCRYPTION
@ MZ_ZIP_UNSUPPORTED_ENCRYPTION
Definition: miniz.h:1073
tdefl_compressor::m_pOut_buf
void * m_pOut_buf
Definition: miniz.h:761
TINFL_MAX_HUFF_SYMBOLS_1
@ TINFL_MAX_HUFF_SYMBOLS_1
Definition: miniz.h:917
mz_zip_writer_add_cfile
mz_bool mz_zip_writer_add_cfile(mz_zip_archive *pZip, const char *pArchive_name, FILE *pSrc_file, mz_uint64 size_to_add, const 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, const char *user_extra_data_central, mz_uint user_extra_data_central_len)
Definition: miniz.cpp:5961
mz_deflateReset
int mz_deflateReset(mz_streamp pStream)
Definition: miniz.cpp:242
mz_zip_reader_extract_to_mem
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)
Definition: miniz.cpp:4416
tinfl_decompressor_tag::m_num_bits
mz_uint32 m_num_bits
Definition: miniz.h:943
MZ_ZIP_FILE_WRITE_FAILED
@ MZ_ZIP_FILE_WRITE_FAILED
Definition: miniz.h:1087
MZ_ZIP_FILE_CREATE_FAILED
@ MZ_ZIP_FILE_CREATE_FAILED
Definition: miniz.h:1086
mz_zip_get_mode
mz_zip_mode mz_zip_get_mode(mz_zip_archive *pZip)
Definition: miniz.cpp:6991
MZ_ZIP_FLAG_VALIDATE_HEADERS_ONLY
@ MZ_ZIP_FLAG_VALIDATE_HEADERS_ONLY
Definition: miniz.h:1048
mz_zip_reader_init_mem
mz_bool mz_zip_reader_init_mem(mz_zip_archive *pZip, const void *pMem, size_t size, mz_uint flags)
Definition: miniz.cpp:3774
tinfl_decompress_mem_to_mem
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)
Definition: miniz.cpp:2834
MZ_ZIP_FILE_NOT_FOUND
@ MZ_ZIP_FILE_NOT_FOUND
Definition: miniz.h:1096
voidp
void * voidp
Definition: miniz.h:458
MZ_DEFAULT_LEVEL
@ MZ_DEFAULT_LEVEL
Definition: miniz.h:324
mz_zip_extract_archive_file_to_heap_v2
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)
Definition: miniz.cpp:6941
mz_zip_mode
mz_zip_mode
Definition: miniz.h:1033
TDEFL_FORCE_ALL_RAW_BLOCKS
@ TDEFL_FORCE_ALL_RAW_BLOCKS
Definition: miniz.h:656
TDEFL_LZ_DICT_SIZE_MASK
@ TDEFL_LZ_DICT_SIZE_MASK
Definition: miniz.h:700
tinfl_decompressor_tag::m_counter
mz_uint32 m_counter
Definition: miniz.h:943
mz_zip_writer_add_file
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)
Definition: miniz.cpp:6253
MZ_OK
@ MZ_OK
Definition: miniz.h:305
TDEFL_STATUS_PUT_BUF_FAILED
@ TDEFL_STATUS_PUT_BUF_FAILED
Definition: miniz.h:734
tdefl_put_buf_func_ptr
mz_bool(* tdefl_put_buf_func_ptr)(const void *pBuf, int len, void *pUser)
Definition: miniz.h:688
MZ_ZIP_FLAG_CASE_SENSITIVE
@ MZ_ZIP_FLAG_CASE_SENSITIVE
Definition: miniz.h:1043
mz_zip_reader_locate_file_v2
mz_bool mz_zip_reader_locate_file_v2(mz_zip_archive *pZip, const char *pName, const char *pComment, mz_uint flags, mz_uint32 *file_index)
Definition: miniz.cpp:4200
mz_zip_writer_end
mz_bool mz_zip_writer_end(mz_zip_archive *pZip)
Definition: miniz.cpp:6837
MZ_NO_FLUSH
@ MZ_NO_FLUSH
Definition: miniz.h:294
mz_zip_validate_file
mz_bool mz_zip_validate_file(mz_zip_archive *pZip, mz_uint file_index, mz_uint flags)
Definition: miniz.cpp:4769
tinfl_decompress_mem_to_callback
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)
Definition: miniz.cpp:2843
MZ_FIXED
@ MZ_FIXED
Definition: miniz.h:269
TDEFL_NONDETERMINISTIC_PARSING_FLAG
@ TDEFL_NONDETERMINISTIC_PARSING_FLAG
Definition: miniz.h:652
TINFL_FLAG_PARSE_ZLIB_HEADER
@ TINFL_FLAG_PARSE_ZLIB_HEADER
Definition: miniz.h:825
mz_zip_extract_archive_file_to_heap
void * mz_zip_extract_archive_file_to_heap(const char *pZip_filename, const char *pArchive_name, size_t *pSize, mz_uint flags)
Definition: miniz.cpp:6980
TDEFL_LZ_DICT_SIZE
@ TDEFL_LZ_DICT_SIZE
Definition: miniz.h:699
mz_free
void mz_free(void *p)
Definition: miniz.cpp:173
tinfl_decompress_mem_to_heap
void * tinfl_decompress_mem_to_heap(const void *pSrc_buf, size_t src_buf_len, size_t *pOut_len, int flags)
Definition: miniz.cpp:2796
mz_zip_reader_extract_to_callback
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)
Definition: miniz.cpp:4480
mz_zip_set_last_error
mz_zip_error mz_zip_set_last_error(mz_zip_archive *pZip, mz_zip_error err_num)
Definition: miniz.cpp:7001
MZ_ZIP_FILE_OPEN_FAILED
@ MZ_ZIP_FILE_OPEN_FAILED
Definition: miniz.h:1085
TDEFL_SYNC_FLUSH
@ TDEFL_SYNC_FLUSH
Definition: miniz.h:743
mz_zip_get_type
mz_zip_type mz_zip_get_type(mz_zip_archive *pZip)
Definition: miniz.cpp:6996
mz_zip_archive::m_pRealloc
mz_realloc_func m_pRealloc
Definition: miniz.h:1118
MZ_ZIP_MODE_WRITING
@ MZ_ZIP_MODE_WRITING
Definition: miniz.h:1037
tdefl_compressor::m_flush
tdefl_flush m_flush
Definition: miniz.h:763
tdefl_compress_mem_to_heap
void * tdefl_compress_mem_to_heap(const void *pSrc_buf, size_t src_buf_len, size_t *pOut_len, int flags)
Definition: miniz.cpp:2004
MZ_ZIP_UNEXPECTED_DECOMPRESSED_SIZE
@ MZ_ZIP_UNEXPECTED_DECOMPRESSED_SIZE
Definition: miniz.h:1081
mz_stream_s::total_in
mz_ulong total_in
Definition: miniz.h:338
mz_stream_s::msg
char * msg
Definition: miniz.h:344
mz_uint8
uint8_t mz_uint8
Definition: miniz.h:534
mz_zip_archive_file_stat::m_bit_flag
mz_uint16 m_bit_flag
Definition: miniz.h:982
mz_zip_archive::m_pRead
mz_file_read_func m_pRead
Definition: miniz.h:1121
mz_zip_is_zip64
mz_bool mz_zip_is_zip64(mz_zip_archive *pZip)
Definition: miniz.cpp:7117
mz_stream_s::adler
mz_ulong adler
Definition: miniz.h:352
mz_zip_archive_file_stat::m_central_dir_ofs
mz_uint64 m_central_dir_ofs
Definition: miniz.h:977
MZ_BEST_SPEED
@ MZ_BEST_SPEED
Definition: miniz.h:321
TDEFL_MAX_HUFF_SYMBOLS_2
@ TDEFL_MAX_HUFF_SYMBOLS_2
Definition: miniz.h:698
tinfl_status
tinfl_status
Definition: miniz.h:865
mz_deflateBound
mz_ulong mz_deflateBound(mz_streamp pStream, mz_ulong source_len)
Definition: miniz.cpp:321
mz_compress
int mz_compress(unsigned char *pDest, mz_ulong *pDest_len, const unsigned char *pSource, mz_ulong source_len)
Definition: miniz.cpp:358
mz_zip_error
mz_zip_error
Definition: miniz.h:1066
mz_zip_archive_file_stat
Definition: miniz.h:971
mz_zip_archive_file_stat::m_comment_size
mz_uint32 m_comment_size
Definition: miniz.h:1006
tdefl_compress_buffer
tdefl_status tdefl_compress_buffer(tdefl_compressor *d, const void *pIn_buf, size_t in_buf_size, tdefl_flush flush)
Definition: miniz.cpp:1908
mz_zip_reader_is_file_encrypted
mz_bool mz_zip_reader_is_file_encrypted(mz_zip_archive *pZip, mz_uint file_index)
Definition: miniz.cpp:3924
mz_zip_validate_archive
mz_bool mz_zip_validate_archive(mz_zip_archive *pZip, mz_uint flags)
Definition: miniz.cpp:4972
tinfl_decompressor_tag::m_zhdr1
mz_uint32 m_zhdr1
Definition: miniz.h:943
mz_zip_archive::m_central_directory_file_ofs
mz_uint64 m_central_directory_file_ofs
Definition: miniz.h:1106
mz_zip_reader_init_file_v2
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)
Definition: miniz.cpp:3826
MZ_NEED_DICT
@ MZ_NEED_DICT
Definition: miniz.h:307
mz_uint32
uint32_t mz_uint32
Definition: miniz.h:537
tdefl_compressor
Definition: miniz.h:749
mz_int64
int64_t mz_int64
Definition: miniz.h:539
mz_zip_reader_file_stat
mz_bool mz_zip_reader_file_stat(mz_zip_archive *pZip, mz_uint file_index, mz_zip_archive_file_stat *pStat)
Definition: miniz.cpp:7188
TDEFL_STATUS_BAD_PARAM
@ TDEFL_STATUS_BAD_PARAM
Definition: miniz.h:733
MZ_DATA_ERROR
@ MZ_DATA_ERROR
Definition: miniz.h:310
MZ_MEM_ERROR
@ MZ_MEM_ERROR
Definition: miniz.h:311
TINFL_FLAG_HAS_MORE_INPUT
@ TINFL_FLAG_HAS_MORE_INPUT
Definition: miniz.h:826
mz_stream
struct mz_stream_s mz_stream
MZ_ZIP_UNSUPPORTED_MULTIDISK
@ MZ_ZIP_UNSUPPORTED_MULTIDISK
Definition: miniz.h:1078
MZ_ZIP_TOTAL_ERRORS
@ MZ_ZIP_TOTAL_ERRORS
Definition: miniz.h:1100
mz_zip_writer_finalize_heap_archive
mz_bool mz_zip_writer_finalize_heap_archive(mz_zip_archive *pZip, void **ppBuf, size_t *pSize)
Definition: miniz.cpp:6812
TINFL_MAX_HUFF_SYMBOLS_2
@ TINFL_MAX_HUFF_SYMBOLS_2
Definition: miniz.h:918
tinfl_decompressor_tag::m_raw_header
mz_uint8 m_raw_header[4]
Definition: miniz.h:947
tinfl_decompressor_free
void tinfl_decompressor_free(tinfl_decompressor *pDecomp)
Definition: miniz.cpp:2880
mz_zip_reader_extract_file_to_mem_no_alloc
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)
Definition: miniz.cpp:4408
mz_zip_writer_init
mz_bool mz_zip_writer_init(mz_zip_archive *pZip, mz_uint64 existing_size)
Definition: miniz.cpp:5268
tdefl_compressor::m_pOut_buf_size
size_t * m_pOut_buf_size
Definition: miniz.h:762
miniz_def_alloc_func
void * miniz_def_alloc_func(void *opaque, size_t items, size_t size)
Definition: miniz.cpp:180
mz_zip_reader_extract_file_to_file
mz_bool mz_zip_reader_extract_file_to_file(mz_zip_archive *pZip, const char *pArchive_filename, const char *pDst_filename, mz_uint flags)
Definition: miniz.cpp:4729
mz_zip_archive::m_pIO_opaque
void * m_pIO_opaque
Definition: miniz.h:1123
TDEFL_MAX_MATCH_LEN
@ TDEFL_MAX_MATCH_LEN
Definition: miniz.h:702
MZ_ZIP_INTERNAL_ERROR
@ MZ_ZIP_INTERNAL_ERROR
Definition: miniz.h:1095
tdefl_compress
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)
Definition: miniz.cpp:1840
MZ_ZIP_VALIDATION_FAILED
@ MZ_ZIP_VALIDATION_FAILED
Definition: miniz.h:1098
MZ_ZIP_MAX_ARCHIVE_FILENAME_SIZE
@ MZ_ZIP_MAX_ARCHIVE_FILENAME_SIZE
Definition: miniz.h:967
mz_stream_s::reserved
mz_ulong reserved
Definition: miniz.h:353
mz_zip_reader_extract_file_to_cfile
mz_bool mz_zip_reader_extract_file_to_cfile(mz_zip_archive *pZip, const char *pArchive_filename, FILE *pFile, mz_uint flags)
Definition: miniz.cpp:4751
tdefl_compressor_free
void tdefl_compressor_free(tdefl_compressor *pComp)
Definition: miniz.cpp:2142
mz_zip_reader_init_cfile
mz_bool mz_zip_reader_init_cfile(mz_zip_archive *pZip, FILE *pFile, mz_uint64 archive_size, mz_uint flags)
Definition: miniz.cpp:3875
tdefl_compress_mem_to_mem
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)
Definition: miniz.cpp:2019
TDEFL_STATUS_OKAY
@ TDEFL_STATUS_OKAY
Definition: miniz.h:735
mz_uint16
uint16_t mz_uint16
Definition: miniz.h:536
TINFL_STATUS_FAILED_CANNOT_MAKE_PROGRESS
@ TINFL_STATUS_FAILED_CANNOT_MAKE_PROGRESS
Definition: miniz.h:870
mz_zip_archive_file_stat::m_uncomp_size
mz_uint64 m_uncomp_size
Definition: miniz.h:996
mz_zip_writer_finalize_archive
mz_bool mz_zip_writer_finalize_archive(mz_zip_archive *pZip)
Definition: miniz.cpp:6724
tdefl_status
tdefl_status
Definition: miniz.h:731
mz_zip_writer_init_cfile
mz_bool mz_zip_writer_init_cfile(mz_zip_archive *pZip, FILE *pFile, mz_uint flags)
Definition: miniz.cpp:5373
mz_zip_writer_init_heap
mz_bool mz_zip_writer_init_heap(mz_zip_archive *pZip, size_t size_to_reserve_at_beginning, size_t initial_allocation_size)
Definition: miniz.cpp:5300
mz_stream_s::avail_out
unsigned int avail_out
Definition: miniz.h:341
TDEFL_MAX_PROBES_MASK
@ TDEFL_MAX_PROBES_MASK
Definition: miniz.h:635
tinfl_decompressor_tag::m_dist
mz_uint32 m_dist
Definition: miniz.h:943
MZ_TIME_T
#define MZ_TIME_T
Definition: miniz.h:567
MZ_HUFFMAN_ONLY
@ MZ_HUFFMAN_ONLY
Definition: miniz.h:267
mz_zip_writer_add_from_zip_reader
mz_bool mz_zip_writer_add_from_zip_reader(mz_zip_archive *pZip, mz_zip_archive *pSource_zip, mz_uint src_file_index)
Definition: miniz.cpp:6364
MZ_ZIP_FLAG_IGNORE_PATH
@ MZ_ZIP_FLAG_IGNORE_PATH
Definition: miniz.h:1044
mz_zip_archive_file_stat::m_method
mz_uint16 m_method
Definition: miniz.h:983
mz_zip_archive_file_stat::m_time
time_t m_time
Definition: miniz.h:986
MZ_ZIP_ARCHIVE_TOO_LARGE
@ MZ_ZIP_ARCHIVE_TOO_LARGE
Definition: miniz.h:1097
tinfl_put_buf_func_ptr
int(* tinfl_put_buf_func_ptr)(const void *pBuf, int len, void *pUser)
Definition: miniz.h:848
MZ_SYNC_FLUSH
@ MZ_SYNC_FLUSH
Definition: miniz.h:296
mz_zip_archive::m_zip_mode
mz_zip_mode m_zip_mode
Definition: miniz.h:1110
mz_zip_archive::m_file_offset_alignment
mz_uint64 m_file_offset_alignment
Definition: miniz.h:1114
TINFL_FLAG_COMPUTE_ADLER32
@ TINFL_FLAG_COMPUTE_ADLER32
Definition: miniz.h:828
MZ_ZIP_WRITE_CALLBACK_FAILED
@ MZ_ZIP_WRITE_CALLBACK_FAILED
Definition: miniz.h:1099
mz_stream_s::zfree
mz_free_func zfree
Definition: miniz.h:348
mz_zip_archive::m_pWrite
mz_file_write_func m_pWrite
Definition: miniz.h:1122
MZ_ZIP_FILE_TOO_LARGE
@ MZ_ZIP_FILE_TOO_LARGE
Definition: miniz.h:1071
MZ_ZIP_NOT_AN_ARCHIVE
@ MZ_ZIP_NOT_AN_ARCHIVE
Definition: miniz.h:1076
MZ_DEFAULT_STRATEGY
@ MZ_DEFAULT_STRATEGY
Definition: miniz.h:265
mz_deflateInit
int mz_deflateInit(mz_streamp pStream, int level)
Definition: miniz.cpp:201
miniz_def_free_func
void miniz_def_free_func(void *opaque, void *address)
Definition: miniz.cpp:185
tinfl_decompressor_tag::m_state
mz_uint32 m_state
Definition: miniz.h:943
r
static int8_t r
Definition: irep_hash.h:60
TDEFL_DEFAULT_MAX_PROBES
@ TDEFL_DEFAULT_MAX_PROBES
Definition: miniz.h:634
TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF
@ TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF
Definition: miniz.h:827
MZ_ZIP_FLAG_UTF8_FILENAME
@ MZ_ZIP_FLAG_UTF8_FILENAME
Definition: miniz.h:1051
MZ_ZIP_DECOMPRESSION_FAILED
@ MZ_ZIP_DECOMPRESSION_FAILED
Definition: miniz.h:1079
MZ_NO_COMPRESSION
@ MZ_NO_COMPRESSION
Definition: miniz.h:320
TDEFL_COMPUTE_ADLER32
@ TDEFL_COMPUTE_ADLER32
Definition: miniz.h:650
mz_zip_archive_file_stat::m_is_encrypted
mz_bool m_is_encrypted
Definition: miniz.h:1012
MZ_ZIP_INVALID_HEADER_OR_CORRUPTED
@ MZ_ZIP_INVALID_HEADER_OR_CORRUPTED
Definition: miniz.h:1077
mz_zip_reader_locate_file
int mz_zip_reader_locate_file(mz_zip_archive *pZip, const char *pName, const char *pComment, mz_uint flags)
Definition: miniz.cpp:4191
TDEFL_MAX_HUFF_TABLES
@ TDEFL_MAX_HUFF_TABLES
Definition: miniz.h:695
MZ_PARTIAL_FLUSH
@ MZ_PARTIAL_FLUSH
Definition: miniz.h:295
TDEFL_WRITE_ZLIB_HEADER
@ TDEFL_WRITE_ZLIB_HEADER
Definition: miniz.h:649
intf
int intf
Definition: miniz.h:455
tinfl_decompressor_tag::m_type
mz_uint32 m_type
Definition: miniz.h:943
mz_zip_reader_extract_file_to_heap
void * mz_zip_reader_extract_file_to_heap(mz_zip_archive *pZip, const char *pFilename, size_t *pSize, mz_uint flags)
Definition: miniz.cpp:4468
mz_zip_archive::m_last_error
mz_zip_error m_last_error
Definition: miniz.h:1112
tinfl_decompressor_tag::m_zhdr0
mz_uint32 m_zhdr0
Definition: miniz.h:943
MZ_ZIP_FLAG_VALIDATE_LOCATE_FILE_FLAG
@ MZ_ZIP_FLAG_VALIDATE_LOCATE_FILE_FLAG
Definition: miniz.h:1047
TDEFL_LZ_HASH_SHIFT
@ TDEFL_LZ_HASH_SHIFT
Definition: miniz.h:725
mz_zip_validate_file_archive
mz_bool mz_zip_validate_file_archive(const char *pFilename, mz_uint flags, mz_zip_error *pErr)
Definition: miniz.cpp:5067
mz_zip_get_error_string
const char * mz_zip_get_error_string(mz_zip_error mz_err)
Definition: miniz.cpp:7040
mz_zip_get_archive_size
mz_uint64 mz_zip_get_archive_size(mz_zip_archive *pZip)
Definition: miniz.cpp:7138
MZ_ZIP_TYPE_CFILE
@ MZ_ZIP_TYPE_CFILE
Definition: miniz.h:1061
MZ_ZIP_MODE_WRITING_HAS_BEEN_FINALIZED
@ MZ_ZIP_MODE_WRITING_HAS_BEEN_FINALIZED
Definition: miniz.h:1038
TINFL_MAX_HUFF_TABLES
@ TINFL_MAX_HUFF_TABLES
Definition: miniz.h:915
tinfl_bit_buf_t
mz_uint32 tinfl_bit_buf_t
Definition: miniz.h:937
MZ_PARAM_ERROR
@ MZ_PARAM_ERROR
Definition: miniz.h:314
mz_stream_s::total_out
mz_ulong total_out
Definition: miniz.h:342
MZ_BEST_COMPRESSION
@ MZ_BEST_COMPRESSION
Definition: miniz.h:322
mz_zip_zero_struct
void mz_zip_zero_struct(mz_zip_archive *pZip)
Definition: miniz.cpp:3689
mz_zip_archive::m_pFree
mz_free_func m_pFree
Definition: miniz.h:1117
uIntf
uInt uIntf
Definition: miniz.h:453
TDEFL_OUT_BUF_SIZE
@ TDEFL_OUT_BUF_SIZE
Definition: miniz.h:721
MZ_ZIP_FLAG_WRITE_ZIP64
@ MZ_ZIP_FLAG_WRITE_ZIP64
Definition: miniz.h:1049
tinfl_decompressor_tag::m_table_sizes
mz_uint32 m_table_sizes[TINFL_MAX_HUFF_TABLES]
Definition: miniz.h:943
MZ_VERSION_ERROR
@ MZ_VERSION_ERROR
Definition: miniz.h:313
mz_crc32
mz_ulong mz_crc32(mz_ulong crc, const unsigned char *ptr, size_t buf_len)
TDEFL_FULL_FLUSH
@ TDEFL_FULL_FLUSH
Definition: miniz.h:744
tdefl_compressor::m_pSrc
const mz_uint8 * m_pSrc
Definition: miniz.h:764
tdefl_compressor::m_wants_to_finish
mz_uint m_wants_to_finish
Definition: miniz.h:758
mz_zip_reader_get_filename
mz_uint mz_zip_reader_get_filename(mz_zip_archive *pZip, mz_uint file_index, char *pFilename, mz_uint filename_buf_size)
Definition: miniz.cpp:7167
mz_zip_writer_add_mem_ex
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)
Definition: miniz.cpp:5670
mz_zip_archive_file_stat::m_comp_size
mz_uint64 m_comp_size
Definition: miniz.h:993
tinfl_decompressor_alloc
tinfl_decompressor * tinfl_decompressor_alloc()
Definition: miniz.cpp:2872
mz_zip_archive::m_pAlloc
mz_alloc_func m_pAlloc
Definition: miniz.h:1116
MZ_ZIP_COMPRESSION_FAILED
@ MZ_ZIP_COMPRESSION_FAILED
Definition: miniz.h:1080
MZ_FILTERED
@ MZ_FILTERED
Definition: miniz.h:266
mz_compress2
int mz_compress2(unsigned char *pDest, mz_ulong *pDest_len, const unsigned char *pSource, mz_ulong source_len, int level)
Definition: miniz.cpp:328
TDEFL_MAX_HUFF_SYMBOLS_1
@ TDEFL_MAX_HUFF_SYMBOLS_1
Definition: miniz.h:697
TDEFL_FORCE_ALL_STATIC_BLOCKS
@ TDEFL_FORCE_ALL_STATIC_BLOCKS
Definition: miniz.h:655
MZ_ZIP_ALLOC_FAILED
@ MZ_ZIP_ALLOC_FAILED
Definition: miniz.h:1084
mz_zip_reader_extract_file_to_mem
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)
Definition: miniz.cpp:4421
mz_stream_s::avail_in
unsigned int avail_in
Definition: miniz.h:337
mz_zip_archive::m_pAlloc_opaque
void * m_pAlloc_opaque
Definition: miniz.h:1119
mz_adler32
mz_ulong mz_adler32(mz_ulong adler, const unsigned char *ptr, size_t buf_len)
Definition: miniz.cpp:57