37 #if defined (__cplusplus)
41 #ifndef ATOMS_LZ4_H_2983827168210
42 #define ATOMS_LZ4_H_2983827168210
87 #ifndef ATOMS_LZ4LIB_VISIBILITY
88 # if defined(__GNUC__) && (__GNUC__ >= 4)
89 # define ATOMS_LZ4LIB_VISIBILITY __attribute__ ((visibility ("default")))
91 # define ATOMS_LZ4LIB_VISIBILITY
94 #if defined(ATOMS_LZ4_DLL_EXPORT) && (ATOMS_LZ4_DLL_EXPORT==1)
95 # define ATOMS_LZ4LIB_API __declspec(dllexport) ATOMS_LZ4LIB_VISIBILITY
96 #elif defined(ATOMS_LZ4_DLL_IMPORT) && (ATOMS_LZ4_DLL_IMPORT==1)
97 # define ATOMS_LZ4LIB_API __declspec(dllimport) ATOMS_LZ4LIB_VISIBILITY
99 # define ATOMS_LZ4LIB_API ATOMS_LZ4LIB_VISIBILITY
103 #define ATOMS_LZ4_VERSION_MAJOR 1
104 #define ATOMS_LZ4_VERSION_MINOR 9
105 #define ATOMS_LZ4_VERSION_RELEASE 2
107 #define ATOMS_LZ4_VERSION_NUMBER (ATOMS_LZ4_VERSION_MAJOR *100*100 + ATOMS_LZ4_VERSION_MINOR *100 + ATOMS_LZ4_VERSION_RELEASE)
109 #define ATOMS_LZ4_LIB_VERSION ATOMS_LZ4_VERSION_MAJOR.ATOMS_LZ4_VERSION_MINOR.ATOMS_LZ4_VERSION_RELEASE
110 #define ATOMS_LZ4_QUOTE(str) #str
111 #define ATOMS_LZ4_EXPAND_AND_QUOTE(str) ATOMS_LZ4_QUOTE(str)
112 #define ATOMS_LZ4_VERSION_STRING ATOMS_LZ4_EXPAND_AND_QUOTE(ATOMS_LZ4_LIB_VERSION)
114 ATOMS_LZ4LIB_API
int ATOMS_LZ4_versionNumber(
void);
115 ATOMS_LZ4LIB_API
const char* ATOMS_LZ4_versionString(
void);
128 #ifndef ATOMS_LZ4_MEMORY_USAGE
129 # define ATOMS_LZ4_MEMORY_USAGE 14
150 ATOMS_LZ4LIB_API
int ATOMS_LZ4_compress_default(
const char* src,
char* dst,
int srcSize,
int dstCapacity);
166 ATOMS_LZ4LIB_API
int ATOMS_LZ4_decompress_safe(
const char* src,
char* dst,
int compressedSize,
int dstCapacity);
172 #define ATOMS_LZ4_MAX_INPUT_SIZE 0x7E000000
173 #define ATOMS_LZ4_COMPRESSBOUND(isize) ((unsigned)(isize) > (unsigned)ATOMS_LZ4_MAX_INPUT_SIZE ? 0 : (isize) + ((isize)/255) + 16)
184 ATOMS_LZ4LIB_API
int ATOMS_LZ4_compressBound(
int inputSize);
193 ATOMS_LZ4LIB_API
int ATOMS_LZ4_compress_fast(
const char* src,
char* dst,
int srcSize,
int dstCapacity,
int acceleration);
202 ATOMS_LZ4LIB_API
int ATOMS_LZ4_sizeofState(
void);
203 ATOMS_LZ4LIB_API
int ATOMS_LZ4_compress_fast_extState(
void* state,
const char* src,
char* dst,
int srcSize,
int dstCapacity,
int acceleration);
218 ATOMS_LZ4LIB_API
int ATOMS_LZ4_compress_destSize(
const char* src,
char* dst,
int* srcSizePtr,
int targetDstSize);
245 ATOMS_LZ4LIB_API
int ATOMS_LZ4_decompress_safe_partial(
const char* src,
char* dst,
int srcSize,
int targetOutputSize,
int dstCapacity);
291 ATOMS_LZ4LIB_API
int ATOMS_LZ4_loadDict(
ATOMS_LZ4_stream_t* streamPtr,
const char* dictionary,
int dictSize);
316 ATOMS_LZ4LIB_API
int ATOMS_LZ4_compress_fast_continue(
ATOMS_LZ4_stream_t* streamPtr,
const char* src,
char* dst,
int srcSize,
int dstCapacity,
int acceleration);
325 ATOMS_LZ4LIB_API
int ATOMS_LZ4_saveDict(
ATOMS_LZ4_stream_t* streamPtr,
char* safeBuffer,
int maxDictSize);
348 ATOMS_LZ4LIB_API
int ATOMS_LZ4_setStreamDecode(
ATOMS_LZ4_streamDecode_t* ATOMS_LZ4_streamDecode,
const char* dictionary,
int dictSize);
361 ATOMS_LZ4LIB_API
int ATOMS_LZ4_decoderRingBufferSize(
int maxBlockSize);
362 #define ATOMS_LZ4_DECODER_RING_BUFFER_SIZE(maxBlockSize) (65536 + 14 + (maxBlockSize))
389 ATOMS_LZ4LIB_API
int ATOMS_LZ4_decompress_safe_continue(
ATOMS_LZ4_streamDecode_t* ATOMS_LZ4_streamDecode,
const char* src,
char* dst,
int srcSize,
int dstCapacity);
400 ATOMS_LZ4LIB_API
int ATOMS_LZ4_decompress_safe_usingDict(
const char* src,
char* dst,
int srcSize,
int dstCapcity,
const char* dictStart,
int dictSize);
429 #ifdef ATOMS_LZ4_STATIC_LINKING_ONLY
431 #ifndef ATOMS_LZ4_STATIC_3504398509
432 #define ATOMS_LZ4_STATIC_3504398509
434 #ifdef ATOMS_LZ4_PUBLISH_STATIC_FUNCTIONS
435 #define ATOMS_LZ4LIB_STATIC_API ATOMS_LZ4LIB_API
437 #define ATOMS_LZ4LIB_STATIC_API
451 ATOMS_LZ4LIB_STATIC_API
int ATOMS_LZ4_compress_fast_extState_fastReset(
void* state,
const char* src,
char* dst,
int srcSize,
int dstCapacity,
int acceleration);
533 #define ATOMS_LZ4_DECOMPRESS_INPLACE_MARGIN(compressedSize) (((compressedSize) >> 8) + 32)
534 #define ATOMS_LZ4_DECOMPRESS_INPLACE_BUFFER_SIZE(decompressedSize) ((decompressedSize) + ATOMS_LZ4_DECOMPRESS_INPLACE_MARGIN(decompressedSize))
536 #ifndef ATOMS_LZ4_DISTANCE_MAX
537 # define ATOMS_LZ4_DISTANCE_MAX 65535
540 #define ATOMS_LZ4_COMPRESS_INPLACE_MARGIN (ATOMS_LZ4_DISTANCE_MAX + 32)
541 #define ATOMS_LZ4_COMPRESS_INPLACE_BUFFER_SIZE(maxCompressedSize) ((maxCompressedSize) + ATOMS_LZ4_COMPRESS_INPLACE_MARGIN)
548 #ifndef ATOMS_LZ4_H_98237428734687
549 #define ATOMS_LZ4_H_98237428734687
558 #define ATOMS_LZ4_HASHLOG (ATOMS_LZ4_MEMORY_USAGE-2)
559 #define ATOMS_LZ4_HASHTABLESIZE (1 << ATOMS_LZ4_MEMORY_USAGE)
560 #define ATOMS_LZ4_HASH_SIZE_U32 (1 << ATOMS_LZ4_HASHLOG)
562 #if defined(__cplusplus) || (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) )
567 uint32_t hashTable[ATOMS_LZ4_HASH_SIZE_U32];
568 uint32_t currentOffset;
571 const uint8_t* dictionary;
577 const uint8_t* externalDict;
579 const uint8_t* prefixEnd;
587 unsigned int hashTable[ATOMS_LZ4_HASH_SIZE_U32];
588 unsigned int currentOffset;
589 unsigned short dirty;
590 unsigned short tableType;
591 const unsigned char* dictionary;
593 unsigned int dictSize;
597 const unsigned char* externalDict;
598 const unsigned char* prefixEnd;
614 #define ATOMS_LZ4_STREAMSIZE_U64 ((1 << (ATOMS_LZ4_MEMORY_USAGE-3)) + 4 + ((sizeof(void*)==16) ? 4 : 0) )
615 #define ATOMS_LZ4_STREAMSIZE (ATOMS_LZ4_STREAMSIZE_U64 * sizeof(unsigned long long))
617 unsigned long long table[ATOMS_LZ4_STREAMSIZE_U64];
645 #define ATOMS_LZ4_STREAMDECODESIZE_U64 (4 + ((sizeof(void*)==16) ? 2 : 0) )
646 #define ATOMS_LZ4_STREAMDECODESIZE (ATOMS_LZ4_STREAMDECODESIZE_U64 * sizeof(unsigned long long))
648 unsigned long long table[ATOMS_LZ4_STREAMDECODESIZE_U64];
669 # define ATOMS_LZ4_DEPRECATED(message)
672 ATOMS_LZ4_DEPRECATED(
"use ATOMS_LZ4_compress_default() instead") ATOMS_LZ4LIB_API
int ATOMS_LZ4_compress(const
char* src,
char* dest,
int srcSize);
673 ATOMS_LZ4_DEPRECATED("use ATOMS_LZ4_compress_default() instead") ATOMS_LZ4LIB_API
int ATOMS_LZ4_compress_limitedOutput(const
char* src,
char* dest,
int srcSize,
int maxOutputSize);
674 ATOMS_LZ4_DEPRECATED("use ATOMS_LZ4_compress_fast_extState() instead") ATOMS_LZ4LIB_API
int ATOMS_LZ4_compress_withState(
void* state, const
char* source,
char* dest,
int inputSize);
675 ATOMS_LZ4_DEPRECATED("use ATOMS_LZ4_compress_fast_extState() instead") ATOMS_LZ4LIB_API
int ATOMS_LZ4_compress_limitedOutput_withState(
void* state, const
char* source,
char* dest,
int inputSize,
int maxOutputSize);
676 ATOMS_LZ4_DEPRECATED("use ATOMS_LZ4_compress_fast_continue() instead") ATOMS_LZ4LIB_API
int ATOMS_LZ4_compress_continue(
ATOMS_LZ4_stream_t* ATOMS_LZ4_streamPtr, const
char* source,
char* dest,
int inputSize);
677 ATOMS_LZ4_DEPRECATED("use ATOMS_LZ4_compress_fast_continue() instead") ATOMS_LZ4LIB_API
int ATOMS_LZ4_compress_limitedOutput_continue(
ATOMS_LZ4_stream_t* ATOMS_LZ4_streamPtr, const
char* source,
char* dest,
int inputSize,
int maxOutputSize);
680 ATOMS_LZ4_DEPRECATED("use ATOMS_LZ4_decompress_fast() instead") ATOMS_LZ4LIB_API
int ATOMS_LZ4_uncompress(const
char* source,
char* dest,
int outputSize);
681 ATOMS_LZ4_DEPRECATED("use ATOMS_LZ4_decompress_safe() instead") ATOMS_LZ4LIB_API
int ATOMS_LZ4_uncompress_unknownOutputSize(const
char* source,
char* dest,
int isize,
int maxOutputSize);
692 ATOMS_LZ4_DEPRECATED("Use ATOMS_LZ4_createStream() instead") ATOMS_LZ4LIB_API
void* ATOMS_LZ4_create(
char* inputBuffer);
693 ATOMS_LZ4_DEPRECATED("Use ATOMS_LZ4_createStream() instead") ATOMS_LZ4LIB_API
int ATOMS_LZ4_sizeofStreamState(
void);
694 ATOMS_LZ4_DEPRECATED("Use ATOMS_LZ4_resetStream() instead") ATOMS_LZ4LIB_API
int ATOMS_LZ4_resetStreamState(
void* state,
char* inputBuffer);
695 ATOMS_LZ4_DEPRECATED("Use ATOMS_LZ4_saveDict() instead") ATOMS_LZ4LIB_API
char* ATOMS_LZ4_slideInputBuffer(
void* state);
698 ATOMS_LZ4_DEPRECATED("use ATOMS_LZ4_decompress_safe_usingDict() instead") ATOMS_LZ4LIB_API
int ATOMS_LZ4_decompress_safe_withPrefix64k(const
char* src,
char* dst,
int compressedSize,
int maxDstSize);
699 ATOMS_LZ4_DEPRECATED("use ATOMS_LZ4_decompress_fast_usingDict() instead") ATOMS_LZ4LIB_API
int ATOMS_LZ4_decompress_fast_withPrefix64k(const
char* src,
char* dst,
int originalSize);
729 ATOMS_LZ4_DEPRECATED("This function is deprecated and unsafe. Consider using ATOMS_LZ4_decompress_safe() instead")
730 ATOMS_LZ4LIB_API
int ATOMS_LZ4_decompress_fast(const
char* src,
char* dst,
int originalSize);
731 ATOMS_LZ4_DEPRECATED("This function is deprecated and unsafe. Consider using ATOMS_LZ4_decompress_safe_continue() instead")
732 ATOMS_LZ4LIB_API
int ATOMS_LZ4_decompress_fast_continue(
ATOMS_LZ4_streamDecode_t* ATOMS_LZ4_streamDecode, const
char* src,
char* dst,
int originalSize);
733 ATOMS_LZ4_DEPRECATED("This function is deprecated and unsafe. Consider using ATOMS_LZ4_decompress_safe_usingDict() instead")
734 ATOMS_LZ4LIB_API
int ATOMS_LZ4_decompress_fast_usingDict(const
char* src,
char* dst,
int originalSize, const
char* dictStart,
int dictSize);
748 #if defined (__cplusplus)
Definition: Compression.h:586
Definition: Compression.h:596
Definition: Compression.h:616
Definition: Compression.h:647