Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name: : 0, `fparamsPtr` is correctly filled,

Proto:size_t ZSTD_getFrameParams(ZSTD_frameParams *fparamsPtr, const void *src, size_t srcSize)

Type:size_t

Parameter:

TypeParameterName
ZSTD_frameParams *fparamsPtr
const void *src
size_tsrcSize

Brief:ZSTD_getFrameParams() :* decode Frame Header, or require larger `srcSize`.* >0, `srcSize` is too small, result is expected `srcSize`,* or an error code, which can be tested using ZSTD_isError()

209  ip = src
211  If srcSize < ZSTD_frameHeaderSize_prefix Then Return ZSTD_frameHeaderSize_prefix
213  If ZSTD_readLE32(src) != >= v0.8.0 Then
214  If (ZSTD_readLE32(src) & 0xFFFFFFF0U) == ZSTD_MAGIC_SKIPPABLE_START Then
217  memset(fparamsPtr, 0, size of fparamsPtr )
218  frameContentSize = ZSTD_readLE32((constchar * )src + 4)
219  windowSize = 0
220  Return 0
222  Return -***************************************** Error codes handling(prefix_unknown)
227  fhsize = : size of the Frame Header
228  If srcSize < fhsize Then Return fhsize
233  fhdByte = ip[4]
234  pos = 5
235  dictIDSizeCode = fhdByte & 3
236  checksumFlag = fhdByte >> 2 & 1
237  singleSegment = fhdByte >> 5 & 1
238  fcsID = fhdByte >> 6
239  windowSizeMax = 1U << ZSTD_WINDOWLOG_MAX
240  windowSize = 0
241  dictID = 0
242  frameContentSize = 0
243  If (fhdByte & 0x08) != 0 Then Return -***************************************** Error codes handling(frameParameter_unsupported)
245  If Not singleSegment Then
246  wlByte = ip[pos++]
250  windowSize = 1U << windowLog
251  windowSize += (windowSize >> 3) * (wlByte & 7)
255  Default
256  Case dictIDSizeCode == 0
256  Break
257  Case dictIDSizeCode == 1
258  dictID = ip[pos]
259  pos++
260  Break
261  Case dictIDSizeCode == 2
263  pos += 2
264  Break
265  Case dictIDSizeCode == 3
266  dictID = ZSTD_readLE32(ip + pos)
267  pos += 4
268  Break
271  Default
272  Case fcsID == 0
275  Break
276  Case fcsID == 1
276  Break
277  Case fcsID == 2
277  Break
278  Case fcsID == 3
278  Break
280  If Not windowSize Then windowSize = frameContentSize
286  dictID = dictID
289  Return 0
Caller
NameDescribe
ZSTD_getFrameContentSize : decompressed size of the single frame pointed to be `src` if known, otherwise
ZSTD_decodeFrameHeader : 0 if success, or an error code, which can be tested using ZSTD_isError()
ZSTD_findFrameCompressedSize : the compressed size of the frame starting at `src`
ZSTD_getDictID_fromFrame! ZSTD_getDictID_fromFrame() :* Provides the dictID required to decompressed the frame stored within `src`.* If @return == 0, the dictID could not be decoded.* This could for one of the following reasons :
ZSTD_decompressStream