zstd_compress_using_cdict(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 with zstd_init_cctx. no init, no compression, fr fr πŸ’€
  • dst β€” the buffer you're squeezing src into. destination era 🌈
  • dst_capacity β€” how big the destination buffer is. it may be any size, but ZSTD_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 πŸ’…:

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