unibi_add_ext_bool(3)

✨ unibi_add_ext_bool β€” the unibilium glow-up corner ✨

okay so bestie, you're in the unibilium section of the manual (that's the (3) bit, iykyk) and this is where we add extended capabilities to a terminal object. three little functions, one big vibe. let's go πŸ’…


🌸 NAME 🌸

unibi_add_ext_bool, unibi_add_ext_num, unibi_add_ext_str β€” add extended capabilities to a terminal object

no cap, that's literally the whole job. they add ext caps. 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);

look at them. three icons. one header, three signatures. ✨


πŸ’– DESCRIPTION πŸ’–

so what are we actually doing here? you're adding an extended boolean, numeric, or string capability β€” with the name and the value you hand over. that's it. that's the whole thing. pick your type, pick your name, pick your value, and it gets added. slay.

⚠️ but bestie. LISTEN. these functions simply store any pointers they are given. they will not free t or s, and they will not copy any strings. no duplication, no defensive copies, no take-backs. the pointer you pass in is the pointer that lives there now. so if that string goes out of scope or gets freed elsewhere… that's on you, and it's giving undefined behaviour energy. keep your strings alive, bestie 🫢

πŸ‘‘ 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's not just a number, it's a lil ticket you can redeem later. iconic.

but if an error occurs? you get "SIZE_MAX" back. 😭 that's the "it didn't work, go home" value. check for it, fr fr.


🌈 SEE ALSO 🌈

the del versions are right there when you need to say goodbye πŸ‘‹


this has been your girl in the unibilium-2.1.4 era, dated 2026-09-07 β€” stay terminal, stay iconic, and go add some ext caps πŸ¦‹βœ¨πŸ’œ

πŸ“¦ where this page comes from