summaryrefslogtreecommitdiffstats
path: root/lib/lz4frame.h
diff options
context:
space:
mode:
authorYann Collet <yann.collet.73@gmail.com>2014-12-13 14:05:46 (GMT)
committerYann Collet <yann.collet.73@gmail.com>2014-12-13 14:05:46 (GMT)
commitdaa320f3f7bd9cc121462ef7a201fad87f540bd6 (patch)
tree10a05dcdcfb7255c21e6663dbae8f5fa8351b51c /lib/lz4frame.h
parent8f844fe70068d2a632e7f0e24ecfa05a1d3e1302 (diff)
downloadlz4-daa320f3f7bd9cc121462ef7a201fad87f540bd6.zip
lz4-daa320f3f7bd9cc121462ef7a201fad87f540bd6.tar.gz
lz4-daa320f3f7bd9cc121462ef7a201fad87f540bd6.tar.bz2
New : lz4frame integrated into liblz4 (v1.5.0)
Diffstat (limited to 'lib/lz4frame.h')
-rw-r--r--lib/lz4frame.h18
1 files changed, 3 insertions, 15 deletions
diff --git a/lib/lz4frame.h b/lib/lz4frame.h
index 48fbf80..b2a7f40 100644
--- a/lib/lz4frame.h
+++ b/lib/lz4frame.h
@@ -60,20 +60,8 @@ extern "C" {
* Error management
* ************************************/
typedef size_t LZ4F_errorCode_t;
-#define LZ4F_LIST_ERRORS(ITEM) \
- ITEM(OK_NoError) ITEM(ERROR_GENERIC) \
- ITEM(ERROR_maxBlockSize_invalid) ITEM(ERROR_blockMode_invalid) ITEM(ERROR_contentChecksumFlag_invalid) \
- ITEM(ERROR_compressionLevel_invalid) \
- ITEM(ERROR_allocation_failed) \
- ITEM(ERROR_srcSize_tooLarge) ITEM(ERROR_dstMaxSize_tooSmall) \
- ITEM(ERROR_decompressionFailed) \
- ITEM(ERROR_checksum_invalid) \
- ITEM(ERROR_maxCode)
-
-#define LZ4F_GENERATE_ENUM(ENUM) ENUM,
-typedef enum { LZ4F_LIST_ERRORS(LZ4F_GENERATE_ENUM) } LZ4F_errorCodes; /* enum is exposed, to detect & handle specific errors; compare function result to -enum value */
-
-int LZ4F_isError(LZ4F_errorCode_t code); /* Basically : code > -ERROR_maxCode */
+
+unsigned LZ4F_isError(LZ4F_errorCode_t code);
const char* LZ4F_getErrorName(LZ4F_errorCode_t code); /* return error code string; useful for debugging */
@@ -108,7 +96,7 @@ size_t LZ4F_compressFrameBound(size_t srcSize, const LZ4F_preferences_t* prefere
size_t LZ4F_compressFrame(void* dstBuffer, size_t dstMaxSize, const void* srcBuffer, size_t srcSize, const LZ4F_preferences_t* preferencesPtr);
/* LZ4F_compressFrame()
- * Compress an entire srcBuffer into a valid LZ4 frame, as defined by specification v1.4.1, in a single step.
+ * Compress an entire srcBuffer into a valid LZ4 frame, as defined by specification v1.4.1.
* The most important rule is that dstBuffer MUST be large enough (dstMaxSize) to ensure compression completion even in worst case.
* You can get the minimum value of dstMaxSize by using LZ4F_compressFrameBound()
* If this condition is not respected, LZ4F_compressFrame() will fail (result is an errorCode)