Lines Matching refs:zcs

202 size_t ZSTD_sizeof_CStream(const ZSTD_CStream* zcs)  in ZSTD_sizeof_CStream()  argument
204 return ZSTD_sizeof_CCtx(zcs); /* same object */ in ZSTD_sizeof_CStream()
5055 size_t ZSTD_freeCStream(ZSTD_CStream* zcs) in ZSTD_freeCStream() argument
5057 return ZSTD_freeCCtx(zcs); /* same object */ in ZSTD_freeCStream()
5081 size_t ZSTD_resetCStream(ZSTD_CStream* zcs, unsigned long long pss) in ZSTD_resetCStream() argument
5089 FORWARD_IF_ERROR( ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only) , ""); in ZSTD_resetCStream()
5090 FORWARD_IF_ERROR( ZSTD_CCtx_setPledgedSrcSize(zcs, pledgedSrcSize) , ""); in ZSTD_resetCStream()
5098 size_t ZSTD_initCStream_internal(ZSTD_CStream* zcs, in ZSTD_initCStream_internal() argument
5104 FORWARD_IF_ERROR( ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only) , ""); in ZSTD_initCStream_internal()
5105 FORWARD_IF_ERROR( ZSTD_CCtx_setPledgedSrcSize(zcs, pledgedSrcSize) , ""); in ZSTD_initCStream_internal()
5107 zcs->requestedParams = *params; in ZSTD_initCStream_internal()
5110 FORWARD_IF_ERROR( ZSTD_CCtx_loadDictionary(zcs, dict, dictSize) , ""); in ZSTD_initCStream_internal()
5113 FORWARD_IF_ERROR( ZSTD_CCtx_refCDict(zcs, cdict) , ""); in ZSTD_initCStream_internal()
5120 size_t ZSTD_initCStream_usingCDict_advanced(ZSTD_CStream* zcs, in ZSTD_initCStream_usingCDict_advanced() argument
5126 FORWARD_IF_ERROR( ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only) , ""); in ZSTD_initCStream_usingCDict_advanced()
5127 FORWARD_IF_ERROR( ZSTD_CCtx_setPledgedSrcSize(zcs, pledgedSrcSize) , ""); in ZSTD_initCStream_usingCDict_advanced()
5128 zcs->requestedParams.fParams = fParams; in ZSTD_initCStream_usingCDict_advanced()
5129 FORWARD_IF_ERROR( ZSTD_CCtx_refCDict(zcs, cdict) , ""); in ZSTD_initCStream_usingCDict_advanced()
5134 size_t ZSTD_initCStream_usingCDict(ZSTD_CStream* zcs, const ZSTD_CDict* cdict) in ZSTD_initCStream_usingCDict() argument
5137 FORWARD_IF_ERROR( ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only) , ""); in ZSTD_initCStream_usingCDict()
5138 FORWARD_IF_ERROR( ZSTD_CCtx_refCDict(zcs, cdict) , ""); in ZSTD_initCStream_usingCDict()
5147 size_t ZSTD_initCStream_advanced(ZSTD_CStream* zcs, in ZSTD_initCStream_advanced() argument
5157 FORWARD_IF_ERROR( ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only) , ""); in ZSTD_initCStream_advanced()
5158 FORWARD_IF_ERROR( ZSTD_CCtx_setPledgedSrcSize(zcs, pledgedSrcSize) , ""); in ZSTD_initCStream_advanced()
5160 ZSTD_CCtxParams_setZstdParams(&zcs->requestedParams, &params); in ZSTD_initCStream_advanced()
5161 FORWARD_IF_ERROR( ZSTD_CCtx_loadDictionary(zcs, dict, dictSize) , ""); in ZSTD_initCStream_advanced()
5165 size_t ZSTD_initCStream_usingDict(ZSTD_CStream* zcs, const void* dict, size_t dictSize, int compres… in ZSTD_initCStream_usingDict() argument
5168 FORWARD_IF_ERROR( ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only) , ""); in ZSTD_initCStream_usingDict()
5169 FORWARD_IF_ERROR( ZSTD_CCtx_setParameter(zcs, ZSTD_c_compressionLevel, compressionLevel) , ""); in ZSTD_initCStream_usingDict()
5170 FORWARD_IF_ERROR( ZSTD_CCtx_loadDictionary(zcs, dict, dictSize) , ""); in ZSTD_initCStream_usingDict()
5174 size_t ZSTD_initCStream_srcSize(ZSTD_CStream* zcs, int compressionLevel, unsigned long long pss) in ZSTD_initCStream_srcSize() argument
5182 FORWARD_IF_ERROR( ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only) , ""); in ZSTD_initCStream_srcSize()
5183 FORWARD_IF_ERROR( ZSTD_CCtx_refCDict(zcs, NULL) , ""); in ZSTD_initCStream_srcSize()
5184 FORWARD_IF_ERROR( ZSTD_CCtx_setParameter(zcs, ZSTD_c_compressionLevel, compressionLevel) , ""); in ZSTD_initCStream_srcSize()
5185 FORWARD_IF_ERROR( ZSTD_CCtx_setPledgedSrcSize(zcs, pledgedSrcSize) , ""); in ZSTD_initCStream_srcSize()
5189 size_t ZSTD_initCStream(ZSTD_CStream* zcs, int compressionLevel) in ZSTD_initCStream() argument
5192 FORWARD_IF_ERROR( ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only) , ""); in ZSTD_initCStream()
5193 FORWARD_IF_ERROR( ZSTD_CCtx_refCDict(zcs, NULL) , ""); in ZSTD_initCStream()
5194 FORWARD_IF_ERROR( ZSTD_CCtx_setParameter(zcs, ZSTD_c_compressionLevel, compressionLevel) , ""); in ZSTD_initCStream()
5211 static size_t ZSTD_compressStream_generic(ZSTD_CStream* zcs, in ZSTD_compressStream_generic() argument
5226 if (zcs->appliedParams.inBufferMode == ZSTD_bm_buffered) { in ZSTD_compressStream_generic()
5227 assert(zcs->inBuff != NULL); in ZSTD_compressStream_generic()
5228 assert(zcs->inBuffSize > 0); in ZSTD_compressStream_generic()
5230 if (zcs->appliedParams.outBufferMode == ZSTD_bm_buffered) { in ZSTD_compressStream_generic()
5231 assert(zcs->outBuff != NULL); in ZSTD_compressStream_generic()
5232 assert(zcs->outBuffSize > 0); in ZSTD_compressStream_generic()
5239 switch(zcs->streamStage) in ZSTD_compressStream_generic()
5247 …|| zcs->appliedParams.outBufferMode == ZSTD_bm_stable) /* OR we are allowed to return dstSizeTooS… in ZSTD_compressStream_generic()
5248 && (zcs->inBuffPos == 0) ) { in ZSTD_compressStream_generic()
5250 size_t const cSize = ZSTD_compressEnd(zcs, in ZSTD_compressStream_generic()
5256 zcs->frameEnded = 1; in ZSTD_compressStream_generic()
5257 ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only); in ZSTD_compressStream_generic()
5261 if (zcs->appliedParams.inBufferMode == ZSTD_bm_buffered) { in ZSTD_compressStream_generic()
5262 size_t const toLoad = zcs->inBuffTarget - zcs->inBuffPos; in ZSTD_compressStream_generic()
5264 zcs->inBuff + zcs->inBuffPos, toLoad, in ZSTD_compressStream_generic()
5266 zcs->inBuffPos += loaded; in ZSTD_compressStream_generic()
5270 && (zcs->inBuffPos < zcs->inBuffTarget) ) { in ZSTD_compressStream_generic()
5275 && (zcs->inBuffPos == zcs->inToCompress) ) { in ZSTD_compressStream_generic()
5282 { int const inputBuffered = (zcs->appliedParams.inBufferMode == ZSTD_bm_buffered); in ZSTD_compressStream_generic()
5287 ? zcs->inBuffPos - zcs->inToCompress in ZSTD_compressStream_generic()
5288 : MIN((size_t)(iend - ip), zcs->blockSize); in ZSTD_compressStream_generic()
5289 … if (oSize >= ZSTD_compressBound(iSize) || zcs->appliedParams.outBufferMode == ZSTD_bm_stable) in ZSTD_compressStream_generic()
5292 cDst = zcs->outBuff, oSize = zcs->outBuffSize; in ZSTD_compressStream_generic()
5296 ZSTD_compressEnd(zcs, cDst, oSize, in ZSTD_compressStream_generic()
5297 zcs->inBuff + zcs->inToCompress, iSize) : in ZSTD_compressStream_generic()
5298 ZSTD_compressContinue(zcs, cDst, oSize, in ZSTD_compressStream_generic()
5299 zcs->inBuff + zcs->inToCompress, iSize); in ZSTD_compressStream_generic()
5301 zcs->frameEnded = lastBlock; in ZSTD_compressStream_generic()
5303 zcs->inBuffTarget = zcs->inBuffPos + zcs->blockSize; in ZSTD_compressStream_generic()
5304 if (zcs->inBuffTarget > zcs->inBuffSize) in ZSTD_compressStream_generic()
5305 zcs->inBuffPos = 0, zcs->inBuffTarget = zcs->blockSize; in ZSTD_compressStream_generic()
5307 (unsigned)zcs->inBuffTarget, (unsigned)zcs->inBuffSize); in ZSTD_compressStream_generic()
5309 assert(zcs->inBuffTarget <= zcs->inBuffSize); in ZSTD_compressStream_generic()
5310 zcs->inToCompress = zcs->inBuffPos; in ZSTD_compressStream_generic()
5315 ZSTD_compressEnd(zcs, cDst, oSize, ip, iSize) : in ZSTD_compressStream_generic()
5316 ZSTD_compressContinue(zcs, cDst, oSize, ip, iSize); in ZSTD_compressStream_generic()
5321 zcs->frameEnded = lastBlock; in ZSTD_compressStream_generic()
5327 if (zcs->frameEnded) { in ZSTD_compressStream_generic()
5330 ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only); in ZSTD_compressStream_generic()
5334 zcs->outBuffContentSize = cSize; in ZSTD_compressStream_generic()
5335 zcs->outBuffFlushedSize = 0; in ZSTD_compressStream_generic()
5336 zcs->streamStage = zcss_flush; /* pass-through to flush stage */ in ZSTD_compressStream_generic()
5341 assert(zcs->appliedParams.outBufferMode == ZSTD_bm_buffered); in ZSTD_compressStream_generic()
5342 { size_t const toFlush = zcs->outBuffContentSize - zcs->outBuffFlushedSize; in ZSTD_compressStream_generic()
5344 zcs->outBuff + zcs->outBuffFlushedSize, toFlush); in ZSTD_compressStream_generic()
5349 zcs->outBuffFlushedSize += flushed; in ZSTD_compressStream_generic()
5356 zcs->outBuffContentSize = zcs->outBuffFlushedSize = 0; in ZSTD_compressStream_generic()
5357 if (zcs->frameEnded) { in ZSTD_compressStream_generic()
5360 ZSTD_CCtx_reset(zcs, ZSTD_reset_session_only); in ZSTD_compressStream_generic()
5363 zcs->streamStage = zcss_load; in ZSTD_compressStream_generic()
5374 if (zcs->frameEnded) return 0; in ZSTD_compressStream_generic()
5375 return ZSTD_nextInputSizeHint(zcs); in ZSTD_compressStream_generic()
5384 size_t ZSTD_compressStream(ZSTD_CStream* zcs, ZSTD_outBuffer* output, ZSTD_inBuffer* input) in ZSTD_compressStream() argument
5386 FORWARD_IF_ERROR( ZSTD_compressStream2(zcs, output, input, ZSTD_e_continue) , ""); in ZSTD_compressStream()
5387 return ZSTD_nextInputSizeHint_MTorST(zcs); in ZSTD_compressStream()
5962 size_t ZSTD_flushStream(ZSTD_CStream* zcs, ZSTD_outBuffer* output) in ZSTD_flushStream() argument
5965 return ZSTD_compressStream2(zcs, output, &input, ZSTD_e_flush); in ZSTD_flushStream()
5969 size_t ZSTD_endStream(ZSTD_CStream* zcs, ZSTD_outBuffer* output) in ZSTD_endStream() argument
5972 size_t const remainingToFlush = ZSTD_compressStream2(zcs, output, &input, ZSTD_e_end); in ZSTD_endStream()
5974 if (zcs->appliedParams.nbWorkers > 0) return remainingToFlush; /* minimal estimation */ in ZSTD_endStream()
5976 { size_t const lastBlockSize = zcs->frameEnded ? 0 : ZSTD_BLOCKHEADERSIZE; in ZSTD_endStream()
5977 …size_t const checksumSize = (size_t)(zcs->frameEnded ? 0 : zcs->appliedParams.fParams.checksumFlag… in ZSTD_endStream()