35 #ifndef LZ4_H_2983827168210
36 #define LZ4_H_2983827168210
38 #if defined (__cplusplus)
76 #if defined(LZ4_DLL_EXPORT) && (LZ4_DLL_EXPORT==1)
77 # define LZ4LIB_API __declspec(dllexport)
78 #elif defined(LZ4_DLL_IMPORT) && (LZ4_DLL_IMPORT==1)
79 # define LZ4LIB_API __declspec(dllimport)
86 #define LZ4_VERSION_MAJOR 1
87 #define LZ4_VERSION_MINOR 7
88 #define LZ4_VERSION_RELEASE 5
90 #define LZ4_VERSION_NUMBER (LZ4_VERSION_MAJOR *100*100 + LZ4_VERSION_MINOR *100 + LZ4_VERSION_RELEASE)
92 #define LZ4_LIB_VERSION LZ4_VERSION_MAJOR.LZ4_VERSION_MINOR.LZ4_VERSION_RELEASE
93 #define LZ4_QUOTE(str) #str
94 #define LZ4_EXPAND_AND_QUOTE(str) LZ4_QUOTE(str)
95 #define LZ4_VERSION_STRING LZ4_EXPAND_AND_QUOTE(LZ4_LIB_VERSION)
111 #ifndef LZ4_MEMORY_USAGE
112 # define LZ4_MEMORY_USAGE 14
148 #define LZ4_MAX_INPUT_SIZE 0x7E000000
149 #define LZ4_COMPRESSBOUND(isize) ((unsigned)(isize) > (unsigned)LZ4_MAX_INPUT_SIZE ? 0 : (isize) + ((isize)/255) + 16)
330 #define LZ4_HASHLOG (LZ4_MEMORY_USAGE-2)
331 #define LZ4_HASHTABLESIZE (1 << LZ4_MEMORY_USAGE)
332 #define LZ4_HASH_SIZE_U32 (1 << LZ4_HASHLOG)
334 #if defined(__cplusplus) || (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) )
339 uint32_t currentOffset;
341 const uint8_t* dictionary;
342 uint8_t* bufferStart;
347 const uint8_t* externalDict;
349 const uint8_t* prefixEnd;
381 #define LZ4_STREAMSIZE_U64 ((1 << (LZ4_MEMORY_USAGE-3)) + 4)
382 #define LZ4_STREAMSIZE (LZ4_STREAMSIZE_U64 * sizeof(unsigned long long))
397 #define LZ4_STREAMDECODESIZE_U64 4
398 #define LZ4_STREAMDECODESIZE (LZ4_STREAMDECODESIZE_U64 * sizeof(unsigned long long))
415 #ifdef LZ4_DISABLE_DEPRECATE_WARNINGS
416 # define LZ4_DEPRECATED(message)
418 # define LZ4_GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__)
419 # if defined (__cplusplus) && (__cplusplus >= 201402)
420 # define LZ4_DEPRECATED(message) [[deprecated(message)]]
421 # elif (LZ4_GCC_VERSION >= 405) || defined(__clang__)
422 # define LZ4_DEPRECATED(message) __attribute__((deprecated(message)))
423 # elif (LZ4_GCC_VERSION >= 301)
424 # define LZ4_DEPRECATED(message) __attribute__((deprecated))
425 # elif defined(_MSC_VER)
426 # define LZ4_DEPRECATED(message) __declspec(deprecated(message))
428 # pragma message("WARNING: You need to implement LZ4_DEPRECATED for this compiler")
429 # define LZ4_DEPRECATED(message)
462 #if defined (__cplusplus)
char int int maxOutputSize
Definition: lz4.h:435
const unsigned char * prefixEnd
Definition: lz4.h:367
#define LZ4LIB_API
Introduction.
Definition: lz4.h:81
#define LZ4_HASH_SIZE_U32
Definition: lz4.h:332
unsigned long long table[LZ4_STREAMSIZE_U64]
Definition: lz4.h:384
LZ4LIB_API int LZ4_sizeofState(void)
LZ4LIB_API void LZ4_resetStream(LZ4_stream_t *streamPtr)
const unsigned char * dictionary
Definition: lz4.h:359
size_t prefixSize
Definition: lz4.h:368
#define LZ4_STREAMSIZE_U64
Definition: lz4.h:381
LZ4LIB_API int LZ4_decompress_safe_continue(LZ4_streamDecode_t *LZ4_streamDecode, const char *source, char *dest, int compressedSize, int maxDecompressedSize)
#define LZ4_STREAMDECODESIZE_U64
Definition: lz4.h:397
unsigned int initCheck
Definition: lz4.h:358
char * dst
Definition: lz4.h:458
char int int maxDstSize
Definition: lz4.h:458
LZ4LIB_API int LZ4_decompress_safe_partial(const char *source, char *dest, int compressedSize, int targetOutputSize, int maxDecompressedSize)
size_t extDictSize
Definition: lz4.h:366
char int compressedSize
Definition: lz4.h:458
char * inputBuffer
Definition: lz4.h:454
LZ4_stream_t_internal internal_donotuse
Definition: lz4.h:385
LZ4LIB_API int LZ4_decompress_fast_continue(LZ4_streamDecode_t *LZ4_streamDecode, const char *source, char *dest, int originalSize)
unsigned long long table[LZ4_STREAMDECODESIZE_U64]
Definition: lz4.h:400
char int originalSize
Definition: lz4.h:459
LZ4LIB_API int LZ4_compress_fast_extState(void *state, const char *source, char *dest, int inputSize, int maxDestSize, int acceleration)
#define LZ4_DEPRECATED(message)
Definition: lz4.h:429
char int sourceSize
Definition: lz4.h:434
LZ4LIB_API int LZ4_freeStream(LZ4_stream_t *streamPtr)
LZ4LIB_API LZ4_stream_t * LZ4_createStream(void)
LZ4LIB_API const char * LZ4_versionString(void)
library version string; to be used when checking dll version
unsigned int currentOffset
Definition: lz4.h:357
LZ4LIB_API int LZ4_compress_default(const char *source, char *dest, int sourceSize, int maxDestSize)
LZ4LIB_API int LZ4_compress_fast_continue(LZ4_stream_t *streamPtr, const char *src, char *dst, int srcSize, int maxDstSize, int acceleration)
LZ4LIB_API int LZ4_saveDict(LZ4_stream_t *streamPtr, char *safeBuffer, int dictSize)
const char * source
Definition: lz4.h:436
LZ4LIB_API int LZ4_decompress_fast_usingDict(const char *source, char *dest, int originalSize, const char *dictStart, int dictSize)
LZ4LIB_API int LZ4_versionNumber(void)
library version number; to be used when checking dll version
LZ4LIB_API int LZ4_compress_fast(const char *source, char *dest, int sourceSize, int maxDestSize, int acceleration)
LZ4_streamDecode_t_internal internal_donotuse
Definition: lz4.h:401
LZ4LIB_API int LZ4_compress_destSize(const char *source, char *dest, int *sourceSizePtr, int targetDestSize)
const char char int inputSize
Definition: lz4.h:436
LZ4LIB_API int LZ4_decompress_safe_usingDict(const char *source, char *dest, int compressedSize, int maxDecompressedSize, const char *dictStart, int dictSize)
LZ4LIB_API LZ4_streamDecode_t * LZ4_createStreamDecode(void)
LZ4LIB_API int LZ4_decompress_fast(const char *source, char *dest, int originalSize)
LZ4LIB_API int LZ4_loadDict(LZ4_stream_t *streamPtr, const char *dictionary, int dictSize)
LZ4LIB_API int LZ4_decompress_safe(const char *source, char *dest, int compressedSize, int maxDecompressedSize)
unsigned int dictSize
Definition: lz4.h:361
const unsigned char * externalDict
Definition: lz4.h:365
LZ4LIB_API int LZ4_setStreamDecode(LZ4_streamDecode_t *LZ4_streamDecode, const char *dictionary, int dictSize)
unsigned char * bufferStart
Definition: lz4.h:360
LZ4LIB_API int LZ4_freeStreamDecode(LZ4_streamDecode_t *LZ4_stream)
char * dest
Definition: lz4.h:434
LZ4LIB_API int LZ4_compressBound(int inputSize)