,
161 "Output buffer overflow",
178 const char* lpFileName,
180 const char* lpMessage
183printf(
"Error: %s(%d) - %s\n",lpFileName,iLine,lpMessage);
211 URCOMPRERR(
"No more data in input buffer");
225 unsigned char* pData,
268 unsigned chartheChar
284 unsigned shortusData
321 unsigned char* pData,
345 const void* pInputData,
351 unsigned charucFlags = 0;
352 unsigned shortusAttr =
BINARY;
353 unsigned shortusDeflateFlags = 0;
356 if( pInputData ==
NULL 357|| pOutputBuff ==
NULL 358|| ipCompressedSize ==
NULL) {
366*ipCompressedSize = 0;
369 pInBuffer= (
unsigned char*)pInputData;
423 const void* pInputData,
436 if( pInputData ==
NULL 437|| pOutputBuff ==
NULL 438|| ipUncompressedSize ==
NULL) {
445*ipUncompressedSize = 0;
448 pInBuffer= (
unsigned char*)pInputData;
461 if( memcmp (cBuffer,
MAGIC_KEY, 2) != 0 ) {
467 URCOMPRERR(
"Invalid compression Nlmzip_method");
472(
unsigned char*)cBuffer,
482 URCOMPRERR(
"Out of memory on uncompression");
483}
else if( iResult != 0 ) {
484 URCOMPRERR(
"Invalid compressed data(format violated)");
492ulOrigCrc =
LG(cBuffer);
493ulOrigLen =
LG(cBuffer+4);
498&& ulOrigCrc != ulCurCrc ) {
499 URCOMPRERR(
"Invalid compressed data(CRC error)");
502 URCOMPRERR(
"Invalid compressed data(length error)");
526 return "Invalid error code";
540 char* lpTemp = (
char*)pBuffer;
543lpTemp = lpTemp + iSize -
sizeof(
Int4);
556 const unsigned char kMagic[2] = {0x2f, 0x9a};
561 const void* src_buf,
size_tsrc_len,
562 void* dst_buf,
size_tdst_size,
570 if(!src_len || !src_buf || !dst_buf || dst_size <=
kHeaderSize) {
574 unsigned char* dst = (
unsigned char*)dst_buf;
579dst[2] = (
unsignedchar)method;
591 if(src_len > dst_size) {
594memcpy(dst, src_buf, src_len);
607 #if defined(HAVE_LIBLZO) 645 const void* src_buf,
size_tsrc_len,
646 void* dst_buf,
size_tdst_size,
652 if(!src_len || !src_buf || !dst_buf) {
657 unsigned char* src = (
unsigned char*)src_buf;
659 boolold_format =
true;
675*dst_len = (size_t)
n;
686 if(src_len > dst_size) {
689memcpy(dst_buf, src, src_len);
702 #if defined(HAVE_LIBLZO)void Nlmzip_bi_init(void)
void Nlmzip_CompressInit(void)
void Nlmzip_WriteByte(unsigned char theChar)
DEFINE_STATIC_FAST_MUTEX(s_NlmZip)
void Nlmzip_WriteLong(ulg ulData)
void Nlmzip_WriteShort(unsigned short usData)
unsigned short Nlmzip_prev[1L<< 16]
static const char * theComprErr[]
const unsigned char kMagic[2]
unsigned char Nlmzip_inbuf[0x8000]
void Nlmzip_WriteData(unsigned char *pData, int iSize)
void Nlmzip_ReadUndo(void)
unsigned char Nlmzip_outbuf[16384]
BEGIN_CTRANSITION_SCOPE int Nlmzip_level
unsigned char Nlmzip_ReadByte(void)
static unsigned char * pOutBuffer
void Nlmzip_Err(const char *lpFileName, int iLine, const char *lpMessage)
unsigned char Nlmzip_window[2L *0x8000]
unsigned short Nlmzip_d_buf[0x8000]
static jmp_buf theErrJumper
int Nlmzip_ReadData(unsigned char *pData, int iSize)
static unsigned char * pInBuffer
void Nlmzip_lm_init(int pack_level, ush *flags)
void Nlmzip_ct_init(unsigned short *, int *)
ulg Nlmzip_updcrc(unsigned char *, Uint4)
EMethod
Compression/decompression methods.
@ eZip
ZLIB (raw zip data / DEFLATE method)
@ eNone
no compression method (copy "as is")
@ eConcatenatedGZipFile
Synonym for eGZipFile (for backward compatibility) - deprecated.
@ eGZipFile
.gz file (including concatenated files)
virtual bool 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.
virtual bool CompressBuffer(const void *src_buf, size_t src_len, void *dst_buf, size_t dst_size, size_t *dst_len)
Compress data in the buffer.
virtual bool 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.
virtual void SetFlags(TFlags flags)
virtual TFlags GetFlags(void) const
Get/set flags.
ELevel
Compression level.
virtual bool CompressBuffer(const void *src_buf, size_t src_len, void *dst_buf, size_t dst_size, size_t *dst_len)
Compress data in the buffer.
virtual bool CompressBuffer(const void *src_buf, size_t src_len, void *dst_buf, size_t dst_size, size_t *dst_len)
Compress data in the buffer.
virtual bool 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.
@ fGZip
Set of flags for gzip file support. See each flag description above.
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
int32_t Int4
4-byte (32-bit) signed integer
uint32_t Uint4
4-byte (32-bit) unsigned integer
TFastMutexGuard CFastMutexGuard
...and backward compatibility
unsigned int
A callback function used to compare two keys in a database.
Multi-threading â mutexes; rw-locks; semaphore.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4