1 /* 2 * LZ4 - Fast LZ compression algorithm 3 * Header File 4 * Copyright (C) 2011-2017, Yann Collet. 5 6 BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php) 7 8 Redistribution and use in source and binary forms, with or without 9 modification, are permitted provided that the following conditions are 10 met: 11 12 * Redistributions of source code must retain the above copyright 13 notice, this list of conditions and the following disclaimer. 14 * Redistributions in binary form must reproduce the above 15 copyright notice, this list of conditions and the following disclaimer 16 in the documentation and/or other materials provided with the 17 distribution. 18 19 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 20 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 21 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 22 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 23 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 25 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 31 You can contact the author at : 32 - LZ4 homepage : http://www.lz4.org 33 - LZ4 source repository : https://github.com/lz4/lz4 34 */ 35 #if defined (__cplusplus) 36 extern "C" { 37 #endif 38 39 #ifndef LZ4_H_2983827168210 40 #define LZ4_H_2983827168210 41 42 /* --- Dependency --- */ 43 #include <stddef.h> /* size_t */ 44 45 46 /** 47 Introduction 48 49 LZ4 is lossless compression algorithm, providing compression speed at 400 MB/s per core, 50 scalable with multi-cores CPU. It features an extremely fast decoder, with speed in 51 multiple GB/s per core, typically reaching RAM speed limits on multi-core systems. 52 53 The LZ4 compression library provides in-memory compression and decompression functions. 54 Compression can be done in: 55 - a single step (described as Simple Functions) 56 - a single step, reusing a context (described in Advanced Functions) 57 - unbounded multiple steps (described as Streaming compression) 58 59 lz4.h provides block compression functions. It gives full buffer control to user. 60 Decompressing an lz4-compressed block also requires metadata (such as compressed size). 61 Each application is free to encode such metadata in whichever way it wants. 62 63 An additional format, called LZ4 frame specification (doc/lz4_Frame_format.md), 64 take care of encoding standard metadata alongside LZ4-compressed blocks. 65 If your application requires interoperability, it's recommended to use it. 66 A library is provided to take care of it, see lz4frame.h. 67 */ 68 69 /*^*************************************************************** 70 * Export parameters 71 *****************************************************************/ 72 /* 73 * LZ4_DLL_EXPORT : 74 * Enable exporting of functions when building a Windows DLL 75 * LZ4LIB_API : 76 * Control library symbols visibility. 77 */ 78 #if defined(LZ4_DLL_EXPORT) && (LZ4_DLL_EXPORT==1) 79 # define LZ4LIB_API __declspec(dllexport) 80 #elif defined(LZ4_DLL_IMPORT) && (LZ4_DLL_IMPORT==1) 81 # define LZ4LIB_API __declspec(dllimport) /* It isn't required but allows to generate better code, saving a function pointer load from the IAT and an indirect jump.*/ 82 #elif defined(__GNUC__) && (__GNUC__ >= 4) 83 # define LZ4LIB_API __attribute__ ((__visibility__ ("default"))) 84 #else 85 # define LZ4LIB_API 86 #endif 87 88 89 /*------ Version ------*/ 90 #define LZ4_VERSION_MAJOR 1 /* for breaking interface changes */ 91 #define LZ4_VERSION_MINOR 8 /* for new (non-breaking) interface capabilities */ 92 #define LZ4_VERSION_RELEASE 0 /* for tweaks, bug-fixes, or development */ 93 94 #define LZ4_VERSION_NUMBER (LZ4_VERSION_MAJOR *100*100 + LZ4_VERSION_MINOR *100 + LZ4_VERSION_RELEASE) 95 96 #define LZ4_LIB_VERSION LZ4_VERSION_MAJOR.LZ4_VERSION_MINOR.LZ4_VERSION_RELEASE 97 #define LZ4_QUOTE(str) #str 98 #define LZ4_EXPAND_AND_QUOTE(str) LZ4_QUOTE(str) 99 #define LZ4_VERSION_STRING LZ4_EXPAND_AND_QUOTE(LZ4_LIB_VERSION) 100 101 LZ4LIB_API int LZ4_versionNumber (void); /**< library version number; to be used when checking dll version */ 102 LZ4LIB_API const char* LZ4_versionString (void); /**< library version string; to be used when checking dll version */ 103 104 105 /*-************************************ 106 * Tuning parameter 107 **************************************/ 108 /*! 109 * LZ4_MEMORY_USAGE : 110 * Memory usage formula : N->2^N Bytes (examples : 10 -> 1KB; 12 -> 4KB ; 16 -> 64KB; 20 -> 1MB; etc.) 111 * Increasing memory usage improves compression ratio 112 * Reduced memory usage can improve speed, due to cache effect 113 * Default value is 14, for 16KB, which nicely fits into Intel x86 L1 cache 114 */ 115 #ifndef LZ4_MEMORY_USAGE 116 # define LZ4_MEMORY_USAGE 14 117 #endif 118 119 /*-************************************ 120 * Simple Functions 121 **************************************/ 122 /*! LZ4_compress_default() : 123 Compresses 'sourceSize' bytes from buffer 'source' 124 into already allocated 'dest' buffer of size 'maxDestSize'. 125 Compression is guaranteed to succeed if 'maxDestSize' >= LZ4_compressBound(sourceSize). 126 It also runs faster, so it's a recommended setting. 127 If the function cannot compress 'source' into a more limited 'dest' budget, 128 compression stops *immediately*, and the function result is zero. 129 As a consequence, 'dest' content is not valid. 130 This function never writes outside 'dest' buffer, nor read outside 'source' buffer. 131 sourceSize : Max supported value is LZ4_MAX_INPUT_VALUE 132 maxDestSize : full or partial size of buffer 'dest' (which must be already allocated) 133 return : the number of bytes written into buffer 'dest' (necessarily <= maxOutputSize) 134 or 0 if compression fails */ 135 LZ4LIB_API int LZ4_compress_default(const char* source, char* dest, int sourceSize, int maxDestSize); 136 137 /*! LZ4_decompress_safe() : 138 compressedSize : is the precise full size of the compressed block. 139 maxDecompressedSize : is the size of destination buffer, which must be already allocated. 140 return : the number of bytes decompressed into destination buffer (necessarily <= maxDecompressedSize) 141 If destination buffer is not large enough, decoding will stop and output an error code (<0). 142 If the source stream is detected malformed, the function will stop decoding and return a negative result. 143 This function is protected against buffer overflow exploits, including malicious data packets. 144 It never writes outside output buffer, nor reads outside input buffer. 145 */ 146 LZ4LIB_API int LZ4_decompress_safe (const char* source, char* dest, int compressedSize, int maxDecompressedSize); 147 148 149 /*-************************************ 150 * Advanced Functions 151 **************************************/ 152 #define LZ4_MAX_INPUT_SIZE 0x7E000000 /* 2 113 929 216 bytes */ 153 #define LZ4_COMPRESSBOUND(isize) ((unsigned)(isize) > (unsigned)LZ4_MAX_INPUT_SIZE ? 0 : (isize) + ((isize)/255) + 16) 154 155 /*! 156 LZ4_compressBound() : 157 Provides the maximum size that LZ4 compression may output in a "worst case" scenario (input data not compressible) 158 This function is primarily useful for memory allocation purposes (destination buffer size). 159 Macro LZ4_COMPRESSBOUND() is also provided for compilation-time evaluation (stack memory allocation for example). 160 Note that LZ4_compress_default() compress faster when dest buffer size is >= LZ4_compressBound(srcSize) 161 inputSize : max supported value is LZ4_MAX_INPUT_SIZE 162 return : maximum output size in a "worst case" scenario 163 or 0, if input size is too large ( > LZ4_MAX_INPUT_SIZE) 164 */ 165 LZ4LIB_API int LZ4_compressBound(int inputSize); 166 167 /*! 168 LZ4_compress_fast() : 169 Same as LZ4_compress_default(), but allows to select an "acceleration" factor. 170 The larger the acceleration value, the faster the algorithm, but also the lesser the compression. 171 It's a trade-off. It can be fine tuned, with each successive value providing roughly +~3% to speed. 172 An acceleration value of "1" is the same as regular LZ4_compress_default() 173 Values <= 0 will be replaced by ACCELERATION_DEFAULT (see lz4.c), which is 1. 174 */ 175 LZ4LIB_API int LZ4_compress_fast (const char* source, char* dest, int sourceSize, int maxDestSize, int acceleration); 176 177 178 /*! 179 LZ4_compress_fast_extState() : 180 Same compression function, just using an externally allocated memory space to store compression state. 181 Use LZ4_sizeofState() to know how much memory must be allocated, 182 and allocate it on 8-bytes boundaries (using malloc() typically). 183 Then, provide it as 'void* state' to compression function. 184 */ 185 LZ4LIB_API int LZ4_sizeofState(void); 186 LZ4LIB_API int LZ4_compress_fast_extState (void* state, const char* source, char* dest, int inputSize, int maxDestSize, int acceleration); 187 188 189 /*! 190 LZ4_compress_destSize() : 191 Reverse the logic, by compressing as much data as possible from 'source' buffer 192 into already allocated buffer 'dest' of size 'targetDestSize'. 193 This function either compresses the entire 'source' content into 'dest' if it's large enough, 194 or fill 'dest' buffer completely with as much data as possible from 'source'. 195 *sourceSizePtr : will be modified to indicate how many bytes where read from 'source' to fill 'dest'. 196 New value is necessarily <= old value. 197 return : Nb bytes written into 'dest' (necessarily <= targetDestSize) 198 or 0 if compression fails 199 */ 200 LZ4LIB_API int LZ4_compress_destSize (const char* source, char* dest, int* sourceSizePtr, int targetDestSize); 201 202 203 /*! 204 LZ4_decompress_fast() : 205 originalSize : is the original and therefore uncompressed size 206 return : the number of bytes read from the source buffer (in other words, the compressed size) 207 If the source stream is detected malformed, the function will stop decoding and return a negative result. 208 Destination buffer must be already allocated. Its size must be a minimum of 'originalSize' bytes. 209 note : This function fully respect memory boundaries for properly formed compressed data. 210 It is a bit faster than LZ4_decompress_safe(). 211 However, it does not provide any protection against intentionally modified data stream (malicious input). 212 Use this function in trusted environment only (data to decode comes from a trusted source). 213 */ 214 LZ4LIB_API int LZ4_decompress_fast (const char* source, char* dest, int originalSize); 215 216 /*! 217 LZ4_decompress_safe_partial() : 218 This function decompress a compressed block of size 'compressedSize' at position 'source' 219 into destination buffer 'dest' of size 'maxDecompressedSize'. 220 The function tries to stop decompressing operation as soon as 'targetOutputSize' has been reached, 221 reducing decompression time. 222 return : the number of bytes decoded in the destination buffer (necessarily <= maxDecompressedSize) 223 Note : this number can be < 'targetOutputSize' should the compressed block to decode be smaller. 224 Always control how many bytes were decoded. 225 If the source stream is detected malformed, the function will stop decoding and return a negative result. 226 This function never writes outside of output buffer, and never reads outside of input buffer. It is therefore protected against malicious data packets 227 */ 228 LZ4LIB_API int LZ4_decompress_safe_partial (const char* source, char* dest, int compressedSize, int targetOutputSize, int maxDecompressedSize); 229 230 231 /*-********************************************* 232 * Streaming Compression Functions 233 ***********************************************/ 234 typedef union LZ4_stream_u LZ4_stream_t; /* incomplete type (defined later) */ 235 236 /*! LZ4_createStream() and LZ4_freeStream() : 237 * LZ4_createStream() will allocate and initialize an `LZ4_stream_t` structure. 238 * LZ4_freeStream() releases its memory. 239 */ 240 LZ4LIB_API LZ4_stream_t* LZ4_createStream(void); 241 LZ4LIB_API int LZ4_freeStream (LZ4_stream_t* streamPtr); 242 243 /*! LZ4_resetStream() : 244 * An LZ4_stream_t structure can be allocated once and re-used multiple times. 245 * Use this function to start compressing a new stream. 246 */ 247 LZ4LIB_API void LZ4_resetStream (LZ4_stream_t* streamPtr); 248 249 /*! LZ4_loadDict() : 250 * Use this function to load a static dictionary into LZ4_stream_t. 251 * Any previous data will be forgotten, only 'dictionary' will remain in memory. 252 * Loading a size of 0 is allowed, and is the same as reset. 253 * @return : dictionary size, in bytes (necessarily <= 64 KB) 254 */ 255 LZ4LIB_API int LZ4_loadDict (LZ4_stream_t* streamPtr, const char* dictionary, int dictSize); 256 257 /*! LZ4_compress_fast_continue() : 258 * Compress content into 'src' using data from previously compressed blocks, improving compression ratio. 259 * 'dst' buffer must be already allocated. 260 * If dstCapacity >= LZ4_compressBound(srcSize), compression is guaranteed to succeed, and runs faster. 261 * 262 * Important : Up to 64KB of previously compressed data is assumed to remain present and unmodified in memory ! 263 * Special 1 : If input buffer is a double-buffer, it can have any size, including < 64 KB. 264 * Special 2 : If input buffer is a ring-buffer, it can have any size, including < 64 KB. 265 * 266 * @return : size of compressed block 267 * or 0 if there is an error (typically, compressed data cannot fit into 'dst') 268 * After an error, the stream status is invalid, it can only be reset or freed. 269 */ 270 LZ4LIB_API int LZ4_compress_fast_continue (LZ4_stream_t* streamPtr, const char* src, char* dst, int srcSize, int dstCapacity, int acceleration); 271 272 /*! LZ4_saveDict() : 273 * If previously compressed data block is not guaranteed to remain available at its current memory location, 274 * save it into a safer place (char* safeBuffer). 275 * Note : it's not necessary to call LZ4_loadDict() after LZ4_saveDict(), dictionary is immediately usable. 276 * @return : saved dictionary size in bytes (necessarily <= dictSize), or 0 if error. 277 */ 278 LZ4LIB_API int LZ4_saveDict (LZ4_stream_t* streamPtr, char* safeBuffer, int dictSize); 279 280 281 /*-********************************************** 282 * Streaming Decompression Functions 283 * Bufferless synchronous API 284 ************************************************/ 285 typedef union LZ4_streamDecode_u LZ4_streamDecode_t; /* incomplete type (defined later) */ 286 287 /*! LZ4_createStreamDecode() and LZ4_freeStreamDecode() : 288 * creation / destruction of streaming decompression tracking structure. 289 * A tracking structure can be re-used multiple times sequentially. */ 290 LZ4LIB_API LZ4_streamDecode_t* LZ4_createStreamDecode(void); 291 LZ4LIB_API int LZ4_freeStreamDecode (LZ4_streamDecode_t* LZ4_stream); 292 293 /*! LZ4_setStreamDecode() : 294 * An LZ4_streamDecode_t structure can be allocated once and re-used multiple times. 295 * Use this function to start decompression of a new stream of blocks. 296 * A dictionary can optionnally be set. Use NULL or size 0 for a simple reset order. 297 * @return : 1 if OK, 0 if error 298 */ 299 LZ4LIB_API int LZ4_setStreamDecode (LZ4_streamDecode_t* LZ4_streamDecode, const char* dictionary, int dictSize); 300 301 /*! LZ4_decompress_*_continue() : 302 * These decoding functions allow decompression of consecutive blocks in "streaming" mode. 303 * A block is an unsplittable entity, it must be presented entirely to a decompression function. 304 * Decompression functions only accept one block at a time. 305 * Previously decoded blocks *must* remain available at the memory position where they were decoded (up to 64 KB). 306 * 307 * Special : if application sets a ring buffer for decompression, it must respect one of the following conditions : 308 * - Exactly same size as encoding buffer, with same update rule (block boundaries at same positions) 309 * In which case, the decoding & encoding ring buffer can have any size, including very small ones ( < 64 KB). 310 * - Larger than encoding buffer, by a minimum of maxBlockSize more bytes. 311 * maxBlockSize is implementation dependent. It's the maximum size of any single block. 312 * In which case, encoding and decoding buffers do not need to be synchronized, 313 * and encoding ring buffer can have any size, including small ones ( < 64 KB). 314 * - _At least_ 64 KB + 8 bytes + maxBlockSize. 315 * In which case, encoding and decoding buffers do not need to be synchronized, 316 * and encoding ring buffer can have any size, including larger than decoding buffer. 317 * Whenever these conditions are not possible, save the last 64KB of decoded data into a safe buffer, 318 * and indicate where it is saved using LZ4_setStreamDecode() before decompressing next block. 319 */ 320 LZ4LIB_API int LZ4_decompress_safe_continue (LZ4_streamDecode_t* LZ4_streamDecode, const char* source, char* dest, int compressedSize, int maxDecompressedSize); 321 LZ4LIB_API int LZ4_decompress_fast_continue (LZ4_streamDecode_t* LZ4_streamDecode, const char* source, char* dest, int originalSize); 322 323 324 /*! LZ4_decompress_*_usingDict() : 325 * These decoding functions work the same as 326 * a combination of LZ4_setStreamDecode() followed by LZ4_decompress_*_continue() 327 * They are stand-alone, and don't need an LZ4_streamDecode_t structure. 328 */ 329 LZ4LIB_API int LZ4_decompress_safe_usingDict (const char* source, char* dest, int compressedSize, int maxDecompressedSize, const char* dictStart, int dictSize); 330 LZ4LIB_API int LZ4_decompress_fast_usingDict (const char* source, char* dest, int originalSize, const char* dictStart, int dictSize); 331 332 333 /*^********************************************** 334 * !!!!!! STATIC LINKING ONLY !!!!!! 335 ***********************************************/ 336 /*-************************************ 337 * Private definitions 338 ************************************** 339 * Do not use these definitions. 340 * They are exposed to allow static allocation of `LZ4_stream_t` and `LZ4_streamDecode_t`. 341 * Using these definitions will expose code to API and/or ABI break in future versions of the library. 342 **************************************/ 343 #define LZ4_HASHLOG (LZ4_MEMORY_USAGE-2) 344 #define LZ4_HASHTABLESIZE (1 << LZ4_MEMORY_USAGE) 345 #define LZ4_HASH_SIZE_U32 (1 << LZ4_HASHLOG) /* required as macro for static allocation */ 346 347 #if defined(__cplusplus) || (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */) 348 #include <stdint.h> 349 350 typedef struct { 351 uint32_t hashTable[LZ4_HASH_SIZE_U32]; 352 uint32_t currentOffset; 353 uint32_t initCheck; 354 const uint8_t* dictionary; 355 uint8_t* bufferStart; /* obsolete, used for slideInputBuffer */ 356 uint32_t dictSize; 357 } LZ4_stream_t_internal; 358 359 typedef struct { 360 const uint8_t* externalDict; 361 size_t extDictSize; 362 const uint8_t* prefixEnd; 363 size_t prefixSize; 364 } LZ4_streamDecode_t_internal; 365 366 #else 367 368 typedef struct { 369 unsigned int hashTable[LZ4_HASH_SIZE_U32]; 370 unsigned int currentOffset; 371 unsigned int initCheck; 372 const unsigned char* dictionary; 373 unsigned char* bufferStart; /* obsolete, used for slideInputBuffer */ 374 unsigned int dictSize; 375 } LZ4_stream_t_internal; 376 377 typedef struct { 378 const unsigned char* externalDict; 379 size_t extDictSize; 380 const unsigned char* prefixEnd; 381 size_t prefixSize; 382 } LZ4_streamDecode_t_internal; 383 384 #endif 385 386 /*! 387 * LZ4_stream_t : 388 * information structure to track an LZ4 stream. 389 * init this structure before first use. 390 * note : only use in association with static linking ! 391 * this definition is not API/ABI safe, 392 * it may change in a future version ! 393 */ 394 #define LZ4_STREAMSIZE_U64 ((1 << (LZ4_MEMORY_USAGE-3)) + 4) 395 #define LZ4_STREAMSIZE (LZ4_STREAMSIZE_U64 * sizeof(unsigned long long)) 396 union LZ4_stream_u { 397 unsigned long long table[LZ4_STREAMSIZE_U64]; 398 LZ4_stream_t_internal internal_donotuse; 399 } ; /* previously typedef'd to LZ4_stream_t */ 400 401 402 /*! 403 * LZ4_streamDecode_t : 404 * information structure to track an LZ4 stream during decompression. 405 * init this structure using LZ4_setStreamDecode (or memset()) before first use 406 * note : only use in association with static linking ! 407 * this definition is not API/ABI safe, 408 * and may change in a future version ! 409 */ 410 #define LZ4_STREAMDECODESIZE_U64 4 411 #define LZ4_STREAMDECODESIZE (LZ4_STREAMDECODESIZE_U64 * sizeof(unsigned long long)) 412 union LZ4_streamDecode_u { 413 unsigned long long table[LZ4_STREAMDECODESIZE_U64]; 414 LZ4_streamDecode_t_internal internal_donotuse; 415 } ; /* previously typedef'd to LZ4_streamDecode_t */ 416 417 418 /*-************************************ 419 * Obsolete Functions 420 **************************************/ 421 422 /*! Deprecation warnings 423 Should deprecation warnings be a problem, 424 it is generally possible to disable them, 425 typically with -Wno-deprecated-declarations for gcc 426 or _CRT_SECURE_NO_WARNINGS in Visual. 427 Otherwise, it's also possible to define LZ4_DISABLE_DEPRECATE_WARNINGS */ 428 #ifdef LZ4_DISABLE_DEPRECATE_WARNINGS 429 # define LZ4_DEPRECATED(message) /* disable deprecation warnings */ 430 #else 431 # define LZ4_GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__) 432 # if defined(__clang__) /* clang doesn't handle mixed C++11 and CNU attributes */ 433 # define LZ4_DEPRECATED(message) __attribute__((deprecated(message))) 434 # elif defined (__cplusplus) && (__cplusplus >= 201402) /* C++14 or greater */ 435 # define LZ4_DEPRECATED(message) [[deprecated(message)]] 436 # elif (LZ4_GCC_VERSION >= 405) 437 # define LZ4_DEPRECATED(message) __attribute__((deprecated(message))) 438 # elif (LZ4_GCC_VERSION >= 301) 439 # define LZ4_DEPRECATED(message) __attribute__((deprecated)) 440 # elif defined(_MSC_VER) 441 # define LZ4_DEPRECATED(message) __declspec(deprecated(message)) 442 # else 443 # pragma message("WARNING: You need to implement LZ4_DEPRECATED for this compiler") 444 # define LZ4_DEPRECATED(message) 445 # endif 446 #endif /* LZ4_DISABLE_DEPRECATE_WARNINGS */ 447 448 /* Obsolete compression functions */ 449 LZ4LIB_API LZ4_DEPRECATED("use LZ4_compress_default() instead") int LZ4_compress (const char* source, char* dest, int sourceSize); 450 LZ4LIB_API LZ4_DEPRECATED("use LZ4_compress_default() instead") int LZ4_compress_limitedOutput (const char* source, char* dest, int sourceSize, int maxOutputSize); 451 LZ4LIB_API LZ4_DEPRECATED("use LZ4_compress_fast_extState() instead") int LZ4_compress_withState (void* state, const char* source, char* dest, int inputSize); 452 LZ4LIB_API LZ4_DEPRECATED("use LZ4_compress_fast_extState() instead") int LZ4_compress_limitedOutput_withState (void* state, const char* source, char* dest, int inputSize, int maxOutputSize); 453 LZ4LIB_API LZ4_DEPRECATED("use LZ4_compress_fast_continue() instead") int LZ4_compress_continue (LZ4_stream_t* LZ4_streamPtr, const char* source, char* dest, int inputSize); 454 LZ4LIB_API LZ4_DEPRECATED("use LZ4_compress_fast_continue() instead") int LZ4_compress_limitedOutput_continue (LZ4_stream_t* LZ4_streamPtr, const char* source, char* dest, int inputSize, int maxOutputSize); 455 456 /* Obsolete decompression functions */ 457 LZ4LIB_API LZ4_DEPRECATED("use LZ4_decompress_fast() instead") int LZ4_uncompress (const char* source, char* dest, int outputSize); 458 LZ4LIB_API LZ4_DEPRECATED("use LZ4_decompress_safe() instead") int LZ4_uncompress_unknownOutputSize (const char* source, char* dest, int isize, int maxOutputSize); 459 460 /* Obsolete streaming functions; use new streaming interface whenever possible */ 461 LZ4LIB_API LZ4_DEPRECATED("use LZ4_createStream() instead") void* LZ4_create (char* inputBuffer); 462 LZ4LIB_API LZ4_DEPRECATED("use LZ4_createStream() instead") int LZ4_sizeofStreamState(void); 463 LZ4LIB_API LZ4_DEPRECATED("use LZ4_resetStream() instead") int LZ4_resetStreamState(void* state, char* inputBuffer); 464 LZ4LIB_API LZ4_DEPRECATED("use LZ4_saveDict() instead") char* LZ4_slideInputBuffer (void* state); 465 466 /* Obsolete streaming decoding functions */ 467 LZ4LIB_API LZ4_DEPRECATED("use LZ4_decompress_safe_usingDict() instead") int LZ4_decompress_safe_withPrefix64k (const char* src, char* dst, int compressedSize, int maxDstSize); 468 LZ4LIB_API LZ4_DEPRECATED("use LZ4_decompress_fast_usingDict() instead") int LZ4_decompress_fast_withPrefix64k (const char* src, char* dst, int originalSize); 469 470 #endif /* LZ4_H_2983827168210 */ 471 472 473 #if defined (__cplusplus) 474 } 475 #endif 476