getCallableRoutines: Find routines that are callable from within R via the .C or...

View source: R/register.R

getCallableRoutinesR Documentation

Find routines that are callable from within R via the .C or .Call interfaces

Description

This function processes C and C++ source code files and determines which of the routines in these can be called via R's .Call or .C interfaces.

Usage

getCallableRoutines(dir, src = list.files(dir, pattern = "\\.(c|cpp|cxx|C)$",
                                          full.names = TRUE),
                    args = sprintf("-I%s/include", R.home()), ..., verbose = TRUE)

Arguments

dir

the directory in which to find C and C++ source files. This is ignored if src is specified.

src

a character vector giving the fully qualified names of the source files to process.

args

a character vector of command line arguments passed to the clang parser. This can specify include directories, precompiled headers, and many flags.

...

additional parameters passed on to createTU

verbose

a logical value which controls whether we print the name of each file as we process it.

Value

A list possibly containing elements "C" and "Call". Each such element is a list of functions objects containing the return type, parameter types and the function definition cursor. Only routines that are declared or defined within the source file are included in the output. In other words, we ignore files from the included files.

Author(s)

Duncan Temple Lang

References

Routine Registration in Writing R Extensions Manual.

See Also

isDotCall createRegistrationCode

Examples

  a = getCallableRoutines(system.file("exampleCode", package = "RCIndex"))
  as(a, "RegistrationTable")

omegahat/RClangSimple documentation built on Aug. 17, 2024, 10:23 a.m.