Artifact [29783edadd]

Artifact 29783edadd73c7d65a0703114cb0942fb027c9ce:

Wiki page [Documentation] by rkeene on 2014-06-17 01:05:05.
D 2014-06-17T01:05:05.196
L Documentation
N text/x-markdown
U rkeene
W 1288
Manual Page
===========

`package require tcc4tcl`

tcc4tcl::cproc
--------------
Creates a Tcl procedure that calls C code.

Synopsis:

  1.  `tcc4tcl::cproc <procName> <argList> <returnType> <code>`
    1. `<procName>` is the name of the Tcl procedure to create
    1. `<argList>` is a list of arguments and their types for the C function;
      1. The list is in the format of: type1 name1 type2 name2 ... typeN nameN
      1. The supported types are:
        1. Tcl_Interp*
        1. int
        1. long
        1. float
        1. double
        1. char*
        1. Tcl_Obj*
        1. void*
    1. `<returnType>` is the return type for the C function
      1. The supported types are:
        1. void: No return value
        1. ok: Return TCL_OK or TCL_ERROR
        1. int
        1. long
        1. float
        1. double
        1. char*: TCL_STATIC string (immutable from C)
        1. string, dstring: TCL_DYNAMIC string (mutable from C)
        1. vstring: TCL_VOLATILE string (mutable from C)
        1. default: Tcl_Obj*, a Tcl Object
    1. `<code>` is the C code that comprises the function

Example:

  1.  `tcc4tcl::cproc add {int a int b} { return(a+b); }`


tcc4tcl::ccode
--------------

tcc4tcl::cdata
--------------
Z 670ec8db6fa703f70245363df1cf55ac