zstd_compress_using_cdict(9)
π zstd_compress_using_cdict β the Kernel API Manual moment
okay so bestie, welcome to the zstd_compress_using_cdict(9) page, straight out of the kernel API manual β¨ this is the one where you take ur data and squish it into a smaller buffer with a dictionary, and honestly? iconic behavior.
πΈ NAME πΈ
zstd_compress_using_cdict β compress src into dst using a dictionary π
like, that's it. that's the whole vibe. dictionary-powered compression, no cap.
π SYNOPSIS π
size_t zstd_compress_using_cdict (zstd_cctx *cctx , void *dst , size_t
dst_capacity , const void *src , size_t src_size , const zstd_cdict
*cdict );
she's got six parameters and she's not sorry about it π«Ά
β¨ ARGUMENTS β¨
cctxβ the context, bestie. it must have been initialized withzstd_init_cctx. no init, no compression, fr fr πdstβ the buffer you're squeezingsrcinto. destination era πdst_capacityβ how big the destination buffer is. it may be any size, butZSTD_compressBound(srcSize)is guaranteed to be large enough. so like, you can wing it, but if you want to be safe-safe, use that πsrcβ the actual data you wanna compress. the main character of this whole operation πsrc_sizeβ the size of the data you're compressing. gotta know how much you're working with πcdictβ the dictionary being used. the whole reason this function has using_cdict in the name, iykyk π¦
π₯ RETURN π₯
the compressed size, or an error π and you can check whether it's an error with zstd_is_error. always do the vibe check, bestie β don't just assume it slayed.
β SEE ALSO β
kernel file ./include/linux/zstd.h and like, the whole zstd friend group π
:
zstd_compress_bound(9)zstd_is_error(9)zstd_get_error_code(9)zstd_get_error_name(9)zstd_min_clevel(9)zstd_max_clevel(9)zstd_default_clevel(9)zstd_get_params(9)zstd_get_cparams(9)zstd_cctx_set_param(9)zstd_cctx_workspace_bound(9)zstd_cctx_workspace_bound_with_ext_seq_prod(9)zstd_init_cctx(9)zstd_compress_cctx(9)zstd_create_cctx_advanced(9)zstd_free_cctx(9)zstd_create_cdict_byreference(9)zstd_free_cdict(9)zstd_dctx_workspace_bound(9)zstd_init_dctx(9)zstd_decompress_dctx(9)zstd_create_ddict_byreference(9)zstd_free_ddict(9)zstd_create_dctx_advanced(9)zstd_free_dctx(9)zstd_decompress_using_ddict(9)zstd_cstream_workspace_bound(9)zstd_cstream_workspace_bound_with_ext_seq_prod(9)zstd_init_cstream(9)zstd_reset_cstream(9)zstd_compress_stream(9)zstd_flush_stream(9)zstd_end_stream(9)zstd_dstream_workspace_bound(9)zstd_init_dstream(9)zstd_reset_dstream(9)zstd_decompress_stream(9)zstd_find_frame_compressed_size(9)zstd_get_frame_header(9)zstd_compress_sequences_and_literals(9)
go read them. all of them. she said what she said πβ¨
and that's the page, bestie π§ this little number lives in ./include/linux and it's dated October 2026, and yes we're still out here citing zstd_compress_using_cdict(9) like the queen she is. mwah ππ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms