Biomedical Image Analysis Library
The Biomedical Image Analysis Library is a poweful tool for developers, physicians, researchers, engineers, and so on.
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)   (state->flags ? crc32(check, buf, len) : adler32(check, buf, len))
 
#define CRC2(check, word)
 
#define CRC4(check, word)
 
#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

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

Macro Definition Documentation

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

Definition at line 506 of file inflate.c.

#define BYTEBITS ( )
Value:
do { \
hold >>= bits & 7; \
bits -= bits & 7; \
} while (0)
static int bits(struct state *s, int need)
Definition: blast.c:68

Definition at line 517 of file inflate.c.

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

Definition at line 441 of file inflate.c.

#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)
unsigned long crc32(unsigned long crc, unsigned char *buf, uInt len)
Definition: crc32.c:204

Definition at line 448 of file inflate.c.

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

Definition at line 510 of file inflate.c.

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

Definition at line 481 of file inflate.c.

#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: blast.c:37

Definition at line 459 of file inflate.c.

#define NEEDBITS (   n)
Value:
do { \
while (bits < (unsigned)(n)) \
PULLBYTE(); \
} while (0)
static int bits(struct state *s, int need)
Definition: blast.c:68

Definition at line 499 of file inflate.c.

#define PULLBYTE ( )
Value:
do { \
if (have == 0) goto inf_leave; \
have--; \
hold += (unsigned long)(*next++) << bits; \
bits += 8; \
} while (0)
static int bits(struct state *s, int need)
Definition: blast.c:68

Definition at line 489 of file inflate.c.

#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)
static int bits(struct state *s, int need)
Definition: blast.c:68

Definition at line 470 of file inflate.c.

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

Definition at line 433 of file inflate.c.

Function Documentation

static void fixedtables ( )
static
static void fixedtables ( struct inflate_state state)
static

Definition at line 261 of file inflate.c.

int inflate ( z_streamp  strm,
int  flush 
)

Definition at line 605 of file inflate.c.

int inflateCopy ( z_streamp  dest,
z_streamp  source 
)

Definition at line 1438 of file inflate.c.

int inflateEnd ( z_streamp  strm)

Definition at line 1254 of file inflate.c.

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

Definition at line 1268 of file inflate.c.

int inflateGetHeader ( z_streamp  strm,
gz_headerp  head 
)

Definition at line 1326 of file inflate.c.

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

Definition at line 180 of file inflate.c.

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

Definition at line 222 of file inflate.c.

long inflateMark ( z_streamp  strm)

Definition at line 1502 of file inflate.c.

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

Definition at line 230 of file inflate.c.

int inflateReset ( z_streamp  strm)

Definition at line 129 of file inflate.c.

int inflateReset2 ( z_streamp  strm,
int  windowBits 
)

Definition at line 142 of file inflate.c.

int inflateResetKeep ( z_streamp  strm)

Definition at line 104 of file inflate.c.

int inflateSetDictionary ( z_streamp  strm,
Bytef dictionary,
uInt  dictLength 
)

Definition at line 1291 of file inflate.c.

int inflateSync ( z_streamp  strm)

Definition at line 1377 of file inflate.c.

int inflateSyncPoint ( z_streamp  strm)

Definition at line 1428 of file inflate.c.

int inflateUndermine ( z_streamp  strm,
int  subvert 
)

Definition at line 1485 of file inflate.c.

static unsigned syncsearch ( )
static
static unsigned syncsearch ( unsigned *  have,
unsigned char *  buf,
unsigned  len 
)
static

Definition at line 1354 of file inflate.c.

static int updatewindow ( )
static
static int updatewindow ( z_streamp  strm,
Bytef end,
unsigned  copy 
)
static

Definition at line 379 of file inflate.c.