Visualization Library 2.0.0-b5

A lightweight C++ OpenGL middleware for 2D/3D graphics

VL     Star     Watch     Fork     Issue

[Download] [Tutorials] [All Classes] [Grouped Classes]
Macros | Functions
puff.c File Reference
#include <setjmp.h>
#include "puff.h"

Go to the source code of this file.

Macros

#define local   static /* for local function definitions */
 
#define MAXBITS   15 /* maximum bits in a code */
 
#define MAXLCODES   286 /* maximum number of literal/length codes */
 
#define MAXDCODES   30 /* maximum number of distance codes */
 
#define MAXCODES   (MAXLCODES+MAXDCODES) /* maximum codes lengths to read */
 
#define FIXLCODES   288 /* number of fixed literal/length codes */
 

Functions

local int bits (struct state *s, int need)
 
local int stored (struct state *s)
 
local int decode (struct state *s, const struct huffman *h)
 
local int construct (struct huffman *h, const short *length, int n)
 
local int codes (struct state *s, const struct huffman *lencode, const struct huffman *distcode)
 
local int fixed (struct state *s)
 
local int dynamic (struct state *s)
 
int puff (unsigned char *dest, unsigned long *destlen, const unsigned char *source, unsigned long *sourcelen)
 

Macro Definition Documentation

◆ FIXLCODES

#define FIXLCODES   288 /* number of fixed literal/length codes */

Definition at line 95 of file puff.c.

Referenced by fixed().

◆ local

#define local   static /* for local function definitions */

Definition at line 85 of file puff.c.

Referenced by stored().

◆ MAXBITS

#define MAXBITS   15 /* maximum bits in a code */

Definition at line 91 of file puff.c.

Referenced by construct(), decode(), dynamic(), fixed(), and stored().

◆ MAXCODES

#define MAXCODES   (MAXLCODES+MAXDCODES) /* maximum codes lengths to read */

Definition at line 94 of file puff.c.

Referenced by dynamic().

◆ MAXDCODES

#define MAXDCODES   30 /* maximum number of distance codes */

Definition at line 93 of file puff.c.

Referenced by dynamic(), and fixed().

◆ MAXLCODES

#define MAXLCODES   286 /* maximum number of literal/length codes */

Definition at line 92 of file puff.c.

Referenced by dynamic().

Function Documentation

◆ bits()

local int bits ( struct state *  s,
int  need 
)

Definition at line 126 of file puff.c.

References int, and long().

Referenced by codes(), dynamic(), puff(), and stored().

◆ codes()

local int codes ( struct state *  s,
const struct huffman *  lencode,
const struct huffman *  distcode 
)

Definition at line 436 of file puff.c.

References bits(), decode(), and NIL.

Referenced by dynamic(), fixed(), inflate_table(), and inflate_table9().

◆ construct()

local int construct ( struct huffman *  h,
const short *  length,
int  n 
)

Definition at line 340 of file puff.c.

References for(), and MAXBITS.

Referenced by dynamic(), and fixed().

◆ decode()

local int decode ( struct state *  s,
const struct huffman *  h 
)

Definition at line 263 of file puff.c.

References code, and MAXBITS.

Referenced by codes(), dynamic(), and stored().

◆ dynamic()

local int dynamic ( struct state *  s)

Definition at line 665 of file puff.c.

References bits(), codes(), construct(), decode(), MAXBITS, MAXCODES, MAXDCODES, and MAXLCODES.

Referenced by puff().

◆ fixed()

local int fixed ( struct state *  s)

◆ puff()

int puff ( unsigned char *  dest,
unsigned long destlen,
const unsigned char *  source,
unsigned long sourcelen 
)

Definition at line 793 of file puff.c.

References bits(), dynamic(), fixed(), and stored().

Referenced by main().

◆ stored()

local int stored ( struct state *  s)

Definition at line 164 of file puff.c.

References bits(), code, decode(), local, MAXBITS, and NIL.

Referenced by puff().