TICKIT_BUILD(3)

πŸ’– TICKIT_BUILD(3) β€” bestie edition πŸ’–

Library Functions Manual ✨ so this is a section 3 page, meaning it's a library function, and it lives in the tickit house. Come sit with me, we're building a whole toplevel Tickit instance together and it's gonna slay.


🌸 NAME 🌸

tickit_build β€” create a new toplevel Tickit instance with arguments 🫢


✨ SYNOPSIS ✨

#include <tickit.h>

struct TickitBuilder {
  TickitTerm *tt;
  struct TickitTermBuilder term_builder;
  ...
};

Tickit *tickit_build(const struct TickitBuilder *builder);

Link with -ltickit.

ok so real talk: that ... in the struct is NOT decoration, we'll get to it in a sec. 🫣

πŸ¦‹ DESCRIPTION πŸ¦‹

So tickit_build() makes you a brand new toplevel Tickit instance, and it sets that baby up using all the various parameters you handed over in the builder struct. That's the whole vibe. πŸ’…

Heads up bestie: the struct definition printed up there is incomplete. The actual, real-life struct definition has more fields than what's shown, because some of them are strictly for internal purposes. So like… mind your business on those ones, okay? πŸ™ˆ User code should only attempt to interact with the fields that are documented here. That's the rule and we respect it.

Now, about tt:

  • If the tt field is set, it should contain a TickitTerm instance. You brought your own terminal, iconic. πŸ‘‘
  • If you leave it blank, then one will be constructed for you β€” by passing the nested term_builder structure on over to tickit_term_build(3). The term gets built, the vibes get immaculate, everyone wins. ✨

πŸ’œ RETURN VALUE πŸ’œ

  • If it works? tickit_build() returns a pointer to the new instance. New instance, who dis. πŸ”₯
  • If it fails? NULL comes back, and errno is set to indicate the failure. So like, please check it. Don't be out here dereferencing NULL and acting surprised, I'm begging. 😭

πŸŽ€ SEE ALSO πŸŽ€


and that's the page!! tysm for reading, you're doing amazing sweetie πŸ’– This was TICKIT_BUILD(3) signing off β€” same name up top, same name at the bottom, bookends fr fr. πŸ¦‹πŸŒΈπŸ’