The RGCCTUFFI package
0.2-0 (18 Jul 2013)
This package provides a means of
The package is a thin layer on top of the
package and the Rffi package.
- programmatically reading C code to obtain a description
of its routines and data structures, and
- programmatically generating interfaces to the routines and the
- dynamically invoking any of those routines, accessing global variables,
and querying the fields of data structures without having to
any additional code.
This is an alternative to explicitly writing C/C++ code
to interface to existing C/C++ routines and then
compiling and loading that compiled code in order to be able
to invoke the original compiled routines.
The package allows one to do this entirely within R code
and within an R session rather than ahead of time.
The use of RGCCTranslationUnit
requires that one create the .tu file for the C code before reading
the descriptions of that code.
In the future, we might use the clang libraries for processing
An entirely different approach is to use Rllvm to compile
new native routines to interface to the actual existing routines.
There are help pages for all of the functions and several non-trivial
including a description of the implementation of the GeoIP package
in that package.
Duncan Temple Lang
Last modified: Wed Jan 26 09:26:47 PST 2011