39 # ifdef nx_oss_lz4_EXPORTS
40 # define LZ4_API __declspec(dllexport)
42 # define LZ4_API __declspec(dllimport)
44 #elif defined(__linux__) || defined(__FreeBSD__) || defined(__APPLE__)
45 # define LZ4_API __attribute__((visibility("default")))
51 #if defined (__cplusplus)
64 #define LZ4_VERSION_MAJOR 1
65 #define LZ4_VERSION_MINOR 7
66 #define LZ4_VERSION_RELEASE 0
67 #define LZ4_VERSION_NUMBER (LZ4_VERSION_MAJOR *100*100 + LZ4_VERSION_MINOR *100 + LZ4_VERSION_RELEASE)
68 LZ4_API
int LZ4_versionNumber (
void);
80 #define LZ4_MEMORY_USAGE 14
87 LZ4_API
int LZ4_compress_default(
const char* source,
char* dest,
int sourceSize,
int maxDestSize);
88 LZ4_API
int LZ4_decompress_safe(
const char* source,
char* dest,
int compressedSize,
int maxDecompressedSize);
119 #define LZ4_MAX_INPUT_SIZE 0x7E000000
120 #define LZ4_COMPRESSBOUND(isize) ((unsigned)(isize) > (unsigned)LZ4_MAX_INPUT_SIZE ? 0 : (isize) + ((isize)/255) + 16)
132 LZ4_API
int LZ4_compressBound(
int inputSize);
142 LZ4_API
int LZ4_compress_fast(
const char* source,
char* dest,
int sourceSize,
int maxDestSize,
int acceleration);
152 LZ4_API
int LZ4_sizeofState(
void);
153 LZ4_API
int LZ4_compress_fast_extState(
void* state,
const char* source,
char* dest,
int inputSize,
int maxDestSize,
int acceleration);
167 LZ4_API
int LZ4_compress_destSize(
const char* source,
char* dest,
int* sourceSizePtr,
int targetDestSize);
181 LZ4_API
int LZ4_decompress_fast(
const char* source,
char* dest,
int originalSize);
195 LZ4_API
int LZ4_decompress_safe_partial(
const char* source,
char* dest,
int compressedSize,
int targetOutputSize,
int maxDecompressedSize);
201 #define LZ4_STREAMSIZE_U64 ((1 << (LZ4_MEMORY_USAGE-3)) + 4)
202 #define LZ4_STREAMSIZE (LZ4_STREAMSIZE_U64 * sizeof(long long))
210 typedef struct {
long long table[LZ4_STREAMSIZE_U64]; } LZ4_stream_t;
216 LZ4_API
void LZ4_resetStream(LZ4_stream_t* streamPtr);
224 LZ4_API LZ4_stream_t* LZ4_createStream(
void);
225 LZ4_API
int LZ4_freeStream(LZ4_stream_t* streamPtr);
234 LZ4_API
int LZ4_loadDict(LZ4_stream_t* streamPtr,
const char* dictionary,
int dictSize);
244 LZ4_API
int LZ4_compress_fast_continue(LZ4_stream_t* streamPtr,
const char* src,
char* dst,
int srcSize,
int maxDstSize,
int acceleration);
254 LZ4_API
int LZ4_saveDict(LZ4_stream_t* streamPtr,
char* safeBuffer,
int dictSize);
261 #define LZ4_STREAMDECODESIZE_U64 4
262 #define LZ4_STREAMDECODESIZE (LZ4_STREAMDECODESIZE_U64 * sizeof(unsigned long long))
263 typedef struct {
unsigned long long table[LZ4_STREAMDECODESIZE_U64]; } LZ4_streamDecode_t;
274 LZ4_API LZ4_streamDecode_t* LZ4_createStreamDecode(
void);
275 LZ4_API
int LZ4_freeStreamDecode(LZ4_streamDecode_t* LZ4_stream);
283 LZ4_API
int LZ4_setStreamDecode(LZ4_streamDecode_t* LZ4_streamDecode,
const char* dictionary,
int dictSize);
302 LZ4_API
int LZ4_decompress_safe_continue(LZ4_streamDecode_t* LZ4_streamDecode,
const char* source,
char* dest,
int compressedSize,
int maxDecompressedSize);
303 LZ4_API
int LZ4_decompress_fast_continue(LZ4_streamDecode_t* LZ4_streamDecode,
const char* source,
char* dest,
int originalSize);
313 LZ4_API
int LZ4_decompress_safe_usingDict(
const char* source,
char* dest,
int compressedSize,
int maxDecompressedSize,
const char* dictStart,
int dictSize);
314 LZ4_API
int LZ4_decompress_fast_usingDict(
const char* source,
char* dest,
int originalSize,
const char* dictStart,
int dictSize);
324 LZ4_API
int LZ4_compress(
const char* source,
char* dest,
int sourceSize);
325 LZ4_API
int LZ4_compress_limitedOutput(
const char* source,
char* dest,
int sourceSize,
int maxOutputSize);
326 LZ4_API
int LZ4_compress_withState(
void* state,
const char* source,
char* dest,
int inputSize);
327 LZ4_API
int LZ4_compress_limitedOutput_withState(
void* state,
const char* source,
char* dest,
int inputSize,
int maxOutputSize);
328 LZ4_API
int LZ4_compress_continue(LZ4_stream_t* LZ4_streamPtr,
const char* source,
char* dest,
int inputSize);
329 LZ4_API
int LZ4_compress_limitedOutput_continue(LZ4_stream_t* LZ4_streamPtr,
const char* source,
char* dest,
int inputSize,
int maxOutputSize);
332 #if defined (__cplusplus)