| createLibraryExports {Slcc} | R Documentation |
This generates the C code for registering native routines
accessed via the .Call and .C
for a library.
This is untested and is currently intended to serve as an illustration! (But the basic logic is ok.)
createLibraryExports(cSourceFiles, rSourceFiles, libraryName="", header="")
cSourceFiles |
the (fully-qualified) names of the pre-processed C source files or the directory containing them that are to be compiled and linked to create the shared library/DLL. |
rSourceFiles |
a directory or the list
of fully qualified file names containing the R source
code in which to look for references to .C,
.Call routines. |
libraryName |
the name of the library or package for which the native code is to be used. This controls the name given to the initialization routine that actually registers the native methods. |
header |
user-specified (i.e given by the author creating the registration code) C code to preceed the definitions of the registration tables and the initialization routine. This can be used for specifying included header files, pre-processor macros, conditionals and defines, etc. |
This reads the C code using lcc
and the R code using getRoutineRefs
and creates C code defining the array for
registering the C routines with R.
It also returns code for initializing the
library and performing this registration.
A named list of strings
.C |
table definition for routines accessed via .C |
.Call |
table definition for routines accessed via .Call |
.Fortran |
names of the functions accessed via .Fortran |
.External |
names of the functions accessed via .External |
header |
code to be placed at the top of the C file |
init |
the library's initialization routine which registers the routines. |
Duncan Temple Lang (duncan@research.bell-labs.com)
http://www.omegahat.org/Slcc, http://www.cs.princeton.edu/software/lcc/