NCBI C++ ToolKit
Functions | Variables
ct_nlmzip_dcompr.cpp File Reference
#include <ncbi_pch.hpp>
#include <corelib/ncbimtx.hpp>
#include <setjmp.h>
#include "ct_nlmzip_i.h"
+ Include dependency graph for ct_nlmzip_dcompr.cpp:

Go to the source code of this file.

Go to the SVN repository for this file.

Functions

 DEFINE_STATIC_FAST_MUTEX (s_NlmZip)
 
void Nlmzip_Err (const char *lpFileName, int iLine, const char *lpMessage)
 
void Nlmzip_CompressInit (void)
 
unsigned char Nlmzip_ReadByte (void)
 
int Nlmzip_ReadData (unsigned char *pData, int iSize)
 
void Nlmzip_ReadUndo (void)
 
void Nlmzip_WriteByte (unsigned char theChar)
 
void Nlmzip_WriteShort (unsigned short usData)
 
void Nlmzip_WriteLong (ulg ulData)
 
void Nlmzip_WriteData (unsigned char *pData, int iSize)
 
Nlmzip_rc_t Nlmzip_Compress (const void *pInputData, Int4 iInputSize, void *pOutputBuff, Int4 iOutputSize, Int4Ptr ipCompressedSize)
 
Nlmzip_rc_t Nlmzip_Uncompress (const void *pInputData, Int4 iInputSize, void *pOutputBuff, Int4 iOutputSize, Int4Ptr ipUncompressedSize)
 
const char * Nlmzip_ErrMsg (Int4 iCode)
 
Int4 Nlmzip_UncompressedSize (VoidPtr pBuffer, Int4 iSize)
 
bool CT_CompressBuffer (const void *src_buf, size_t src_len, void *dst_buf, size_t dst_size, size_t *dst_len, CCompressStream::EMethod method, CCompression::ELevel level)
 Compress data in the buffer. More...
 
bool CT_DecompressBuffer (const void *src_buf, size_t src_len, void *dst_buf, size_t dst_size, size_t *dst_len)
 Decompress data in the buffer. More...
 

Variables

BEGIN_CTRANSITION_SCOPE int Nlmzip_level = 8
 
int Nlmzip_method = 8
 
unsigned char Nlmzip_inbuf [0x8000]
 
unsigned char Nlmzip_outbuf [16384]
 
unsigned short Nlmzip_d_buf [0x8000]
 
unsigned char Nlmzip_window [2L *0x8000]
 
unsigned short Nlmzip_prev [1L<< 16]
 
Int4 Nlmzip_block_start
 
Uint4 Nlmzip_strstart
 
Uint4 Nlmzip_outcnt
 
Uint4 Nlmzip_insize
 
static unsigned char * pInBuffer = NULL
 
static int iInDataSize = 0
 
static int iInCurPos = 0
 
static unsigned char * pOutBuffer = NULL
 
static int iOutDataSize = 0
 
static int iOutCurPos = 0
 
static jmp_buf theErrJumper
 
static ulg ulCrc
 
static const char * theComprErr []
 
const int kHeaderSize = 4
 
const unsigned char kMagic [2] = {0x2f, 0x9a}
 

Function Documentation

◆ DEFINE_STATIC_FAST_MUTEX()

DEFINE_STATIC_FAST_MUTEX ( s_NlmZip  )

◆ Nlmzip_CompressInit()

void Nlmzip_CompressInit ( void  )

Definition at line 196 of file ct_nlmzip_dcompr.cpp.

◆ Nlmzip_Err()

void Nlmzip_Err ( const char *  lpFileName,
int  iLine,
const char *  lpMessage 
)

Definition at line 177 of file ct_nlmzip_dcompr.cpp.

References theErrJumper.

◆ Nlmzip_ReadByte()

unsigned char Nlmzip_ReadByte ( void  )

Definition at line 208 of file ct_nlmzip_dcompr.cpp.

References iInCurPos, iInDataSize, pInBuffer, and URCOMPRERR.

Referenced by Nlmzip_Uncompress().

◆ Nlmzip_ReadData()

int Nlmzip_ReadData ( unsigned char *  pData,
int  iSize 
)

Definition at line 224 of file ct_nlmzip_dcompr.cpp.

References iInCurPos, iInDataSize, Nlmzip_updcrc(), pInBuffer, and ulCrc.

Referenced by fill_window(), Nlmzip_lm_init(), and Nlmzip_Uncompress().

◆ Nlmzip_ReadUndo()

void Nlmzip_ReadUndo ( void  )

Definition at line 253 of file ct_nlmzip_dcompr.cpp.

References iInCurPos.

Referenced by Nlmzip_inflate().

◆ Nlmzip_WriteByte()

void Nlmzip_WriteByte ( unsigned char  theChar)

◆ Nlmzip_WriteData()

void Nlmzip_WriteData ( unsigned char *  pData,
int  iSize 
)

Definition at line 320 of file ct_nlmzip_dcompr.cpp.

References iOutCurPos, iOutDataSize, pOutBuffer, and URCOMPRERR.

Referenced by Nlmzip_flush_window().

◆ Nlmzip_WriteLong()

void Nlmzip_WriteLong ( ulg  ulData)

Definition at line 300 of file ct_nlmzip_dcompr.cpp.

References iOutCurPos, iOutDataSize, pOutBuffer, and URCOMPRERR.

Referenced by Nlmzip_Compress().

◆ Nlmzip_WriteShort()

void Nlmzip_WriteShort ( unsigned short  usData)

Variable Documentation

◆ iInCurPos

int iInCurPos = 0
static

◆ iInDataSize

int iInDataSize = 0
static

◆ iOutCurPos

int iOutCurPos = 0
static

◆ iOutDataSize

int iOutDataSize = 0
static

◆ kHeaderSize

const int kHeaderSize = 4

◆ kMagic

const unsigned char kMagic[2] = {0x2f, 0x9a}

◆ Nlmzip_block_start

Int4 Nlmzip_block_start

◆ Nlmzip_d_buf

unsigned short Nlmzip_d_buf[0x8000]

Definition at line 121 of file ct_nlmzip_dcompr.cpp.

Referenced by compress_block(), and Nlmzip_ct_tally().

◆ Nlmzip_inbuf

unsigned char Nlmzip_inbuf[0x8000]

Definition at line 119 of file ct_nlmzip_dcompr.cpp.

◆ Nlmzip_insize

Uint4 Nlmzip_insize

Definition at line 132 of file ct_nlmzip_dcompr.cpp.

Referenced by Nlmzip_clear_bufs().

◆ Nlmzip_level

BEGIN_CTRANSITION_SCOPE int Nlmzip_level = 8

Definition at line 115 of file ct_nlmzip_dcompr.cpp.

Referenced by Nlmzip_Compress(), and Nlmzip_ct_tally().

◆ Nlmzip_method

int Nlmzip_method = 8

Definition at line 116 of file ct_nlmzip_dcompr.cpp.

Referenced by Nlmzip_Compress(), and Nlmzip_Uncompress().

◆ Nlmzip_outbuf

unsigned char Nlmzip_outbuf[16384]

Definition at line 120 of file ct_nlmzip_dcompr.cpp.

◆ Nlmzip_outcnt

Uint4 Nlmzip_outcnt

◆ Nlmzip_prev

unsigned short Nlmzip_prev[1L<< 16]

Definition at line 123 of file ct_nlmzip_dcompr.cpp.

Referenced by fill_window(), and longest_match().

◆ Nlmzip_strstart

Uint4 Nlmzip_strstart

◆ Nlmzip_window

unsigned char Nlmzip_window[2L *0x8000]

◆ pInBuffer

unsigned char* pInBuffer = NULL
static

◆ pOutBuffer

unsigned char* pOutBuffer = NULL
static

◆ theComprErr

const char* theComprErr[]
static
Initial value:
= {
"No error",
"Bad CRC",
"Invalid parameter",
"Output buffer overflow",
"No memory"
}

Definition at line 157 of file ct_nlmzip_dcompr.cpp.

Referenced by Nlmzip_ErrMsg().

◆ theErrJumper

jmp_buf theErrJumper
static

Definition at line 148 of file ct_nlmzip_dcompr.cpp.

Referenced by Nlmzip_Compress(), Nlmzip_Err(), and Nlmzip_Uncompress().

◆ ulCrc

ulg ulCrc
static

Definition at line 151 of file ct_nlmzip_dcompr.cpp.

Referenced by Nlmzip_Compress(), and Nlmzip_ReadData().

Modified on Wed Jul 17 13:22:15 2024 by modify_doxy.py rev. 669887