summaryrefslogtreecommitdiffstats
path: root/lz4frame.h
diff options
context:
space:
mode:
authorYann Collet <yann.collet.73@gmail.com>2014-09-21 08:56:21 (GMT)
committerYann Collet <yann.collet.73@gmail.com>2014-09-21 08:56:21 (GMT)
commiteeb9011467d4064eca754bd32e629e88fa5ec8f3 (patch)
tree1a2274334233a0db5df0a0290ed4a790baa7d567 /lz4frame.h
parentd71b9e25b729e92871cd6a9791170e334d5199d1 (diff)
downloadlz4-eeb9011467d4064eca754bd32e629e88fa5ec8f3.zip
lz4-eeb9011467d4064eca754bd32e629e88fa5ec8f3.tar.gz
lz4-eeb9011467d4064eca754bd32e629e88fa5ec8f3.tar.bz2
lz4frame : support stableDst option
Multiple bugfixes within lz4frame decompression Small decompression speed improvements Improved fuzzer test, with more thorough and complex tests
Diffstat (limited to 'lz4frame.h')
-rw-r--r--lz4frame.h23
1 files changed, 13 insertions, 10 deletions
diff --git a/lz4frame.h b/lz4frame.h
index 4bc8c59..d24a824 100644
--- a/lz4frame.h
+++ b/lz4frame.h
@@ -59,18 +59,21 @@ extern "C" {
Error management
**************************************/
typedef size_t LZ4F_errorCode_t;
-typedef enum { OK_FrameEnd = 1 } LZ4F_successCodes;
-typedef enum { OK_NoError = 0, ERROR_GENERIC = 1,
- ERROR_maxBlockSize_invalid, ERROR_blockMode_invalid, ERROR_contentChecksumFlag_invalid,
- ERROR_compressionLevel_invalid,
- ERROR_allocation_failed,
- ERROR_srcSize_tooLarge, ERROR_dstMaxSize_tooSmall,
- ERROR_checksum_invalid,
- ERROR_maxCode
- } LZ4F_errorCodes; /* error codes are negative unsigned values.
- Compare function result to (-specificCode) */
+#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 let programmer detect & handle specific errors */
int LZ4F_isError(LZ4F_errorCode_t code); /* Basically : code > -ERROR_maxCode */
+const char* LZ4F_getErrorName(LZ4F_errorCode_t code); /* return enum as string */
/**************************************