ZT_CMP_BOOL(3)
β¨ ZT_CMP_BOOL(3) β¨
okay bestie, welcome to the ZT_CMP_BOOL page π this is from section 3 of the manual (the LOCAL one, iykyk) and no, the original page literally had no title line so we're just vibing with the name, periodt.
πΈ NAME πΈ
ZT_CMP_BOOL, zt_cmp_bool β bestie we are literally constructing a claim of a relation between two booleans and it's giving very demure, very mindful π¦
π SYNOPSIS π
#include <zt.h>
#define ZT_CMP_BOOL(left, rel, right) \
zt_cmp_bool( \
ZT_CURRENT_LOCATION(), \
zt_pack_boolean((left), (#left)), \
zt_pack_string((#rel), (#rel)), \
zt_pack_boolean((right), (#right)))
zt_claim
zt_cmp_bool(zt_location location, zt_value left, zt_value rel,
zt_value right);
like, there's a macro and a function, and the macro is the one you actually use, no cap π
π DESCRIPTION π
okay so zt_cmp_bool() constructs a claim of a relation between two booleans. that's the whole job. but listen β you should be using it through the macro ZT_CMP_BOOL(), which is the one that passes the source code location and packs the arguments for you. the raw function is lowkey the behind-the-scenes girlie π¬
the relation must be either == or !=. those are literally the only two options. anything else? not it. π
βοΈ
and ngl, it may be more natural to use ZT_TRUE() or ZT_FALSE() instead. just saying. consider it. β¨
π«Ά IMPLEMENTATION NOTES π«Ά
ZT_CMP_BOOL() evaluates left and right exactly once. that's it, that's the note, and it's iconic because side effects won't get double-dipped π
π RETURN VALUES π
both the macro and the function return a claim structure with the right attributes set. so like, it's a whole struct situation π the returned claim is usually passed to zt_check() or to zt_assert(). that's the pipeline, bestie π₯
π SEE ALSO π
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_TRUE(3)zt_check(3)
the whole friend group fr fr π«
π¦ HISTORY π¦
the ZT_CMP_BOOL() macro and the zt_cmp_bool() function first appeared in libzt 0.1 β so they're basically elders in the libzt universe and we respect them for it π
π AUTHORS π
Zygmunt Krynicki <me@zygoon.pl> β the main character who wrote all this, we stan π«Άπ
and that's the page!! this was libzt 0.3.1, dated January 12, 2020, and it lives in section ZT_CMP_BOOL(3) of the manual π β¨ mwah, go write some boolean claims bestie π
π¦ 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