lz77_encode_match(9)
π lz77_encode_match β bestie's guide to match encoding π
okay so this one lives in the Kernel API Manual (yes, the kernel has a manual, and yes it's iconic) and it's called lz77_encode_match(9). buckle up, it's actually short and slay. π
β¨ NAME β¨
lz77_encode_match β match encoding. that's it. that's the whole vibe. it encodes a match. periodt. π
β¨ SYNOPSIS β¨
void * lz77_encode_match (void *dst , void **nib , u16 dist , u32 len );
look at her. four args, returns a pointer, no cap. π«Ά
β¨ ARGUMENTS β¨
so these four besties walk into a function:
dstβ the compressed buffer. this is the main character, the one getting written into. πnibβ a pointer to an address indst. like, a pointer inside the buffer. nested pointer energy, highkey iconic. π¦distβ the match distance. how far back we're reaching, ngl. π§lenβ the match length. how much we're grabbing from back there. β¨
it's typedu16 distandu32 lenfr fr β short distance, long length, that's the signature, don't @ me.
β¨ DESCRIPTION β¨
so the description is literally one line and it's giving confident:
Assumes all args were previously checked. π
like ok queen, she's not doing the vibe check herself β somebody already validated everything before calling her, and she trusts that. so please, please do your checking before you pass stuff in, because she will not be re-checking it for you. π
and here's the receipt, the reference, the source-of-truth citation:
Ref: MS-XCA 2.3.4 "Plain LZ77 Compression Algorithm Details" - "Processing"
that's where the algorithm brainrot comes from. go read it if you want the whole lore. π₯
β¨ RETURN β¨
dst advanced to new position. π
that's the whole return value. the buffer pointer, but moved forward. new position, new her. β
β¨ SEE ALSO β¨
- Kernel file
./fs/smb/common/compress/lz77.cβ the actual source, go read it bestie π lz77_encode_literals(9)β the sibling function, the literal counterpart, the other half of the duo π
anyway that's the whole page, no filler, all facts, all slay ππΈ
also lowkey: this page is from ./fs/smb/common/compress and it's dated October 2026 β yes, the future, because we're just that ahead. π°οΈβ¨ and the manual name up top? Kernel API Manual, iykyk. π«Ά
bye bestie, go encode some matches πππ¦
π¦ 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