zinflate.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 NEEDBYTE   {if(z->avail_in==0)return r;r=Z_OK;}
 Performs one or both of the following actions:.
#define NEXTBYTE   (z->avail_in--,z->total_in++,*z->next_in++)

Functions

 DECLARE_SOURCE ("$Revision: 1282 $")

Variables

uInt inflate_mask []


Define Documentation

#define NEEDBYTE   {if(z->avail_in==0)return r;r=Z_OK;}
 

Performs one or both of the following actions:.

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
24/05/95
Parameters:
s the zip strema to use [INPUTS] f dictates the flush type to use
  • Decompress more input starting at next_in and update next_in and avail_in accordingly. If not all input can be processed (because there is not enough room in the output buffer), next_in is updated and processing will resume at this point for the next call of inflate().

  • Provide more output starting at next_out and update next_out and avail_out accordingly. inflate() provides as much output as possible, until there is no more input data or no more space in the output buffer (see below about the flush parameter).

Before the call of inflate(), the application should ensure that at least one of the actions is possible, by providing more input and/or consuming more output, and updating the next_* and avail_* values accordingly. The application can consume the uncompressed output when it wants, for example when the output buffer is full (avail_out == 0), or after each call of inflate(). If inflate returns Z_OK and with zero avail_out, it must be called again after making room in the output buffer because there might be more output pending.

If the parameter flush is set to Z_PARTIAL_FLUSH, inflate flushes as much output as possible to the output buffer. The flushing behavior of inflate is not specified for values of the flush parameter other than Z_PARTIAL_FLUSH and Z_FINISH, but the current implementation actually flushes as much output as possible anyway.

inflate() should normally be called until it returns Z_STREAM_END or an error. However if all decompression is to be performed in a single step (a single call of inflate), the parameter flush should be set to Z_FINISH. In this case all pending input is processed and all pending output is flushed; avail_out must be large enough to hold all the uncompressed data. (The size of the uncompressed data may have been saved by the compressor for this purpose.) The next operation on this stream must be inflateEnd to deallocate the decompression state.

inflate() returns Z_OK if some progress has been made (more input processed or more output produced), ZStream_END if the end of the compressed data has been reached and all uncompressed output has been produced, Z_DATA_ERROR if the input data was corrupted, Z_STREAM_ERROR if the stream structure was inconsistent (for example if next_in or next_out was NULL), Z_MEM_ERROR if there was not enough memory, Z_BUF_ERROR if no progress is possible or if there was not enough room in the output buffer when Z_FINISH is used. In the Z_DATA_ERROR case, the application may then call inflateSync to look for a good compression block.

Definition at line 411 of file zinflate.cpp.

#define new   CAM_DEBUG_NEW
 

Definition at line 123 of file zinflate.cpp.

#define NEXTBYTE   (z->avail_in--,z->total_in++,*z->next_in++)
 

Definition at line 412 of file zinflate.cpp.


Function Documentation

DECLARE_SOURCE "$Revision: 1282 $"   ) 
 


Variable Documentation

uInt inflate_mask[]
 

Initial value:

 {
    0x0000,
    0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, 0x007f, 0x00ff,
    0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff
}

Definition at line 125 of file zinflate.cpp.


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