Skip to content

Add Tcl_CreateInterpWithStubs and runtime library

Compare
Choose a tag to compare
@snoe925 snoe925 released this 12 Dec 21:51
· 36 commits to master since this release
996f40e

Add a new C function Tcl_CreateInterpWithStubs to perform a common: Tcl_CreateInterp, Tcl_Init, Tcl_StubsInit, Tcl_PkgRequire.
This saves implementers several lines of code and avoids problems with USE_TCL_STUBS being set at the wrong time. In general, cpptcl users should stick to always setting the preprocessor variable USE_TCL_STUBS. Note that USE_TCL_STUBS will be set by cpptcl.h unless CPPTCL_NO_TCL_STUBS is set. The TCL TEA system always sets USE_TCL_STUBS; it is a reasonable default.

The simplest means to create a TCL interpreter is to use

#include <cpptcl/cpptcl.h>
Tcl_Interp * interp = Tcl_CreateInterpWithStubs("8.6", 0);  // C style pointer
Tcl::interpreter i(interp, true); // wrapped by cpptcl class

and to link in the static library cpptcl_runtime.