unibi_get_num(3)

πŸ’– unibi_get_num β€” access the capabilities of a terminal object πŸ’–

okay bestie, sit down, hydrate, and let me tell you about unibilium section 3, because this little family of functions is literally the ✨key✨ to the whole terminal-capability kingdom. no cap. πŸ‘‘


🌸 NAME 🌸

unibi_get_bool, unibi_set_bool, unibi_get_num, unibi_set_num, unibi_get_str, unibi_set_str β€” access the capabilities of a terminal object 🫢


πŸŽ€ SYNOPSIS πŸŽ€

#include <unibilium.h>

int unibi_get_bool(const unibi_term *ut, enum unibi_boolean b);
void unibi_set_bool(unibi_term *ut, enum unibi_boolean b, int x);

int unibi_get_num(const unibi_term *ut, enum unibi_numeric n);
void unibi_set_num(unibi_term *ut, enum unibi_numeric n, int x);

const char *unibi_get_str(const unibi_term *ut, enum unibi_string s);
void unibi_set_str(unibi_term *ut, enum unibi_string s, const char *x);

like, look at that. six little functions. a whole glow-up for your terminal object. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so the vibe is: get and set your boolean, numeric, and string capabilities. that's the whole assignment. ✨

here's the tea though, and this part matters:

  • absent numeric capabilities are represented as -1 😭
  • absent string capabilities are represented as "NULL" πŸ’€

so if you go grabbing a number and it hands you a -1, that's not a value, that's an absence, and you should act accordingly. same energy with the string that says "NULL".

🚨 HEADS UP, THIS IS THE IMPORTANT ONE: unibi_set_str simply stores the pointer it is given; it will not free x or make a copy of the string.

read that again fr fr. it does NOT copy. it does NOT free. it just keeps your pointer. so if you hand it something that goes away later, that's a you problem and it's gonna be a whole situation. 🫠


🌈 SEE ALSO 🌈


that's the page, bestie!! go forth and slay your terminal capabilities βœ¨πŸ¦‹πŸŒΈ

this iconic little number comes to you from unibilium-2.1.4, dated 2026-09-07. mwah πŸ’‹

πŸ“¦ where this page comes from