ZT_PACK_RUNE(3)

πŸ’– zt_pack_rune(3) πŸ’–

okay bestie, so this is a page from the LOCAL manual, and it's literally all about one lil function in libzt. sit down, hydrate, we're doing this 🌸


✨ NAME ✨

zt_pack_rune β€” pack a character into a variant πŸ’…


🌟 SYNOPSIS 🌟

#include <zt.h>

zt_value
zt_pack_rune(int value, const char *source);

like, that's it. that's the whole vibe check right there πŸ¦‹


πŸŽ€ DESCRIPTION πŸŽ€

so what does it DO? zt_pack_rune packs a rune, plus the string that describes the expression you evaluated to get that rune, into a variant-like zt_value. two for one, no cap πŸ‘‘

the source argument is retained by the value β€” it doesn't get copied or thrown away, it sticks around. and it's typically a constant string literal produced by the preprocessor. iykyk ✨

now, runes. runes are generalized characters. unlike char, they are never negative, and you can think of them as Unicode code points. yes queen, actual unicode, we're cultured here 🌈


🧚 IMPLEMENTATION NOTES 🧚

okay so here's the tea πŸ“: zt_pack_rune() compensates for signed negative characters by masking them with 0xFF. that's the whole note. go off, little mask πŸŽ€


πŸ’œ RETURN VALUES πŸ’œ

the packed value. that's it. she returns the value she packed, as one does πŸ’–


🫢 SEE ALSO 🫢

(and yes, zt_pack_integer(3) shows up twice and there's a lil missing comma in there β€” we don't fix the family tree, we just love it as it is πŸ˜­πŸ’€)


⭐ HISTORY ⭐

zt_pack_rune first appeared in libzt 0.1. a true original. main character from day one πŸ‘‘


πŸ‘‘ AUTHORS πŸ‘‘

Zygmunt Krynicki <me@zygoon.pl> β€” thank you for your service, king πŸ«‘πŸ’–


this iconic lil page comes from libzt 0.3.1, dated January 12, 2020, and it lives in the LOCAL manual. mwah, stay hydrated, and go pack some runes bestie πŸ’…βœ¨πŸ¦‹πŸŒΈ