zstd_compress_cctx(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… zstd_compress_cctx(9)

okay so this is a page from the Kernel API Manual β€” yes bestie, we're in kernel-land now, it's giving "big brain main character energy" and honestly? iconic πŸŽ€

✨ NAME ✨

zstd_compress_cctx β€” compress src into dst with the initialized parameters 🫢

🌸 SYNOPSIS 🌸

size_t zstd_compress_cctx (zstd_cctx *cctx , void *dst , size_t
dst_capacity , const void *src , size_t src_size , const zstd_parameters
*parameters );

no cap, that's the whole signature, keep it exactly like that πŸ’–

πŸ¦‹ ARGUMENTS πŸ¦‹

  • cctx β€” the context, bestie. it must have been initialized with zstd_init_cctx β€” like, this is not optional, do not skip this step πŸ™ˆ
  • dst β€” the buffer you're compressing src into. that's her home now πŸ’…
  • dst_capacity β€” the size of the destination buffer. lowkey it may be any size, but ZSTD_compressBound(srcSize) is guaranteed to be large enough. so if you want the safe route, that's the vibe ⭐
  • src β€” the data to compress. the raw material, the moment, the muse ✨
  • src_size β€” the size of the data to compress. gotta know how much you're working with πŸ“
  • parameters β€” the compression parameters to be used. the settings, the lewk, the whole aesthetic πŸŽ€

πŸ”₯ RETURN πŸ”₯

it returns the compressed size πŸ’– β€” or an error 😭, which you can check using zstd_is_error. fr fr, always check, don't just assume it slayed.

πŸ‘‘ SEE ALSO πŸ‘‘

kernel file ./include/linux/zstd.h plus the whole friend group:


that's the whole page, bestie β€” go compress something and slay πŸ’œ

source path: ./include/linux Β· dated October 2026 Β· manual: zstd_compress_cctx(9) β€” ok that's the cute sign-off, ily, bye πŸ§šβ€β™€οΈπŸ’–

πŸ“¦ where this page comes from