Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:ZSTD_compressStream_generic

Proto:static size_t ZSTD_compressStream_generic(ZSTD_CStream *zcs, void *dst, size_t *dstCapacityPtr, const void *src, size_t *srcSizePtr, ZSTD_flush_e const flush)

Type:size_t

Parameter:

TypeParameterName
ZSTD_CStream *zcs
void *dst
size_t *dstCapacityPtr
const void *src
size_t *srcSizePtr
ZSTD_flush_e constflush
3131  someMoreWork = 1
3132  istart = src
3133  iend = istart + srcSizePtr
3134  ip = istart
3135  ostart = dst
3136  oend = ostart + dstCapacityPtr
3137  op = ostart
3139  When someMoreWork cycle
3141  Case stage == zcss_init
3144  Case stage == zcss_load
3149  inBuffPos += loaded
3150  ip += loaded
3151  If inBuffPos == inToCompress || Not flush && toLoad != loaded Then
3152  someMoreWork = 0
3153  Break
3161  oSize = oend - op
3164  Else cDst = outBuff , oSize = outBuffSize
3170  If flush == zsf_end Then frameEnded = 1
3177  If cDst == op Then
3178  op += cSize
3179  Break
3182  outBuffFlushedSize = 0
3183  stage = zcss_flush
3187  Case stage == zcss_flush
3188  toFlush = outBuffContentSize - outBuffFlushedSize
3189  flushed = ZSTD_limitCopy(op, oend - op, outBuff + outBuffFlushedSize, toFlush)
3190  op += flushed
3191  outBuffFlushedSize += flushed
3192  If toFlush != flushed Then
3193  someMoreWork = 0
3194  Break
3196  outBuffContentSize = outBuffFlushedSize = 0
3197  stage = zcss_load
3198  Break
3201  Case stage == zcss_final
3202  someMoreWork = 0
3203  Break
3205  Default
3206  Return -***************************************** Error codes handling(GENERIC)
3210  srcSizePtr = ip - istart
3211  dstCapacityPtr = op - ostart
3212  inputProcessed += srcSizePtr
3213  If frameEnded Then Return 0
3216  hintInSize = inBuffTarget - inBuffPos
3217  If hintInSize == 0 Then hintInSize = blockSize
3219  Return hintInSize
Caller
NameDescribe
ZSTD_compressStream
ZSTD_flushStream : amount of data remaining to flush
ZSTD_endStream