1gensio_tcl_funcs_alloc(3)  Library Functions Manual  gensio_tcl_funcs_alloc(3)
2
3
4

NAME

6       gensio_tcl_funcs_alloc  -  Abstraction  for some operating system func‐
7       tions done with tcl
8

SYNOPSIS

10       #include <gensio/gensio_tcl.h>
11
12       int gensio_tcl_funcs_alloc(struct gensio_os_funcs **o)
13

DESCRIPTION

15       This structure provides an abstraction for the gensio library that lets
16       it  work on top of tcl.  See the tcl_os_funcs.3 man page for details on
17       what this does.  This can be used if you have a project  based  on  tcl
18       that you want to integrate gensio into.
19
20       Unfortunately, it has some limitations because of weaknesses in the tcl
21       interface.  Basically, no threads.
22
23       In tcl, if you start a  timer,  that  timer  will  only  fire  in  that
24       thread's  call to Tcl_DoOneEvent.  Same with file handlers.  Basically,
25       timers, idle calls, and file handlers belong to a thread.
26
27       You could, theoretically, have multiple threads as long as you allocate
28       an  os handler per thread and did everything with an os handler only in
29       the thread that created it.  But that's not very useful.
30
31       If you really want real threading to work, you put tcl on top of gensio
32       os  funcs  using Tcl_NotifierProcs.  I leave that as an exercise to the
33       reader.
34

RETURN VALUES

36       A gensio_err returns a standard gensio error.
37

SEE ALSO

39       gensio_os_funcs(3), gensio(5), gensio_err(3)
40
41
42
43                                  03 Feb 2021        gensio_tcl_funcs_alloc(3)
Impressum