Parolin 0.7.9 6796
Console (soon DLLs) to do a tar like job
Loading...
Searching...
No Matches
lz4hc.h File Reference
#include "lz4.h"

Go to the source code of this file.

Data Structures

struct  LZ4HC_CCtx_internal
 
union  LZ4_streamHC_u
 

Macros

#define LZ4HC_CLEVEL_MIN   2
 
#define LZ4HC_CLEVEL_DEFAULT   9
 
#define LZ4HC_CLEVEL_OPT_MIN   10
 
#define LZ4HC_CLEVEL_MAX   12
 
#define LZ4HC_DICTIONARY_LOGSIZE   16
 
#define LZ4HC_MAXD   (1<<LZ4HC_DICTIONARY_LOGSIZE)
 
#define LZ4HC_MAXD_MASK   (LZ4HC_MAXD - 1)
 
#define LZ4HC_HASH_LOG   15
 
#define LZ4HC_HASHTABLESIZE   (1 << LZ4HC_HASH_LOG)
 
#define LZ4HC_HASH_MASK   (LZ4HC_HASHTABLESIZE - 1)
 
#define LZ4_STREAMHC_MINSIZE   262200 /* static size, for inter-version compatibility */
 

Functions

LZ4LIB_API int LZ4_compress_HC (const char *src, char *dst, int srcSize, int dstCapacity, int compressionLevel)
 
LZ4LIB_API int LZ4_sizeofStateHC (void)
 
LZ4LIB_API int LZ4_compress_HC_extStateHC (void *stateHC, const char *src, char *dst, int srcSize, int maxDstSize, int compressionLevel)
 
LZ4LIB_API int LZ4_compress_HC_destSize (void *stateHC, const char *src, char *dst, int *srcSizePtr, int targetDstSize, int compressionLevel)
 
LZ4LIB_API LZ4_streamHC_tLZ4_createStreamHC (void)
 
LZ4LIB_API int LZ4_freeStreamHC (LZ4_streamHC_t *streamHCPtr)
 
LZ4LIB_API void LZ4_resetStreamHC_fast (LZ4_streamHC_t *streamHCPtr, int compressionLevel)
 
LZ4LIB_API int LZ4_loadDictHC (LZ4_streamHC_t *streamHCPtr, const char *dictionary, int dictSize)
 
LZ4LIB_API int LZ4_compress_HC_continue (LZ4_streamHC_t *streamHCPtr, const char *src, char *dst, int srcSize, int maxDstSize)
 
LZ4LIB_API int LZ4_compress_HC_continue_destSize (LZ4_streamHC_t *LZ4_streamHCPtr, const char *src, char *dst, int *srcSizePtr, int targetDstSize)
 
LZ4LIB_API int LZ4_saveDictHC (LZ4_streamHC_t *streamHCPtr, char *safeBuffer, int maxDictSize)
 
LZ4LIB_API void LZ4_attach_HC_dictionary (LZ4_streamHC_t *working_stream, const LZ4_streamHC_t *dictionary_stream)
 
LZ4LIB_API LZ4_streamHC_tLZ4_initStreamHC (void *buffer, size_t size)
 
 LZ4_DEPRECATED ("use LZ4_compress_HC() instead") LZ4LIB_API int LZ4_compressHC(const char *source
 
 LZ4_DEPRECATED ("use LZ4_compress_HC_extStateHC() instead") LZ4LIB_API int LZ4_compressHC_withStateHC(void *state
 
 LZ4_DEPRECATED ("use LZ4_compress_HC_continue() instead") LZ4LIB_API int LZ4_compressHC_continue(LZ4_streamHC_t *LZ4_streamHCPtr
 
 LZ4_DEPRECATED ("use LZ4_createStreamHC() instead") LZ4LIB_API void *LZ4_createHC(const char *inputBuffer)
 
 LZ4_DEPRECATED ("use LZ4_freeStreamHC() instead") LZ4LIB_API int LZ4_freeHC(void *LZ4HC_Data)
 
 LZ4_DEPRECATED ("use LZ4_saveDictHC() instead") LZ4LIB_API char *LZ4_slideInputBufferHC(void *LZ4HC_Data)
 
 LZ4_DEPRECATED ("use LZ4_initStreamHC() instead") LZ4LIB_API int LZ4_resetStreamStateHC(void *state
 
LZ4LIB_API void LZ4_resetStreamHC (LZ4_streamHC_t *streamHCPtr, int compressionLevel)
 

Variables

char * dest
 
char int inputSize
 
char int int maxOutputSize
 
char int int compressionLevel
 
const char * source
 
char * inputBuffer
 

Macro Definition Documentation

◆ LZ4_STREAMHC_MINSIZE

#define LZ4_STREAMHC_MINSIZE   262200 /* static size, for inter-version compatibility */

◆ LZ4HC_CLEVEL_DEFAULT

#define LZ4HC_CLEVEL_DEFAULT   9

◆ LZ4HC_CLEVEL_MAX

#define LZ4HC_CLEVEL_MAX   12

◆ LZ4HC_CLEVEL_MIN

#define LZ4HC_CLEVEL_MIN   2

◆ LZ4HC_CLEVEL_OPT_MIN

#define LZ4HC_CLEVEL_OPT_MIN   10

◆ LZ4HC_DICTIONARY_LOGSIZE

#define LZ4HC_DICTIONARY_LOGSIZE   16

◆ LZ4HC_HASH_LOG

#define LZ4HC_HASH_LOG   15

◆ LZ4HC_HASH_MASK

#define LZ4HC_HASH_MASK   (LZ4HC_HASHTABLESIZE - 1)

◆ LZ4HC_HASHTABLESIZE

#define LZ4HC_HASHTABLESIZE   (1 << LZ4HC_HASH_LOG)

◆ LZ4HC_MAXD

#define LZ4HC_MAXD   (1<<LZ4HC_DICTIONARY_LOGSIZE)

◆ LZ4HC_MAXD_MASK

#define LZ4HC_MAXD_MASK   (LZ4HC_MAXD - 1)

Function Documentation

◆ LZ4_attach_HC_dictionary()

LZ4LIB_API void LZ4_attach_HC_dictionary ( LZ4_streamHC_t * working_stream,
const LZ4_streamHC_t * dictionary_stream )

LZ4_attach_HC_dictionary() : stable since v1.10.0 This API allows for the efficient re-use of a static dictionary many times.

Rather than re-loading the dictionary buffer into a working context before each compression, or copying a pre-loaded dictionary's LZ4_streamHC_t into a working LZ4_streamHC_t, this function introduces a no-copy setup mechanism, in which the working stream references the dictionary stream in-place.

Several assumptions are made about the state of the dictionary stream. Currently, only streams which have been prepared by LZ4_loadDictHC() should be expected to work.

Alternatively, the provided dictionary stream pointer may be NULL, in which case any existing dictionary stream is unset.

A dictionary should only be attached to a stream without any history (i.e., a stream that has just been reset).

The dictionary will remain attached to the working stream only for the current stream session. Calls to LZ4_resetStreamHC(_fast) will remove the dictionary context association from the working stream. The dictionary stream (and source buffer) must remain in-place / accessible / unchanged through the lifetime of the stream session.

◆ LZ4_compress_HC()

LZ4LIB_API int LZ4_compress_HC ( const char * src,
char * dst,
int srcSize,
int dstCapacity,
int compressionLevel )

LZ4_compress_HC() : Compress data from src into dst, using the powerful but slower "HC" algorithm. dst must be already allocated. Compression is guaranteed to succeed if dstCapacity >= LZ4_compressBound(srcSize) (see "lz4.h") Max supported srcSize value is LZ4_MAX_INPUT_SIZE (see "lz4.h") compressionLevel : any value between 1 and LZ4HC_CLEVEL_MAX will work. Values > LZ4HC_CLEVEL_MAX behave the same as LZ4HC_CLEVEL_MAX.

Returns
: the number of bytes written into 'dst' or 0 if compression fails.

◆ LZ4_compress_HC_continue()

LZ4LIB_API int LZ4_compress_HC_continue ( LZ4_streamHC_t * streamHCPtr,
const char * src,
char * dst,
int srcSize,
int maxDstSize )

◆ LZ4_compress_HC_continue_destSize()

LZ4LIB_API int LZ4_compress_HC_continue_destSize ( LZ4_streamHC_t * LZ4_streamHCPtr,
const char * src,
char * dst,
int * srcSizePtr,
int targetDstSize )

LZ4_compress_HC_continue_destSize() : v1.9.0+ Similar to LZ4_compress_HC_continue(), but will read as much data as possible from src to fit into targetDstSize budget. Result is provided into 2 parts :

Returns
: the number of bytes written into 'dst' (necessarily <= targetDstSize) or 0 if compression fails. srcSizePtr : on success, *srcSizePtr will be updated to indicate how much bytes were read from src. Note that this function may not consume the entire input.

◆ LZ4_compress_HC_destSize()

LZ4LIB_API int LZ4_compress_HC_destSize ( void * stateHC,
const char * src,
char * dst,
int * srcSizePtr,
int targetDstSize,
int compressionLevel )

LZ4_compress_HC_destSize() : v1.9.0+ Will compress as much data as possible from src to fit into targetDstSize budget. Result is provided in 2 parts :

Returns
: the number of bytes written into 'dst' (necessarily <= targetDstSize) or 0 if compression fails. srcSizePtr : on success, *srcSizePtr is updated to indicate how much bytes were read from src

◆ LZ4_compress_HC_extStateHC()

LZ4LIB_API int LZ4_compress_HC_extStateHC ( void * stateHC,
const char * src,
char * dst,
int srcSize,
int maxDstSize,
int compressionLevel )

◆ LZ4_createStreamHC()

LZ4LIB_API LZ4_streamHC_t * LZ4_createStreamHC ( void )

LZ4_createStreamHC() and LZ4_freeStreamHC() : These functions create and release memory for LZ4 HC streaming state. Newly created states are automatically initialized. A same state can be used multiple times consecutively, starting with LZ4_resetStreamHC_fast() to start a new stream of blocks.

◆ LZ4_DEPRECATED() [1/7]

LZ4_DEPRECATED ( "use LZ4_compress_HC() instead" ) const

◆ LZ4_DEPRECATED() [2/7]

LZ4_DEPRECATED ( "use LZ4_compress_HC_continue() instead" )

◆ LZ4_DEPRECATED() [3/7]

LZ4_DEPRECATED ( "use LZ4_compress_HC_extStateHC() instead" )

◆ LZ4_DEPRECATED() [4/7]

LZ4_DEPRECATED ( "use LZ4_createStreamHC() instead" ) const

◆ LZ4_DEPRECATED() [5/7]

LZ4_DEPRECATED ( "use LZ4_freeStreamHC() instead" )

◆ LZ4_DEPRECATED() [6/7]

LZ4_DEPRECATED ( "use LZ4_initStreamHC() instead" )

◆ LZ4_DEPRECATED() [7/7]

LZ4_DEPRECATED ( "use LZ4_saveDictHC() instead" )

◆ LZ4_freeStreamHC()

LZ4LIB_API int LZ4_freeStreamHC ( LZ4_streamHC_t * streamHCPtr)

◆ LZ4_initStreamHC()

LZ4LIB_API LZ4_streamHC_t * LZ4_initStreamHC ( void * buffer,
size_t size )

◆ LZ4_loadDictHC()

LZ4LIB_API int LZ4_loadDictHC ( LZ4_streamHC_t * streamHCPtr,
const char * dictionary,
int dictSize )

◆ LZ4_resetStreamHC()

LZ4LIB_API void LZ4_resetStreamHC ( LZ4_streamHC_t * streamHCPtr,
int compressionLevel )

◆ LZ4_resetStreamHC_fast()

LZ4LIB_API void LZ4_resetStreamHC_fast ( LZ4_streamHC_t * streamHCPtr,
int compressionLevel )

◆ LZ4_saveDictHC()

LZ4LIB_API int LZ4_saveDictHC ( LZ4_streamHC_t * streamHCPtr,
char * safeBuffer,
int maxDictSize )

◆ LZ4_sizeofStateHC()

LZ4LIB_API int LZ4_sizeofStateHC ( void )

LZ4_compress_HC_extStateHC() : Same as LZ4_compress_HC(), but using an externally allocated memory segment for state. state size is provided by LZ4_sizeofStateHC(). Memory segment must be aligned on 8-bytes boundaries (which a normal malloc() should do properly).

Variable Documentation

◆ compressionLevel

const char char int int int compressionLevel

◆ dest

const char char* dest

◆ inputBuffer

char* inputBuffer

◆ inputSize

const char char int inputSize

◆ maxOutputSize

const char char int int maxOutputSize

◆ source

const char* source