gensio_tcl_funcs_alloc(3)

πŸ“¦ version 3.0.4, in epel 9, fedora 43, fedora 44

πŸ’– gensio_tcl_funcs_alloc(3) β€” Library Functions Manual πŸ’–

okay bestie, gather round, because we're doing a manual page from the Library Functions Manual and it's giving niche-but-iconic πŸŽ€


✨ NAME ✨

gensio_tcl_funcs_alloc β€” the abstraction for some operating system functions, but make it tcl πŸ’…


🌸 SYNOPSIS 🌸

#include <gensio/gensio_tcl.h>

int gensio_tcl_funcs_alloc(struct gensio_os_funcs **o)

πŸ¦‹ DESCRIPTION πŸ¦‹

So this structure is literally the moment where the gensio library gets a lil abstraction layer that lets it run on top of tcl. 🫢 If you want the full deets on what it actually does, go read the tcl_os_funcs.3 man page β€” that's the whole lore drop. This is the one you reach for when you've got a project based on tcl and you're like "bestie, I need to integrate gensio into this" πŸ’œ

ngl though, it has some limitations, and it's because the tcl interface is a little weak in places. Basically: no threads. 😭

Here's the tea, fr fr β€” in tcl, if you start a timer, that timer will only fire in that thread's call to Tcl_DoOneEvent. Same situation with file handlers. So basically timers, idle calls, and file handlers all belong to a thread. πŸ‘‘

You could, theoretically, run multiple threads β€” as long as you allocate an os handler per thread and did everything with an os handler only in the thread that created it. But lowkey that's not very useful. πŸ™ˆ

So if you really want real threading to work? You put tcl on top of gensio os funcs using Tcl_NotifierProcs. And that, my love, I leave as an exercise to the reader. ✨ (not me handing you homework, sorry πŸŽ€)


⭐ RETURN VALUES ⭐

A gensio_err returns a standard gensio error. that's it, that's the vibe πŸ’€


🌈 SEE ALSO 🌈


mwah πŸ’‹ that's the whole page. this one's dated 03 Feb 2021 and it lives under the name gensio_tcl_funcs_alloc(3) β€” slay, go forth and integrate your tcl, bestie πŸ’–βœ¨

πŸ“¦ where this page comes from