NVBIO
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Macros | Typedefs | Enumerations | Functions
lz4frame.c File Reference
#include <stdlib.h>
#include <string.h>
#include "lz4frame_static.h"
#include "lz4.h"
#include "lz4hc.h"
#include "xxhash.h"

Go to the source code of this file.

Classes

struct  LZ4F_cctx_internal_t
 
struct  LZ4F_dctx_internal_t
 

Macros

#define GCC_VERSION   (__GNUC__ * 100 + __GNUC_MINOR__)
 
#define ALLOCATOR(s)   calloc(1,s)
 
#define FREEMEM   free
 
#define MEM_INIT   memset
 
#define KB   *(1<<10)
 
#define MB   *(1<<20)
 
#define GB   *(1<<30)
 
#define _1BIT   0x01
 
#define _2BITS   0x03
 
#define _3BITS   0x07
 
#define _4BITS   0x0F
 
#define _8BITS   0xFF
 
#define LZ4F_MAGICNUMBER   0x184D2204U
 
#define LZ4F_BLOCKUNCOMPRESSED_FLAG   0x80000000U
 
#define LZ4F_MAXHEADERFRAME_SIZE   7
 
#define LZ4F_BLOCKSIZEID_DEFAULT   max64KB
 
#define LZ4F_GENERATE_STRING(STRING)   #STRING,
 

Typedefs

typedef unsigned char BYTE
 
typedef unsigned short U16
 
typedef unsigned int U32
 
typedef signed int S32
 
typedef unsigned long long U64
 
typedef int(* compressFunc_t )(void *ctx, const char *src, char *dst, int srcSize, int dstSize, int level)
 

Enumerations

enum  LZ4F_lastBlockStatus { notDone, fromTmpBuffer, fromSrcBuffer }
 
enum  dStage_t {
  dstage_getHeader =0, dstage_storeHeader, dstage_decodeHeader, dstage_getCBlockSize,
  dstage_storeCBlockSize, dstage_decodeCBlockSize, dstage_copyDirect, dstage_getCBlock,
  dstage_storeCBlock, dstage_decodeCBlock, dstage_decodeCBlock_intoDst, dstage_decodeCBlock_intoTmp,
  dstage_flushOut, dstage_getSuffix, dstage_storeSuffix, dstage_checkSuffix
}
 

Functions

U32 LZ4F_isError (LZ4F_errorCode_t code)
 
const char * LZ4F_getErrorName (LZ4F_errorCode_t code)
 
size_t LZ4F_compressFrameBound (size_t srcSize, const LZ4F_preferences_t *preferencesPtr)
 
size_t LZ4F_compressFrame (void *dstBuffer, size_t dstMaxSize, const void *srcBuffer, size_t srcSize, const LZ4F_preferences_t *preferencesPtr)
 
LZ4F_errorCode_t LZ4F_createCompressionContext (LZ4F_compressionContext_t *LZ4F_compressionContextPtr, unsigned version)
 
LZ4F_errorCode_t LZ4F_freeCompressionContext (LZ4F_compressionContext_t LZ4F_compressionContext)
 
size_t LZ4F_compressBegin (LZ4F_compressionContext_t compressionContext, void *dstBuffer, size_t dstMaxSize, const LZ4F_preferences_t *preferencesPtr)
 
size_t LZ4F_compressBound (size_t srcSize, const LZ4F_preferences_t *preferencesPtr)
 
size_t LZ4F_compressUpdate (LZ4F_compressionContext_t compressionContext, void *dstBuffer, size_t dstMaxSize, const void *srcBuffer, size_t srcSize, const LZ4F_compressOptions_t *compressOptionsPtr)
 
size_t LZ4F_flush (LZ4F_compressionContext_t compressionContext, void *dstBuffer, size_t dstMaxSize, const LZ4F_compressOptions_t *compressOptionsPtr)
 
size_t LZ4F_compressEnd (LZ4F_compressionContext_t compressionContext, void *dstBuffer, size_t dstMaxSize, const LZ4F_compressOptions_t *compressOptionsPtr)
 
LZ4F_errorCode_t LZ4F_createDecompressionContext (LZ4F_compressionContext_t *LZ4F_decompressionContextPtr, unsigned versionNumber)
 
LZ4F_errorCode_t LZ4F_freeDecompressionContext (LZ4F_compressionContext_t LZ4F_decompressionContext)
 
LZ4F_errorCode_t LZ4F_getFrameInfo (LZ4F_decompressionContext_t decompressionContext, LZ4F_frameInfo_t *frameInfoPtr, const void *srcBuffer, size_t *srcSizePtr)
 
size_t LZ4F_decompress (LZ4F_decompressionContext_t decompressionContext, void *dstBuffer, size_t *dstSizePtr, const void *srcBuffer, size_t *srcSizePtr, const LZ4F_decompressOptions_t *decompressOptionsPtr)
 

Macro Definition Documentation

#define _1BIT   0x01

Definition at line 99 of file lz4frame.c.

#define _2BITS   0x03

Definition at line 100 of file lz4frame.c.

#define _3BITS   0x07

Definition at line 101 of file lz4frame.c.

#define _4BITS   0x0F

Definition at line 102 of file lz4frame.c.

#define _8BITS   0xFF

Definition at line 103 of file lz4frame.c.

#define ALLOCATOR (   s)    calloc(1,s)

Definition at line 58 of file lz4frame.c.

#define FREEMEM   free

Definition at line 59 of file lz4frame.c.

#define GB   *(1<<30)

Definition at line 97 of file lz4frame.c.

#define GCC_VERSION   (__GNUC__ * 100 + __GNUC_MINOR__)

Definition at line 47 of file lz4frame.c.

#define KB   *(1<<10)

Definition at line 95 of file lz4frame.c.

#define LZ4F_BLOCKSIZEID_DEFAULT   max64KB

Definition at line 108 of file lz4frame.c.

#define LZ4F_BLOCKUNCOMPRESSED_FLAG   0x80000000U

Definition at line 106 of file lz4frame.c.

#define LZ4F_GENERATE_STRING (   STRING)    #STRING,

Definition at line 160 of file lz4frame.c.

#define LZ4F_MAGICNUMBER   0x184D2204U

Definition at line 105 of file lz4frame.c.

#define LZ4F_MAXHEADERFRAME_SIZE   7

Definition at line 107 of file lz4frame.c.

#define MB   *(1<<20)

Definition at line 96 of file lz4frame.c.

#define MEM_INIT   memset

Definition at line 61 of file lz4frame.c.

Typedef Documentation

typedef unsigned char BYTE

Definition at line 84 of file lz4frame.c.

typedef int(* compressFunc_t)(void *ctx, const char *src, char *dst, int srcSize, int dstSize, int level)

Definition at line 453 of file lz4frame.c.

typedef signed int S32

Definition at line 87 of file lz4frame.c.

typedef unsigned short U16

Definition at line 85 of file lz4frame.c.

typedef unsigned int U32

Definition at line 86 of file lz4frame.c.

typedef unsigned long long U64

Definition at line 88 of file lz4frame.c.

Enumeration Type Documentation

enum dStage_t
Enumerator
dstage_getHeader 
dstage_storeHeader 
dstage_decodeHeader 
dstage_getCBlockSize 
dstage_storeCBlockSize 
dstage_decodeCBlockSize 
dstage_copyDirect 
dstage_getCBlock 
dstage_storeCBlock 
dstage_decodeCBlock 
dstage_decodeCBlock_intoDst 
dstage_decodeCBlock_intoTmp 
dstage_flushOut 
dstage_getSuffix 
dstage_storeSuffix 
dstage_checkSuffix 

Definition at line 806 of file lz4frame.c.

Enumerator
notDone 
fromTmpBuffer 
fromSrcBuffer 

Definition at line 508 of file lz4frame.c.

Function Documentation

size_t LZ4F_compressBegin ( LZ4F_compressionContext_t  compressionContext,
void *  dstBuffer,
size_t  dstMaxSize,
const LZ4F_preferences_t preferencesPtr 
)

Definition at line 362 of file lz4frame.c.

size_t LZ4F_compressBound ( size_t  srcSize,
const LZ4F_preferences_t preferencesPtr 
)

Definition at line 437 of file lz4frame.c.

size_t LZ4F_compressEnd ( LZ4F_compressionContext_t  compressionContext,
void *  dstBuffer,
size_t  dstMaxSize,
const LZ4F_compressOptions_t compressOptionsPtr 
)

Definition at line 671 of file lz4frame.c.

size_t LZ4F_compressFrame ( void *  dstBuffer,
size_t  dstMaxSize,
const void *  srcBuffer,
size_t  srcSize,
const LZ4F_preferences_t preferencesPtr 
)

Definition at line 259 of file lz4frame.c.

size_t LZ4F_compressFrameBound ( size_t  srcSize,
const LZ4F_preferences_t preferencesPtr 
)

Definition at line 220 of file lz4frame.c.

size_t LZ4F_compressUpdate ( LZ4F_compressionContext_t  compressionContext,
void *  dstBuffer,
size_t  dstMaxSize,
const void *  srcBuffer,
size_t  srcSize,
const LZ4F_compressOptions_t compressOptionsPtr 
)

Definition at line 519 of file lz4frame.c.

LZ4F_errorCode_t LZ4F_createCompressionContext ( LZ4F_compressionContext_t LZ4F_compressionContextPtr,
unsigned  version 
)

Definition at line 328 of file lz4frame.c.

LZ4F_errorCode_t LZ4F_createDecompressionContext ( LZ4F_compressionContext_t LZ4F_decompressionContextPtr,
unsigned  versionNumber 
)

Definition at line 711 of file lz4frame.c.

size_t LZ4F_decompress ( LZ4F_decompressionContext_t  decompressionContext,
void *  dstBuffer,
size_t *  dstSizePtr,
const void *  srcBuffer,
size_t *  srcSizePtr,
const LZ4F_decompressOptions_t decompressOptionsPtr 
)

Definition at line 949 of file lz4frame.c.

size_t LZ4F_flush ( LZ4F_compressionContext_t  compressionContext,
void *  dstBuffer,
size_t  dstMaxSize,
const LZ4F_compressOptions_t compressOptionsPtr 
)

Definition at line 628 of file lz4frame.c.

LZ4F_errorCode_t LZ4F_freeCompressionContext ( LZ4F_compressionContext_t  LZ4F_compressionContext)

Definition at line 344 of file lz4frame.c.

LZ4F_errorCode_t LZ4F_freeDecompressionContext ( LZ4F_compressionContext_t  LZ4F_decompressionContext)

Definition at line 723 of file lz4frame.c.

const char* LZ4F_getErrorName ( LZ4F_errorCode_t  code)

Definition at line 169 of file lz4frame.c.

LZ4F_errorCode_t LZ4F_getFrameInfo ( LZ4F_decompressionContext_t  decompressionContext,
LZ4F_frameInfo_t frameInfoPtr,
const void *  srcBuffer,
size_t *  srcSizePtr 
)

Definition at line 825 of file lz4frame.c.

U32 LZ4F_isError ( LZ4F_errorCode_t  code)

Definition at line 164 of file lz4frame.c.