iv_main(3)

πŸ’– iv_main(3) β€” the ivykis programmer's manual, but make it cute πŸ’–

okay bestie, sit down, hydrate, and let me tell you about iv_main β€” straight out of the ivykis programmer's manual. this is the function that literally starts the party for your thread. no cap. πŸŽ€


✨ NAME ✨

iv_main β€” enter the ivykis main loop. that's it. that's the whole job. she walks in, she runs the loop. main character energy fr fr. πŸ‘‘


🌸 SYNOPSIS 🌸

#include <iv.h>

void iv_main(void);

no args, no return value, no drama. void in, void out. she's mysterious like that. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so, iv_main enters the current thread's ivykis main loop. current thread. that's important, bestie β€” i'll get to why in a sec. 🫢

and what even is the ivykis main loop, you ask? it's this whole situation:

  • it checks the status of all the registered file descriptors, timers and tasks, and then
  • it either calls the callback functions that correspond to the objects that are active, or
  • it just blocks until an event shows up. 🌈

like, it's either doing the thing or waiting very patiently for the thing. both are valid. both are iconic. ✨

and here's the part that makes her different from every other main loop out there: every thread that wants to use ivykis has to call iv_main individually. individually!! each thread!! her own call!! no sharing, no borrowing, no "oh my friend already called it." πŸ™ˆ

⚠️ and bestie, listen β€” you can only do this after you've already called iv_init(3) earlier. iv_init first, iv_main second. that's the order. do not skip step one. do not flip them. that's it, that's the rule. πŸ’€

πŸ‘‘ SEE ALSO πŸ‘‘

  • ivykis(3) β€” the whole vibe, the mothership 🌟
  • iv_examples(3) β€” examples!! if you learn by reading code like me πŸ“
  • iv_quit(3) β€” the one you call when you want the loop to, uh, stop 🧚

and that's the page, bestie!! it's from the ivykis crew and it's dated 2010-08-15 β€” old enough to be vintage, still serving πŸ’œ go forth, call iv_init first, then iv_main, and slay. periodt. πŸ’–βœ¨πŸŽ€