ZT_LOCATION(3)

πŸ’– zt_location β€” ok so WHERE even ARE we?? πŸ“

bestie. it's the zt_location page from the LOCAL manual, and she's a lil struct who knows exactly which line of which file you're standing on. iconic behavior tbh. πŸŽ€


✨ SYNOPSIS ✨

#include <zt.h>

typedef struct zt_location { ... } zt_location;

like yes, she's a struct, she's short, she's giving minimalist queen πŸ’…


🌸 DESCRIPTION 🌸

okay so zt_location holds two things and honestly that's all she needs: a file name and a line number. no drama, no extra fields, just vibes and coordinates fr fr πŸ¦‹

here's the whole squad, field by field:

  • const char * filename β€” the name of the source file, and it comes straight from __FILE__ ✨
  • int lineno β€” the number of the line inside said file, and it comes from __LINE__ πŸ“

and if you want one of these bad boys describing right here, right now, you use the ZT_CURRENT_LOCATION() macro. she hands you a location describing the current file and current line number. no cap. πŸ”₯


πŸ‘‘ IMPLEMENTATION NOTES πŸ‘‘

so like, what is she for? zt_location gets used to report the location of failing test checks and assertions. that's it, that's the job. she's the one pointing at the crime scene when a test goes πŸ’€ and honestly? main character energy. πŸ™ˆ


🫢 SEE ALSO 🫢

go read those too bestie, they're the friend group 🧚


🌈 HISTORY 🌈

zt_location first appeared in libzt 0.1. a true original. a pioneer. we stan an early-era icon ⭐


πŸ’œ AUTHORS πŸ’œ

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


and that's the whole page!! this was libzt 0.3.1, dated January 12, 2020, and yes she's still serving. mwah, go write some tests, ily πŸŽ€βœ¨πŸ’