zstd_compres...and_literals(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… zstd_compress_sequences_and_literals β€” a kernel API glow-up

Okay bestie, welcome to the zstd_compres...and_literals(9) page from the Kernel API Manual ✨ no cap, the name is a whole mouthful (the man page legit truncates it, iconic), but the function itself is zstd_compress_sequences_and_literals β€” and it does exactly what it says on the tin: it compresses an array of zstd_sequence plus literals. Slay. πŸŽ€


✨ NAME ✨

zstd_compress_sequences_and_literals β€” compress an array of zstd_sequence and literals πŸ’–


🌸 SYNOPSIS 🌸

size_t zstd_compress_sequences_and_literals (zstd_cctx *cctx , void* dst
, size_t dst_capacity , const zstd_sequence *in_seqs , size_t
in_seqs_size , const void* literals , size_t lit_size , size_t
lit_capacity , size_t decompressed_size );

Nine parameters, bestie. Nine. She's high-maintenance but she's worth it πŸ’…


πŸ¦‹ ARGUMENTS πŸ¦‹

Every single one, laid out like a group chat roll call:

  • cctx β€” the zstd compression context. Your main character. πŸ‘‘
  • dst β€” the buffer you're compressing the data into.
  • dst_capacity β€” the size of the destination buffer. Don't be weird about it, just tell her how big she is.
  • in_seqs β€” the array of zstd_sequence to compress. The whole squad.
  • in_seqs_size β€” how many sequences are actually in in_seqs. Count your friends, girl.
  • literals β€” the literals associated with the sequences being compressed. They come as a pair, iykyk 🫢
  • lit_size β€” the size of the literals in the literals buffer.
  • lit_capacity β€” the size of the literals buffer. (Yes, lit_size and lit_capacity are two different things. Both matter. Periodt.)
  • decompressed_size β€” the size of the input data.

πŸ”₯ RETURN πŸ”₯

She returns the compressed size β€” or an error, if things went sideways 😭. You can vibe-check whether it's an error with zstd_is_error.


🌈 SEE ALSO 🌈

Kernel file ./include/linux/zstd.h β€” go read it, it's giving lore πŸ“–

And the whole extended friend group, no one left out:

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_compress_using_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)


Ngl bestie, this one lives in the kernel tree under ./include/linux β€” that's the source, and the version stamp is October 2026. Also she's a 9 section page, so kernel API only, no userland shenanigans πŸ™ˆ

Anyway, that's the whole page, you ate it up, go compress something πŸ“πŸ’œ bye bestie!

πŸ“¦ where this page comes from