ziftrees.cpp File Reference

(r1785/r1282)

#include "camtypes.h"
#include "zinflate.h"
#include "zstream.h"

Go to the source code of this file.

Defines

#define new   CAM_DEBUG_NEW
#define base   more.Base
#define next   more.Next
#define exop   word.what.Exop
#define bits   word.what.Bits
#define BMAX   15
#define N_MAX   288
#define UPDBITS   {s->bitb=b;s->bitk=k;}
#define UPDIN   {z->avail_in=n;z->total_in+=p-z->next_in;z->next_in=p;}
#define UPDOUT   {s->write=q;}
#define UPDATE   {UPDBITS UPDIN UPDOUT}
#define LEAVE   {UPDATE return inflate_flush(s,z,r);}
#define LOADIN   {p=z->next_in;n=z->avail_in;b=s->bitb;k=s->bitk;}
#define NEEDBYTE   {if(n)r=Z_OK;else LEAVE}
#define NEXTBYTE   (n--,*p++)
#define NEEDBITS(j)   {while(k<(j)){NEEDBYTE;b|=((uLong)NEXTBYTE)<<k;k+=8;}}
#define DUMPBITS(j)   {b>>=(j);k-=(j);}
#define WAVAIL   (uInt)(q<s->read?s->read-q-1:s->end-q)
#define LOADOUT   {q=s->write;m=(uInt)WAVAIL;}
#define WRAP   {if(q==s->end&&s->read!=s->window){q=s->window;m=(uInt)WAVAIL;}}
#define FLUSH   {UPDOUT r=inflate_flush(s,z,r); LOADOUT}
#define NEEDOUT   {if(m==0){WRAP if(m==0){FLUSH WRAP if(m==0) LEAVE}}r=Z_OK;}
#define OUTBYTE(a)   {*q++=(Byte)(a);m--;}
#define LOAD   {LOADIN LOADOUT}
#define C0   *p++ = 0;
#define C2   C0 C0 C0 C0
#define C4   C2 C2 C2 C2
#define FIXEDH   530
#define GRABBITS(j)   {while(k<(j)){b|=((uLong)NEXTBYTE)<<k;k+=8;}}
#define UNGRAB   {n+=(c=k>>3);p-=c;k&=7;}

Functions

 DECLARE_SOURCE ("$Revision: 1282 $")
void * falloc (void *q, uInt n, uInt s)

Variables

static uInt cplens [31]
static uInt cplext [31]
static uInt cpdist [30]
static uInt cpdext [30]
static INT32 fixed_built = 0
static inflate_huft fixed_mem [530]
static uInt fixed_bl
static uInt fixed_bd
static inflate_huftfixed_tl
static inflate_huftfixed_td
static uInt border [] = { 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}


Define Documentation

#define base   more.Base
 

Definition at line 175 of file ziftrees.cpp.

#define bits   word.what.Bits
 

Definition at line 178 of file ziftrees.cpp.

#define BMAX   15
 

Definition at line 231 of file ziftrees.cpp.

#define C0   *p++ = 0;
 

#define C2   C0 C0 C0 C0
 

#define C4   C2 C2 C2 C2
 

#define DUMPBITS  )     {b>>=(j);k-=(j);}
 

Definition at line 245 of file ziftrees.cpp.

#define exop   word.what.Exop
 

Definition at line 177 of file ziftrees.cpp.

#define FIXEDH   530
 

Definition at line 567 of file ziftrees.cpp.

#define FLUSH   {UPDOUT r=inflate_flush(s,z,r); LOADOUT}
 

Definition at line 250 of file ziftrees.cpp.

#define GRABBITS  )     {while(k<(j)){b|=((uLong)NEXTBYTE)<<k;k+=8;}}
 

macros for bit input with no checking and for returning unused bytes

Definition at line 1120 of file ziftrees.cpp.

#define LEAVE   {UPDATE return inflate_flush(s,z,r);}
 

Definition at line 239 of file ziftrees.cpp.

#define LOAD   {LOADIN LOADOUT}
 

Definition at line 254 of file ziftrees.cpp.

#define LOADIN   {p=z->next_in;n=z->avail_in;b=s->bitb;k=s->bitk;}
 

Definition at line 241 of file ziftrees.cpp.

#define LOADOUT   {q=s->write;m=(uInt)WAVAIL;}
 

Definition at line 248 of file ziftrees.cpp.

#define N_MAX   288
 

Definition at line 232 of file ziftrees.cpp.

#define NEEDBITS  )     {while(k<(j)){NEEDBYTE;b|=((uLong)NEXTBYTE)<<k;k+=8;}}
 

Definition at line 244 of file ziftrees.cpp.

#define NEEDBYTE   {if(n)r=Z_OK;else LEAVE}
 

Definition at line 242 of file ziftrees.cpp.

#define NEEDOUT   {if(m==0){WRAP if(m==0){FLUSH WRAP if(m==0) LEAVE}}r=Z_OK;}
 

Definition at line 251 of file ziftrees.cpp.

#define new   CAM_DEBUG_NEW
 

Definition at line 123 of file ziftrees.cpp.

#define next   more.Next
 

Definition at line 176 of file ziftrees.cpp.

#define NEXTBYTE   (n--,*p++)
 

Definition at line 243 of file ziftrees.cpp.

#define OUTBYTE  )     {*q++=(Byte)(a);m--;}
 

Definition at line 252 of file ziftrees.cpp.

#define UNGRAB   {n+=(c=k>>3);p-=c;k&=7;}
 

Definition at line 1121 of file ziftrees.cpp.

#define UPDATE   {UPDBITS UPDIN UPDOUT}
 

Definition at line 238 of file ziftrees.cpp.

#define UPDBITS   {s->bitb=b;s->bitk=k;}
 

Definition at line 235 of file ziftrees.cpp.

#define UPDIN   {z->avail_in=n;z->total_in+=p-z->next_in;z->next_in=p;}
 

Definition at line 236 of file ziftrees.cpp.

#define UPDOUT   {s->write=q;}
 

Definition at line 237 of file ziftrees.cpp.

#define WAVAIL   (uInt)(q<s->read?s->read-q-1:s->end-q)
 

Definition at line 247 of file ziftrees.cpp.

#define WRAP   {if(q==s->end&&s->read!=s->window){q=s->window;m=(uInt)WAVAIL;}}
 

Definition at line 249 of file ziftrees.cpp.


Function Documentation

DECLARE_SOURCE "$Revision: 1282 $"   ) 
 

void* falloc void *  q,
uInt  n,
uInt  s
 

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
25/05/95
Parameters:
q opaque pointer (not used) [INPUTS] n number of items s size of item

Definition at line 587 of file ziftrees.cpp.

00588 {
00589   Assert(s == sizeof(inflate_huft) && n <= (UINT32) (*(intf *)q),
00590          "inflate_trees falloc overflow");
00591   *(intf *)q -= n+s-s; /* s-s to avoid warning */
00592   return (voidpf)(fixed_mem + *(intf *)q);
00593 }


Variable Documentation

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

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
25/05/95
Parameters:
s [INPUTS] z c

Definition at line 729 of file ziftrees.cpp.

uInt cpdext[30] [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 192 of file ziftrees.cpp.

uInt cpdist[30] [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 188 of file ziftrees.cpp.

uInt cplens[31] [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 181 of file ziftrees.cpp.

uInt cplext[31] [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, 192, 192}

Definition at line 185 of file ziftrees.cpp.

uInt fixed_bd [static]
 

Definition at line 570 of file ziftrees.cpp.

uInt fixed_bl [static]
 

Definition at line 569 of file ziftrees.cpp.

INT32 fixed_built = 0 [static]
 

Definition at line 566 of file ziftrees.cpp.

inflate_huft fixed_mem[530] [static]
 

Definition at line 568 of file ziftrees.cpp.

inflate_huft* fixed_td [static]
 

Definition at line 572 of file ziftrees.cpp.

inflate_huft* fixed_tl [static]
 

Definition at line 571 of file ziftrees.cpp.


Generated on Sat Nov 10 03:49:25 2007 for Camelot by  doxygen 1.4.4