Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\zstd\decompress.c Create Date:2022-07-28 07:07:22
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name: : the compressed size of the frame starting at `src`

Proto:size_t ZSTD_findFrameCompressedSize(const void *src, size_t srcSize)

Type:size_t

Parameter:

TypeParameterName
const void *src
size_tsrcSize

Brief:ZSTD_findFrameCompressedSize() :* compatible with legacy mode* `src` must point to the start of a ZSTD frame, ZSTD legacy frame, or skippable frame* `srcSize` must be at least as large as the frame contained

1512  If srcSize >= magic number + skippable frame length && (ZSTD_readLE32(src) & 0xFFFFFFF0U) == ZSTD_MAGIC_SKIPPABLE_START Then
1513  Return magic number + skippable frame length + ZSTD_readLE32((constBYTE * )src + 4)
1514  Else
1515  ip = src
1516  ipstart = ip
1517  remainingSize = srcSize
1520  headerSize = : size of the Frame Header
1521  If ZSTD_isError() - tells if a size_t function result is an error code*@code: The function result to check for error.* Return: Non-zero iff the code is an error. Then Return headerSize
1526  ret = : 0, `fparamsPtr` is correctly filled,
1527  If ZSTD_isError() - tells if a size_t function result is an error code*@code: The function result to check for error.* Return: Non-zero iff the code is an error. Then Return ret
1529  If ret > 0 Then Return -***************************************** Error codes handling(srcSize_wrong)
1533  ip += headerSize
1534  remainingSize -= headerSize
1537  When 1 cycle
1539  cBlockSize = ! ZSTD_getcBlockSize() :* Provides the size of compressed block from block header `src`
1540  If ZSTD_isError() - tells if a size_t function result is an error code*@code: The function result to check for error.* Return: Non-zero iff the code is an error. Then Return cBlockSize
1543  If ZSTD_blockHeaderSize + cBlockSize > remainingSize Then Return -***************************************** Error codes handling(srcSize_wrong)
1546  ip += ZSTD_blockHeaderSize + cBlockSize
1547  remainingSize -= ZSTD_blockHeaderSize + cBlockSize
1549  If lastBlock Then Break
1553  If checksumFlag Then
1554  If remainingSize < 4 Then Return -***************************************** Error codes handling(srcSize_wrong)
1556  ip += 4
1557  remainingSize -= 4
1560  Return ip - ipstart
Caller
NameDescribe
ZSTD_findDecompressedSize : decompressed size of the frames contained
ZSTD_decompressStream