Rizin
unix-like reverse engineering framework and cli tools
|
#include "lz4.h"
Go to the source code of this file.
Classes | |
struct | LZ4HC_CCtx_internal |
union | LZ4_streamHC_u |
Macros | |
#define | LZ4HC_CLEVEL_MIN 3 |
#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_STREAMHCSIZE 262200 /* static size, for inter-version compatibility */ |
#define | LZ4_STREAMHCSIZE_VOIDP (LZ4_STREAMHCSIZE / sizeof(void*)) |
Typedefs | |
typedef union LZ4_streamHC_u | LZ4_streamHC_t |
typedef struct LZ4HC_CCtx_internal | LZ4HC_CCtx_internal |
Variables | |
char * | dest |
char int | inputSize |
char int int | maxOutputSize |
char int int | compressionLevel |
const char * | source |
char * | inputBuffer |
#define LZ4_STREAMHCSIZE_VOIDP (LZ4_STREAMHCSIZE / sizeof(void*)) |
#define LZ4HC_HASH_MASK (LZ4HC_HASHTABLESIZE - 1) |
#define LZ4HC_HASHTABLESIZE (1 << LZ4HC_HASH_LOG) |
#define LZ4HC_MAXD (1<<LZ4HC_DICTIONARY_LOGSIZE) |
#define LZ4HC_MAXD_MASK (LZ4HC_MAXD - 1) |
typedef union LZ4_streamHC_u LZ4_streamHC_t |
typedef struct LZ4HC_CCtx_internal LZ4HC_CCtx_internal |
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.
Definition at line 954 of file lz4hc.c.
References ALLOC, compressionLevel, dst, FREEMEM, LZ4_compress_HC_extStateHC(), src, and srcSize.
Referenced by FUZ_test(), LLVMFuzzerTestOneInput(), local_LZ4_compress_HC(), LZ4_compressBlockNoStreamHC(), LZ4_compressHC(), LZ4_compressHC2(), LZ4_compressHC2_limitedOutput(), LZ4_compressHC_limitedOutput(), LZ4IO_compressFilename_Legacy(), and roundTripTest().
LZ4LIB_API int LZ4_compress_HC_continue | ( | LZ4_streamHC_t * | streamHCPtr, |
const char * | src, | ||
char * | dst, | ||
int | srcSize, | ||
int | maxDstSize | ||
) |
Definition at line 1138 of file lz4hc.c.
References dst, limitedOutput, LZ4_compressBound(), LZ4_compressHC_continue_generic(), notLimited, src, and srcSize.
Referenced by FUZ_test(), FUZ_unitTests(), local_LZ4_compress_HC_continue(), LZ4_compressBlockStreamHC(), LZ4_compressHC_continue(), LZ4_compressHC_limitedOutput_continue(), LZ4F_compressBlockHC(), LZ4F_compressBlockHC_continue(), state_extDictHCRoundTrip(), state_prefixHCRoundTrip(), and test_compress().
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 :
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. Definition at line 1146 of file lz4hc.c.
References dst, fillOutput, LZ4_compressHC_continue_generic(), and src.
Referenced by FUZ_test().
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 :
srcSizePtr
: on success, *srcSizePtr is updated to indicate how much bytes were read from src
Definition at line 970 of file lz4hc.c.
References dest, fillOutput, LZ4_initStreamHC(), LZ4_setCompressionLevel(), LZ4HC_compress_generic(), LZ4HC_init_internal(), NULL, and source.
Referenced by FUZ_test(), FUZ_unitTests(), and LLVMFuzzerTestOneInput().
LZ4LIB_API int LZ4_compress_HC_extStateHC | ( | void * | stateHC, |
const char * | src, | ||
char * | dst, | ||
int | srcSize, | ||
int | maxDstSize, | ||
int | compressionLevel | ||
) |
Definition at line 947 of file lz4hc.c.
References compressionLevel, dst, LZ4_compress_HC_extStateHC_fastReset(), LZ4_initStreamHC(), NULL, src, and srcSize.
Referenced by FUZ_test(), local_LZ4_compress_HC_extStateHC(), LZ4_compress_HC(), LZ4_compressHC2_limitedOutput_withStateHC(), LZ4_compressHC2_withStateHC(), LZ4_compressHC_limitedOutput_withStateHC(), and LZ4_compressHC_withStateHC().
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.
Definition at line 985 of file lz4hc.c.
References ALLOC_AND_ZERO, LZ4_setCompressionLevel(), LZ4HC_CLEVEL_DEFAULT, and NULL.
Referenced by FUZ_test(), FUZ_unitTests(), LZ4_compressInitStreamHC(), LZ4_createHC(), LZ4F_compressBegin_usingCDict(), LZ4F_createCDict(), state_attachDictHCRoundTrip(), and state_create().
LZ4_DEPRECATED | ( | "use LZ4_compress_HC() instead" | ) | const |
LZ4_DEPRECATED | ( | "use LZ4_compress_HC_continue() instead" | ) |
LZ4_DEPRECATED | ( | "use LZ4_compress_HC_extStateHC() instead" | ) |
LZ4_DEPRECATED | ( | "use LZ4_createStreamHC() instead" | ) | const |
LZ4_DEPRECATED | ( | "use LZ4_freeStreamHC() instead" | ) |
LZ4_DEPRECATED | ( | "use LZ4_initStreamHC() instead" | ) |
LZ4_DEPRECATED | ( | "use LZ4_saveDictHC() instead" | ) |
LZ4LIB_API int LZ4_freeStreamHC | ( | LZ4_streamHC_t * | streamHCPtr | ) |
Definition at line 994 of file lz4hc.c.
References DEBUGLOG, and FREEMEM.
Referenced by FUZ_test(), FUZ_unitTests(), LZ4_compressCleanupStreamHC(), LZ4F_freeCDict(), state_attachDictHCRoundTrip(), and state_free().
LZ4LIB_API LZ4_streamHC_t* LZ4_initStreamHC | ( | void * | buffer, |
size_t | size | ||
) |
Definition at line 1003 of file lz4hc.c.
References DEBUGLOG, LZ4_streamHC_u::internal_donotuse, LZ4_isAligned(), LZ4_setCompressionLevel(), LZ4_STATIC_ASSERT, LZ4_streamHC_t_alignment(), LZ4_STREAMHCSIZE, LZ4HC_CLEVEL_DEFAULT, MEM_INIT, and NULL.
Referenced by FUZ_unitTests(), local_LZ4_resetStreamHC(), LZ4_compress_HC_destSize(), LZ4_compress_HC_extStateHC(), LZ4_loadDictHC(), LZ4_resetStreamHC(), LZ4_resetStreamHC_fast(), LZ4_resetStreamStateHC(), and LZ4F_compressBegin_usingCDict().
LZ4LIB_API int LZ4_loadDictHC | ( | LZ4_streamHC_t * | streamHCPtr, |
const char * | dictionary, | ||
int | dictSize | ||
) |
Definition at line 1056 of file lz4hc.c.
References assert(), LZ4HC_CCtx_internal::compressionLevel, DEBUGLOG, LZ4HC_CCtx_internal::end, LZ4_streamHC_u::internal_donotuse, KB, LZ4_initStreamHC(), LZ4_setCompressionLevel(), LZ4HC_init_internal(), LZ4HC_Insert(), and NULL.
Referenced by fullSpeedBench(), FUZ_test(), FUZ_unitTests(), LZ4_compressHC_continue_generic(), LZ4_compressInitStreamHC(), LZ4F_createCDict(), state_attachDictHCRoundTrip(), and state_loadDictHCRoundTrip().
LZ4LIB_API void LZ4_resetStreamHC | ( | LZ4_streamHC_t * | streamHCPtr, |
int | compressionLevel | ||
) |
Definition at line 1021 of file lz4hc.c.
References compressionLevel, LZ4_initStreamHC(), and LZ4_setCompressionLevel().
Referenced by FUZ_unitTests().
LZ4LIB_API void LZ4_resetStreamHC_fast | ( | LZ4_streamHC_t * | streamHCPtr, |
int | compressionLevel | ||
) |
Definition at line 1027 of file lz4hc.c.
References LZ4HC_CCtx_internal::base, compressionLevel, DEBUGLOG, LZ4HC_CCtx_internal::dictCtx, LZ4HC_CCtx_internal::dirty, LZ4HC_CCtx_internal::end, LZ4_streamHC_u::internal_donotuse, LZ4_initStreamHC(), LZ4_setCompressionLevel(), and NULL.
Referenced by FUZ_test(), FUZ_unitTests(), LZ4_compress_HC_extStateHC_fastReset(), LZ4_compressResetStreamHC(), LZ4_slideInputBufferHC(), LZ4F_initStream(), and state_reset().
LZ4LIB_API int LZ4_saveDictHC | ( | LZ4_streamHC_t * | streamHCPtr, |
char * | safeBuffer, | ||
int | maxDictSize | ||
) |
Definition at line 1158 of file lz4hc.c.
References assert(), LZ4HC_CCtx_internal::base, DEBUGLOG, LZ4HC_CCtx_internal::dictLimit, LZ4HC_CCtx_internal::end, int, LZ4_streamHC_u::internal_donotuse, KB, LZ4HC_CCtx_internal::lowLimit, LZ4HC_CCtx_internal::nextToUpdate, NULL, and U32.
Referenced by FUZ_unitTests(), local_LZ4_saveDictHC(), and LZ4F_localSaveDict().
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).
Definition at line 921 of file lz4hc.c.
Referenced by FUZ_test(), and LLVMFuzzerTestOneInput().
Definition at line 258 of file lz4hc.h.
Referenced by FUZ_test(), FUZ_unitTests(), LZ4_compress_HC(), LZ4_compress_HC_extStateHC(), LZ4_compress_HC_extStateHC_fastReset(), LZ4_resetStreamHC(), LZ4_resetStreamHC_fast(), LZ4_setCompressionLevel(), LZ4IO_compressFilename(), LZ4IO_compressFilename_extRess(), LZ4IO_compressMultipleFilenames(), and LZ4IO_compressMultipleFilenames_Legacy().