This function allows us to query the set of routines
in a DLL that are registered with R to enhance
dynamic lookup, error handling when calling native routines,
and potentially security in the future.
This function provides a description of each of the
registered routines in the DLL for the different interfaces,
getDLLRegisteredRoutines(dll, addNames = TRUE)
a character string or
The character string specifies the file name of the DLL
of interest, and is given without the file name extension (e.g., the
.so) and with no directory/path information.
So a file
MyPackage/libs/MyPackage.so would be specified as
DLLInfo objects can be obtained directly
in calls to
or can be found after the DLL has been loaded using
getLoadedDLLs, which returns a list of
DLLInfo objects (index-able by DLL file name).
DLLInfo approach avoids any ambiguities related to two
DLLs having the same name but corresponding to files in different
a logical value. If this is
TRUE, the elements
of the returned lists are named using the names of the routines (as
seen by R via registration or raw name). If
these names are not computed and assigned to the lists. As a
result, the call should be quicker. The name information is also
available in the
NativeSymbolInfo objects in the lists.
A list of class
"DLLRegisteredRoutines" with four elements
corresponding to the routines registered for the
.External interfaces. Each is
a list (of class
"NativeRoutineList") with as many elements as
there were routines registered for that interface.
Each element identifies a routine and is an object
An object of this class has the following fields:
the registered name of the routine (not necessarily the name in the C code).
the memory address of the routine as resolved in the
loaded DLL. This may be
NULL if the symbol has not yet been
an object of class
DLLInfo describing the DLL.
This is same for all elements returned.
the number of arguments the native routine is to be called with.
This takes the registration information after it has been registered and processed by the R internals. In other words, it uses the extended information.
‘Writing R Extensions Manual’ for symbol registration.
R News, Volume 1/3, September 2001. "In search of C/C++ & Fortran Symbols"