| getExportTable {Slcc} | R Documentation |
These functions handle the creation of C code
that registers C routines with S that
can be accessed via .C and
.Call (and potentially .External
getExportTable is the top-level function that process the C
source files and determines information about the parameters for the
arguments.
createExportTable does the actual C code generation
given the routines being exported.
This can be used directly when changing the way
the routines to be exported is determined.
getExportTable(fileNames, which, libraryName = "")
createExportTable(exports, varName = "", elFun=function(el) {
paste(" { \"", el$name,
"\", (DLFUNC) &",
el$name, ", ",
length(el$type$parameters), "}",
sep="")
})
fileNames |
a character vector giving the names of the C files in which to find routines. |
which |
an optional list of routine names, which if specified, limits the set of ``exported'' routines to the names in this vector. |
libraryName |
the name of the library (or package), used to better describe the C variables storing the information about the exported routines |
exports |
a list of routines, usually retrieved from lcc,
defining the routines that are to be listed in the export table. |
varName |
the name of the C variable to assign the array of routine registration information, usually the library name appended with the type of routine (e.g. C, Call, Fortran, etc.) |
elFun |
a function which is used to generate the C code text defining each element in the routine registration array, allowing one to perform different mappings. |
This is an initial example of using the lcc
mechanism. It will be enhanced with more controls for
specifying which routines are to be used.
createExportTable
getExportTable returns the value
from calling createExportTable.
Duncan Temple Lang (duncan@research.bell-labs.com)
http://www.omegahat.org/Slcc, http://www.cs.princeton.edu/software/lcc/