[ RDocumentation ](/)

Moon  [ ](https://github.com/datacamp/rdocumentation-2.0) [ Learn R
](https://www.datacamp.com/learn/r)

Search all packages and functions

[ base  (version  3.6.2  ) ](/packages/base/versions/3.6.2)

#  getDLLRegisteredRoutines: Reflectance Information for C/Fortran routines in
a DLL

##  Description

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, i.e. ` [ .C ](/link/.C?package=base&version=3.6.2) ` , `
[ .Call ](/link/.Call?package=base&version=3.6.2) ` , ` [ .Fortran
](/link/.Fortran?package=base&version=3.6.2) ` and ` [ .External
](/link/.External?package=base&version=3.6.2) ` .

##  Usage

    
    
    getDLLRegisteredRoutines(dll, addNames = TRUE)

##  Arguments

dll

a character string or ` DLLInfo ` object. The character string specifies the
file name of the DLL of interest, and is given without the file name extension
(e.g., the ` .dll ` or ` .so ` ) and with no directory/path information. So a
file ` MyPackage/libs/MyPackage.so ` would be specified as  MyPackage  .

The ` DLLInfo ` objects can be obtained directly in calls to ` [ dyn.load
](/link/dyn.load?package=base&version=3.6.2) ` and ` [ library.dynam
](/link/library.dynam?package=base&version=3.6.2) ` , or can be found after
the DLL has been loaded using ` [ getLoadedDLLs
](/link/getLoadedDLLs?package=base&version=3.6.2) ` , which returns a list of
` DLLInfo ` objects (index-able by DLL file name).

The ` DLLInfo ` approach avoids any ambiguities related to two DLLs having the
same name but corresponding to files in different directories.

addNames

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 ` FALSE ` , 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.

##  Value

A list of class ` "DLLRegisteredRoutines" ` with four elements corresponding
to the routines registered for the ` .C ` , ` .Call ` , ` .Fortran ` and `
.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 of class `
"NativeSymbolInfo" ` . An object of this class has the following fields:

name

    

the registered name of the routine (not necessarily the name in the C code).

address

    

the memory address of the routine as resolved in the loaded DLL. This may be `
NULL ` if the symbol has not yet been resolved.

dll

    

an object of class ` DLLInfo ` describing the DLL. This is same for all
elements returned.

numParameters

    

the number of arguments the native routine is to be called with.

##  Details

This takes the registration information after it has been registered and
processed by the R internals. In other words, it uses the extended
information.

There is ` print ` methods for the class, which prints only the types which
have registered routines.

##  References

‘Writing R Extensions Manual’ for symbol registration.

R News, Volume 1/3, September 2001. "In search of C/C++ & Fortran Symbols"

##  See Also

` [ getLoadedDLLs ](/link/getLoadedDLLs?package=base&version=3.6.2) ` , ` [
getNativeSymbolInfo ](/link/getNativeSymbolInfo?package=base&version=3.6.2) `
for information on the entry points listed.

##  Examples

[ Run this code
](https://app.datacamp.com/workspace/preview?_tag=rdocs&rdocsPath=packages%2Fbase%2Fversions%2F3.6.2%2Ftopics%2FgetDLLRegisteredRoutines&utm_source=r-docs&utm_medium=docs&utm_term=getDLLRegisteredRoutines&utm_content=run_example_in_workspace)

    
    
    # NOT RUN {