The RGCCTUFFI package
Last Release:
0.2-0 (18 Jul 2013)
This package provides a means of
- programmatically reading C code to obtain a description
of its routines and data structures, and
- programmatically generating interfaces to the routines and the
data structures,
- dynamically invoking any of those routines, accessing global variables,
and querying the fields of data structures without having to
compile
any additional code.
The package is a thin layer on top of the
RGCCTranslationUnit
package and the Rffi package.
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.
Documentation
There are help pages for all of the functions and several non-trivial
examples
including a description of the implementation of the GeoIP package
in that package.
-
-
-
Duncan Temple Lang
<duncan@wald.ucdavis.edu>
Last modified: Wed Jan 26 09:26:47 PST 2011