ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
inflate.c File Reference
#include "zutil.h"
#include "inftrees.h"
#include "inflate.h"
#include "inffast.h"
#include "inffixed.h"
+ Include dependency graph for inflate.c:

Go to the source code of this file.

Macros

#define UPDATE(check, buf, len)   adler32(check, buf, len)
 
#define LOAD()
 
#define RESTORE()
 
#define INITBITS()
 
#define PULLBYTE()
 
#define NEEDBITS(n)
 
#define BITS(n)   ((unsigned)hold & ((1U << (n)) - 1))
 
#define DROPBITS(n)
 
#define BYTEBITS()
 

Functions

local int inflateStateCheck OF ((z_streamp strm))
 
local void fixedtables OF ((struct inflate_state FAR *state))
 
local int updatewindow OF ((z_streamp strm, const unsigned char FAR *end, unsigned copy))
 
local unsigned syncsearch OF ((unsigned FAR *have, const unsigned char FAR *buf, unsigned len))
 
local int inflateStateCheck (z_streamp strm)
 
int ZEXPORT inflateResetKeep (z_streamp strm)
 
int ZEXPORT inflateReset (z_streamp strm)
 
int ZEXPORT inflateReset2 (z_streamp strm, int windowBits)
 
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)
 
int ZEXPORT inflatePrime (z_streamp strm, int bits, int value)
 
local void fixedtables (struct inflate_state FAR *state)
 
local int updatewindow (z_streamp strm, const Bytef *end, unsigned copy)
 
int ZEXPORT inflate (z_streamp strm, int flush)
 
int ZEXPORT inflateEnd (z_streamp strm)
 
int ZEXPORT inflateGetDictionary (z_streamp strm, Bytef *dictionary, uInt *dictLength)
 
int ZEXPORT inflateSetDictionary (z_streamp strm, const Bytef *dictionary, uInt dictLength)
 
int ZEXPORT inflateGetHeader (z_streamp strm, gz_headerp head)
 
local unsigned syncsearch (unsigned FAR *have, const unsigned char FAR *buf, unsigned len)
 
int ZEXPORT inflateSync (z_streamp strm)
 
int ZEXPORT inflateSyncPoint (z_streamp strm)
 
int ZEXPORT inflateCopy (z_streamp dest, z_streamp source)
 
int ZEXPORT inflateUndermine (z_streamp strm, int subvert)
 
int ZEXPORT inflateValidate (z_streamp strm, int check)
 
long ZEXPORT inflateMark (z_streamp strm)
 
unsigned long ZEXPORT inflateCodesUsed (z_streamp strm)
 

Macro Definition Documentation

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

Definition at line 523 of file inflate.c.

View newest version in sPHENIX GitHub at line 523 of file inflate.c

Referenced by inflate().

#define BYTEBITS ( )
Value:
do { \
hold >>= bits & 7; \
bits -= bits & 7; \
} while (0)

Definition at line 534 of file inflate.c.

View newest version in sPHENIX GitHub at line 534 of file inflate.c

Referenced by inflate().

#define DROPBITS (   n)
Value:
do { \
hold >>= (n); \
bits -= (unsigned)(n); \
} while (0)

Definition at line 527 of file inflate.c.

View newest version in sPHENIX GitHub at line 527 of file inflate.c

Referenced by inflate().

#define INITBITS ( )
Value:
do { \
hold = 0; \
bits = 0; \
} while (0)

Definition at line 498 of file inflate.c.

View newest version in sPHENIX GitHub at line 498 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)

Definition at line 476 of file inflate.c.

View newest version in sPHENIX GitHub at line 476 of file inflate.c

Referenced by inflate().

#define NEEDBITS (   n)
Value:
do { \
while (bits < (unsigned)(n)) \
PULLBYTE(); \
} while (0)

Definition at line 516 of file inflate.c.

View newest version in sPHENIX GitHub at line 516 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)

Definition at line 506 of file inflate.c.

View newest version in sPHENIX GitHub at line 506 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)

Definition at line 487 of file inflate.c.

View newest version in sPHENIX GitHub at line 487 of file inflate.c

Referenced by inflate().

#define UPDATE (   check,
  buf,
  len 
)    adler32(check, buf, len)

Definition at line 453 of file inflate.c.

View newest version in sPHENIX GitHub at line 453 of file inflate.c

Referenced by inflate().

Function Documentation

local void fixedtables ( struct inflate_state FAR *  state)

Definition at line 278 of file inflate.c.

View newest version in sPHENIX GitHub at line 278 of file inflate.c

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

+ Here is the call graph for this function:

int ZEXPORT inflate ( z_streamp  strm,
int  flush 
)

Definition at line 622 of file inflate.c.

View newest version in sPHENIX GitHub at line 622 of file inflate.c

References adler32(), inflate_state::back, BAD, code::bits, inflate_state::bits, BITS, BYTEBITS, CHECK, inflate_state::check, CODELENS, CODES, inflate_state::codes, COMMENT, COPY, field_utils::copy(), COPY_, crc32(), 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(), in, inflate_fast(), inflate_table(), inflateStateCheck(), INITBITS, int(), L, inflate_state::last, left, 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, 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, zmemcpy(), and ZSWAP32.

Referenced by gz_decomp(), and uncompress2().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

unsigned long ZEXPORT inflateCodesUsed ( z_streamp  strm)

Definition at line 1554 of file inflate.c.

View newest version in sPHENIX GitHub at line 1554 of file inflate.c

References inflate_state::codes, inflateStateCheck(), inflate_state::next, and return().

+ Here is the call graph for this function:

int ZEXPORT inflateCopy ( z_streamp  dest,
z_streamp  source 
)

Definition at line 1461 of file inflate.c.

View newest version in sPHENIX GitHub at line 1461 of file inflate.c

References field_utils::copy(), ENOUGH, inflateStateCheck(), inflate_state::wbits, inflate_state::window, inflate_state::wsize, Z_MEM_ERROR, Z_NULL, Z_OK, Z_STREAM_ERROR, ZALLOC, ZFREE, and zmemcpy().

+ Here is the call graph for this function:

int ZEXPORT inflateEnd ( z_streamp  strm)

Definition at line 1277 of file inflate.c.

View newest version in sPHENIX GitHub at line 1277 of file inflate.c

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

Referenced by gzclose_r(), and uncompress2().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int ZEXPORT inflateGetDictionary ( z_streamp  strm,
Bytef *  dictionary,
uInt *  dictLength 
)

Definition at line 1291 of file inflate.c.

View newest version in sPHENIX GitHub at line 1291 of file inflate.c

References if(), inflateStateCheck(), inflate_state::whave, inflate_state::window, inflate_state::wnext, Z_NULL, Z_OK, Z_STREAM_ERROR, and zmemcpy().

+ Here is the call graph for this function:

int ZEXPORT inflateGetHeader ( z_streamp  strm,
gz_headerp  head 
)

Definition at line 1349 of file inflate.c.

View newest version in sPHENIX GitHub at line 1349 of file inflate.c

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

+ Here is the call graph for this function:

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

Definition at line 195 of file inflate.c.

View newest version in sPHENIX GitHub at line 195 of file inflate.c

References HEAD, inflateReset2(), inflate_state::mode, inflate_state::strm, internal_state::strm, 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_().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 239 of file inflate.c.

View newest version in sPHENIX GitHub at line 239 of file inflate.c

References DEF_WBITS, and inflateInit2_().

+ Here is the call graph for this function:

long ZEXPORT inflateMark ( z_streamp  strm)

Definition at line 1541 of file inflate.c.

View newest version in sPHENIX GitHub at line 1541 of file inflate.c

References inflate_state::back, COPY, inflateStateCheck(), L, inflate_state::length, MATCH, inflate_state::mode, return(), and inflate_state::was.

+ Here is the call graph for this function:

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

Definition at line 247 of file inflate.c.

View newest version in sPHENIX GitHub at line 247 of file inflate.c

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

+ Here is the call graph for this function:

int ZEXPORT inflateReset ( z_streamp  strm)

Definition at line 144 of file inflate.c.

View newest version in sPHENIX GitHub at line 144 of file inflate.c

References inflateResetKeep(), inflateStateCheck(), inflate_state::whave, inflate_state::wnext, inflate_state::wsize, and Z_STREAM_ERROR.

Referenced by gz_look(), inflateReset2(), and inflateSync().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int ZEXPORT inflateReset2 ( z_streamp  strm,
int  windowBits 
)

Definition at line 157 of file inflate.c.

View newest version in sPHENIX GitHub at line 157 of file inflate.c

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

Referenced by inflateInit2_().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int ZEXPORT inflateResetKeep ( z_streamp  strm)

Definition at line 119 of file inflate.c.

View newest version in sPHENIX GitHub at line 119 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, if(), inflateStateCheck(), inflate_state::last, inflate_state::lencode, inflate_state::mode, inflate_state::next, inflate_state::sane, inflate_state::total, Tracev, inflate_state::wrap, Z_NULL, Z_OK, and Z_STREAM_ERROR.

Referenced by inflateReset().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 1314 of file inflate.c.

View newest version in sPHENIX GitHub at line 1314 of file inflate.c

References adler32(), inflate_state::check, DICT, inflate_state::havedict, if(), inflateStateCheck(), L, MEM, inflate_state::mode, Tracev, updatewindow(), inflate_state::wrap, Z_DATA_ERROR, Z_MEM_ERROR, Z_NULL, Z_OK, and Z_STREAM_ERROR.

+ Here is the call graph for this function:

local int inflateStateCheck ( z_streamp  strm)

Definition at line 105 of file inflate.c.

View newest version in sPHENIX GitHub at line 105 of file inflate.c

References HEAD, if(), inflate_state::mode, inflate_state::strm, SYNC, and Z_NULL.

Referenced by inflate(), inflateCodesUsed(), inflateCopy(), inflateEnd(), inflateGetDictionary(), inflateGetHeader(), inflateMark(), inflatePrime(), inflateReset(), inflateReset2(), inflateResetKeep(), inflateSetDictionary(), inflateSync(), inflateSyncPoint(), inflateUndermine(), and inflateValidate().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int ZEXPORT inflateSync ( z_streamp  strm)

Definition at line 1400 of file inflate.c.

View newest version in sPHENIX GitHub at line 1400 of file inflate.c

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

+ Here is the call graph for this function:

int ZEXPORT inflateSyncPoint ( z_streamp  strm)

Definition at line 1451 of file inflate.c.

View newest version in sPHENIX GitHub at line 1451 of file inflate.c

References inflate_state::bits, inflateStateCheck(), inflate_state::mode, STORED, and Z_STREAM_ERROR.

+ Here is the call graph for this function:

int ZEXPORT inflateUndermine ( z_streamp  strm,
int  subvert 
)

Definition at line 1508 of file inflate.c.

View newest version in sPHENIX GitHub at line 1508 of file inflate.c

References inflateStateCheck(), inflate_state::sane, Z_DATA_ERROR, Z_OK, and Z_STREAM_ERROR.

+ Here is the call graph for this function:

int ZEXPORT inflateValidate ( z_streamp  strm,
int  check 
)

Definition at line 1526 of file inflate.c.

View newest version in sPHENIX GitHub at line 1526 of file inflate.c

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

+ Here is the call graph for this function:

local void fixedtables OF ( (struct inflate_state FAR *state)  )
local int updatewindow OF ( (z_streamp strm, const unsigned char FAR *end, unsigned copy)  )
local unsigned syncsearch OF ( (unsigned FAR *have, const unsigned char FAR *buf, unsigned len )
local unsigned syncsearch ( unsigned FAR *  have,
const unsigned char FAR *  buf,
unsigned  len 
)

Definition at line 1377 of file inflate.c.

View newest version in sPHENIX GitHub at line 1377 of file inflate.c

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

Referenced by inflateSync().

+ Here is the caller graph for this function:

local int updatewindow ( z_streamp  strm,
const Bytef *  end,
unsigned  copy 
)

Definition at line 396 of file inflate.c.

View newest version in sPHENIX GitHub at line 396 of file inflate.c

References field_utils::copy(), 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().

+ Here is the call graph for this function:

+ Here is the caller graph for this function: