函数逻辑报告 |
Source Code:lib\zstd\compress.c |
Create Date:2022-07-27 08:02:50 |
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
| 首页 | 函数Tree |
| 注解内核,赢得工具 | 下载SCCT | English |
函数名称: : compressed size, or an error code
函数原型:static size_t ZSTD_compress_generic(ZSTD_CCtx *cctx, void *dst, size_t dstCapacity, const void *src, size_t srcSize, U32 lastFrameChunk)
返回类型:size_t
参数:
| 类型 | 参数 | 名称 |
|---|---|---|
| ZSTD_CCtx * | cctx | |
| void * | dst | |
| size_t | dstCapacity | |
| const void * | src | |
| size_t | srcSize | |
| U32 | lastFrameChunk |
| 2364 | 如果checksumFlag且srcSize则xxh64_update( & xxhState, src, srcSize) |
| 2368 | lastBlock等于lastFrameChunk按位与blockSize大于等于remaining |
| 2371 | 如果dstCapacity小于ZSTD_blockHeaderSize加r a non-null block 则返回:-***************************************** Error codes handling(dstSize_tooSmall) |
| 2377 | 如果lowLimit大于3U左移29位则 |
| 2381 | correction等于curr减newCurr |
| 2384 | base加等于correction |
| 2385 | dictBase加等于correction |
| 2386 | lowLimit减等于correction |
| 2387 | dictLimit减等于correction |
| 2388 | 如果nextToUpdate小于correction则nextToUpdate等于0 |
| 2390 | 否则nextToUpdate减等于correction |
| 2394 | 如果ip加blockSize减base大于loadedDictEnd加maxDist则 |
| 2396 | newLowLimit等于ip加blockSize减base减maxDist |
| 2397 | 如果lowLimit小于newLowLimit则lowLimit等于newLowLimit |
| 2403 | cSize等于ZSTD_compressBlock_internal(cctx, op + ZSTD_blockHeaderSize, dstCapacity - ZSTD_blockHeaderSize, ip, blockSize) |
| 2404 | 如果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.则返回:cSize |
| 2407 | 如果cSize恒等于0则 |
| 2408 | cBlockHeader24等于lastBlock加bt_raw左移1位的值加blockSize左移3位的值 |
| 2409 | 如果blockSize加ZSTD_blockHeaderSize大于dstCapacity则返回:-***************************************** Error codes handling(dstSize_tooSmall) |
| 2411 | ZSTD_writeLE32(op, cBlockHeader24) |
| 2412 | 内存复制(op + ZSTD_blockHeaderSize, ip, blockSize) |
| 2414 | 否则 |
| 2415 | cBlockHeader24等于lastBlock加bt_compressed左移1位的值加cSize左移3位的值 |
| 2416 | ZSTD_writeLE24(op, cBlockHeader24) |
| 2417 | cSize加等于ZSTD_blockHeaderSize |
| 2421 | dstCapacity减等于cSize |
| 2426 | 如果lastFrameChunk且op大于ostart则stage等于ZSTDcs_ending |
| 名称 | 描述 |
|---|---|
| ZSTD_compressContinue_internal |
| 源代码转换工具 开放的插件接口 | X |
|---|---|
| 支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |
摘要:! ZSTD_compress_generic() :* Compress a chunk of data into one or multiple blocks.* All blocks will be terminated, all input will be consumed.* Function will issue an error if there is not enough `dstCapacity` to hold the compressed content.* Frame is supposed already started (header already produced)