123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771 |
- #if defined(__cplusplus)
- extern "C"
- {
- #endif
- #ifndef LZ4_H_2983827168210
- #define LZ4_H_2983827168210
- #include <common/stddef.h> /* size_t */
- #ifndef LZ4LIB_VISIBILITY
- #if defined(__GNUC__) && (__GNUC__ >= 4)
- #define LZ4LIB_VISIBILITY __attribute__((visibility("default")))
- #else
- #define LZ4LIB_VISIBILITY
- #endif
- #endif
- #if defined(LZ4_DLL_EXPORT) && (LZ4_DLL_EXPORT == 1)
- #define LZ4LIB_API __declspec(dllexport) LZ4LIB_VISIBILITY
- #elif defined(LZ4_DLL_IMPORT) && (LZ4_DLL_IMPORT == 1)
- #define LZ4LIB_API __declspec(dllimport) LZ4LIB_VISIBILITY
- #else
- #define LZ4LIB_API LZ4LIB_VISIBILITY
- #endif
- #define LZ4_VERSION_MAJOR 1
- #define LZ4_VERSION_MINOR 9
- #define LZ4_VERSION_RELEASE 3
- #define LZ4_VERSION_NUMBER (LZ4_VERSION_MAJOR * 100 * 100 + LZ4_VERSION_MINOR * 100 + LZ4_VERSION_RELEASE)
- #define LZ4_LIB_VERSION LZ4_VERSION_MAJOR.LZ4_VERSION_MINOR.LZ4_VERSION_RELEASE
- #define LZ4_QUOTE(str) #str
- #define LZ4_EXPAND_AND_QUOTE(str) LZ4_QUOTE(str)
- #define LZ4_VERSION_STRING LZ4_EXPAND_AND_QUOTE(LZ4_LIB_VERSION)
- LZ4LIB_API int LZ4_versionNumber(void);
- LZ4LIB_API const char *LZ4_versionString(void);
- #ifndef LZ4_MEMORY_USAGE
- #define LZ4_MEMORY_USAGE 14
- #endif
-
-
- LZ4LIB_API int LZ4_compress_default(const char *src, char *dst, int srcSize, int dstCapacity);
-
- LZ4LIB_API int LZ4_decompress_safe(const char *src, char *dst, int compressedSize, int dstCapacity);
- #define LZ4_MAX_INPUT_SIZE 0x7E000000
- #define LZ4_COMPRESSBOUND(isize) ((unsigned)(isize) > (unsigned)LZ4_MAX_INPUT_SIZE ? 0 : (isize) + ((isize) / 255) + 16)
-
- LZ4LIB_API int LZ4_compressBound(int inputSize);
-
- LZ4LIB_API int LZ4_compress_fast(const char *src, char *dst, int srcSize, int dstCapacity, int acceleration);
-
- LZ4LIB_API int LZ4_sizeofState(void);
- LZ4LIB_API int LZ4_compress_fast_extState(void *state, const char *src, char *dst, int srcSize, int dstCapacity, int acceleration);
-
- LZ4LIB_API int LZ4_compress_destSize(const char *src, char *dst, int *srcSizePtr, int targetDstSize);
-
- LZ4LIB_API int LZ4_decompress_safe_partial(const char *src, char *dst, int srcSize, int targetOutputSize, int dstCapacity);
-
- typedef union LZ4_stream_u LZ4_stream_t;
- LZ4LIB_API LZ4_stream_t *LZ4_createStream(void);
- LZ4LIB_API int LZ4_freeStream(LZ4_stream_t *streamPtr);
-
- LZ4LIB_API void LZ4_resetStream_fast(LZ4_stream_t *streamPtr);
-
- LZ4LIB_API int LZ4_loadDict(LZ4_stream_t *streamPtr, const char *dictionary, 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_saveDict(LZ4_stream_t *streamPtr, char *safeBuffer, int maxDictSize);
-
- typedef union LZ4_streamDecode_u LZ4_streamDecode_t;
-
- LZ4LIB_API LZ4_streamDecode_t *LZ4_createStreamDecode(void);
- LZ4LIB_API int LZ4_freeStreamDecode(LZ4_streamDecode_t *LZ4_stream);
-
- LZ4LIB_API int LZ4_setStreamDecode(LZ4_streamDecode_t *LZ4_streamDecode, const char *dictionary, int dictSize);
-
- LZ4LIB_API int LZ4_decoderRingBufferSize(int maxBlockSize);
- #define LZ4_DECODER_RING_BUFFER_SIZE(maxBlockSize) (65536 + 14 + (maxBlockSize))
-
- LZ4LIB_API int LZ4_decompress_safe_continue(LZ4_streamDecode_t *LZ4_streamDecode, const char *src, char *dst, int srcSize, int dstCapacity);
-
- LZ4LIB_API int LZ4_decompress_safe_usingDict(const char *src, char *dst, int srcSize, int dstCapcity, const char *dictStart, int dictSize);
- #endif
-
-
- #ifdef LZ4_STATIC_LINKING_ONLY
- #ifndef LZ4_STATIC_3504398509
- #define LZ4_STATIC_3504398509
- #ifdef LZ4_PUBLISH_STATIC_FUNCTIONS
- #define LZ4LIB_STATIC_API LZ4LIB_API
- #else
- #define LZ4LIB_STATIC_API
- #endif
-
- LZ4LIB_STATIC_API int LZ4_compress_fast_extState_fastReset(void *state, const char *src, char *dst, int srcSize, int dstCapacity, int acceleration);
-
- LZ4LIB_STATIC_API void LZ4_attach_dictionary(LZ4_stream_t *workingStream, const LZ4_stream_t *dictionaryStream);
-
- #define LZ4_DECOMPRESS_INPLACE_MARGIN(compressedSize) (((compressedSize) >> 8) + 32)
- #define LZ4_DECOMPRESS_INPLACE_BUFFER_SIZE(decompressedSize) ((decompressedSize) + LZ4_DECOMPRESS_INPLACE_MARGIN(decompressedSize))
- #ifndef LZ4_DISTANCE_MAX
- #define LZ4_DISTANCE_MAX 65535
- #endif
- #define LZ4_COMPRESS_INPLACE_MARGIN (LZ4_DISTANCE_MAX + 32)
- #define LZ4_COMPRESS_INPLACE_BUFFER_SIZE(maxCompressedSize) ((maxCompressedSize) + LZ4_COMPRESS_INPLACE_MARGIN)
- #endif
- #endif
- #ifndef LZ4_H_98237428734687
- #define LZ4_H_98237428734687
- #define LZ4_HASHLOG (LZ4_MEMORY_USAGE - 2)
- #define LZ4_HASHTABLESIZE (1 << LZ4_MEMORY_USAGE)
- #define LZ4_HASH_SIZE_U32 (1 << LZ4_HASHLOG)
- #if defined(__cplusplus) || (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) )
- #include <stdint.h>
- typedef int8_t LZ4_i8;
- typedef uint8_t LZ4_byte;
- typedef uint16_t LZ4_u16;
- typedef uint32_t LZ4_u32;
- #else
- typedef signed char LZ4_i8;
- typedef unsigned char LZ4_byte;
- typedef unsigned short LZ4_u16;
- typedef unsigned int LZ4_u32;
- #endif
- typedef struct LZ4_stream_t_internal LZ4_stream_t_internal;
- struct LZ4_stream_t_internal
- {
- LZ4_u32 hashTable[LZ4_HASH_SIZE_U32];
- LZ4_u32 currentOffset;
- LZ4_u32 tableType;
- const LZ4_byte *dictionary;
- const LZ4_stream_t_internal *dictCtx;
- LZ4_u32 dictSize;
- };
- typedef struct
- {
- const LZ4_byte *externalDict;
- size_t extDictSize;
- const LZ4_byte *prefixEnd;
- size_t prefixSize;
- } LZ4_streamDecode_t_internal;
- #define LZ4_STREAMSIZE 16416
- #define LZ4_STREAMSIZE_VOIDP (LZ4_STREAMSIZE / sizeof(void *))
- union LZ4_stream_u
- {
- void *table[LZ4_STREAMSIZE_VOIDP];
- LZ4_stream_t_internal internal_donotuse;
- };
-
- LZ4LIB_API LZ4_stream_t *LZ4_initStream(void *buffer, size_t size);
- #define LZ4_STREAMDECODESIZE_U64 (4 + ((sizeof(void *) == 16) ? 2 : 0) )
- #define LZ4_STREAMDECODESIZE (LZ4_STREAMDECODESIZE_U64 * sizeof(unsigned long long))
- union LZ4_streamDecode_u
- {
- unsigned long long table[LZ4_STREAMDECODESIZE_U64];
- LZ4_streamDecode_t_internal internal_donotuse;
- };
- #ifdef LZ4_DISABLE_DEPRECATE_WARNINGS
- #define LZ4_DEPRECATED(message)
- #else
- #if defined(__cplusplus) && (__cplusplus >= 201402)
- #define LZ4_DEPRECATED(message) [[deprecated(message)]]
- #elif defined(_MSC_VER)
- #define LZ4_DEPRECATED(message) __declspec(deprecated(message))
- #elif defined(__clang__) || (defined(__GNUC__) && (__GNUC__ * 10 + __GNUC_MINOR__ >= 45))
- #define LZ4_DEPRECATED(message) __attribute__((deprecated(message)))
- #elif defined(__GNUC__) && (__GNUC__ * 10 + __GNUC_MINOR__ >= 31)
- #define LZ4_DEPRECATED(message) __attribute__((deprecated))
- #else
- #pragma message("WARNING: LZ4_DEPRECATED needs custom implementation for this compiler")
- #define LZ4_DEPRECATED(message)
- #endif
- #endif
-
- LZ4_DEPRECATED("use LZ4_compress_default() instead")
- LZ4LIB_API int LZ4_compress(const char *src, char *dest, int srcSize);
- LZ4_DEPRECATED("use LZ4_compress_default() instead")
- LZ4LIB_API int LZ4_compress_limitedOutput(const char *src, char *dest, int srcSize, int maxOutputSize);
- LZ4_DEPRECATED("use LZ4_compress_fast_extState() instead")
- LZ4LIB_API int LZ4_compress_withState(void *state, const char *source, char *dest, int inputSize);
- LZ4_DEPRECATED("use LZ4_compress_fast_extState() instead")
- LZ4LIB_API int LZ4_compress_limitedOutput_withState(void *state, const char *source, char *dest, int inputSize, int maxOutputSize);
- LZ4_DEPRECATED("use LZ4_compress_fast_continue() instead")
- LZ4LIB_API int LZ4_compress_continue(LZ4_stream_t *LZ4_streamPtr, const char *source, char *dest, int inputSize);
- LZ4_DEPRECATED("use LZ4_compress_fast_continue() instead")
- LZ4LIB_API int LZ4_compress_limitedOutput_continue(LZ4_stream_t *LZ4_streamPtr, const char *source, char *dest, int inputSize, int maxOutputSize);
-
- LZ4_DEPRECATED("use LZ4_decompress_fast() instead")
- LZ4LIB_API int LZ4_uncompress(const char *source, char *dest, int outputSize);
- LZ4_DEPRECATED("use LZ4_decompress_safe() instead")
- LZ4LIB_API int LZ4_uncompress_unknownOutputSize(const char *source, char *dest, int isize, int maxOutputSize);
-
- LZ4_DEPRECATED("Use LZ4_createStream() instead")
- LZ4LIB_API void *LZ4_create(char *inputBuffer);
- LZ4_DEPRECATED("Use LZ4_createStream() instead")
- LZ4LIB_API int LZ4_sizeofStreamState(void);
- LZ4_DEPRECATED("Use LZ4_resetStream() instead")
- LZ4LIB_API int LZ4_resetStreamState(void *state, char *inputBuffer);
- LZ4_DEPRECATED("Use LZ4_saveDict() instead")
- LZ4LIB_API char *LZ4_slideInputBuffer(void *state);
-
- LZ4_DEPRECATED("use LZ4_decompress_safe_usingDict() instead")
- LZ4LIB_API int LZ4_decompress_safe_withPrefix64k(const char *src, char *dst, int compressedSize, int maxDstSize);
- LZ4_DEPRECATED("use LZ4_decompress_fast_usingDict() instead")
- LZ4LIB_API int LZ4_decompress_fast_withPrefix64k(const char *src, char *dst, int originalSize);
-
- LZ4_DEPRECATED("This function is deprecated and unsafe. Consider using LZ4_decompress_safe() instead")
- LZ4LIB_API int LZ4_decompress_fast(const char *src, char *dst, int originalSize);
- LZ4_DEPRECATED("This function is deprecated and unsafe. Consider using LZ4_decompress_safe_continue() instead")
- LZ4LIB_API int LZ4_decompress_fast_continue(LZ4_streamDecode_t *LZ4_streamDecode, const char *src, char *dst, int originalSize);
- LZ4_DEPRECATED("This function is deprecated and unsafe. Consider using LZ4_decompress_safe_usingDict() instead")
- LZ4LIB_API int LZ4_decompress_fast_usingDict(const char *src, char *dst, int originalSize, const char *dictStart, int dictSize);
-
- LZ4LIB_API void LZ4_resetStream(LZ4_stream_t *streamPtr);
- #endif
- #if defined(__cplusplus)
- }
- #endif
|