convertToCType {RGtkBindingGenerator} | R Documentation |
These functions generate the code that marshall a value from
S to C and from C to S by calling the appropriate
conversion function.
These generate a string which is responsible for
converting the parameter identified by name
and of type type
to a C or S value.
convertToCType
generates S code that is typically used
to process arguments in S interface functions
with the results passed on to the C routine.
convertToR
generates C code that is used at the end
of a C interface routine that connects a routine or object field in
the defs files and an S language function.
convertToCType(name, type, defs) convertToR(var, type, defs)
name |
the name of the parameter in the S function defining the S-to-C interface. |
var |
same as name ; the name of the parameter in the C routine
defining the S-to-C interface. |
type |
an object describing the target C type which is expected to be represented in the S argument. |
defs |
the collection of all the definitions in which to find the type information. |
This is mainly hand-crafted piece of code consisting of numerous if-else clauses. It needs to be extended to handle lists, etc. and made more externally extensible by looking up tables or invoking generic functions allowing for methods.
A string giving the code that performs the coercion and/or dereferencing of the S value to return a corresponding C value.
Duncan Temple Lang <duncan@research.bell-labs.com>
http://www.omegahat.org/RGtk, http://www.omegahat.org/RGtkBindingGenerator, http://www.gtk.org http://www.pygtk.org(?)