ZT_VALUE(3)
π zt_value(3) π
okay bestie, welcome to the local manual for zt_value and zt_value_kind β the variant type that carries data into claim verifiers. it's a LOCAL page, it's untitled in the fancy header sense, and it is so much more fun than it sounds. let's go π
β¨ NAME β¨
zt_value, zt_value_kind β variant type for passing data into claim verifiers
π¦ SYNOPSIS π¦
#include <zt.h>
typedef struct zt_value { ... } zt_value;
so the struct is giving little container energy, and here's every single thing inside it:
zt_value_kindβkindβ the discriminator for the union. she decides which member is the main character πconst char *βsourceβ the source code used to compute the valueunion { ... }βasβ the union containing the actual valueboolβas.booleanβ value when used asZT_BOOLEANintβas.integerβ value when used asZT_INTEGERunsignedβas.unsigned_integerβ value when used asZT_UNSIGNEDintβas.runeβ value when used asZT_RUNEconst char *βas.stringβ value when used asZT_STRINGconst void *βas.pointerβ value when used asZT_POINTERintmax_tβas.intmaxβ value when used asZT_INTMAXuintmax_tβas.uintmaxβ value when used asZT_UINTMAX
and then the enum, which is literally the vibe check for the union:
typedef enum zt_value_kind { ... } zt_value_kind;
ZT_NOTHINGβ placeholder for unused valuesZT_BOOLEANβzt_value.as.booleanis validZT_INTEGERβzt_value.as.integeris valid (deprecated)ZT_UNSIGNEDβzt_value.as.unsigned_integeris valid (deprecated)ZT_RUNEβzt_value.as.runeis validZT_STRINGβzt_value.as.stringis validZT_POINTERβzt_value.as.pointeris validZT_INTMAXβzt_value.as.intmaxis validZT_UINTMAXβzt_value.as.uintmaxis valid
π DESCRIPTION π
zt_value is a variant-like type that gets used to pass values around libzt internals. she's built from three things and you're gonna remember all three, fr fr: the kind enumeration, the as union, and the source string. that's the whole girl. β¨
zt_value_kind describes the type of verification function arguments.
π§ IMPLEMENTATION NOTES π§
zt_value exists to pass packed values of several types from the test source code, through the zt_claim type, and into private verification functions that determine test outcome. yes bestie, she's a little courier π«Ά
Tests using binary relations encode the operator as an argument of kind ZT_STRING.
π BUGS π
On some architecturesZT_INTEGERandZT_UNSIGNEDare too short to handlesize_tandssize_tvalues correctly.
not me finding out they're too tiny π they are now deprecated and automatically promoted to ZT_INTMAX and ZT_UINTMAX respectively.
π SEE ALSO π
zt_visit_test_case(3)zt_visit_test_suite(3)
π HISTORY π
zt_value and zt_value_kind first appeared in libzt 0.1
ZT_INTMAX, ZT_UINTMAX and the corresponding union members first appeared in libzt 0.3. glow-up era, honestly.
π AUTHORS π
Zygmunt Krynicki <me@zygoon.pl>
and that's the whole page, bestie π this one is from libzt 0.3.1, dated January 12, 2020 β slay, periodt π
π¦ where this page comes from
- debian bookworm: libzt-doc 0.3.1-4 Β· LGPL-3.0-only
- debian trixie: libzt-doc 0.3.1-4 Β· LGPL-3.0-only
- ubuntu jammy: libzt-doc 0.3.1-4 Β· LGPL-3.0-only
- ubuntu noble: libzt-doc 0.3.1-4build1 Β· LGPL-3.0-only
- ubuntu questing: libzt-doc 0.3.1-4build1
- ubuntu resolute: libzt-doc 0.3.1-4build2 Β· LGPL-3.0-only
- ubuntu stonking: libzt-doc 0.3.1-4build2 Β· LGPL-3.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms