Update of "Documentation"
Overview

Artifact ID: 606bbdc6eef7115f70e609e960f750475a68ad58
Page Name:Documentation
Date: 2014-06-17 01:05:48
Original User: rkeene
Mimetype:text/x-markdown
Parent: 29783edadd73c7d65a0703114cb0942fb027c9ce (diff)
Next 7c8f1965682b83a402d3fb9c5ba761f68277ff80
Content

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
    2. <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
      2. The supported types are:
      3. Tcl_Interp*
      4. int
      5. long
      6. float
      7. double
      8. char*
      9. Tcl_Obj*
      10. void*
    3. <returnType> is the return type for the C function
      1. The supported types are:
      2. void: No return value
      3. ok: Return TCL_OK or TCL_ERROR
      4. int
      5. long
      6. float
      7. double
      8. char*: TCL_STATIC string (immutable from C)
      9. string, dstring: TCL_DYNAMIC string (mutable from C)
      10. vstring: TCL_VOLATILE string (mutable from C)
      11. default: Tcl_Obj*, a Tcl Object
    4. <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