theo.c implementation for Tcl
