ZT_CMP_PTR(3)
π ZT_CMP_PTR(3) β the pointer-relation claim girly π
okay so bestie, we're in section 3 of the manual, the LOCAL one, and this page is literally just about one (1) thing: making a claim about how two pointers relate to each other. that's it. that's the whole vibe. π
β¨ NAME β¨
ZT_CMP_PTR, zt_cmp_int β construct a claim of a relation between two pointers πΈ
π¦ SYNOPSIS π¦
#include <zt.h>
#define ZT_CMP_PTR(left, rel, right) \
zt_cmp_ptr( \
ZT_CURRENT_LOCATION(), \
zt_pack_pointer((left), (#left)), \
zt_pack_string((#rel), (#rel)), \
zt_pack_pointer((right), (#right)))
zt_claim
zt_cmp_ptr(zt_location location, zt_value left, zt_value rel,
zt_value right);
like, that's the macro, that's the function, copy-paste energy, periodt. π
π DESCRIPTION π
zt_cmp_ptr() constructs a claim of a relation between two integers. (yes bestie, the page says integers, we are simply reporting the lore, don't come for me π)
the way that this works is: you don't really call the function yourself, you go through the macro ZT_CMP_PTR(), which is the one that passes the source code location and packs the arguments for you. so like, macro = main character, function = the friend holding her bag. π«Ά
the relation has to be either == or != β those are the only two options, no in-between, no "kinda equals", nothing. that's the whole menu. β¨
π§ IMPLEMENTATION NOTES π§
ZT_CMP_PTR() evaluates left and right exactly once.
(one time. one. singular. iconic behavior, no double-evaluation jumpscares here. π₯)
π RETURN VALUES π
both the macro and the function return a claim structure with the right attributes set. and then, usually, you take that returned claim and hand it over to zt_check() or to zt_assert(). that's the handoff. that's the relay race. πββοΈπ¨
β SEE ALSO β
ZT_CMP_BOOL(3)ZT_CMP_CHAR(3)ZT_CMP_CSTR(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)
(yes, the page lists ZT_CMP_PTR(3) in its own SEE ALSO. self-love! we stan a confident queen. π)
π HISTORY π
the ZT_CMP_PTR() macro and the zt_cmp_ptr() function first appeared in libzt 0.3. glow-up origin story fr fr. πΈ
π AUTHORS π
Zygmunt Krynicki <me@zygoon.pl> β the genius behind this whole situation π
that's the whole page bestie, we ate and left no crumbs π
this waslibzt 0.3.1, datedMarch 12, 2020β love that for us πβ¨π¦
π¦ 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