Geant4  10.01.p01
csz_inflate.cc File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+ Include dependency graph for csz_inflate.cc:

Go to the source code of this file.

Classes

struct  huft
 

Macros

#define WSIZE   0x8000 /* window size--must be a power of two, and at least */
 
#define NEXTBYTE   csz__ReadByte()
 
#define FPRINTF   fprintf
 
#define FLUSH(n)   csz__WriteData(n) /* return value not used */
 
#define Trace(x)
 
#define CHECK_EOF
 
#define NEEDBITS(n)   {while(k<(n)){if(ibufcnt-- <= 0)return 1;b|=((ulg) *ibufptr++)<<k;k+=8;}}
 
#define DUMPBITS(n)   {b>>=(n);k-=(n);}
 
#define BMAX   16 /* maximum bit length of any code (16 for explode) */
 
#define N_MAX   288 /* maximum number of codes in any set */
 
#define NEEDBITS_free_tl(n)   {while(k<(n)){if(ibufcnt-- <= 0){csz__huft_free(tl);return 1;} b|=((ulg) *ibufptr++)<<k;k+=8;}}
 

Typedefs

typedef char boolean
 
typedef unsigned char uch
 
typedef unsigned short ush
 
typedef unsigned long ulg
 

Functions

int csz__huft_build (unsigned *, unsigned, unsigned, ush *, ush *, struct huft **, int *)
 
int csz__huft_free (struct huft *)
 
int csz__Inflate_codes (struct huft *, struct huft *, int, int)
 
int csz__Inflate_stored (void)
 
int csz__Inflate_fixed (void)
 
int csz__Inflate_dynamic (void)
 
int csz__Inflate_block (int *)
 
int csz__Inflate (void)
 
int csz__Inflate_free (void)
 
static void csz__WriteData (int)
 
void csz__Init_Inflate (long a_ibufcnt, unsigned char *a_ibufptr, long a_obufcnt, unsigned char *a_obufptr)
 
unsigned char * csz__obufptr ()
 

Variables

static uch csz__slide [32768]
 
static unsigned wp
 
static unsigned border []
 
static ush cplens []
 
static ush cplext []
 
static ush cpdist []
 
static ush cpdext []
 
static ush mask []
 
static ulg bb
 
static unsigned bk
 
static uchibufptr
 
static uchobufptr
 
static long ibufcnt
 
static long obufcnt
 
static int lbits = 9
 
static int dbits = 6
 
static unsigned hufts
 
struct huftcsz__fixed_tl = (struct huft *)NULL
 
struct huftcsz__fixed_td
 
int csz__fixed_bl
 
int csz__fixed_bd
 

Macro Definition Documentation

#define BMAX   16 /* maximum bit length of any code (16 for explode) */

Definition at line 418 of file csz_inflate.cc.

Referenced by csz__huft_build().

#define CHECK_EOF

Definition at line 364 of file csz_inflate.cc.

#define DUMPBITS (   n)    {b>>=(n);k-=(n);}
#define FLUSH (   n)    csz__WriteData(n) /* return value not used */

Definition at line 241 of file csz_inflate.cc.

Referenced by csz__Inflate(), csz__Inflate_codes(), and csz__Inflate_stored().

#define FPRINTF   fprintf

Definition at line 237 of file csz_inflate.cc.

Referenced by csz__Inflate_dynamic().

#define N_MAX   288 /* maximum number of codes in any set */

Definition at line 419 of file csz_inflate.cc.

Referenced by csz__huft_build().

#define NEEDBITS (   n)    {while(k<(n)){if(ibufcnt-- <= 0)return 1;b|=((ulg) *ibufptr++)<<k;k+=8;}}
#define NEEDBITS_free_tl (   n)    {while(k<(n)){if(ibufcnt-- <= 0){csz__huft_free(tl);return 1;} b|=((ulg) *ibufptr++)<<k;k+=8;}}

Referenced by csz__Inflate_dynamic().

#define NEXTBYTE   csz__ReadByte()

Definition at line 233 of file csz_inflate.cc.

#define Trace (   x)
#define WSIZE   0x8000 /* window size--must be a power of two, and at least */

Definition at line 229 of file csz_inflate.cc.

Referenced by csz__Inflate_codes(), and csz__Inflate_stored().

Typedef Documentation

typedef char boolean

Definition at line 223 of file csz_inflate.cc.

typedef unsigned char uch

Definition at line 224 of file csz_inflate.cc.

typedef unsigned long ulg

Definition at line 226 of file csz_inflate.cc.

typedef unsigned short ush

Definition at line 225 of file csz_inflate.cc.

Function Documentation

int csz__huft_build ( unsigned *  b,
unsigned  n,
unsigned  s,
ush d,
ush e,
struct huft **  t,
int *  m 
)

Definition at line 425 of file csz_inflate.cc.

References a, huft::b, BMAX, csz__huft_free(), huft::e, g, hufts, n, huft::n, N_MAX, s, huft::t, huft::v, and z.

Referenced by csz__Inflate_dynamic(), and csz__Inflate_fixed().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int csz__huft_free ( struct huft t)

Definition at line 624 of file csz_inflate.cc.

References huft::t, and huft::v.

Referenced by csz__huft_build(), csz__Inflate_dynamic(), csz__Inflate_fixed(), and csz__Inflate_free().

+ Here is the caller graph for this function:

int csz__Inflate ( void  )

Definition at line 1091 of file csz_inflate.cc.

References bb, bk, csz__Inflate_block(), huft::e, FLUSH, hufts, Trace, and wp.

+ Here is the call graph for this function:

int csz__Inflate_block ( int *  e)

Definition at line 1043 of file csz_inflate.cc.

References huft::b, bb, bk, csz__Inflate_dynamic(), csz__Inflate_fixed(), csz__Inflate_stored(), DUMPBITS, NEEDBITS, and huft::t.

Referenced by csz__Inflate().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int csz__Inflate_codes ( struct huft tl,
struct huft td,
int  bl,
int  bd 
)

Definition at line 653 of file csz_inflate.cc.

References huft::b, bb, bk, csz__slide, DUMPBITS, huft::e, FLUSH, mask, n, huft::n, NEEDBITS, huft::t, huft::v, wp, and WSIZE.

Referenced by csz__Inflate_fixed().

+ Here is the caller graph for this function:

int csz__Inflate_dynamic ( void  )

Definition at line 869 of file csz_inflate.cc.

References huft::b, bb, bk, border, cpdext, cpdist, cplens, cplext, csz__huft_build(), csz__huft_free(), dbits, DUMPBITS, FPRINTF, lbits, m, mask, n, huft::n, NEEDBITS, NEEDBITS_free_tl, Trace, and huft::v.

Referenced by csz__Inflate_block().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int csz__Inflate_fixed ( void  )

Definition at line 821 of file csz_inflate.cc.

References cpdext, cpdist, cplens, cplext, csz__fixed_bd, csz__fixed_bl, csz__huft_build(), csz__huft_free(), csz__Inflate_codes(), and Trace.

Referenced by csz__Inflate_block().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int csz__Inflate_free ( void  )

Definition at line 1126 of file csz_inflate.cc.

References csz__huft_free().

+ Here is the call graph for this function:

int csz__Inflate_stored ( void  )

Definition at line 763 of file csz_inflate.cc.

References huft::b, bb, bk, csz__slide, DUMPBITS, FLUSH, n, NEEDBITS, Trace, wp, and WSIZE.

Referenced by csz__Inflate_block().

+ Here is the caller graph for this function:

void csz__Init_Inflate ( long  a_ibufcnt,
unsigned char *  a_ibufptr,
long  a_obufcnt,
unsigned char *  a_obufptr 
)

Definition at line 1138 of file csz_inflate.cc.

References ibufcnt, ibufptr, obufcnt, and obufptr.

unsigned char* csz__obufptr ( )

Definition at line 1146 of file csz_inflate.cc.

References obufptr.

static void csz__WriteData ( int  n)
static

Definition at line 1164 of file csz_inflate.cc.

References csz__slide, n, obufcnt, and obufptr.

Variable Documentation

unsigned border[]
static
Initial value:
= {
16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}

Definition at line 313 of file csz_inflate.cc.

Referenced by csz__Inflate_dynamic(), G4Poisson(), and G4ModifiedTsai::SampleDirection().

ush cpdext[]
static
Initial value:
= {
0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6,
7, 7, 8, 8, 9, 9, 10, 10, 11, 11,
12, 12, 13, 13}

Definition at line 326 of file csz_inflate.cc.

Referenced by csz__Inflate_dynamic(), and csz__Inflate_fixed().

ush cpdist[]
static
Initial value:
= {
1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
8193, 12289, 16385, 24577}

Definition at line 322 of file csz_inflate.cc.

Referenced by csz__Inflate_dynamic(), and csz__Inflate_fixed().

ush cplens[]
static
Initial value:
= {
3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,
35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0}

Definition at line 315 of file csz_inflate.cc.

Referenced by csz__Inflate_dynamic(), and csz__Inflate_fixed().

ush cplext[]
static
Initial value:
= {
0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2,
3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 99, 99}

Definition at line 319 of file csz_inflate.cc.

Referenced by csz__Inflate_dynamic(), and csz__Inflate_fixed().

int csz__fixed_bd

Definition at line 819 of file csz_inflate.cc.

Referenced by csz__Inflate_fixed().

int csz__fixed_bl

Definition at line 819 of file csz_inflate.cc.

Referenced by csz__Inflate_fixed().

struct huft* csz__fixed_td

Definition at line 818 of file csz_inflate.cc.

struct huft* csz__fixed_tl = (struct huft *)NULL

Definition at line 817 of file csz_inflate.cc.

uch csz__slide[32768]
static

Definition at line 308 of file csz_inflate.cc.

Referenced by csz__Inflate_codes(), csz__Inflate_stored(), and csz__WriteData().

int dbits = 6
static

Definition at line 414 of file csz_inflate.cc.

Referenced by csz__Inflate_dynamic().

unsigned hufts
static

Definition at line 422 of file csz_inflate.cc.

Referenced by csz__huft_build(), and csz__Inflate().

long ibufcnt
static

Definition at line 362 of file csz_inflate.cc.

Referenced by csz__Init_Inflate().

uch* ibufptr
static

Definition at line 361 of file csz_inflate.cc.

Referenced by csz__Init_Inflate().

int lbits = 9
static

Definition at line 413 of file csz_inflate.cc.

Referenced by csz__Inflate_dynamic().

ush mask[]
static
Initial value:
= {
0x0000,
0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, 0x007f, 0x00ff,
0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff
}

Definition at line 332 of file csz_inflate.cc.

Referenced by csz__Inflate_codes(), csz__Inflate_dynamic(), UVoxelizer::GetCandidatesVoxelArray(), G4SurfaceVoxelizer::GetCandidatesVoxelArray(), inflate_table(), lookup(), G4ViewParameters::ParseGeometry(), and storeAtts().

long obufcnt
static

Definition at line 362 of file csz_inflate.cc.

Referenced by csz__Init_Inflate(), and csz__WriteData().

uch * obufptr
static

Definition at line 361 of file csz_inflate.cc.

Referenced by csz__Init_Inflate(), csz__obufptr(), and csz__WriteData().