unibi_dump(3)

πŸ’– unibi_dump(3) β€” the unibilium girlies' guide to dumping terminfo πŸ’–

okay so bestie, welcome to unibi_dump from the unibilium manual, section 3. this is the glow-up-your-terminal-object-into-compiled-terminfo function and honestly? she ate. πŸ“


✨ NAME ✨

unibi_dump β€” convert a terminal object to compiled terminfo data πŸ¦‹


🌸 SYNOPSIS 🌸

#include <unibilium.h>

size_t unibi_dump(const unibi_term *ut, char *p, size_t n);

like, that's it. three args. slay. πŸ’…


πŸ‘‘ DESCRIPTION πŸ‘‘

so what this queen does: she takes your terminal object ut and creates a compiled terminfo entry out of it. ✨

where does it go? into p, bestie. and p must have room for at least n bytes β€” no squeezing, no negotiating, n bytes minimum or it's not happening. πŸŽ€

now here's the lowkey iconic part β€” the format depends on your numbers:

  • if all numeric properties in ut have values that fit in 15 bits, she uses the traditional ncurses terminfo format, which starts with the bytes "1A 01" 🧚
  • otherwise? she switches to the newer "wide integer" format, which starts with the bytes "1E 02" πŸ”₯

two vibes, one function. iykyk. πŸ’œ


⭐ RETURN VALUE ⭐

"unibi_dump" returns the number of bytes required to store the terminfo data. πŸ“

but listen:

if that number exceeds n, literally nothing is written to p. like, p stays untouched. no partial spills, no half-finished mess. periodt.

and if the terminal object can't be represented in terminfo format at all β€” for example because the string table would be too large β€” the return value is "SIZE_MAX". 😭 dramatic, but fair.


πŸ’€ ERRORS πŸ’€

  • "EINVAL" β€” ut can't be converted to terminfo format. not me crying over an unconvertible terminal object πŸ™ˆ
  • "EFAULT" β€” the resulting terminfo entry would be longer than n bytes. buffer said no. πŸ’…

🫢 SEE ALSO 🫢

go read those too, bestie, they're all part of the same friend group 🌈


and that's the whole page, no cap πŸ’– this was unibilium-2.1.4, dated 2026-09-07 β€” catch you in the next manpage, mwah πŸ˜­πŸ‘‘βœ¨

πŸ“¦ where this page comes from