ZT_TRUE(3)
π ZT_TRUE π
okay bestie, so we're in the libzt corner of the manual β section 3, the C library function pages β and today's main character is ZT_TRUE and its function bestie zt_true. the whole vibe? you're constructing a claim that some value is true. that's it. that's the job. β¨
πΈ NAME πΈ
ZT_TRUE, zt_true β construct a claim that a value is true
π SYNOPSIS π
#include <zt.h>
#define ZT_TRUE(value) \
zt_true( \
ZT_CURRENT_LOCATION(), \
zt_pack_boolean((value), #value)) \
zt_claim
zt_true(zt_location location, zt_value value);
π¦ DESCRIPTION π¦
so zt_true() does exactly one thing and it does it slay: it constructs a claim that a given value is true. π
but listen β you're not supposed to call the function directly, bestie. you use it through the macro ZT_TRUE(), which is the one that passes the source code location and packs the argument for you. the macro is the whole point. the function is just the machinery underneath. iykyk. π
zt_true() can also be used to check custom properties, by calling arbitrary verification logic. the trade-off tho? when that fails, the error message can't precisely explain what the problem actually was. like, it'll tell you something went wrong, but not what went wrong in a nice specific way. it's giving mystery. π΅οΈβοΈ
π₯ IMPLEMENTATION NOTES π₯
ZT_TRUE() evaluates value only once.
no double-evaluation shenanigans, no side effects firing twice, we love to see it. π«Ά
β¨ RETURN VALUES β¨
both the macro and the function hand you back a zt_claim structure, with the appropriate attributes all set. π
and what do you do with that claim? you usually pass it straight to zt_check() or to zt_assert(). those are the ones that actually make a fuss about it. periodt.
π SEE ALSO π
zt_assert(3)zt_check(3)zt_claim(3)ZT_CMP_BOOL(3)ZT_CMP_RUNE(3)ZT_CMP_CSTR(3)ZT_CMP_INT(3)ZT_CMP_PTR(3)ZT_CMP_UINT(3)ZT_FALSE(3)ZT_NOT_NULL(3)ZT_NULL(3)zt_value(3)
π HISTORY π
the ZT_TRUE() macro and the zt_true() function first appeared in libzt 0.1. iconic behaviour from day one, no cap. π
π AUTHORS π
Zygmunt Krynicki <me@zygoon.pl>
and that's the whole page, bestie!! this was libzt 0.3.1, dated January 12, 2020, for ZT_TRUE(3) in the LOCAL manual section. go forth and assert things. true ones. ππ§π
π¦ 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