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)
336 #define LZ4_HASHLOG (LZ4_MEMORY_USAGE-2)
337 #define LZ4_HASHTABLESIZE (1 << LZ4_MEMORY_USAGE)
338 #define LZ4_HASH_SIZE_U32 (1 << LZ4_HASHLOG)
340 #if defined(__cplusplus) || (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) )
345 uint32_t currentOffset;
347 const uint8_t* dictionary;
348 uint8_t* bufferStart;
353 const uint8_t* externalDict;
355 const uint8_t* prefixEnd;
387 #define LZ4_STREAMSIZE_U64 ((1 << (LZ4_MEMORY_USAGE-3)) + 4)
388 #define LZ4_STREAMSIZE (LZ4_STREAMSIZE_U64 * sizeof(unsigned long long))
403 #define LZ4_STREAMDECODESIZE_U64 4
404 #define LZ4_STREAMDECODESIZE (LZ4_STREAMDECODESIZE_U64 * sizeof(unsigned long long))
421 #ifdef LZ4_DISABLE_DEPRECATE_WARNINGS
422 # define LZ4_DEPRECATED(message)
424 # define LZ4_GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__)
425 # if defined (__cplusplus) && (__cplusplus >= 201402)
426 # define LZ4_DEPRECATED(message) [[deprecated(message)]]
427 # elif (LZ4_GCC_VERSION >= 405) || defined(__clang__)
428 # define LZ4_DEPRECATED(message) __attribute__((deprecated(message)))
429 # elif (LZ4_GCC_VERSION >= 301)
430 # define LZ4_DEPRECATED(message) __attribute__((deprecated))
431 # elif defined(_MSC_VER)
432 # define LZ4_DEPRECATED(message) __declspec(deprecated(message))
434 # pragma message("WARNING: You need to implement LZ4_DEPRECATED for this compiler")
435 # define LZ4_DEPRECATED(message)
468 #if defined (__cplusplus)
char int int maxOutputSize
Definition: lz4.h:441
const unsigned char * prefixEnd
Definition: lz4.h:373
#define LZ4LIB_API
Introduction.
Definition: lz4.h:81
#define LZ4_HASH_SIZE_U32
Definition: lz4.h:338
unsigned long long table[LZ4_STREAMSIZE_U64]
Definition: lz4.h:390
LZ4LIB_API int LZ4_sizeofState(void)
LZ4LIB_API void LZ4_resetStream(LZ4_stream_t *streamPtr)
const unsigned char * dictionary
Definition: lz4.h:365
size_t prefixSize
Definition: lz4.h:374
#define LZ4_STREAMSIZE_U64
Definition: lz4.h:387
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:403
unsigned int initCheck
Definition: lz4.h:364
char * dst
Definition: lz4.h:464
char int int maxDstSize
Definition: lz4.h:464
LZ4LIB_API int LZ4_decompress_safe_partial(const char *source, char *dest, int compressedSize, int targetOutputSize, int maxDecompressedSize)
size_t extDictSize
Definition: lz4.h:372
char int compressedSize
Definition: lz4.h:464
char * inputBuffer
Definition: lz4.h:460
LZ4_stream_t_internal internal_donotuse
Definition: lz4.h:391
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:406
char int originalSize
Definition: lz4.h:465
LZ4LIB_API int LZ4_compress_fast_extState(void *state, const char *source, char *dest, int inputSize, int maxDestSize, int acceleration)
LZ4LIB_API int LZ4_decompress_fastStatic(const char *source, char *dest, int originalSize)
#define LZ4_DEPRECATED(message)
Definition: lz4.h:435
char int sourceSize
Definition: lz4.h:440
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:363
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:442
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:407
LZ4LIB_API int LZ4_compress_destSize(const char *source, char *dest, int *sourceSizePtr, int targetDestSize)
const char char int inputSize
Definition: lz4.h:442
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_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:367
const unsigned char * externalDict
Definition: lz4.h:371
LZ4LIB_API int LZ4_setStreamDecode(LZ4_streamDecode_t *LZ4_streamDecode, const char *dictionary, int dictSize)
unsigned char * bufferStart
Definition: lz4.h:366
LZ4LIB_API int LZ4_freeStreamDecode(LZ4_streamDecode_t *LZ4_stream)
char * dest
Definition: lz4.h:440
LZ4LIB_API int LZ4_compressBound(int inputSize)