Go to the documentation of this file.
45 #ifndef LZ4F_H_09782039843
46 #define LZ4F_H_09782039843
48 #if defined (__cplusplus)
72 #ifndef LZ4FLIB_VISIBILITY
73 # if defined(__GNUC__) && (__GNUC__ >= 4)
74 # define LZ4FLIB_VISIBILITY __attribute__ ((visibility ("default")))
76 # define LZ4FLIB_VISIBILITY
79 #if defined(LZ4_DLL_EXPORT) && (LZ4_DLL_EXPORT==1)
80 # define LZ4FLIB_API __declspec(dllexport) LZ4FLIB_VISIBILITY
81 #elif defined(LZ4_DLL_IMPORT) && (LZ4_DLL_IMPORT==1)
82 # define LZ4FLIB_API __declspec(dllimport) LZ4FLIB_VISIBILITY
84 # define LZ4FLIB_API LZ4FLIB_VISIBILITY
87 #ifdef LZ4F_DISABLE_DEPRECATE_WARNINGS
88 # define LZ4F_DEPRECATE(x) x
90 # if defined(_MSC_VER)
91 # define LZ4F_DEPRECATE(x) x
92 # elif defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 6))
93 # define LZ4F_DEPRECATE(x) x __attribute__((deprecated))
95 # define LZ4F_DEPRECATE(x) x
113 #ifdef LZ4F_ENABLE_OBSOLETE_ENUMS
114 # define LZ4F_OBSOLETE_ENUM(x) , LZ4F_DEPRECATE(x) = LZ4F_##x
116 # define LZ4F_OBSOLETE_ENUM(x)
163 #ifdef LZ4F_ENABLE_OBSOLETE_ENUMS
185 #define LZ4F_INIT_FRAMEINFO { LZ4F_default, LZ4F_blockLinked, LZ4F_noContentChecksum, LZ4F_frame, 0ULL, 0U, LZ4F_noBlockChecksum }
197 unsigned reserved[3];
200 #define LZ4F_INIT_PREFERENCES { LZ4F_INIT_FRAMEINFO, 0, 0u, 0u, { 0u, 0u, 0u } }
225 const void* srcBuffer,
size_t srcSize,
237 unsigned reserved[3];
242 #define LZ4F_VERSION 100
266 #define LZ4F_HEADER_SIZE_MIN 7
267 #define LZ4F_HEADER_SIZE_MAX 19
270 #define LZ4F_BLOCK_HEADER_SIZE 4
273 #define LZ4F_BLOCK_CHECKSUM_SIZE 4
276 #define LZ4F_CONTENT_CHECKSUM_SIZE 4
286 void* dstBuffer,
size_t dstCapacity,
319 void* dstBuffer,
size_t dstCapacity,
320 const void* srcBuffer,
size_t srcSize,
333 void* dstBuffer,
size_t dstCapacity,
347 void* dstBuffer,
size_t dstCapacity,
387 #define LZ4F_MAGICNUMBER 0x184D2204U
388 #define LZ4F_MAGIC_SKIPPABLE_START 0x184D2A50U
389 #define LZ4F_MIN_SIZE_TO_KNOW_HEADER_LENGTH 5
448 const void* srcBuffer,
size_t* srcSizePtr);
483 void* dstBuffer,
size_t* dstSizePtr,
484 const void* srcBuffer,
size_t* srcSizePtr,
497 #if defined (__cplusplus)
503 #if defined(LZ4F_STATIC_LINKING_ONLY) && !defined(LZ4F_H_STATIC_09782039843)
504 #define LZ4F_H_STATIC_09782039843
506 #if defined (__cplusplus)
520 #ifdef LZ4F_PUBLISH_STATIC_FUNCTIONS
521 # define LZ4FLIB_STATIC_API LZ4FLIB_API
523 # define LZ4FLIB_STATIC_API
528 #define LZ4F_LIST_ERRORS(ITEM) \
530 ITEM(ERROR_GENERIC) \
531 ITEM(ERROR_maxBlockSize_invalid) \
532 ITEM(ERROR_blockMode_invalid) \
533 ITEM(ERROR_contentChecksumFlag_invalid) \
534 ITEM(ERROR_compressionLevel_invalid) \
535 ITEM(ERROR_headerVersion_wrong) \
536 ITEM(ERROR_blockChecksum_invalid) \
537 ITEM(ERROR_reservedFlag_set) \
538 ITEM(ERROR_allocation_failed) \
539 ITEM(ERROR_srcSize_tooLarge) \
540 ITEM(ERROR_dstMaxSize_tooSmall) \
541 ITEM(ERROR_frameHeader_incomplete) \
542 ITEM(ERROR_frameType_unknown) \
543 ITEM(ERROR_frameSize_wrong) \
544 ITEM(ERROR_srcPtr_wrong) \
545 ITEM(ERROR_decompressionFailed) \
546 ITEM(ERROR_headerChecksum_invalid) \
547 ITEM(ERROR_contentChecksum_invalid) \
548 ITEM(ERROR_frameDecoding_alreadyStarted) \
549 ITEM(ERROR_compressionState_uninitialized) \
550 ITEM(ERROR_parameter_null) \
553 #define LZ4F_GENERATE_ENUM(ENUM) LZ4F_##ENUM,
556 typedef enum { LZ4F_LIST_ERRORS(LZ4F_GENERATE_ENUM)
557 _LZ4F_dummy_error_enum_for_c89_never_used } LZ4F_errorCodes;
581 LZ4FLIB_STATIC_API
size_t
583 void* dstBuffer,
size_t dstCapacity,
584 const void* srcBuffer,
size_t srcSize,
615 LZ4FLIB_STATIC_API LZ4F_CDict*
LZ4F_createCDict(
const void* dictBuffer,
size_t dictSize);
629 LZ4FLIB_STATIC_API
size_t
631 void*
dst,
size_t dstCapacity,
632 const void* src,
size_t srcSize,
633 const LZ4F_CDict* cdict,
644 LZ4FLIB_STATIC_API
size_t
646 void* dstBuffer,
size_t dstCapacity,
647 const LZ4F_CDict* cdict,
655 LZ4FLIB_STATIC_API
size_t
657 void* dstBuffer,
size_t* dstSizePtr,
658 const void* srcBuffer,
size_t* srcSizePtr,
659 const void* dict,
size_t dictSize,
668 typedef void* (*LZ4F_AllocFunction) (
void* opaqueState,
size_t size);
669 typedef void* (*LZ4F_CallocFunction) (
void* opaqueState,
size_t size);
670 typedef void (*LZ4F_FreeFunction) (
void* opaqueState,
void* address);
672 LZ4F_AllocFunction customAlloc;
673 LZ4F_CallocFunction customCalloc;
674 LZ4F_FreeFunction customFree;
679 __attribute__((__unused__))
681 LZ4F_CustomMem
const LZ4F_defaultCMem = { NULL, NULL, NULL, NULL };
685 LZ4FLIB_STATIC_API LZ4F_CDict*
LZ4F_createCDict_advanced(LZ4F_CustomMem customMem,
const void* dictBuffer,
size_t dictSize);
688 #if defined (__cplusplus)
LZ4FLIB_API LZ4F_errorCode_t LZ4F_freeDecompressionContext(LZ4F_dctx *dctx)
LZ4FLIB_API size_t LZ4F_flush(LZ4F_cctx *cctx, void *dstBuffer, size_t dstCapacity, const LZ4F_compressOptions_t *cOptPtr)
@ LZ4F_blockChecksumEnabled
LZ4F_blockSizeID_t blockSizeID
LZ4FLIB_API int LZ4F_compressionLevel_max(void)
LZ4F_errorCodes LZ4F_getErrorCode(size_t functionResult)
const LZ4FLIB_API char * LZ4F_getErrorName(LZ4F_errorCode_t code)
LZ4FLIB_API LZ4F_errorCode_t LZ4F_freeCompressionContext(LZ4F_cctx *cctx)
size_t LZ4F_decompress_usingDict(LZ4F_dctx *dctx, void *dstBuffer, size_t *dstSizePtr, const void *srcBuffer, size_t *srcSizePtr, const void *dict, size_t dictSize, const LZ4F_decompressOptions_t *decompressOptionsPtr)
unsigned long long contentSize
LZ4F_blockChecksum_t blockChecksumFlag
LZ4FLIB_API unsigned LZ4F_getVersion(void)
size_t LZ4F_getBlockSize(LZ4F_blockSizeID_t blockSizeID)
LZ4FLIB_API size_t LZ4F_compressEnd(LZ4F_cctx *cctx, void *dstBuffer, size_t dstCapacity, const LZ4F_compressOptions_t *cOptPtr)
LZ4F_cctx * LZ4F_compressionContext_t
LZ4F_frameType_t frameType
LZ4F_cctx * LZ4F_createCompressionContext_advanced(LZ4F_CustomMem customMem, unsigned version)
LZ4F_dctx * LZ4F_decompressionContext_t
LZ4F_contentChecksum_t contentChecksumFlag
size_t LZ4F_uncompressedUpdate(LZ4F_cctx *cctxPtr, void *dstBuffer, size_t dstCapacity, const void *srcBuffer, size_t srcSize, const LZ4F_compressOptions_t *compressOptionsPtr)
LZ4FLIB_API unsigned LZ4F_isError(LZ4F_errorCode_t code)
span_constexpr std::size_t size(span< T, Extent > const &spn)
LZ4FLIB_API size_t LZ4F_compressBound(size_t srcSize, const LZ4F_preferences_t *prefsPtr)
void version(int *major_, int *minor_, int *patch_)
LZ4FLIB_API size_t LZ4F_compressUpdate(LZ4F_cctx *cctx, void *dstBuffer, size_t dstCapacity, const void *srcBuffer, size_t srcSize, const LZ4F_compressOptions_t *cOptPtr)
LZ4F_blockMode_t blockMode
LZ4FLIB_API size_t LZ4F_getFrameInfo(LZ4F_dctx *dctx, LZ4F_frameInfo_t *frameInfoPtr, const void *srcBuffer, size_t *srcSizePtr)
LZ4FLIB_API size_t LZ4F_decompress(LZ4F_dctx *dctx, void *dstBuffer, size_t *dstSizePtr, const void *srcBuffer, size_t *srcSizePtr, const LZ4F_decompressOptions_t *dOptPtr)
LZ4FLIB_API size_t LZ4F_compressBegin(LZ4F_cctx *cctx, void *dstBuffer, size_t dstCapacity, const LZ4F_preferences_t *prefsPtr)
size_t LZ4F_compressFrame_usingCDict(LZ4F_cctx *cctx, void *dstBuffer, size_t dstCapacity, const void *srcBuffer, size_t srcSize, const LZ4F_CDict *cdict, const LZ4F_preferences_t *preferencesPtr)
LZ4FLIB_API size_t LZ4F_compressFrameBound(size_t srcSize, const LZ4F_preferences_t *preferencesPtr)
#define LZ4F_OBSOLETE_ENUM(x)
LZ4F_CDict * LZ4F_createCDict(const void *dictBuffer, size_t dictSize)
@ LZ4F_contentChecksumEnabled
size_t LZ4F_compressBegin_usingCDict(LZ4F_cctx *cctxPtr, void *dstBuffer, size_t dstCapacity, const LZ4F_CDict *cdict, const LZ4F_preferences_t *preferencesPtr)
void LZ4F_freeCDict(LZ4F_CDict *cdict)
LZ4FLIB_API void LZ4F_resetDecompressionContext(LZ4F_dctx *dctx)
LZ4F_frameInfo_t frameInfo
LZ4FLIB_API size_t LZ4F_headerSize(const void *src, size_t srcSize)
LZ4F_CDict * LZ4F_createCDict_advanced(LZ4F_CustomMem cmem, const void *dictBuffer, size_t dictSize)
LZ4FLIB_API size_t LZ4F_compressFrame(void *dstBuffer, size_t dstCapacity, const void *srcBuffer, size_t srcSize, const LZ4F_preferences_t *preferencesPtr)
LZ4F_dctx * LZ4F_createDecompressionContext_advanced(LZ4F_CustomMem customMem, unsigned version)
LZ4FLIB_API LZ4F_errorCode_t LZ4F_createDecompressionContext(LZ4F_dctx **dctxPtr, unsigned version)
LZ4FLIB_API LZ4F_errorCode_t LZ4F_createCompressionContext(LZ4F_cctx **cctxPtr, unsigned version)
plotjuggler
Author(s): Davide Faconti
autogenerated on Mon Nov 11 2024 03:23:45