TICKIT_TERM_INPUT_WAIT_MSEC(3)

πŸ’– TICKIT_TERM_INPUT_WAIT_MSEC πŸ’–

okay bestie, gather round, because this is one of those pages from the Library Functions Manual (section 3, as the header is screaming at us) and it's actually so chill once you get it. no cap.


✨ NAME ✨

tickit_term_input_wait_* β€” read more data from the terminal

like... it waits. for input. from the terminal. that's the whole vibe. πŸ¦‹


🌸 SYNOPSIS 🌸

#include <tickit.h>

void tickit_term_input_wait_msec(TickitTerm *tt, long msec);
void tickit_term_input_wait_tv(TickitTerm *tt, const struct timeval *timeout);

and when you link it, you link it like this, exactly:

-ltickit

periodt. πŸ’…


πŸ‘‘ DESCRIPTION πŸ‘‘

so the tickit_term_input_wait_*() family of functions β€” literally all of them β€” wait for at least one input event to be received, and they keep waiting up until the maximum time given. that's the whole job. that's the assignment. and they ate. πŸ”₯

quick heads up though: calling these functions may block if the underlying file descriptor is in blocking mode. yes bestie, block. as in your whole program just sits there vibing until something happens. if that's not the energy you want, you know what to do about it (set nonblocking, iykyk).

they may also result in TICKIT_EV_KEY or TICKIT_EV_MOUSE events being invoked. so like, your key and mouse handlers get called. surprise! πŸŽ€

and the extra cute part: these functions also invoke deferred TICKIT_EV_RESIZE events if enabled by tickit_term_observe_sigwinch(3). so if someone drags their terminal window around, you get notified. iconic behaviour honestly.

now, the two functions differ in how the timeout is specified. that's the only difference. everything else? same girl, different font:

  • tickit_term_input_wait_msec() β€” takes a time as an integer in milliseconds, or -1 to wait indefinitely. so -1 = wait forever, no thoughts, head empty, just vibes. 🌈
  • tickit_term_input_wait_tv() β€” takes a time as a struct timeval, or NULL to wait indefinitely. same energy, fancier time format. πŸ’œ

πŸ’€ RETURN VALUE πŸ’€

tickit_term_input_wait_msec() and tickit_term_input_wait_tv() return no value.

they're void, bestie. nothing comes back. don't go assigning them to anything, don't go checking them for errors, there's literally nothing there. πŸ™ˆ


🫢 SEE ALSO 🫢

go read those too, they're all part of the same friend group. ✨


and that's the page, bestie!! we made it. this one came straight out of the Library Functions Manual, TICKIT_TER...T_WAIT_MSEC(3), and yeah, the footer is just that same name again β€” TICKIT_TER...T_WAIT_MSEC(3) β€” giving main character energy twice because it can. πŸ’…πŸ¦‹πŸ’–