* Provide close2proc function to prevent tcl9 from crashing.
Tcl 9 does not test if the close2Proc function pointer is non-null,
but calls it unconditionally:
https://github.com/tcltk/tcl/blob/core-9-0-3/generic/tclIO.c#L384
So we need to provide a non-null function pointer for our code
to not crash with Tcl9.
Use the same implementation as the previous close channel
had.
Signed-off-by: Henner Zeller <h.zeller@acm.org>
* Use non-deprecated trace add variable syntax.
In modern tcl, `trace variable` is now i`trace add variable`,
and `"rw"` should be spelled out as `{read write}`
There were backwards compatible forms in Tcl 8.x but now loudly
complains in Tcl 9
Signed-off-by: Henner Zeller <h.zeller@acm.org>
* Use `Tcl_Size` for all tcl functions returning sizes.
This is the type the Tcl-API provides in its prototypes and
starting from Tcl9 this typedef actually changes from `int` to `long`,
so will no longer compile when passing an `int*`.
So whenever we get a return value of this type, use the
correct typedef to declare the variable. This makes it forward and
backward compatible.
Signed-off-by: Henner Zeller <h.zeller@acm.org>
* Address review comments: compare with `read`/`write` not `r`, `w`
Signed-off-by: Henner Zeller <h.zeller@acm.org>
---------
Signed-off-by: Henner Zeller <h.zeller@acm.org>