ZT_NULL(3)
π ZT_NULL(3) β the "bestie, is this pointer literally nothing" page π
okay so welcome to the ZT_NULL(3) manual page, local section, and yes we're about to talk about the most iconic little guy in libzt: the one that checks whether a pointer is NULL. no cap, it's giving "is this thing even here" energy and I'm obsessed. β¨
πΈ NAME πΈ
ZT_NULL, zt_null β construct a claim that a pointer is NULL. that's the whole job. she clocks in, she says "that pointer is nothing", she clocks out. π
β¨ SYNOPSIS β¨
#include <zt.h>
#define ZT_NULL(value) \
zt_null( \
ZT_CURRENT_LOCATION(), \
zt_pack_pointer((value), #value))
zt_claim
zt_null(zt_location location, zt_value value);
like yes, that's the whole thing, and every character matters so don't you dare retype it from memory bestie π
π DESCRIPTION π
so zt_null() constructs a claim that a given pointer is NULL. that's it, that's the assignment. π«Ά
but listen β you should be using it through the macro ZT_NULL(), not calling the function by hand like a menace. the macro is the main character here because it handles the boring-but-critical stuff for you: it passes the source code location and it packs the argument. that's why the macro is the vibe and the raw function is just backstage. π
ZT_NULL() is highkey useful when you couple it with zt_assert(), because it lets you make sure that something the rest of the test relies on did not happen. for example: that no error had occurred. like, you're not just hoping bestie, you're claiming it, out loud, in the source code, with receipts. π
π₯ IMPLEMENTATION NOTES π₯
ZT_NULL() evaluates value only once.
no double-evaluation jumpscare, no side effects firing twice. we love a considerate macro. π§
π RETURN VALUES π
both the macro and the function return a zt_claim structure with the appropriate attributes set. so whatever you call, you get a claim back. π
and that returned claim is usually passed to zt_check() or to zt_assert(), because a claim with nowhere to go is just a girl standing in a room. π
π¦ 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)
(yes she's listed in her own SEE ALSO. self-love. periodt. π )
π HISTORY π
the ZT_NULL() macro and the zt_null() function first appeared in libzt 0.1. an OG. a founding member. we stan a legacy. π
π AUTHORS π
Zygmunt Krynicki <me@zygoon.pl> β the mastermind, the icon, the one who wrote this into existence. π«Ά
ok that's the whole page bestie, every flag, every macro, every claim, nothing skipped, we ate and left no crumbs πβ¨
signing off from libzt 0.3.1, dated January 12, 2020 β go forth and assert that your pointers are NULL, fr fr π¦π
π¦ 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