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 ⭐

(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 was libzt 0.3.1, dated March 12, 2020 β€” love that for us πŸŽ€βœ¨πŸ¦‹