interp: A pointer to a Tcl interpreter. (Tcl_Interp *interp) c_var: The address of the c variable to be linked (char **) tcl_var: The name of the Tcl variable (char *)
This function links strings between C++ and Tcl.
CDM_LinkVar uses variable traces to keep the Tcl variable named by
"tcl_var" in sync with the C variable at the address given by "c_var".
Whenever the Tcl variable is red the value of the C variable will be
returned, and whenever the Tcl variable is written the C variable will be
updated to have the same value.
Return Value:
CDM_LinkVar normally returns TCL_OK; if an error occurs while setting up
the link (e.g. because "tcl_var" is the name of array) then TCL_ERROR is
returned and an error message is placed in the provided Tcl interpreter.
Notes:
Note that the memory referenced by "c_var" must have been allocated with
a call to either CDM_Malloc or Tcl_Alloc. "c_var" must never point to a
staticly allocated buffer. "c_var" is allowed to have the value NULL as
initial value. In this case it will be updated to point to a dynamicly
allocated empty string.
If "interp" has the value NULL, the Tcl interpreter referenced by
"CDM_Interp" will be used.