zenilib: zenilib/jni/external/zlib/inflate.c File Reference

zenilib 0.5.3.0

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Macros | Functions
inflate.c File Reference
`#include "zutil.h"`
`#include "inftrees.h"`
`#include "inflate.h"`
`#include "inffast.h"`
`#include "inffixed.h"`

Go to the source code of this file.

## Macros

#define | BITS(n) ((unsigned)hold & ((1U << (n)) - 1))
#define | BYTEBITS()
#define | CRC2(check, word)
#define | CRC4(check, word)
#define | DROPBITS(n)
#define | INITBITS()
#define | LOAD()
#define | NEEDBITS(n)
#define | PULLBYTE()
#define | RESTORE()
#define | REVERSE(q)
#define | UPDATE(check, buf, len) (state->flags ? crc32(check, buf, len) : adler32(check, buf, len))

## Functions

local void | fixedtables (struct inflate_state FAR *state)
int ZEXPORT | inflate (z_streamp strm, int flush)
int ZEXPORT | inflateCopy (z_streamp dest, z_streamp source)
int ZEXPORT | inflateEnd (z_streamp strm)
int ZEXPORT | inflateGetHeader (z_streamp strm, gz_headerp head)
int ZEXPORT | inflateInit2_ (z_streamp strm, int windowBits, const char *version, int stream_size)
int ZEXPORT | inflateInit_ (z_streamp strm, const char *version, int stream_size)
long ZEXPORT | inflateMark (z_streamp strm)
int ZEXPORT | inflatePrime (z_streamp strm, int bits, int value)
int ZEXPORT | inflateReset (z_streamp strm)
int ZEXPORT | inflateReset2 (z_streamp strm, int windowBits)
int ZEXPORT | inflateSetDictionary (z_streamp strm, const Bytef *dictionary, uInt dictLength)
int ZEXPORT | inflateSync (z_streamp strm)
int ZEXPORT | inflateSyncPoint (z_streamp strm)
int ZEXPORT | inflateUndermine (z_streamp strm, int subvert)
local void fixedtables | OF ((struct inflate_state FAR *state))
local int updatewindow | OF ((z_streamp strm, unsigned out))
local unsigned syncsearch | OF ((unsigned FAR *have, unsigned char FAR *buf, unsigned len))
local unsigned | syncsearch (unsigned FAR *have, unsigned char FAR *buf, unsigned len)
local int | updatewindow (z_streamp strm, unsigned out)

## Macro Definition Documentation

#define BITS | ( |  | n | ) | ((unsigned)hold & ((1U << (n)) - 1))

Definition at line 485 of file inflate.c.

Referenced by inflate().

#define BYTEBITS | ( |  | ) |

Value:
do { \
hold >>= bits & 7; \
bits -= bits & 7; \
} while (0)
bits
#define bits
Definition: infblock.c:15
bits
GLenum GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * bits
Definition: SDL_opengl.h:10449

Definition at line 496 of file inflate.c.

Referenced by inflate().

#define CRC2 | ( |  | check,
|  |  | word
| ) |  |

Value:
do { \
hbuf[0] = (unsigned char)(word); \
hbuf[1] = (unsigned char)((word) >> 8); \
check = crc32(check, hbuf, 2); \
} while (0)
crc32
unsigned long ZEXPORT crc32(unsigned long crc, const unsigned char FAR *buf, uInt len)
Definition: crc32.c:221

Definition at line 420 of file inflate.c.

Referenced by inflate().

#define CRC4 | ( |  | check,
|  |  | word
| ) |  |

Value:
do { \
hbuf[0] = (unsigned char)(word); \
hbuf[1] = (unsigned char)((word) >> 8); \
hbuf[2] = (unsigned char)((word) >> 16); \
hbuf[3] = (unsigned char)((word) >> 24); \
check = crc32(check, hbuf, 4); \
} while (0)
crc32
unsigned long ZEXPORT crc32(unsigned long crc, const unsigned char FAR *buf, uInt len)
Definition: crc32.c:221

Definition at line 427 of file inflate.c.

Referenced by inflate().

#define DROPBITS | ( |  | n | ) |

Value:
do { \
hold >>= (n); \
bits -= (unsigned)(n); \
} while (0)
n
GLclampd n
Definition: glew.h:7287
bits
#define bits
Definition: infblock.c:15

Definition at line 489 of file inflate.c.

Referenced by inflate().

#define INITBITS | ( |  | ) |

Value:
do { \
hold = 0; \
bits = 0; \
} while (0)
bits
#define bits
Definition: infblock.c:15

Definition at line 460 of file inflate.c.

Referenced by inflate().

#define LOAD | ( |  | ) |

Value:
do { \
put = strm->next_out; \
left = strm->avail_out; \
next = strm->next_in; \
have = strm->avail_in; \
hold = state->hold; \
bits = state->bits; \
} while (0)
left
GLint left
Definition: glew.h:7291
bits
#define bits
Definition: infblock.c:15

Definition at line 438 of file inflate.c.

Referenced by inflate().

#define NEEDBITS | ( |  | n | ) |

Value:
do { \
while (bits < (unsigned)(n)) \
PULLBYTE(); \
} while (0)
n
GLclampd n
Definition: glew.h:7287
bits
GLenum GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * bits
Definition: SDL_opengl.h:10449
while
while(1)
Definition: glslang_lex.cpp:1063
PULLBYTE
#define PULLBYTE()
Definition: inflate.c:468

Definition at line 478 of file inflate.c.

Referenced by inflate().

#define PULLBYTE | ( |  | ) |

Value:
do { \
if (have == 0) goto inf_leave; \
have--; \
hold += (unsigned long)(*next++) << bits; \
bits += 8; \
} while (0)
if
if(!yyg->yy_init)
Definition: glslang_lex.cpp:1037
bits
GLenum GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * bits
Definition: SDL_opengl.h:10449
while
while(1)
Definition: glslang_lex.cpp:1063

Definition at line 468 of file inflate.c.

Referenced by inflate().

#define RESTORE | ( |  | ) |

Value:
do { \
strm->next_out = put; \
strm->avail_out = left; \
strm->next_in = next; \
strm->avail_in = have; \
state->hold = hold; \
state->bits = bits; \
} while (0)
left
GLint left
Definition: glew.h:7291
bits
#define bits
Definition: infblock.c:15

Definition at line 449 of file inflate.c.

Referenced by inflate().

#define REVERSE | ( |  | q | ) |

Value:
((((q) >> 24) & 0xff) + (((q) >> 8) & 0xff00) + \
(((q) & 0xff00) << 8) + (((q) & 0xff) << 24))
q
GLdouble GLdouble GLdouble GLdouble q
Definition: glew.h:1400

Definition at line 503 of file inflate.c.

Referenced by inflate().

#define UPDATE | ( |  | check,
|  |  | buf,
|  |  | len
| ) |  | (state->flags ? crc32(check, buf, len) : adler32(check, buf, len))

Definition at line 412 of file inflate.c.

Referenced by inflate().

## Function Documentation

local void fixedtables | ( | struct inflate_state FAR * | state | ) |

Definition at line 240 of file inflate.c.

References bits, distfix, DISTS, inflate_table(), lenfix, LENS, inflate_state::next, and sym.

int ZEXPORT inflate | ( | z_streamp | strm,
|  | int | flush
| ) |  |

Definition at line 589 of file inflate.c.

References adler32(), inflate_state::back, BAD, bits, code::bits, inflate_state::bits, BITS, BYTEBITS, CHECK, inflate_state::check, CODELENS, CODES, inflate_state::codes, COMMENT, COPY, COPY_, CRC2, crc32(), CRC4, DICT, DICTID, DIST, inflate_state::distbits, inflate_state::distcode, DISTEXT, DISTS, inflate_state::dmax, DONE, DROPBITS, EXLEN, EXTRA, inflate_state::extra, fixedtables(), FLAGS, inflate_state::flags, GUNZIP, inflate_state::have, inflate_state::havedict, HCRC, HEAD, inflate_state::head, inflate_state::hold, if(), inflate_fast(), inflate_table(), INITBITS, int, inflate_state::last, LEN, LEN_, inflate_state::lenbits, inflate_state::lencode, LENEXT, LENGTH, inflate_state::length, LENLENS, LENS, inflate_state::lens, LIT, LOAD, MATCH, MEM, inflate_state::mode, NAME, inflate_state::ncode, inflate_state::ndist, NEEDBITS, inflate_state::next, inflate_state::nlen, inflate_state::offset, code::op, OS, PULLBYTE, RESTORE, ret, REVERSE, inflate_state::sane, STORED, SYNC, TABLE, TIME, inflate_state::total, Trace, Tracev, Tracevv, TYPE, TYPEDO, UPDATE, updatewindow(), code::val, inflate_state::was, inflate_state::wbits, inflate_state::whave, inflate_state::window, inflate_state::wnext, inflate_state::work, inflate_state::wrap, inflate_state::wsize, Z_BLOCK, Z_BUF_ERROR, Z_DATA_ERROR, Z_DEFLATED, Z_FINISH, Z_MEM_ERROR, Z_NEED_DICT, Z_NULL, Z_OK, Z_STREAM_END, Z_STREAM_ERROR, Z_TREES, and zmemcpy().

Referenced by gz_decomp(), gzread(), png_inflate(), png_process_IDAT_data(), png_push_read_zTXt(), png_read_finish_row(), png_read_row(), test_dict_inflate(), test_inflate(), test_large_inflate(), test_sync(), and uncompress().

int ZEXPORT inflateCopy | ( | z_streamp | dest,
|  | z_streamp | source
| ) |  |

Definition at line 1406 of file inflate.c.

References inflate_state::codes, inflate_state::distcode, ENOUGH, inflate_state::lencode, inflate_state::next, inflate_state::wbits, inflate_state::window, inflate_state::wsize, Z_MEM_ERROR, Z_NULL, Z_OK, Z_STREAM_ERROR, ZALLOC, ZFREE, and zmemcpy().

int ZEXPORT inflateEnd | ( | z_streamp | strm | ) |

Definition at line 1238 of file inflate.c.

References if(), Tracev, inflate_state::window, Z_NULL, Z_OK, Z_STREAM_ERROR, and ZFREE.

Referenced by destroy(), gzclose_r(), png_read_destroy(), test_dict_inflate(), test_inflate(), test_large_inflate(), test_sync(), and uncompress().

int ZEXPORT inflateGetHeader | ( | z_streamp | strm,
|  | gz_headerp | head
| ) |  |

Definition at line 1294 of file inflate.c.

References head, inflate_state::head, if(), inflate_state::wrap, Z_NULL, Z_OK, and Z_STREAM_ERROR.

int ZEXPORT inflateInit2_ | ( | z_streamp | strm,
|  | int | windowBits,
|  | const char * | version,
|  | int | stream_size
| ) |  |

Definition at line 168 of file inflate.c.

References inflateReset2(), ret, Tracev, inflate_state::window, Z_MEM_ERROR, Z_NULL, Z_OK, Z_STREAM_ERROR, Z_VERSION_ERROR, ZALLOC, zcalloc(), zcfree(), ZFREE, and ZLIB_VERSION.

Referenced by inflateInit_().

int ZEXPORT inflateInit_ | ( | z_streamp | strm,
|  | const char * | version,
|  | int | stream_size
| ) |  |

Definition at line 201 of file inflate.c.

References DEF_WBITS, and inflateInit2_().

long ZEXPORT inflateMark | ( | z_streamp | strm | ) |

Definition at line 1470 of file inflate.c.

References inflate_state::back, COPY, inflate_state::length, MATCH, inflate_state::mode, return, inflate_state::was, and Z_NULL.

int ZEXPORT inflatePrime | ( | z_streamp | strm,
|  | int | bits,
|  | int | value
| ) |  |

Definition at line 209 of file inflate.c.

References bits, inflate_state::bits, inflate_state::hold, if(), Z_NULL, Z_OK, and Z_STREAM_ERROR.

int ZEXPORT inflateReset | ( | z_streamp | strm | ) |

Definition at line 103 of file inflate.c.

References inflate_state::back, inflate_state::bits, inflate_state::codes, inflate_state::distcode, inflate_state::dmax, inflate_state::havedict, HEAD, inflate_state::head, inflate_state::hold, inflate_state::last, inflate_state::lencode, inflate_state::mode, inflate_state::next, inflate_state::sane, inflate_state::total, Tracev, inflate_state::whave, inflate_state::wnext, inflate_state::wsize, Z_NULL, Z_OK, and Z_STREAM_ERROR.

Referenced by gz_head(), gzread(), gzrewind(), inflateReset2(), inflateSync(), png_inflate(), png_push_read_zTXt(), png_read_finish_row(), and png_reset_zstream().

int ZEXPORT inflateReset2 | ( | z_streamp | strm,
|  | int | windowBits
| ) |  |

Definition at line 130 of file inflate.c.

References if(), inflateReset(), inflate_state::wbits, inflate_state::window, windowBits, inflate_state::wrap, Z_NULL, Z_STREAM_ERROR, and ZFREE.

Referenced by inflateInit2_().

int ZEXPORT inflateSetDictionary | ( | z_streamp | strm,
|  | const Bytef * | dictionary,
|  | uInt | dictLength
| ) |  |

Definition at line 1252 of file inflate.c.

References adler32(), inflate_state::check, DICT, inflate_state::havedict, if(), MEM, inflate_state::mode, Tracev, updatewindow(), inflate_state::whave, inflate_state::window, inflate_state::wrap, inflate_state::wsize, Z_DATA_ERROR, Z_MEM_ERROR, Z_NULL, Z_OK, Z_STREAM_ERROR, and zmemcpy().

Referenced by test_dict_inflate().

int ZEXPORT inflateSync | ( | z_streamp | strm | ) |

Definition at line 1345 of file inflate.c.

References inflate_state::bits, inflate_state::have, inflate_state::hold, if(), inflateReset(), inflate_state::mode, SYNC, syncsearch(), TYPE, Z_BUF_ERROR, Z_DATA_ERROR, Z_NULL, Z_OK, and Z_STREAM_ERROR.

Referenced by test_sync().

int ZEXPORT inflateSyncPoint | ( | z_streamp | strm | ) |

Definition at line 1396 of file inflate.c.

References inflate_state::bits, inflate_state::mode, STORED, Z_NULL, and Z_STREAM_ERROR.

int ZEXPORT inflateUndermine | ( | z_streamp | strm,
|  | int | subvert
| ) |  |

Definition at line 1453 of file inflate.c.

References inflate_state::sane, Z_DATA_ERROR, Z_NULL, Z_OK, and Z_STREAM_ERROR.

local void fixedtables OF | ( | (struct inflate_state FAR *state) |  | ) |

local int updatewindow OF | ( | (z_streamp strm, unsigned out) |  | ) |

local unsigned syncsearch OF | ( | (unsigned FAR *have, unsigned char FAR *buf, unsigned len) |  | ) |

local unsigned syncsearch | ( | unsigned FAR * | have,
|  | unsigned char FAR * | buf,
|  | unsigned | len
| ) |  |

Definition at line 1322 of file inflate.c.

References inflate_state::have, and inflate_state::next.

Referenced by inflateSync().

local int updatewindow | ( | z_streamp | strm,
|  | unsigned | out
| ) |  |

Definition at line 358 of file inflate.c.

References if(), inflate_state::wbits, inflate_state::whave, inflate_state::window, inflate_state::wnext, inflate_state::wsize, Z_NULL, ZALLOC, and zmemcpy().

Referenced by inflate(), and inflateSetDictionary().