Definition: | #include <CDM.h> |
---|
|
Prototype: | int CDM_Eval(Tcl_Interp *, arg1);
|
---|
Arguments: | Interp: Interpreter Pointer (Tcl_Interp) arg1: A (NULL terminated) sequence of strings (char *)
|
---|
|
|
Description:
This function can be used to execute a Tcl statement/code from within
C/C++.
CDM_Eval accepts a variable number of strings (of type char*) and
assumes that each such string corresponds to a token of the Tcl command.
CDM_Eval evaluates then the command, by-passing variable substitution
and byte-code compilation.
For example, in order to execute the Tcl statement "puts
"This is a test"", the following C code should be
used:
CDM_Eval("puts", "This is a test", NULL);
The return value from this function will be a standart Tcl completion
code (of type int) with one of the values TCL_OK and TCL_ERROR. If an
error occurs, the return value will be TCL_ERROR and an error message
describing the error will be left at the current Tcl interpreter
(CDM_Interp). If all annotators run without errors, TCL_OK will be
returned.
The results of the Tcl code execution will be placed as the result in
the current Tcl interpreter (CDM_Interp), if the command has been
succesfully executed. The caller can use
Tcl_GetObjResult(CDM_GetActiveInterpreter()) to get the stored result
Tcl object.
Return Value:
The return value from this function will be a standart Tcl completion
code (of type int) with one of the values TCL_OK and TCL_ERROR. If an
error occurs, the return value will be TCL_ERROR and an error message
describing the error will be left at the current Tcl interpreter
(CDM_Interp). If all annotators run without errors, TCL_OK will be
returned.
Notes:
Note that the last argument should always be NULL, signaling the end of
arguments.
See Also:
CDM_Exec
Generated by: petasis@aias on Wed Aug 16 10:31:57 PM EEST 2006.