zstream.cpp File Reference

(r1785/r1282)

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

Go to the source code of this file.

Defines

#define new   CAM_DEBUG_NEW
#define Z_BUFSIZE   32*1024
#define ALLOC(size)   CCMalloc(size)
#define TRYFREE(p)   {if (p) { CCFree(p); p = NULL; } }
#define ASCII_FLAG   0x01
#define HEAD_CRC   0x02
#define EXTRA_FIELD   0x04
#define ORIG_NAME   0x08
#define COMMENT   0x10
#define RESERVED   0xE0
#define SEEK_CUR   1
#define DO1(buf)   crc = crc_table[((INT32)crc ^ (*buf++)) & 0xff] ^ (crc >> 8);
#define DO2(buf)   DO1(buf); DO1(buf);
#define DO4(buf)   DO2(buf); DO2(buf);
#define DO8(buf)   DO4(buf); DO4(buf);
#define BASE   65521L
#define NMAX   5552
#define A_DO1(buf, i)   {s1 += buf[i]; s2 += s1;}
#define A_DO2(buf, i)   A_DO1(buf,i); A_DO1(buf,i+1);
#define A_DO4(buf, i)   A_DO2(buf,i); A_DO2(buf,i+2);
#define A_DO8(buf, i)   A_DO4(buf,i); A_DO4(buf,i+4);
#define A_DO16(buf)   A_DO8(buf,0); A_DO8(buf,8);

Functions

 DECLARE_SOURCE ("$Revision: 1282 $")

Variables

static uLongf crc_table [256]
 Returns the error message for the last error which occured on the given compressed file. errnum is set to zlib error number. If an error occured in the file system and not in the compression library, errnum is set to Z_ERRNO and the application may consult errno to get the exact error code.Table of CRC-32's of all single-byte values (made by make_crc_table).


Define Documentation

#define A_DO1 buf,
 )     {s1 += buf[i]; s2 += s1;}
 

Definition at line 1591 of file zstream.cpp.

#define A_DO16 buf   )     A_DO8(buf,0); A_DO8(buf,8);
 

Definition at line 1595 of file zstream.cpp.

#define A_DO2 buf,
 )     A_DO1(buf,i); A_DO1(buf,i+1);
 

Definition at line 1592 of file zstream.cpp.

#define A_DO4 buf,
 )     A_DO2(buf,i); A_DO2(buf,i+2);
 

Definition at line 1593 of file zstream.cpp.

#define A_DO8 buf,
 )     A_DO4(buf,i); A_DO4(buf,i+4);
 

Definition at line 1594 of file zstream.cpp.

#define ALLOC size   )     CCMalloc(size)
 

Definition at line 137 of file zstream.cpp.

#define ASCII_FLAG   0x01
 

Definition at line 146 of file zstream.cpp.

#define BASE   65521L
 

Definition at line 1587 of file zstream.cpp.

#define COMMENT   0x10
 

Definition at line 150 of file zstream.cpp.

#define DO1 buf   )     crc = crc_table[((INT32)crc ^ (*buf++)) & 0xff] ^ (crc >> 8);
 

Definition at line 1518 of file zstream.cpp.

#define DO2 buf   )     DO1(buf); DO1(buf);
 

Definition at line 1519 of file zstream.cpp.

#define DO4 buf   )     DO2(buf); DO2(buf);
 

Definition at line 1520 of file zstream.cpp.

#define DO8 buf   )     DO4(buf); DO4(buf);
 

Definition at line 1521 of file zstream.cpp.

#define EXTRA_FIELD   0x04
 

Definition at line 148 of file zstream.cpp.

#define HEAD_CRC   0x02
 

Definition at line 147 of file zstream.cpp.

#define new   CAM_DEBUG_NEW
 

Definition at line 126 of file zstream.cpp.

#define NMAX   5552
 

Definition at line 1588 of file zstream.cpp.

#define ORIG_NAME   0x08
 

Definition at line 149 of file zstream.cpp.

#define RESERVED   0xE0
 

Definition at line 151 of file zstream.cpp.

#define SEEK_CUR   1
 

Definition at line 154 of file zstream.cpp.

#define TRYFREE p   )     {if (p) { CCFree(p); p = NULL; } }
 

Definition at line 138 of file zstream.cpp.

#define Z_BUFSIZE   32*1024
 

Definition at line 132 of file zstream.cpp.


Function Documentation

DECLARE_SOURCE "$Revision: 1282 $"   ) 
 


Variable Documentation

uLongf crc_table[256] [static]
 

Returns the error message for the last error which occured on the given compressed file. errnum is set to zlib error number. If an error occured in the file system and not in the compression library, errnum is set to Z_ERRNO and the application may consult errno to get the exact error code.Table of CRC-32's of all single-byte values (made by make_crc_table).

Author:
Neville_Humphrys (Xara Group Ltd) <camelotdev@xara.com>
Date:
24/05/95

Definition at line 1461 of file zstream.cpp.


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