Anonymous user
Use another language to call a function: Difference between revisions
Use another language to call a function (view source)
Revision as of 22:21, 22 January 2010
, 14 years ago→‘In’ Parameters: lang c
(→‘In’ Parameters: lang c) |
|||
Line 174:
===‘In’ Parameters===
To connect a function to Tcl that passes an arbitrary C string as input, you'd use a short C thunk, like this:
<lang
Tcl_Obj *arguments[2];
int code;
Line 201:
return 1;
}</lang>
===‘Out’ Parameters===
However, in the specific case of writing to a user-specified buffer (an “out” parameter) the thunk code would instead manage copying the result from the interpreter back to the buffer:
|