diff options
author | Tim Zakian <2895723+tzakian@users.noreply.github.com> | 2019-01-09 18:49:49 (GMT) |
---|---|---|
committer | Tim Zakian <2895723+tzakian@users.noreply.github.com> | 2019-01-09 18:49:49 (GMT) |
commit | 81937422514f5b6847d1a99cd5315449ec59566e (patch) | |
tree | f7fd4d6b2c5c28540dfb3444ffb58406eea9dbbb /lib/lz4frame.c | |
parent | d6eac9c5cf376570595e07115304fbbbdeb32a06 (diff) | |
download | lz4-81937422514f5b6847d1a99cd5315449ec59566e.zip lz4-81937422514f5b6847d1a99cd5315449ec59566e.tar.gz lz4-81937422514f5b6847d1a99cd5315449ec59566e.tar.bz2 |
Make LZ4F_getBlockSize public and publis in experimental section
Diffstat (limited to 'lib/lz4frame.c')
-rw-r--r-- | lib/lz4frame.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/lib/lz4frame.c b/lib/lz4frame.c index 705832d..3f81ef0 100644 --- a/lib/lz4frame.c +++ b/lib/lz4frame.c @@ -265,22 +265,21 @@ unsigned LZ4F_getVersion(void) { return LZ4F_VERSION; } int LZ4F_compressionLevel_max(void) { return LZ4HC_CLEVEL_MAX; } - -/*-************************************ -* Private functions -**************************************/ -#define MIN(a,b) ( (a) < (b) ? (a) : (b) ) - -static size_t LZ4F_getBlockSize(unsigned blockSizeID) +size_t LZ4F_getBlockSize(unsigned blockSizeID) { static const size_t blockSizes[4] = { 64 KB, 256 KB, 1 MB, 4 MB }; if (blockSizeID == 0) blockSizeID = LZ4F_BLOCKSIZEID_DEFAULT; + if (blockSizeID < 4 || blockSizeID > 7) return err0r(LZ4F_ERROR_maxBlockSize_invalid); blockSizeID -= 4; - if (blockSizeID > 3) return err0r(LZ4F_ERROR_maxBlockSize_invalid); return blockSizes[blockSizeID]; } +/*-************************************ +* Private functions +**************************************/ +#define MIN(a,b) ( (a) < (b) ? (a) : (b) ) + static BYTE LZ4F_headerChecksum (const void* header, size_t length) { U32 const xxh = XXH32(header, length, 0); |