35 #if defined(__cplusplus)
39 #ifndef LZ4_H_2983827168210
40 #define LZ4_H_2983827168210
80 #ifndef LZ4LIB_VISIBILITY
81 #if defined(__GNUC__) && (__GNUC__ >= 4)
82 #define LZ4LIB_VISIBILITY __attribute__((visibility("default")))
84 #define LZ4LIB_VISIBILITY
87 #if defined(LZ4_DLL_EXPORT) && (LZ4_DLL_EXPORT == 1)
88 #define LZ4LIB_API __declspec(dllexport) LZ4LIB_VISIBILITY
89 #elif defined(LZ4_DLL_IMPORT) && (LZ4_DLL_IMPORT == 1)
91 __declspec(dllimport) \
96 #define LZ4LIB_API LZ4LIB_VISIBILITY
100 #define LZ4_VERSION_MAJOR 1
101 #define LZ4_VERSION_MINOR \
104 #define LZ4_VERSION_RELEASE 2
106 #define LZ4_VERSION_NUMBER \
107 (LZ4_VERSION_MAJOR * 100 * 100 + LZ4_VERSION_MINOR * 100 + \
110 #define LZ4_LIB_VERSION LZ4_VERSION_MAJOR.LZ4_VERSION_MINOR.LZ4_VERSION_RELEASE
111 #define LZ4_QUOTE(str) #str
112 #define LZ4_EXPAND_AND_QUOTE(str) LZ4_QUOTE(str)
113 #define LZ4_VERSION_STRING LZ4_EXPAND_AND_QUOTE(LZ4_LIB_VERSION)
131 #ifndef LZ4_MEMORY_USAGE
132 #define LZ4_MEMORY_USAGE 14
164 int compressedSize,
int dstCapacity);
169 #define LZ4_MAX_INPUT_SIZE 0x7E000000
170 #define LZ4_COMPRESSBOUND(isize) \
171 ((unsigned)(isize) > (unsigned)LZ4_MAX_INPUT_SIZE \
173 : (isize) + ((isize) / 255) + 16)
199 int dstCapacity,
int acceleration);
210 char *dst,
int srcSize,
211 int dstCapacity,
int acceleration);
225 int *srcSizePtr,
int targetDstSize);
261 int srcSize,
int targetOutputSize,
310 const char *src,
char *dst,
311 int srcSize,
int dstCapacity,
347 const char *dictionary,
int dictSize);
361 #define LZ4_DECODER_RING_BUFFER_SIZE(mbs) \
398 const char *src,
char *dst,
int srcSize,
402 const char *src,
char *dst,
int originalSize);
412 int srcSize,
int dstCapcity,
413 const char *dictStart,
417 const char *dictStart,
433 #ifdef LZ4_STATIC_LINKING_ONLY
480 const char *src,
char *dst,
524 #define LZ4_HASHLOG (LZ4_MEMORY_USAGE - 2)
525 #define LZ4_HASHTABLESIZE (1 << LZ4_MEMORY_USAGE)
526 #define LZ4_HASH_SIZE_U32 \
529 #if defined(__cplusplus) || \
530 (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) )
545 const uint8_t *externalDict;
547 const uint8_t *prefixEnd;
565 const unsigned char *externalDict;
567 const unsigned char *prefixEnd;
581 #define LZ4_STREAMSIZE_U64 ((1 << (LZ4_MEMORY_USAGE - 3)) + 4)
582 #define LZ4_STREAMSIZE (LZ4_STREAMSIZE_U64 * sizeof(unsigned long long))
596 #define LZ4_STREAMDECODESIZE_U64 4
597 #define LZ4_STREAMDECODESIZE \
598 (LZ4_STREAMDECODESIZE_U64 * sizeof(unsigned long long))
614 #ifdef LZ4_DISABLE_DEPRECATE_WARNINGS
615 #define LZ4_DEPRECATED(message)
617 #define LZ4_GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__)
618 #if defined(__cplusplus) && (__cplusplus >= 201402)
619 #define LZ4_DEPRECATED(message) [[deprecated(message)]]
620 #elif (LZ4_GCC_VERSION >= 405) || defined(__clang__)
621 #define LZ4_DEPRECATED(message) __attribute__((deprecated(message)))
622 #elif (LZ4_GCC_VERSION >= 301)
623 #define LZ4_DEPRECATED(message) __attribute__((deprecated))
624 #elif defined(_MSC_VER)
625 #define LZ4_DEPRECATED(message) __declspec(deprecated(message))
628 "WARNING: You need to implement LZ4_DEPRECATED for this compiler")
629 #define LZ4_DEPRECATED(message)
638 int sourceSize,
int maxOutputSize);
641 char *dest,
int inputSize);
645 char *dest,
int inputSize,
650 char *dest,
int inputSize);
654 const
char *source,
char *dest,
655 int inputSize,
int maxOutputSize);
662 int isize,
int maxOutputSize);
686 int compressedSize,
int maxDstSize);
693 #if defined(__cplusplus)
void LZ4_resetStream_fast(LZ4_stream_t *ctx)
void LZ4_attach_dictionary(LZ4_stream_t *working_stream, const LZ4_stream_t *dictionary_stream)
int LZ4_compress_fast_extState_fastReset(void *state, const char *src, char *dst, int srcSize, int dstCapacity, int acceleration)
LZ4LIB_API int LZ4_decompress_fast_usingDict(const char *src, char *dst, int originalSize, const char *dictStart, int dictSize)
LZ4LIB_API int LZ4_compress_fast_continue(LZ4_stream_t *streamPtr, const char *src, char *dst, int srcSize, int dstCapacity, int acceleration)
LZ4LIB_API int LZ4_decompress_safe_usingDict(const char *src, char *dst, int srcSize, int dstCapcity, const char *dictStart, int dictSize)
LZ4LIB_API char * LZ4_slideInputBuffer(void *state)
LZ4LIB_API int LZ4_compress_fast(const char *src, char *dst, int srcSize, int dstCapacity, int acceleration)
LZ4LIB_API int LZ4_decoderRingBufferSize(int maxBlockSize)
LZ4LIB_API int LZ4_freeStreamDecode(LZ4_streamDecode_t *LZ4_stream)
LZ4LIB_API int LZ4_decompress_fast_continue(LZ4_streamDecode_t *LZ4_streamDecode, const char *src, char *dst, int originalSize)
#define LZ4_STREAMDECODESIZE_U64
LZ4LIB_API const char * LZ4_versionString(void)
LZ4LIB_API int LZ4_decompress_safe_withPrefix64k(const char *src, char *dst, int compressedSize, int maxDstSize)
LZ4LIB_API int LZ4_saveDict(LZ4_stream_t *streamPtr, char *safeBuffer, int maxDictSize)
LZ4LIB_API int LZ4_versionNumber(void)
LZ4LIB_API LZ4_streamDecode_t * LZ4_createStreamDecode(void)
LZ4LIB_API void * LZ4_create(char *inputBuffer)
LZ4LIB_API int LZ4_uncompress(const char *source, char *dest, int outputSize)
LZ4LIB_API int LZ4_compress(const char *source, char *dest, int sourceSize)
LZ4LIB_API int LZ4_sizeofState(void)
LZ4LIB_API int LZ4_compress_limitedOutput(const char *source, char *dest, int sourceSize, int maxOutputSize)
#define LZ4_HASH_SIZE_U32
LZ4LIB_API int LZ4_compressBound(int inputSize)
LZ4LIB_API int LZ4_decompress_safe(const char *src, char *dst, int compressedSize, int dstCapacity)
LZ4LIB_API int LZ4_compress_continue(LZ4_stream_t *LZ4_streamPtr, const char *source, char *dest, int inputSize)
LZ4LIB_API int LZ4_resetStreamState(void *state, char *inputBuffer)
LZ4LIB_API int LZ4_setStreamDecode(LZ4_streamDecode_t *LZ4_streamDecode, const char *dictionary, int dictSize)
LZ4LIB_API int LZ4_freeStream(LZ4_stream_t *streamPtr)
LZ4LIB_API int LZ4_compress_limitedOutput_withState(void *state, const char *source, char *dest, int inputSize, int maxOutputSize)
LZ4LIB_API int LZ4_uncompress_unknownOutputSize(const char *source, char *dest, int isize, int maxOutputSize)
LZ4LIB_API int LZ4_compress_fast_extState(void *state, const char *src, char *dst, int srcSize, int dstCapacity, int acceleration)
LZ4LIB_API int LZ4_decompress_safe_partial(const char *src, char *dst, int srcSize, int targetOutputSize, int dstCapacity)
LZ4LIB_API int LZ4_decompress_fast_withPrefix64k(const char *src, char *dst, int originalSize)
LZ4LIB_API int LZ4_compress_limitedOutput_continue(LZ4_stream_t *LZ4_streamPtr, const char *source, char *dest, int inputSize, int maxOutputSize)
LZ4LIB_API int LZ4_loadDict(LZ4_stream_t *streamPtr, const char *dictionary, int dictSize)
LZ4LIB_API int LZ4_decompress_safe_continue(LZ4_streamDecode_t *LZ4_streamDecode, const char *src, char *dst, int srcSize, int dstCapacity)
LZ4LIB_API void LZ4_resetStream(LZ4_stream_t *streamPtr)
#define LZ4_STREAMSIZE_U64
LZ4LIB_API int LZ4_compress_destSize(const char *src, char *dst, int *srcSizePtr, int targetDstSize)
LZ4LIB_API int LZ4_decompress_fast(const char *src, char *dst, int originalSize)
LZ4LIB_API int LZ4_compress_default(const char *src, char *dst, int srcSize, int dstCapacity)
LZ4LIB_API LZ4_stream_t * LZ4_createStream(void)
LZ4LIB_API int LZ4_sizeofStreamState(void)
LZ4LIB_API int LZ4_compress_withState(void *state, const char *source, char *dest, int inputSize)
#define LZ4_DEPRECATED(message)
const LZ4_stream_t_internal * dictCtx
unsigned int currentOffset
unsigned int hashTable[LZ4_HASH_SIZE_U32]
const unsigned char * dictionary
LZ4_streamDecode_t_internal internal_donotuse
unsigned long long table[LZ4_STREAMDECODESIZE_U64]
LZ4_stream_t_internal internal_donotuse
unsigned long long table[LZ4_STREAMSIZE_U64]