Overview
Artifact ID: | 6510a3168ed2b29e2d2673e89315affef19d3fcd |
---|---|
Page Name: | Documentation |
Date: | 2014-06-17 05:07:32 |
Original User: | rkeene |
Mimetype: | text/x-markdown |
Parent: | 7c8f1965682b83a402d3fb9c5ba761f68277ff80 (diff) |
Next | 75ea53a7c199dcb325993054472d455010743be6 |
Content
Manual Page
package require tcc4tcl
tcc4tcl::cproc
Creates a Tcl procedure that calls C code.
Synopsis:
tcc4tcl::cproc <procName> <argList> <returnType> <code>
<procName>
is the name of the Tcl procedure to create<argList>
is a list of arguments and their types for the C function;- The list is in the format of: type1 name1 type2 name2 ... typeN nameN
- The supported types are:
- Tcl_Interp*
- int
- long
- float
- double
- char*
- Tcl_Obj*
- void*
<returnType>
is the return type for the C function- The supported types are:
- void: No return value
- ok: Return TCL_OK or TCL_ERROR
- int
- long
- float
- double
- char*: TCL_STATIC string (immutable from C)
- string, dstring: TCL_DYNAMIC string (mutable from C)
- vstring: TCL_VOLATILE string (mutable from C)
- default: Tcl_Obj*, a Tcl Object
- The supported types are:
<code>
is the C code that comprises the function
Example:
tcc4tcl::cproc add {int a int b} int { return(a+b); }