ZT_PACK_STRING(3)
β¨ zt_pack_string β the manual page, but make it cute β¨
okay so bestie, welcome to the LOCAL manual, section 3 π this one is all about zt_pack_string and it's lowkey iconic, let's get into it π
πΈ NAME πΈ
zt_pack_string β pack an C string into a variant π¦
β SYNOPSIS β
#include <zt.h>
zt_value
zt_pack_string(const char *value, const char *source);
π DESCRIPTION π
okay so zt_pack_string does the thing where it takes a C string and packs it into a variant-like zt_value β and not just the string, bestie, it also packs in the string that describes the expression that got evaluated to produce it. two for one, we love to see it πβ¨
the source argument? that one gets retained by the value, like it's holding onto it, and it's typically a constant string literal that the preprocessor made. so it's giving "I was born in a macro" energy fr fr.
π§ IMPLEMENTATION NOTES π§
so here's the tea π β zt_pack_string is only provided as a static inline function. that's it, that's the whole vibe.
and also, very important, no cap: the memory that the string references is not copied. it's just assumed that the memory reference stays valid during the execution of the verification of an assertion that relies on the zt_value. so likeβ¦ if that memory dips out on you mid-verification, that's on you bestie, the function did not sign up for that π
π RETURN VALUES π
the packed value. that's the whole answer. slay π
π«Ά SEE ALSO π«Ά
zt_pack_nothing(3)zt_pack_string(3)zt_pack_rune(3)zt_pack_string(3)zt_pack_string(3)zt_pack_string(3)zt_pack_pointer(3)zt_value(3)
(yes bestie, zt_pack_string(3) really is in there four times β that's exactly how the original wrote it, so we're keeping it, periodt π)
π HISTORY π
zt_pack_string first appeared in libzt 0.1 β a true original, the main character from day one β
π AUTHORS π
Zygmunt Krynicki <me@zygoon.pl> π¦
and that's the whole page bestie!! this little beauty is from libzt 0.3.1, dated January 12, 2020 πΈ take care of her, she's doing her best π₯Ίπ bye pookie, go pack some strings β¨
π¦ 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