VENTI-ZERO(3)

πŸ“¦ version 0_git20260208, in alpine 3.24, arch rolling, nixos 26.05, nixpkgs unstable

πŸ’… okay bestie, welcome to VENTI-ZERO(3) from the Library Functions Manual πŸ’…

✨ NAME ✨

  • vtzerotruncate, vtzeroextend, vtzeroscore β€” Venti block truncation, and yes these three are the whole squad πŸ’–

🌸 SYNOPSIS 🌸

#include <u.h>
#include <libc.h>
#include <venti.h>

uint vtzerotruncate(int type, uchar *buf, uint size)

void vtzeroextend(int type, uchar *buf, uint size, uint newsize)

extern uchar vtzeroscore[VtScoreSize];

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so these utility functions are lowkey here to figure out how to truncate or replace trailing zeros β€” that's for data blocks β€” or trailing zero scores β€” that's for pointer blocks β€” so the blocks can be canonicalized before they get stored to Venti. Periodt.

  • Vtzerotruncate β€” returns the size of the size-byte buffer pointed to by buf, ignoring trailing zeros or zero scores, according to the given type. It's giving β€œwhere does the actual content end?” energy.
  • Vtzeroextend β€” pads buf with zeros or zero scores, according to the given type, to grow it from size bytes to newsize bytes. Stretch that block, bestie.
  • Vtzeroscore β€” the score of the zero-length block. Tiny, iconic, and it's literally declared as extern uchar vtzeroscore[VtScoreSize]; up in the synopsis.
no cap: the type matters here β€” it's the thing telling these functions whether they're dealing with zeros or zero scores πŸ’…

πŸŽ€ SOURCE πŸŽ€

  • /src/libventi/zero.c
  • /src/libventi/zeroscore.c

πŸ”₯ SEE ALSO πŸ”₯

that's the whole page, bestie β€” VENTI-ZERO(3) from the Library Functions Manual, sourced from /src/libventi/zero.c and /src/libventi/zeroscore.c 🫢✨πŸ’