VENTI-ZERO(3)
π
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 thesize-byte buffer pointed to bybuf, ignoring trailing zeros or zero scores, according to the giventype. It's giving βwhere does the actual content end?β energy.Vtzeroextendβ padsbufwith zeros or zero scores, according to the giventype, to grow it fromsizebytes tonewsizebytes. Stretch that block, bestie.Vtzeroscoreβ the score of the zero-length block. Tiny, iconic, and it's literally declared asextern 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 π«Άβ¨π
π¦ where this page comes from
- alpine 3.24: plan9port-doc 0_git20260208-r0 Β· LPL-1.02
- arch rolling: plan9port 20261021-2 Β· custom
- nixos 26.05: plan9port 0-unstable-2025-11-10
- nixos 26.05: plan9port-wayland 0-unstable-2025-11-26
- nixpkgs unstable: plan9port 0-unstable-2025-11-10
- nixpkgs unstable: plan9port-wayland 0-unstable-2025-11-26
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms