unibi_add_ext_str(3)

πŸ’– unibi_add_ext_str(3) β€” the unibilium glow-up page πŸ’–

okay bestie, come CLOSER β€” this is the unibilium manual, section 3, and today we're talking about three lil functions that all do the same cute thing but for different types: unibi_add_ext_bool, unibi_add_ext_num, and unibi_add_ext_str. They add extended capabilities to a terminal object. Yes queen, we're customizing terminals. It's giving main character energy fr fr. πŸ‘‘


✨ NAME ✨

unibi_add_ext_bool, unibi_add_ext_num, unibi_add_ext_str β€” add extended capabilities to a terminal object πŸ¦‹


🌸 SYNOPSIS 🌸

#include <unibilium.h>

size_t unibi_add_ext_bool(unibi_term *ut, const char *t, int b);
size_t unibi_add_ext_num(unibi_term *ut, const char *t, int v);
size_t unibi_add_ext_str(unibi_term *ut, const char *t, const char *s);

Like… look at them. Three sisters. Same silhouette. Different vibes. πŸ’…


πŸ’œ DESCRIPTION πŸ’œ

So what these do is: add an extended boolean, numeric, or string capability with the specified name and value. That's it, that's the whole plot. You hand it a name and a value, it slots it in. Iconic behavior honestly.

🚨 IMPORTANT, NO CAP: these functions simply store any pointers they are given. They will not free t or s, and they will not copy any strings.

Read that again bestie, because it MATTERS. 😭 The pointer you pass in is the pointer that lives there now. If it's a string, that string is yours to keep alive. If you free it or it goes out of scope, that's a you problem and the terminal object is just sitting there holding a dangling pointer like 🧍. So keep your strings alive, okay? Please. For me. 🫢


⭐ RETURN VALUE ⭐

The return value is the index of the new capability, which you can then use in unibi_get_ext_bool(3), unibi_set_ext_bool(3), etc. So it hands you back a lil ticket number for the thing you just added. 🎟️

If an error occurs, SIZE_MAX is returned. That's the "it's not giving" signal. Check for it, bestie. πŸ™ˆ


πŸ‘€ SEE ALSO πŸ‘€


That's the whole page, you ate it, go add some extended capabilities and be free. 🌈

Sign-off szn: this lil beauty comes from unibilium-2.1.4, dated 2026-09-07. Mwah. πŸ’‹ periodt. πŸŽ€

πŸ“¦ where this page comes from